diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py new file mode 100644 index 000000000000..c7c15443cef0 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/__init__.py @@ -0,0 +1,18 @@ +# 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 .dev_spaces_management_client import DevSpacesManagementClient +from .version import VERSION + +__all__ = ['DevSpacesManagementClient'] + +__version__ = VERSION + diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py new file mode 100644 index 000000000000..15bca069693d --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py @@ -0,0 +1,86 @@ +# 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.service_client import SDKClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.controllers_operations import ControllersOperations +from .operations.operations import Operations +from . import models + + +class DevSpacesManagementClientConfiguration(AzureConfiguration): + """Configuration for DevSpacesManagementClient + 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: Azure subscription ID. + :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(DevSpacesManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-devspaces/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class DevSpacesManagementClient(SDKClient): + """Dev Spaces Client + + :ivar config: Configuration for client. + :vartype config: DevSpacesManagementClientConfiguration + + :ivar controllers: Controllers operations + :vartype controllers: azure.mgmt.devspaces.operations.ControllersOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.devspaces.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Azure subscription ID. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = DevSpacesManagementClientConfiguration(credentials, subscription_id, base_url) + super(DevSpacesManagementClient, self).__init__(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-06-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.controllers = ControllersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py new file mode 100644 index 000000000000..b23c697b8c05 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py @@ -0,0 +1,65 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from .sku_py3 import Sku + from .controller_py3 import Controller + from .controller_update_parameters_py3 import ControllerUpdateParameters + from .orchestrator_specific_connection_details_py3 import OrchestratorSpecificConnectionDetails + from .controller_connection_details_py3 import ControllerConnectionDetails + from .controller_connection_details_list_py3 import ControllerConnectionDetailsList + from .tracked_resource_py3 import TrackedResource + from .resource_provider_operation_display_py3 import ResourceProviderOperationDisplay + from .resource_provider_operation_definition_py3 import ResourceProviderOperationDefinition + from .resource_py3 import Resource + from .kubernetes_connection_details_py3 import KubernetesConnectionDetails + from .error_details_py3 import ErrorDetails + from .error_response_py3 import ErrorResponse, ErrorResponseException +except (SyntaxError, ImportError): + from .sku import Sku + from .controller import Controller + from .controller_update_parameters import ControllerUpdateParameters + from .orchestrator_specific_connection_details import OrchestratorSpecificConnectionDetails + from .controller_connection_details import ControllerConnectionDetails + from .controller_connection_details_list import ControllerConnectionDetailsList + from .tracked_resource import TrackedResource + from .resource_provider_operation_display import ResourceProviderOperationDisplay + from .resource_provider_operation_definition import ResourceProviderOperationDefinition + from .resource import Resource + from .kubernetes_connection_details import KubernetesConnectionDetails + from .error_details import ErrorDetails + from .error_response import ErrorResponse, ErrorResponseException +from .controller_paged import ControllerPaged +from .resource_provider_operation_definition_paged import ResourceProviderOperationDefinitionPaged +from .dev_spaces_management_client_enums import ( + ProvisioningState, + SkuTier, +) + +__all__ = [ + 'Sku', + 'Controller', + 'ControllerUpdateParameters', + 'OrchestratorSpecificConnectionDetails', + 'ControllerConnectionDetails', + 'ControllerConnectionDetailsList', + 'TrackedResource', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationDefinition', + 'Resource', + 'KubernetesConnectionDetails', + 'ErrorDetails', + 'ErrorResponse', 'ErrorResponseException', + 'ControllerPaged', + 'ResourceProviderOperationDefinitionPaged', + 'ProvisioningState', + 'SkuTier', +] diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py new file mode 100644 index 000000000000..6066bd15af2a --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller.py @@ -0,0 +1,86 @@ +# 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 Controller(TrackedResource): + """Controller. + + 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. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Tags for the Azure resource. + :type tags: dict[str, str] + :param location: Region where the Azure resource is located. + :type location: str + :ivar provisioning_state: Provisioning state of the Azure Dev Spaces + Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'Updating', 'Creating', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.devspaces.models.ProvisioningState + :param host_suffix: Required. DNS suffix for public endpoints running in + the Azure Dev Spaces Controller. + :type host_suffix: str + :ivar data_plane_fqdn: DNS name for accessing DataPlane services + :vartype data_plane_fqdn: str + :param target_container_host_resource_id: Required. Resource ID of the + target container host + :type target_container_host_resource_id: str + :param target_container_host_credentials_base64: Required. Credentials of + the target container host (base64). + :type target_container_host_credentials_base64: str + :param sku: Required. + :type sku: ~azure.mgmt.devspaces.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_suffix': {'required': True}, + 'data_plane_fqdn': {'readonly': True}, + 'target_container_host_resource_id': {'required': True}, + 'target_container_host_credentials_base64': {'required': True}, + 'sku': {'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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_suffix': {'key': 'properties.hostSuffix', 'type': 'str'}, + 'data_plane_fqdn': {'key': 'properties.dataPlaneFqdn', 'type': 'str'}, + 'target_container_host_resource_id': {'key': 'properties.targetContainerHostResourceId', 'type': 'str'}, + 'target_container_host_credentials_base64': {'key': 'properties.targetContainerHostCredentialsBase64', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(Controller, self).__init__(**kwargs) + self.provisioning_state = None + self.host_suffix = kwargs.get('host_suffix', None) + self.data_plane_fqdn = None + self.target_container_host_resource_id = kwargs.get('target_container_host_resource_id', None) + self.target_container_host_credentials_base64 = kwargs.get('target_container_host_credentials_base64', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py new file mode 100644 index 000000000000..3701e8a363b8 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py @@ -0,0 +1,50 @@ +# 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 ControllerConnectionDetails(Model): + """ControllerConnectionDetails. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar auth_key: Authentication key for communicating with services. + :vartype auth_key: str + :ivar workspace_storage_account_name: Workspace storage account name. + :vartype workspace_storage_account_name: str + :ivar workspace_storage_sas_token: Workspace storage account SAS token. + :vartype workspace_storage_sas_token: str + :param orchestrator_specific_connection_details: + :type orchestrator_specific_connection_details: + ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails + """ + + _validation = { + 'auth_key': {'readonly': True}, + 'workspace_storage_account_name': {'readonly': True}, + 'workspace_storage_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'auth_key': {'key': 'authKey', 'type': 'str'}, + 'workspace_storage_account_name': {'key': 'workspaceStorageAccountName', 'type': 'str'}, + 'workspace_storage_sas_token': {'key': 'workspaceStorageSasToken', 'type': 'str'}, + 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, + } + + def __init__(self, **kwargs): + super(ControllerConnectionDetails, self).__init__(**kwargs) + self.auth_key = None + self.workspace_storage_account_name = None + self.workspace_storage_sas_token = None + self.orchestrator_specific_connection_details = kwargs.get('orchestrator_specific_connection_details', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list.py new file mode 100644 index 000000000000..20080c760ab4 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list.py @@ -0,0 +1,30 @@ +# 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 ControllerConnectionDetailsList(Model): + """ControllerConnectionDetailsList. + + :param connection_details_list: List of Azure Dev Spaces Controller + connection details. + :type connection_details_list: + list[~azure.mgmt.devspaces.models.ControllerConnectionDetails] + """ + + _attribute_map = { + 'connection_details_list': {'key': 'connectionDetailsList', 'type': '[ControllerConnectionDetails]'}, + } + + def __init__(self, **kwargs): + super(ControllerConnectionDetailsList, self).__init__(**kwargs) + self.connection_details_list = kwargs.get('connection_details_list', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list_py3.py new file mode 100644 index 000000000000..73f94653d0f7 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_list_py3.py @@ -0,0 +1,30 @@ +# 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 ControllerConnectionDetailsList(Model): + """ControllerConnectionDetailsList. + + :param connection_details_list: List of Azure Dev Spaces Controller + connection details. + :type connection_details_list: + list[~azure.mgmt.devspaces.models.ControllerConnectionDetails] + """ + + _attribute_map = { + 'connection_details_list': {'key': 'connectionDetailsList', 'type': '[ControllerConnectionDetails]'}, + } + + def __init__(self, *, connection_details_list=None, **kwargs) -> None: + super(ControllerConnectionDetailsList, self).__init__(**kwargs) + self.connection_details_list = connection_details_list diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py new file mode 100644 index 000000000000..fef49a40f947 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py @@ -0,0 +1,50 @@ +# 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 ControllerConnectionDetails(Model): + """ControllerConnectionDetails. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar auth_key: Authentication key for communicating with services. + :vartype auth_key: str + :ivar workspace_storage_account_name: Workspace storage account name. + :vartype workspace_storage_account_name: str + :ivar workspace_storage_sas_token: Workspace storage account SAS token. + :vartype workspace_storage_sas_token: str + :param orchestrator_specific_connection_details: + :type orchestrator_specific_connection_details: + ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails + """ + + _validation = { + 'auth_key': {'readonly': True}, + 'workspace_storage_account_name': {'readonly': True}, + 'workspace_storage_sas_token': {'readonly': True}, + } + + _attribute_map = { + 'auth_key': {'key': 'authKey', 'type': 'str'}, + 'workspace_storage_account_name': {'key': 'workspaceStorageAccountName', 'type': 'str'}, + 'workspace_storage_sas_token': {'key': 'workspaceStorageSasToken', 'type': 'str'}, + 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, + } + + def __init__(self, *, orchestrator_specific_connection_details=None, **kwargs) -> None: + super(ControllerConnectionDetails, self).__init__(**kwargs) + self.auth_key = None + self.workspace_storage_account_name = None + self.workspace_storage_sas_token = None + self.orchestrator_specific_connection_details = orchestrator_specific_connection_details diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_paged.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_paged.py new file mode 100644 index 000000000000..538f662aaad1 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_paged.py @@ -0,0 +1,27 @@ +# 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 ControllerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Controller ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Controller]'} + } + + def __init__(self, *args, **kwargs): + + super(ControllerPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py new file mode 100644 index 000000000000..c24d70754737 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_py3.py @@ -0,0 +1,86 @@ +# 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 Controller(TrackedResource): + """Controller. + + 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. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Tags for the Azure resource. + :type tags: dict[str, str] + :param location: Region where the Azure resource is located. + :type location: str + :ivar provisioning_state: Provisioning state of the Azure Dev Spaces + Controller. Possible values include: 'Succeeded', 'Failed', 'Canceled', + 'Updating', 'Creating', 'Deleting' + :vartype provisioning_state: str or + ~azure.mgmt.devspaces.models.ProvisioningState + :param host_suffix: Required. DNS suffix for public endpoints running in + the Azure Dev Spaces Controller. + :type host_suffix: str + :ivar data_plane_fqdn: DNS name for accessing DataPlane services + :vartype data_plane_fqdn: str + :param target_container_host_resource_id: Required. Resource ID of the + target container host + :type target_container_host_resource_id: str + :param target_container_host_credentials_base64: Required. Credentials of + the target container host (base64). + :type target_container_host_credentials_base64: str + :param sku: Required. + :type sku: ~azure.mgmt.devspaces.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'host_suffix': {'required': True}, + 'data_plane_fqdn': {'readonly': True}, + 'target_container_host_resource_id': {'required': True}, + 'target_container_host_credentials_base64': {'required': True}, + 'sku': {'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'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'host_suffix': {'key': 'properties.hostSuffix', 'type': 'str'}, + 'data_plane_fqdn': {'key': 'properties.dataPlaneFqdn', 'type': 'str'}, + 'target_container_host_resource_id': {'key': 'properties.targetContainerHostResourceId', 'type': 'str'}, + 'target_container_host_credentials_base64': {'key': 'properties.targetContainerHostCredentialsBase64', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, host_suffix: str, target_container_host_resource_id: str, target_container_host_credentials_base64: str, sku, tags=None, location: str=None, **kwargs) -> None: + super(Controller, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.host_suffix = host_suffix + self.data_plane_fqdn = None + self.target_container_host_resource_id = target_container_host_resource_id + self.target_container_host_credentials_base64 = target_container_host_credentials_base64 + self.sku = sku diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters.py new file mode 100644 index 000000000000..814c47933c7e --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters.py @@ -0,0 +1,28 @@ +# 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 ControllerUpdateParameters(Model): + """Parameters for updating an Azure Dev Spaces Controller. + + :param tags: Tags for the Azure Dev Spaces Controller. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ControllerUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters_py3.py new file mode 100644 index 000000000000..23b45b9cf3ba --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_update_parameters_py3.py @@ -0,0 +1,28 @@ +# 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 ControllerUpdateParameters(Model): + """Parameters for updating an Azure Dev Spaces Controller. + + :param tags: Tags for the Azure Dev Spaces Controller. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(ControllerUpdateParameters, self).__init__(**kwargs) + self.tags = tags diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py new file mode 100644 index 000000000000..b94e6f8aeb98 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/dev_spaces_management_client_enums.py @@ -0,0 +1,27 @@ +# 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 enum import Enum + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" + updating = "Updating" + creating = "Creating" + deleting = "Deleting" + + +class SkuTier(str, Enum): + + standard = "Standard" diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details.py new file mode 100644 index 000000000000..9583fed7fc84 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details.py @@ -0,0 +1,45 @@ +# 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 ErrorDetails(Model): + """ErrorDetails. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Status code for the error. + :vartype code: str + :ivar message: Error message describing the error in detail. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details_py3.py new file mode 100644 index 000000000000..8b8c7492d94a --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_details_py3.py @@ -0,0 +1,45 @@ +# 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 ErrorDetails(Model): + """ErrorDetails. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: Status code for the error. + :vartype code: str + :ivar message: Error message describing the error in detail. + :vartype message: str + :ivar target: The target of the particular error. + :vartype target: str + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response.py new file mode 100644 index 000000000000..9f90351350f0 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response.py @@ -0,0 +1,42 @@ +# 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 indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.devspaces.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + 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/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response_py3.py new file mode 100644 index 000000000000..f2baf9cce1ee --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/error_response_py3.py @@ -0,0 +1,42 @@ +# 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 indicates that the service is not able to process the + incoming request. The reason is provided in the error message. + + :param error: The details of the error. + :type error: ~azure.mgmt.devspaces.models.ErrorDetails + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetails'}, + } + + def __init__(self, *, error=None, **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/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py new file mode 100644 index 000000000000..822de6ef48fb --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details.py @@ -0,0 +1,38 @@ +# 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 .orchestrator_specific_connection_details import OrchestratorSpecificConnectionDetails + + +class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): + """KubernetesConnectionDetails. + + All required parameters must be populated in order to send to Azure. + + :param instance_type: Required. Constant filled by server. + :type instance_type: str + :param kube_config: Gets the kubeconfig for the cluster. + :type kube_config: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + 'kube_config': {'key': 'kubeConfig', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KubernetesConnectionDetails, self).__init__(**kwargs) + self.kube_config = kwargs.get('kube_config', None) + self.instance_type = 'Kubernetes' diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py new file mode 100644 index 000000000000..537bce3ae461 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/kubernetes_connection_details_py3.py @@ -0,0 +1,38 @@ +# 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 .orchestrator_specific_connection_details_py3 import OrchestratorSpecificConnectionDetails + + +class KubernetesConnectionDetails(OrchestratorSpecificConnectionDetails): + """KubernetesConnectionDetails. + + All required parameters must be populated in order to send to Azure. + + :param instance_type: Required. Constant filled by server. + :type instance_type: str + :param kube_config: Gets the kubeconfig for the cluster. + :type kube_config: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + 'kube_config': {'key': 'kubeConfig', 'type': 'str'}, + } + + def __init__(self, *, kube_config: str=None, **kwargs) -> None: + super(KubernetesConnectionDetails, self).__init__(**kwargs) + self.kube_config = kube_config + self.instance_type = 'Kubernetes' diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py new file mode 100644 index 000000000000..f81894f7749c --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details.py @@ -0,0 +1,41 @@ +# 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 OrchestratorSpecificConnectionDetails(Model): + """OrchestratorSpecificConnectionDetails. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: KubernetesConnectionDetails + + All required parameters must be populated in order to send to Azure. + + :param instance_type: Required. Constant filled by server. + :type instance_type: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + } + + _subtype_map = { + 'instance_type': {'Kubernetes': 'KubernetesConnectionDetails'} + } + + def __init__(self, **kwargs): + super(OrchestratorSpecificConnectionDetails, self).__init__(**kwargs) + self.instance_type = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py new file mode 100644 index 000000000000..c361a2b46837 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/orchestrator_specific_connection_details_py3.py @@ -0,0 +1,41 @@ +# 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 OrchestratorSpecificConnectionDetails(Model): + """OrchestratorSpecificConnectionDetails. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: KubernetesConnectionDetails + + All required parameters must be populated in order to send to Azure. + + :param instance_type: Required. Constant filled by server. + :type instance_type: str + """ + + _validation = { + 'instance_type': {'required': True}, + } + + _attribute_map = { + 'instance_type': {'key': 'instanceType', 'type': 'str'}, + } + + _subtype_map = { + 'instance_type': {'Kubernetes': 'KubernetesConnectionDetails'} + } + + def __init__(self, **kwargs) -> None: + super(OrchestratorSpecificConnectionDetails, self).__init__(**kwargs) + self.instance_type = None diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource.py new file mode 100644 index 000000000000..89703dfa24af --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource.py @@ -0,0 +1,45 @@ +# 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): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :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/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition.py new file mode 100644 index 000000000000..2c1aead17da6 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition.py @@ -0,0 +1,33 @@ +# 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 ResourceProviderOperationDefinition(Model): + """ResourceProviderOperationDefinition. + + :param name: Resource provider operation name. + :type name: str + :param display: + :type display: + ~azure.mgmt.devspaces.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_paged.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_paged.py new file mode 100644 index 000000000000..4105598d2244 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_paged.py @@ -0,0 +1,27 @@ +# 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 ResourceProviderOperationDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceProviderOperationDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceProviderOperationDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceProviderOperationDefinitionPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_py3.py new file mode 100644 index 000000000000..f7cb35aa755d --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_definition_py3.py @@ -0,0 +1,33 @@ +# 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 ResourceProviderOperationDefinition(Model): + """ResourceProviderOperationDefinition. + + :param name: Resource provider operation name. + :type name: str + :param display: + :type display: + ~azure.mgmt.devspaces.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(ResourceProviderOperationDefinition, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display.py new file mode 100644 index 000000000000..abc031417cda --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display.py @@ -0,0 +1,40 @@ +# 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 ResourceProviderOperationDisplay(Model): + """ResourceProviderOperationDisplay. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display_py3.py new file mode 100644 index 000000000000..a188e3b0c709 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_provider_operation_display_py3.py @@ -0,0 +1,40 @@ +# 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 ResourceProviderOperationDisplay(Model): + """ResourceProviderOperationDisplay. + + :param provider: Name of the resource provider. + :type provider: str + :param resource: Name of the resource type. + :type resource: str + :param operation: Name of the resource provider operation. + :type operation: str + :param description: Description of the resource provider operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(ResourceProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_py3.py new file mode 100644 index 000000000000..6ff792731c78 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :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/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku.py new file mode 100644 index 000000000000..8757fdec65d6 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku.py @@ -0,0 +1,44 @@ +# 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): + """Model representing SKU for Azure Dev Spaces Controller. + + 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 name: Required. The name of the SKU for Azure Dev Spaces Controller. + Default value: "S1" . + :vartype name: str + :param tier: The tier of the SKU for Azure Dev Spaces Controller. Possible + values include: 'Standard' + :type tier: str or ~azure.mgmt.devspaces.models.SkuTier + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + name = "S1" + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.tier = kwargs.get('tier', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku_py3.py new file mode 100644 index 000000000000..5bcc74ff0d20 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/sku_py3.py @@ -0,0 +1,44 @@ +# 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): + """Model representing SKU for Azure Dev Spaces Controller. + + 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 name: Required. The name of the SKU for Azure Dev Spaces Controller. + Default value: "S1" . + :vartype name: str + :param tier: The tier of the SKU for Azure Dev Spaces Controller. Possible + values include: 'Standard' + :type tier: str or ~azure.mgmt.devspaces.models.SkuTier + """ + + _validation = { + 'name': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + name = "S1" + + def __init__(self, *, tier=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.tier = tier diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource.py new file mode 100644 index 000000000000..f91385972d44 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource.py @@ -0,0 +1,50 @@ +# 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. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Tags for the Azure resource. + :type tags: dict[str, str] + :param location: Region where the Azure resource is located. + :type location: 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'}, + '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/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource_py3.py new file mode 100644 index 000000000000..bd99b6755608 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/tracked_resource_py3.py @@ -0,0 +1,50 @@ +# 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. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param tags: Tags for the Azure resource. + :type tags: dict[str, str] + :param location: Region where the Azure resource is located. + :type location: 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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, tags=None, location: str=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py new file mode 100644 index 000000000000..e2a90c21eba8 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/__init__.py @@ -0,0 +1,18 @@ +# 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 .controllers_operations import ControllersOperations +from .operations import Operations + +__all__ = [ + 'ControllersOperations', + 'Operations', +] diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py new file mode 100644 index 000000000000..d68c6285c616 --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py @@ -0,0 +1,567 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ControllersOperations(object): + """ControllersOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Gets an Azure Dev Spaces Controller. + + Gets the properties for an Azure Dev Spaces Controller. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param name: Name of the resource. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Controller or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.devspaces.models.Controller or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Controller', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'} + + + def _create_initial( + self, resource_group_name, name, controller, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(controller, 'Controller') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Controller', response) + if response.status_code == 201: + deserialized = self._deserialize('Controller', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, name, controller, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an Azure Dev Spaces Controller. + + Creates an Azure Dev Spaces Controller with the specified create + parameters. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param name: Name of the resource. + :type name: str + :param controller: Controller create parameters. + :type controller: ~azure.mgmt.devspaces.models.Controller + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Controller or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.devspaces.models.Controller] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.devspaces.models.Controller]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + name=name, + controller=controller, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Controller', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'} + + + def _delete_initial( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an Azure Dev Spaces Controller. + + Deletes an existing Azure Dev Spaces Controller. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param name: Name of the resource. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + name=name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'} + + def update( + self, resource_group_name, name, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates an Azure Dev Spaces Controller. + + Updates the properties of an existing Azure Dev Spaces Controller with + the specified update parameters. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param name: Name of the resource. + :type name: str + :param tags: Tags for the Azure Dev Spaces Controller. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Controller or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.devspaces.models.Controller or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + controller_update_parameters = models.ControllerUpdateParameters(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(controller_update_parameters, 'ControllerUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Controller', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists the Azure Dev Spaces Controllers in a resource group. + + Lists all the Azure Dev Spaces Controllers with their properties in the + specified resource group and subscription. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Controller + :rtype: + ~azure.mgmt.devspaces.models.ControllerPaged[~azure.mgmt.devspaces.models.Controller] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ControllerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ControllerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists the Azure Dev Spaces Controllers in a subscription. + + Lists all the Azure Dev Spaces Controllers with their properties in the + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Controller + :rtype: + ~azure.mgmt.devspaces.models.ControllerPaged[~azure.mgmt.devspaces.models.Controller] + :raises: + :class:`ErrorResponseException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ControllerPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ControllerPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers'} + + def list_connection_details( + self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + """Lists connection details for an Azure Dev Spaces Controller. + + Lists connection details for the underlying container resources of an + Azure Dev Spaces Controller. + + :param resource_group_name: Resource group to which the resource + belongs. + :type resource_group_name: str + :param name: Name of the resource. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ControllerConnectionDetailsList or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.devspaces.models.ControllerConnectionDetailsList + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_connection_details.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'name': self._serialize.url("name", name, 'str', max_length=31, min_length=3, pattern=r'^[a-zA-Z0-9](-?[a-zA-Z0-9])*$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ControllerConnectionDetailsList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_connection_details.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails'} diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py new file mode 100644 index 000000000000..9b1e28b996fb --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py @@ -0,0 +1,103 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists operations for the resource provider. + + Lists all the supported operations by the Microsoft.DevSpaces resource + provider along with their description. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ResourceProviderOperationDefinition + :rtype: + ~azure.mgmt.devspaces.models.ResourceProviderOperationDefinitionPaged[~azure.mgmt.devspaces.models.ResourceProviderOperationDefinition] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ResourceProviderOperationDefinitionPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceProviderOperationDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DevSpaces/operations'} diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/version.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/version.py new file mode 100644 index 000000000000..e0ec669828cb --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" +