diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/__init__.py index dbdd6fc9d7c4..3b6f76411d08 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/__init__.py @@ -9,10 +9,11 @@ # regenerated. # -------------------------------------------------------------------------- -from .databricks_client import DatabricksClient -from .version import VERSION +from ._configuration import DatabricksClientConfiguration +from ._databricks_client import DatabricksClient +__all__ = ['DatabricksClient', 'DatabricksClientConfiguration'] -__all__ = ['DatabricksClient'] +from .version import VERSION __version__ = VERSION diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py new file mode 100644 index 000000000000..7ebff1648cc4 --- /dev/null +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_configuration.py @@ -0,0 +1,48 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class DatabricksClientConfiguration(AzureConfiguration): + """Configuration for DatabricksClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(DatabricksClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-databricks/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/databricks_client.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py similarity index 59% rename from sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/databricks_client.py rename to sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py index ab52ced185ad..5d6b6c1470be 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/databricks_client.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/_databricks_client.py @@ -11,43 +11,11 @@ from msrest.service_client import SDKClient from msrest import Serializer, Deserializer -from msrestazure import AzureConfiguration -from .version import VERSION -from .operations.workspaces_operations import WorkspacesOperations -from .operations.operations import Operations -from . import models - - -class DatabricksClientConfiguration(AzureConfiguration): - """Configuration for DatabricksClient - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credentials: Credentials needed for the client to connect to Azure. - :type credentials: :mod:`A msrestazure Credentials - object` - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, credentials, subscription_id, base_url=None): - if credentials is None: - raise ValueError("Parameter 'credentials' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - if not base_url: - base_url = 'https://management.azure.com' - - super(DatabricksClientConfiguration, self).__init__(base_url) - - self.add_user_agent('azure-mgmt-databricks/{}'.format(VERSION)) - self.add_user_agent('Azure-SDK-For-Python') - - self.credentials = credentials - self.subscription_id = subscription_id +from ._configuration import DatabricksClientConfiguration +from .operations import WorkspacesOperations +from .operations import Operations +from . import models class DatabricksClient(SDKClient): diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py index a9c9da55beb2..7afaddb1deab 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/__init__.py @@ -10,48 +10,65 @@ # -------------------------------------------------------------------------- try: - from .workspace_provider_authorization_py3 import WorkspaceProviderAuthorization - from .sku_py3 import Sku - from .workspace_py3 import Workspace - from .tracked_resource_py3 import TrackedResource - from .resource_py3 import Resource - from .workspace_update_py3 import WorkspaceUpdate - from .error_detail_py3 import ErrorDetail - from .error_info_py3 import ErrorInfo - from .error_response_py3 import ErrorResponse, ErrorResponseException - from .operation_display_py3 import OperationDisplay - from .operation_py3 import Operation + from ._models_py3 import CreatedBy + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorInfo + from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import Resource + from ._models_py3 import Sku + from ._models_py3 import TrackedResource + from ._models_py3 import Workspace + from ._models_py3 import WorkspaceCustomBooleanParameter + from ._models_py3 import WorkspaceCustomObjectParameter + from ._models_py3 import WorkspaceCustomParameters + from ._models_py3 import WorkspaceCustomStringParameter + from ._models_py3 import WorkspaceProviderAuthorization + from ._models_py3 import WorkspaceUpdate except (SyntaxError, ImportError): - from .workspace_provider_authorization import WorkspaceProviderAuthorization - from .sku import Sku - from .workspace import Workspace - from .tracked_resource import TrackedResource - from .resource import Resource - from .workspace_update import WorkspaceUpdate - from .error_detail import ErrorDetail - from .error_info import ErrorInfo - from .error_response import ErrorResponse, ErrorResponseException - from .operation_display import OperationDisplay - from .operation import Operation -from .workspace_paged import WorkspacePaged -from .operation_paged import OperationPaged -from .databricks_client_enums import ( + from ._models import CreatedBy + from ._models import ErrorDetail + from ._models import ErrorInfo + from ._models import ErrorResponse, ErrorResponseException + from ._models import Operation + from ._models import OperationDisplay + from ._models import Resource + from ._models import Sku + from ._models import TrackedResource + from ._models import Workspace + from ._models import WorkspaceCustomBooleanParameter + from ._models import WorkspaceCustomObjectParameter + from ._models import WorkspaceCustomParameters + from ._models import WorkspaceCustomStringParameter + from ._models import WorkspaceProviderAuthorization + from ._models import WorkspaceUpdate +from ._paged_models import OperationPaged +from ._paged_models import WorkspacePaged +from ._databricks_client_enums import ( + CustomParameterType, ProvisioningState, ) __all__ = [ - 'WorkspaceProviderAuthorization', - 'Sku', - 'Workspace', - 'TrackedResource', - 'Resource', - 'WorkspaceUpdate', + 'CreatedBy', 'ErrorDetail', 'ErrorInfo', 'ErrorResponse', 'ErrorResponseException', - 'OperationDisplay', 'Operation', + 'OperationDisplay', + 'Resource', + 'Sku', + 'TrackedResource', + 'Workspace', + 'WorkspaceCustomBooleanParameter', + 'WorkspaceCustomObjectParameter', + 'WorkspaceCustomParameters', + 'WorkspaceCustomStringParameter', + 'WorkspaceProviderAuthorization', + 'WorkspaceUpdate', 'WorkspacePaged', 'OperationPaged', + 'CustomParameterType', 'ProvisioningState', ] diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/databricks_client_enums.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py similarity index 87% rename from sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/databricks_client_enums.py rename to sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py index 59c762eafc5d..c14cd8e961ae 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/databricks_client_enums.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_databricks_client_enums.py @@ -12,6 +12,13 @@ from enum import Enum +class CustomParameterType(str, Enum): + + bool_enum = "Bool" + object_enum = "Object" + string = "String" + + class ProvisioningState(str, Enum): accepted = "Accepted" diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py new file mode 100644 index 000000000000..92e65b7304d9 --- /dev/null +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models.py @@ -0,0 +1,564 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CreatedBy(Model): + """Provides details of the entity that created/updated the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar oid: The Object ID that created the workspace. + :vartype oid: str + :ivar puid: The Personal Object ID corresponding to the object ID above + :vartype puid: str + :ivar application_id: The application ID of the application that initiated + the creation of the workspace. For example, Azure Portal. + :vartype application_id: str + """ + + _validation = { + 'oid': {'readonly': True}, + 'puid': {'readonly': True}, + 'application_id': {'readonly': True}, + } + + _attribute_map = { + 'oid': {'key': 'oid', 'type': 'str'}, + 'puid': {'key': 'puid', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CreatedBy, self).__init__(**kwargs) + self.oid = None + self.puid = None + self.application_id = None + + +class ErrorDetail(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetail, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class ErrorInfo(Model): + """The code and message for an error. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. A machine readable error code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param details: error details. + :type details: list[~azure.mgmt.databricks.models.ErrorDetail] + :param innererror: Inner error details if they exist. + :type innererror: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorInfo, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + + +class ErrorResponse(Model): + """Error response. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.mgmt.databricks.models.ErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInfo'}, + } + + def __init__(self, **kwargs): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.databricks.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ResourceProvider + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + '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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Sku(Model): + """SKU for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + + +class Workspace(TrackedResource): + """Information about workspace. + + 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 id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param managed_resource_group_id: Required. The managed resource group Id. + :type managed_resource_group_id: str + :param parameters: The workspace's custom parameters. + :type parameters: ~azure.mgmt.databricks.models.WorkspaceCustomParameters + :ivar provisioning_state: The workspace provisioning state. Possible + values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', + 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.databricks.models.ProvisioningState + :param ui_definition_uri: The blob URI where the UI definition file is + located. + :type ui_definition_uri: str + :param authorizations: The workspace provider authorizations. + :type authorizations: + list[~azure.mgmt.databricks.models.WorkspaceProviderAuthorization] + :param created_by: Indicates the Object ID, PUID and Application ID of + entity that created the workspace. + :type created_by: ~azure.mgmt.databricks.models.CreatedBy + :param updated_by: Indicates the Object ID, PUID and Application ID of + entity that last updated the workspace. + :type updated_by: ~azure.mgmt.databricks.models.CreatedBy + :param created_date_time: Specifies the date and time when the workspace + is created. + :type created_date_time: datetime + :ivar workspace_id: The unique identifier of the databricks workspace in + databricks control plane. + :vartype workspace_id: str + :ivar workspace_url: The workspace URL which is of the format + 'adb-{workspaceId}.{random}.azuredatabricks.net' + :vartype workspace_url: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.databricks.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_resource_group_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'workspace_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'WorkspaceCustomParameters'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[WorkspaceProviderAuthorization]'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'CreatedBy'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'CreatedBy'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'workspace_url': {'key': 'properties.workspaceUrl', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(Workspace, self).__init__(**kwargs) + self.managed_resource_group_id = kwargs.get('managed_resource_group_id', None) + self.parameters = kwargs.get('parameters', None) + self.provisioning_state = None + self.ui_definition_uri = kwargs.get('ui_definition_uri', None) + self.authorizations = kwargs.get('authorizations', None) + self.created_by = kwargs.get('created_by', None) + self.updated_by = kwargs.get('updated_by', None) + self.created_date_time = kwargs.get('created_date_time', None) + self.workspace_id = None + self.workspace_url = None + self.sku = kwargs.get('sku', None) + + +class WorkspaceCustomBooleanParameter(Model): + """The value which should be used for this field. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: bool + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(WorkspaceCustomBooleanParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + + +class WorkspaceCustomObjectParameter(Model): + """The value which should be used for this field. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: object + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(WorkspaceCustomObjectParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + + +class WorkspaceCustomParameters(Model): + """Custom Parameters used for Cluster Creation. + + :param custom_virtual_network_id: The ID of a Virtual Network where this + Databricks Cluster should be created + :type custom_virtual_network_id: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param custom_public_subnet_name: The name of a Public Subnet within the + Virtual Network + :type custom_public_subnet_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param custom_private_subnet_name: The name of the Private Subnet within + the Virtual Network + :type custom_private_subnet_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + """ + + _attribute_map = { + 'custom_virtual_network_id': {'key': 'customVirtualNetworkId', 'type': 'WorkspaceCustomStringParameter'}, + 'custom_public_subnet_name': {'key': 'customPublicSubnetName', 'type': 'WorkspaceCustomStringParameter'}, + 'custom_private_subnet_name': {'key': 'customPrivateSubnetName', 'type': 'WorkspaceCustomStringParameter'}, + } + + def __init__(self, **kwargs): + super(WorkspaceCustomParameters, self).__init__(**kwargs) + self.custom_virtual_network_id = kwargs.get('custom_virtual_network_id', None) + self.custom_public_subnet_name = kwargs.get('custom_public_subnet_name', None) + self.custom_private_subnet_name = kwargs.get('custom_private_subnet_name', None) + + +class WorkspaceCustomStringParameter(Model): + """The Value. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceCustomStringParameter, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.value = kwargs.get('value', None) + + +class WorkspaceProviderAuthorization(Model): + """The workspace provider authorization. + + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. The provider's principal identifier. This + is the identity that the provider will use to call ARM to manage the + workspace resources. + :type principal_id: str + :param role_definition_id: Required. The provider's role definition + identifier. This role will define all the permissions that the provider + must have on the workspace's container resource group. This role + definition cannot have permission to delete the resource group. + :type role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceProviderAuthorization, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.role_definition_id = kwargs.get('role_definition_id', None) + + +class WorkspaceUpdate(Model): + """An update to a workspace. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(WorkspaceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py new file mode 100644 index 000000000000..fd034bd8954e --- /dev/null +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_models_py3.py @@ -0,0 +1,564 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CreatedBy(Model): + """Provides details of the entity that created/updated the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar oid: The Object ID that created the workspace. + :vartype oid: str + :ivar puid: The Personal Object ID corresponding to the object ID above + :vartype puid: str + :ivar application_id: The application ID of the application that initiated + the creation of the workspace. For example, Azure Portal. + :vartype application_id: str + """ + + _validation = { + 'oid': {'readonly': True}, + 'puid': {'readonly': True}, + 'application_id': {'readonly': True}, + } + + _attribute_map = { + 'oid': {'key': 'oid', 'type': 'str'}, + 'puid': {'key': 'puid', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CreatedBy, self).__init__(**kwargs) + self.oid = None + self.puid = None + self.application_id = None + + +class ErrorDetail(Model): + """Error details. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. The error's code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param target: Indicates which property in the request is responsible for + the error. + :type target: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, target: str=None, **kwargs) -> None: + super(ErrorDetail, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class ErrorInfo(Model): + """The code and message for an error. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. A machine readable error code. + :type code: str + :param message: Required. A human readable error message. + :type message: str + :param details: error details. + :type details: list[~azure.mgmt.databricks.models.ErrorDetail] + :param innererror: Inner error details if they exist. + :type innererror: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'innererror': {'key': 'innererror', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, details=None, innererror: str=None, **kwargs) -> None: + super(ErrorInfo, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + self.innererror = innererror + + +class ErrorResponse(Model): + """Error response. + + Contains details when the response code indicates an error. + + All required parameters must be populated in order to send to Azure. + + :param error: Required. The error details. + :type error: ~azure.mgmt.databricks.models.ErrorInfo + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorInfo'}, + } + + def __init__(self, *, error, **kwargs) -> None: + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseException(HttpOperationError): + """Server responsed with exception of type: 'ErrorResponse'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) + + +class Operation(Model): + """REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.databricks.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.ResourceProvider + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class Resource(Model): + """The core properties of ARM resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + """ + + _validation = { + '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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class Sku(Model): + """SKU for the resource. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. + :type name: str + :param tier: The SKU tier. + :type tier: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str, tier: str=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier + + +class TrackedResource(Resource): + """The resource model definition for a ARM tracked top level resource. + + 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 id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class Workspace(TrackedResource): + """Information about workspace. + + 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 id: Fully qualified resource Id for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. Ex- + Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param managed_resource_group_id: Required. The managed resource group Id. + :type managed_resource_group_id: str + :param parameters: The workspace's custom parameters. + :type parameters: ~azure.mgmt.databricks.models.WorkspaceCustomParameters + :ivar provisioning_state: The workspace provisioning state. Possible + values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', + 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' + :vartype provisioning_state: str or + ~azure.mgmt.databricks.models.ProvisioningState + :param ui_definition_uri: The blob URI where the UI definition file is + located. + :type ui_definition_uri: str + :param authorizations: The workspace provider authorizations. + :type authorizations: + list[~azure.mgmt.databricks.models.WorkspaceProviderAuthorization] + :param created_by: Indicates the Object ID, PUID and Application ID of + entity that created the workspace. + :type created_by: ~azure.mgmt.databricks.models.CreatedBy + :param updated_by: Indicates the Object ID, PUID and Application ID of + entity that last updated the workspace. + :type updated_by: ~azure.mgmt.databricks.models.CreatedBy + :param created_date_time: Specifies the date and time when the workspace + is created. + :type created_date_time: datetime + :ivar workspace_id: The unique identifier of the databricks workspace in + databricks control plane. + :vartype workspace_id: str + :ivar workspace_url: The workspace URL which is of the format + 'adb-{workspaceId}.{random}.azuredatabricks.net' + :vartype workspace_url: str + :param sku: The SKU of the resource. + :type sku: ~azure.mgmt.databricks.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'managed_resource_group_id': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'workspace_id': {'readonly': True}, + 'workspace_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': 'WorkspaceCustomParameters'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, + 'authorizations': {'key': 'properties.authorizations', 'type': '[WorkspaceProviderAuthorization]'}, + 'created_by': {'key': 'properties.createdBy', 'type': 'CreatedBy'}, + 'updated_by': {'key': 'properties.updatedBy', 'type': 'CreatedBy'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'}, + 'workspace_url': {'key': 'properties.workspaceUrl', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, managed_resource_group_id: str, tags=None, parameters=None, ui_definition_uri: str=None, authorizations=None, created_by=None, updated_by=None, created_date_time=None, sku=None, **kwargs) -> None: + super(Workspace, self).__init__(tags=tags, location=location, **kwargs) + self.managed_resource_group_id = managed_resource_group_id + self.parameters = parameters + self.provisioning_state = None + self.ui_definition_uri = ui_definition_uri + self.authorizations = authorizations + self.created_by = created_by + self.updated_by = updated_by + self.created_date_time = created_date_time + self.workspace_id = None + self.workspace_url = None + self.sku = sku + + +class WorkspaceCustomBooleanParameter(Model): + """The value which should be used for this field. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: bool + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, *, value: bool, type=None, **kwargs) -> None: + super(WorkspaceCustomBooleanParameter, self).__init__(**kwargs) + self.type = type + self.value = value + + +class WorkspaceCustomObjectParameter(Model): + """The value which should be used for this field. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: object + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'object'}, + } + + def __init__(self, *, value, type=None, **kwargs) -> None: + super(WorkspaceCustomObjectParameter, self).__init__(**kwargs) + self.type = type + self.value = value + + +class WorkspaceCustomParameters(Model): + """Custom Parameters used for Cluster Creation. + + :param custom_virtual_network_id: The ID of a Virtual Network where this + Databricks Cluster should be created + :type custom_virtual_network_id: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param custom_public_subnet_name: The name of a Public Subnet within the + Virtual Network + :type custom_public_subnet_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + :param custom_private_subnet_name: The name of the Private Subnet within + the Virtual Network + :type custom_private_subnet_name: + ~azure.mgmt.databricks.models.WorkspaceCustomStringParameter + """ + + _attribute_map = { + 'custom_virtual_network_id': {'key': 'customVirtualNetworkId', 'type': 'WorkspaceCustomStringParameter'}, + 'custom_public_subnet_name': {'key': 'customPublicSubnetName', 'type': 'WorkspaceCustomStringParameter'}, + 'custom_private_subnet_name': {'key': 'customPrivateSubnetName', 'type': 'WorkspaceCustomStringParameter'}, + } + + def __init__(self, *, custom_virtual_network_id=None, custom_public_subnet_name=None, custom_private_subnet_name=None, **kwargs) -> None: + super(WorkspaceCustomParameters, self).__init__(**kwargs) + self.custom_virtual_network_id = custom_virtual_network_id + self.custom_public_subnet_name = custom_public_subnet_name + self.custom_private_subnet_name = custom_private_subnet_name + + +class WorkspaceCustomStringParameter(Model): + """The Value. + + All required parameters must be populated in order to send to Azure. + + :param type: The type of variable that this is. Possible values include: + 'Bool', 'Object', 'String' + :type type: str or ~azure.mgmt.databricks.models.CustomParameterType + :param value: Required. The value which should be used for this field. + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, type=None, **kwargs) -> None: + super(WorkspaceCustomStringParameter, self).__init__(**kwargs) + self.type = type + self.value = value + + +class WorkspaceProviderAuthorization(Model): + """The workspace provider authorization. + + All required parameters must be populated in order to send to Azure. + + :param principal_id: Required. The provider's principal identifier. This + is the identity that the provider will use to call ARM to manage the + workspace resources. + :type principal_id: str + :param role_definition_id: Required. The provider's role definition + identifier. This role will define all the permissions that the provider + must have on the workspace's container resource group. This role + definition cannot have permission to delete the resource group. + :type role_definition_id: str + """ + + _validation = { + 'principal_id': {'required': True}, + 'role_definition_id': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, + } + + def __init__(self, *, principal_id: str, role_definition_id: str, **kwargs) -> None: + super(WorkspaceProviderAuthorization, self).__init__(**kwargs) + self.principal_id = principal_id + self.role_definition_id = role_definition_id + + +class WorkspaceUpdate(Model): + """An update to a workspace. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(WorkspaceUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_paged.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_paged_models.py similarity index 68% rename from sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_paged.py rename to sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_paged_models.py index d514b8bd185a..ff6aad268a73 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_paged.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/_paged_models.py @@ -25,3 +25,16 @@ class WorkspacePaged(Paged): def __init__(self, *args, **kwargs): super(WorkspacePaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail.py deleted file mode 100644 index ac459ba41d0c..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorDetail(Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail_py3.py deleted file mode 100644 index 1bc297891118..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_detail_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorDetail(Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for - the error. - :type target: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - } - - def __init__(self, *, code: str, message: str, target: str=None, **kwargs) -> None: - super(ErrorDetail, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info.py deleted file mode 100644 index eb4b250da207..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorInfo(Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.databricks.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ErrorInfo, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - self.innererror = kwargs.get('innererror', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info_py3.py deleted file mode 100644 index b560e54f16b5..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_info_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ErrorInfo(Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.databricks.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: str - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'str'}, - } - - def __init__(self, *, code: str, message: str, details=None, innererror: str=None, **kwargs) -> None: - super(ErrorInfo, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.innererror = innererror diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response.py deleted file mode 100644 index ca3a62e0c779..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. - - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. The error details. - :type error: ~azure.mgmt.databricks.models.ErrorInfo - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfo'}, - } - - def __init__(self, **kwargs): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response_py3.py deleted file mode 100644 index 0f68702ffa14..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/error_response_py3.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model -from msrest.exceptions import HttpOperationError - - -class ErrorResponse(Model): - """Error response. - - Contains details when the response code indicates an error. - - All required parameters must be populated in order to send to Azure. - - :param error: Required. The error details. - :type error: ~azure.mgmt.databricks.models.ErrorInfo - """ - - _validation = { - 'error': {'required': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfo'}, - } - - def __init__(self, *, error, **kwargs) -> None: - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'ErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation.py deleted file mode 100644 index 2d3b42b12ad7..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.databricks.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, **kwargs): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display.py deleted file mode 100644 index 3f41bf8dc399..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - :param provider: Service provider: Microsoft.ResourceProvider - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Operation type: Read, write, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display_py3.py deleted file mode 100644 index e999835f7548..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_display_py3.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class OperationDisplay(Model): - """The object that represents the operation. - - :param provider: Service provider: Microsoft.ResourceProvider - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: Operation type: Read, write, delete, etc. - :type operation: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, **kwargs) -> None: - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_paged.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_paged.py deleted file mode 100644 index ec9d387e271b..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class OperationPaged(Paged): - """ - A paging container for iterating over a list of :class:`Operation ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} - } - - def __init__(self, *args, **kwargs): - - super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_py3.py deleted file mode 100644 index 043239e379c8..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/operation_py3.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Operation(Model): - """REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation} - :type name: str - :param display: The object that represents the operation. - :type display: ~azure.mgmt.databricks.models.OperationDisplay - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__(self, *, name: str=None, display=None, **kwargs) -> None: - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource.py deleted file mode 100644 index d8f988cdf5f8..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The core properties of ARM resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - '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'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource_py3.py deleted file mode 100644 index 7c8c3022e1fa..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/resource_py3.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Resource(Model): - """The core properties of ARM resources. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - """ - - _validation = { - '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'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku.py deleted file mode 100644 index 59bf3f22dd21..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Sku(Model): - """SKU for the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The SKU name. - :type name: str - :param tier: The SKU tier. - :type tier: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Sku, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.tier = kwargs.get('tier', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku_py3.py deleted file mode 100644 index 6fe2d3126c54..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/sku_py3.py +++ /dev/null @@ -1,38 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Sku(Model): - """SKU for the resource. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. The SKU name. - :type name: str - :param tier: The SKU tier. - :type tier: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, - } - - def __init__(self, *, name: str, tier: str=None, **kwargs) -> None: - super(Sku, self).__init__(**kwargs) - self.name = name - self.tier = tier diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource.py deleted file mode 100644 index 27ab94c7a8dd..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. - - 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 id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource_py3.py deleted file mode 100644 index b28cc1859448..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/tracked_resource_py3.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .resource_py3 import Resource - - -class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. - - 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 id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace.py deleted file mode 100644 index 951ffd97b04d..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class Workspace(TrackedResource): - """Information about workspace. - - 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 id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :param managed_resource_group_id: Required. The managed resource group Id. - :type managed_resource_group_id: str - :param parameters: Name and value pairs that define the workspace - parameters. - :type parameters: object - :ivar provisioning_state: The workspace provisioning state. Possible - values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', - 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.databricks.models.ProvisioningState - :param ui_definition_uri: The blob URI where the UI definition file is - located. - :type ui_definition_uri: str - :param authorizations: The workspace provider authorizations. - :type authorizations: - list[~azure.mgmt.databricks.models.WorkspaceProviderAuthorization] - :param sku: The SKU of the resource. - :type sku: ~azure.mgmt.databricks.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'managed_resource_group_id': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, - 'parameters': {'key': 'properties.parameters', 'type': 'object'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, - 'authorizations': {'key': 'properties.authorizations', 'type': '[WorkspaceProviderAuthorization]'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, **kwargs): - super(Workspace, self).__init__(**kwargs) - self.managed_resource_group_id = kwargs.get('managed_resource_group_id', None) - self.parameters = kwargs.get('parameters', None) - self.provisioning_state = None - self.ui_definition_uri = kwargs.get('ui_definition_uri', None) - self.authorizations = kwargs.get('authorizations', None) - self.sku = kwargs.get('sku', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization.py deleted file mode 100644 index 050276511e13..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WorkspaceProviderAuthorization(Model): - """The workspace provider authorization. - - All required parameters must be populated in order to send to Azure. - - :param principal_id: Required. The provider's principal identifier. This - is the identity that the provider will use to call ARM to manage the - workspace resources. - :type principal_id: str - :param role_definition_id: Required. The provider's role definition - identifier. This role will define all the permissions that the provider - must have on the workspace's container resource group. This role - definition cannot have permission to delete the resource group. - :type role_definition_id: str - """ - - _validation = { - 'principal_id': {'required': True}, - 'role_definition_id': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(WorkspaceProviderAuthorization, self).__init__(**kwargs) - self.principal_id = kwargs.get('principal_id', None) - self.role_definition_id = kwargs.get('role_definition_id', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization_py3.py deleted file mode 100644 index e5584dbd1e78..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_provider_authorization_py3.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WorkspaceProviderAuthorization(Model): - """The workspace provider authorization. - - All required parameters must be populated in order to send to Azure. - - :param principal_id: Required. The provider's principal identifier. This - is the identity that the provider will use to call ARM to manage the - workspace resources. - :type principal_id: str - :param role_definition_id: Required. The provider's role definition - identifier. This role will define all the permissions that the provider - must have on the workspace's container resource group. This role - definition cannot have permission to delete the resource group. - :type role_definition_id: str - """ - - _validation = { - 'principal_id': {'required': True}, - 'role_definition_id': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'role_definition_id': {'key': 'roleDefinitionId', 'type': 'str'}, - } - - def __init__(self, *, principal_id: str, role_definition_id: str, **kwargs) -> None: - super(WorkspaceProviderAuthorization, self).__init__(**kwargs) - self.principal_id = principal_id - self.role_definition_id = role_definition_id diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_py3.py deleted file mode 100644 index d046f0b78626..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource_py3 import TrackedResource - - -class Workspace(TrackedResource): - """Information about workspace. - - 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 id: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :param managed_resource_group_id: Required. The managed resource group Id. - :type managed_resource_group_id: str - :param parameters: Name and value pairs that define the workspace - parameters. - :type parameters: object - :ivar provisioning_state: The workspace provisioning state. Possible - values include: 'Accepted', 'Running', 'Ready', 'Creating', 'Created', - 'Deleting', 'Deleted', 'Canceled', 'Failed', 'Succeeded', 'Updating' - :vartype provisioning_state: str or - ~azure.mgmt.databricks.models.ProvisioningState - :param ui_definition_uri: The blob URI where the UI definition file is - located. - :type ui_definition_uri: str - :param authorizations: The workspace provider authorizations. - :type authorizations: - list[~azure.mgmt.databricks.models.WorkspaceProviderAuthorization] - :param sku: The SKU of the resource. - :type sku: ~azure.mgmt.databricks.models.Sku - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'managed_resource_group_id': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'managed_resource_group_id': {'key': 'properties.managedResourceGroupId', 'type': 'str'}, - 'parameters': {'key': 'properties.parameters', 'type': 'object'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'ui_definition_uri': {'key': 'properties.uiDefinitionUri', 'type': 'str'}, - 'authorizations': {'key': 'properties.authorizations', 'type': '[WorkspaceProviderAuthorization]'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - } - - def __init__(self, *, location: str, managed_resource_group_id: str, tags=None, parameters=None, ui_definition_uri: str=None, authorizations=None, sku=None, **kwargs) -> None: - super(Workspace, self).__init__(tags=tags, location=location, **kwargs) - self.managed_resource_group_id = managed_resource_group_id - self.parameters = parameters - self.provisioning_state = None - self.ui_definition_uri = ui_definition_uri - self.authorizations = authorizations - self.sku = sku diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update.py deleted file mode 100644 index 6692c6b62e60..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WorkspaceUpdate(Model): - """An update to a workspace. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(WorkspaceUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update_py3.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update_py3.py deleted file mode 100644 index 19903c679fb5..000000000000 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/models/workspace_update_py3.py +++ /dev/null @@ -1,28 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WorkspaceUpdate(Model): - """An update to a workspace. - - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, tags=None, **kwargs) -> None: - super(WorkspaceUpdate, self).__init__(**kwargs) - self.tags = tags diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py index 2ef2dea3df5e..a5ed1a00f406 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/__init__.py @@ -9,8 +9,8 @@ # regenerated. # -------------------------------------------------------------------------- -from .workspaces_operations import WorkspacesOperations -from .operations import Operations +from ._workspaces_operations import WorkspacesOperations +from ._operations import Operations __all__ = [ 'WorkspacesOperations', diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py similarity index 90% rename from sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/operations.py rename to sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py index a391f400a6c2..45336311afc5 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_operations.py @@ -18,6 +18,8 @@ class Operations(object): """Operations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -51,8 +53,7 @@ def list( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list.metadata['url'] @@ -77,6 +78,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -85,12 +91,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list.metadata = {'url': '/providers/Microsoft.Databricks/operations'} diff --git a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/workspaces_operations.py b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py similarity index 97% rename from sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/workspaces_operations.py rename to sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py index a02b392eb252..9ca2760df9ad 100644 --- a/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/workspaces_operations.py +++ b/sdk/databricks/azure-mgmt-databricks/azure/mgmt/databricks/operations/_workspaces_operations.py @@ -20,6 +20,8 @@ class WorkspacesOperations(object): """WorkspacesOperations operations. + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -85,11 +87,10 @@ def get( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 404]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None - if response.status_code == 200: deserialized = self._deserialize('Workspace', response) @@ -129,7 +130,7 @@ def _delete_initial( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: raise models.ErrorResponseException(self._deserialize, response) if raw: @@ -402,8 +403,7 @@ def list_by_resource_group( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_resource_group.metadata['url'] @@ -433,6 +433,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -441,12 +446,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Databricks/workspaces'} @@ -466,8 +469,7 @@ def list_by_subscription( :raises: :class:`ErrorResponseException` """ - def internal_paging(next_link=None, raw=False): - + def prepare_request(next_link=None): if not next_link: # Construct URL url = self.list_by_subscription.metadata['url'] @@ -496,6 +498,11 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -504,12 +511,10 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies) - + header_dict = None if raw: header_dict = {} - client_raw_response = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Databricks/workspaces'}