diff --git a/sdk/azure-mgmt-desktopvirtualization/CHANGELOG.md b/sdk/azure-mgmt-desktopvirtualization/CHANGELOG.md new file mode 100644 index 000000000000..578ed6acf479 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 0.1.0 (1970-01-01) + +* Initial Release diff --git a/sdk/azure-mgmt-desktopvirtualization/MANIFEST.in b/sdk/azure-mgmt-desktopvirtualization/MANIFEST.in new file mode 100644 index 000000000000..a3cb07df8765 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/MANIFEST.in @@ -0,0 +1,5 @@ +recursive-include tests *.py *.yaml +include *.md +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/sdk/azure-mgmt-desktopvirtualization/README.md b/sdk/azure-mgmt-desktopvirtualization/README.md new file mode 100644 index 000000000000..168565c7c733 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/README.md @@ -0,0 +1,21 @@ +# Microsoft Azure SDK for Python + +This is the Microsoft Azure MyService Management Client Library. +This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. +For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + + +# Usage + +For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. + + +# Provide Feedback + +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) +section of the project. + + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-desktopvirtualization%2FREADME.png) diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/__init__.py new file mode 100644 index 000000000000..0260537a02bb --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/__init__.py @@ -0,0 +1 @@ +__path__ = __import__('pkgutil').extend_path(__path__, __name__) \ No newline at end of file diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py new file mode 100644 index 000000000000..17ce93677be3 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py @@ -0,0 +1,19 @@ +# 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 ._configuration import DesktopVirtualizationAPIClientConfiguration +from ._desktop_virtualization_api_client import DesktopVirtualizationAPIClient +__all__ = ['DesktopVirtualizationAPIClient', 'DesktopVirtualizationAPIClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py new file mode 100644 index 000000000000..cc89397fba3a --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_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 DesktopVirtualizationAPIClientConfiguration(AzureConfiguration): + """Configuration for DesktopVirtualizationAPIClient + 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(DesktopVirtualizationAPIClientConfiguration, 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-desktopvirtualization/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_api_client.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_api_client.py new file mode 100644 index 000000000000..1036243bc524 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_api_client.py @@ -0,0 +1,89 @@ +# 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 ._configuration import DesktopVirtualizationAPIClientConfiguration +from .operations import Operations +from .operations import WorkspacesOperations +from .operations import ApplicationGroupsOperations +from .operations import StartMenuItemsOperations +from .operations import ApplicationsOperations +from .operations import DesktopsOperations +from .operations import HostPoolsOperations +from .operations import UserSessionsOperations +from .operations import SessionHostsOperations +from . import models + + +class DesktopVirtualizationAPIClient(SDKClient): + """DesktopVirtualizationAPIClient + + :ivar config: Configuration for client. + :vartype config: DesktopVirtualizationAPIClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.desktopvirtualization.operations.Operations + :ivar workspaces: Workspaces operations + :vartype workspaces: azure.mgmt.desktopvirtualization.operations.WorkspacesOperations + :ivar application_groups: ApplicationGroups operations + :vartype application_groups: azure.mgmt.desktopvirtualization.operations.ApplicationGroupsOperations + :ivar start_menu_items: StartMenuItems operations + :vartype start_menu_items: azure.mgmt.desktopvirtualization.operations.StartMenuItemsOperations + :ivar applications: Applications operations + :vartype applications: azure.mgmt.desktopvirtualization.operations.ApplicationsOperations + :ivar desktops: Desktops operations + :vartype desktops: azure.mgmt.desktopvirtualization.operations.DesktopsOperations + :ivar host_pools: HostPools operations + :vartype host_pools: azure.mgmt.desktopvirtualization.operations.HostPoolsOperations + :ivar user_sessions: UserSessions operations + :vartype user_sessions: azure.mgmt.desktopvirtualization.operations.UserSessionsOperations + :ivar session_hosts: SessionHosts operations + :vartype session_hosts: azure.mgmt.desktopvirtualization.operations.SessionHostsOperations + + :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): + + self.config = DesktopVirtualizationAPIClientConfiguration(credentials, subscription_id, base_url) + super(DesktopVirtualizationAPIClient, 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 = '2019-12-10-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.workspaces = WorkspacesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.application_groups = ApplicationGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.start_menu_items = StartMenuItemsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.applications = ApplicationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.desktops = DesktopsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.host_pools = HostPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.user_sessions = UserSessionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.session_hosts = SessionHostsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py new file mode 100644 index 000000000000..04c2751ca2b3 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py @@ -0,0 +1,132 @@ +# 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 ._models_py3 import Application + from ._models_py3 import ApplicationGroup + from ._models_py3 import ApplicationGroupPatch + from ._models_py3 import ApplicationPatch + from ._models_py3 import AzureEntityResource + from ._models_py3 import CloudError, CloudErrorException + from ._models_py3 import Desktop + from ._models_py3 import DesktopList + from ._models_py3 import DesktopPatch + from ._models_py3 import HostPool + from ._models_py3 import HostPoolPatch + from ._models_py3 import ProxyResource + from ._models_py3 import RegistrationInfo + from ._models_py3 import RegistrationInfoPatch + from ._models_py3 import Resource + from ._models_py3 import ResourceProviderOperation + from ._models_py3 import ResourceProviderOperationDisplay + from ._models_py3 import ResourceProviderOperationList + from ._models_py3 import SendMessage + from ._models_py3 import SessionHost + from ._models_py3 import SessionHostPatch + from ._models_py3 import StartMenuItem + from ._models_py3 import TrackedResource + from ._models_py3 import UserSession + from ._models_py3 import Workspace + from ._models_py3 import WorkspacePatch +except (SyntaxError, ImportError): + from ._models import Application + from ._models import ApplicationGroup + from ._models import ApplicationGroupPatch + from ._models import ApplicationPatch + from ._models import AzureEntityResource + from ._models import CloudError, CloudErrorException + from ._models import Desktop + from ._models import DesktopList + from ._models import DesktopPatch + from ._models import HostPool + from ._models import HostPoolPatch + from ._models import ProxyResource + from ._models import RegistrationInfo + from ._models import RegistrationInfoPatch + from ._models import Resource + from ._models import ResourceProviderOperation + from ._models import ResourceProviderOperationDisplay + from ._models import ResourceProviderOperationList + from ._models import SendMessage + from ._models import SessionHost + from ._models import SessionHostPatch + from ._models import StartMenuItem + from ._models import TrackedResource + from ._models import UserSession + from ._models import Workspace + from ._models import WorkspacePatch +from ._paged_models import ApplicationGroupPaged +from ._paged_models import ApplicationPaged +from ._paged_models import HostPoolPaged +from ._paged_models import SessionHostPaged +from ._paged_models import StartMenuItemPaged +from ._paged_models import UserSessionPaged +from ._paged_models import WorkspacePaged +from ._desktop_virtualization_api_client_enums import ( + ApplicationGroupType, + HostPoolType, + PersonalDesktopAssignmentType, + LoadBalancerType, + RegistrationTokenOperation, + PreferredAppGroupType, + CommandLineSetting, + Status, + UpdateState, + ApplicationType, + SessionState, +) + +__all__ = [ + 'Application', + 'ApplicationGroup', + 'ApplicationGroupPatch', + 'ApplicationPatch', + 'AzureEntityResource', + 'CloudError', 'CloudErrorException', + 'Desktop', + 'DesktopList', + 'DesktopPatch', + 'HostPool', + 'HostPoolPatch', + 'ProxyResource', + 'RegistrationInfo', + 'RegistrationInfoPatch', + 'Resource', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', + 'SendMessage', + 'SessionHost', + 'SessionHostPatch', + 'StartMenuItem', + 'TrackedResource', + 'UserSession', + 'Workspace', + 'WorkspacePatch', + 'WorkspacePaged', + 'ApplicationGroupPaged', + 'StartMenuItemPaged', + 'ApplicationPaged', + 'HostPoolPaged', + 'UserSessionPaged', + 'SessionHostPaged', + 'ApplicationGroupType', + 'HostPoolType', + 'PersonalDesktopAssignmentType', + 'LoadBalancerType', + 'RegistrationTokenOperation', + 'PreferredAppGroupType', + 'CommandLineSetting', + 'Status', + 'UpdateState', + 'ApplicationType', + 'SessionState', +] diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py new file mode 100644 index 000000000000..04052cd1efed --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py @@ -0,0 +1,93 @@ +# 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 ApplicationGroupType(str, Enum): + + remote_app = "RemoteApp" + desktop = "Desktop" + + +class HostPoolType(str, Enum): + + personal = "Personal" + pooled = "Pooled" + + +class PersonalDesktopAssignmentType(str, Enum): + + automatic = "Automatic" + direct = "Direct" + + +class LoadBalancerType(str, Enum): + + breadth_first = "BreadthFirst" + depth_first = "DepthFirst" + persistent = "Persistent" + + +class RegistrationTokenOperation(str, Enum): + + delete = "Delete" + none = "None" + update = "Update" + + +class PreferredAppGroupType(str, Enum): + + none = "None" + desktop = "Desktop" + rail_applications = "RailApplications" + + +class CommandLineSetting(str, Enum): + + do_not_allow = "DoNotAllow" + allow = "Allow" + require = "Require" + + +class Status(str, Enum): + + available = "Available" + unavailable = "Unavailable" + shutdown = "Shutdown" + disconnected = "Disconnected" + upgrading = "Upgrading" + upgrade_failed = "UpgradeFailed" + + +class UpdateState(str, Enum): + + initial = "Initial" + pending = "Pending" + started = "Started" + succeeded = "Succeeded" + failed = "Failed" + + +class ApplicationType(str, Enum): + + remote_app = "RemoteApp" + desktop = "Desktop" + + +class SessionState(str, Enum): + + unknown = "Unknown" + active = "Active" + disconnected = "Disconnected" + pending = "Pending" + log_off = "LogOff" + user_profile_disk_mounted = "UserProfileDiskMounted" diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py new file mode 100644 index 000000000000..2f60fc892647 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py @@ -0,0 +1,1221 @@ +# 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 Resource(Model): + """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. 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 Application(Resource): + """Schema for Application properties. + + 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 description: Description of Application. + :type description: str + :param friendly_name: Friendly name of Application. + :type friendly_name: str + :param file_path: Specifies a path for the executable file for the + application. + :type file_path: str + :param command_line_setting: Required. Specifies whether this published + application can be launched with command line arguments provided by the + client, command line arguments specified at publish time, or no command + line arguments at all. Possible values include: 'DoNotAllow', 'Allow', + 'Require' + :type command_line_setting: str or + ~azure.mgmt.desktopvirtualization.models.CommandLineSetting + :param command_line_arguments: Command Line Arguments for Application. + :type command_line_arguments: str + :param show_in_portal: Specifies whether to show the RemoteApp program in + the RD Web Access server. + :type show_in_portal: bool + :param icon_path: Path to icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + :ivar icon_hash: Hash of the icon. + :vartype icon_hash: str + :ivar icon_content: the icon a 64 bit string as a byte array. + :vartype icon_content: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'command_line_setting': {'required': True}, + 'icon_hash': {'readonly': True}, + 'icon_content': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, + 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, + } + + def __init__(self, **kwargs): + super(Application, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.file_path = kwargs.get('file_path', None) + self.command_line_setting = kwargs.get('command_line_setting', None) + self.command_line_arguments = kwargs.get('command_line_arguments', None) + self.show_in_portal = kwargs.get('show_in_portal', None) + self.icon_path = kwargs.get('icon_path', None) + self.icon_index = kwargs.get('icon_index', None) + self.icon_hash = None + self.icon_content = 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 ApplicationGroup(TrackedResource): + """Represents a ApplicationGroup definition. + + 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 description: Description of ApplicationGroup. + :type description: str + :param friendly_name: Friendly name of ApplicationGroup. + :type friendly_name: str + :param host_pool_arm_path: Required. HostPool arm path of + ApplicationGroup. + :type host_pool_arm_path: str + :ivar workspace_arm_path: Workspace arm path of ApplicationGroup. + :vartype workspace_arm_path: str + :param application_group_type: Required. Resource Type of + ApplicationGroup. Possible values include: 'RemoteApp', 'Desktop' + :type application_group_type: str or + ~azure.mgmt.desktopvirtualization.models.ApplicationGroupType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_pool_arm_path': {'required': True}, + 'workspace_arm_path': {'readonly': True}, + 'application_group_type': {'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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'host_pool_arm_path': {'key': 'properties.hostPoolArmPath', 'type': 'str'}, + 'workspace_arm_path': {'key': 'properties.workspaceArmPath', 'type': 'str'}, + 'application_group_type': {'key': 'properties.applicationGroupType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGroup, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.host_pool_arm_path = kwargs.get('host_pool_arm_path', None) + self.workspace_arm_path = None + self.application_group_type = kwargs.get('application_group_type', None) + + +class ApplicationGroupPatch(Resource): + """ApplicationGroup properties that can be patched. + + 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 + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of ApplicationGroup. + :type description: str + :param friendly_name: Friendly name of ApplicationGroup. + :type friendly_name: 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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ApplicationGroupPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + + +class ApplicationPatch(Model): + """Application properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Application. + :type description: str + :param friendly_name: Friendly name of Application. + :type friendly_name: str + :param file_path: Specifies a path for the executable file for the + application. + :type file_path: str + :param command_line_setting: Specifies whether this published application + can be launched with command line arguments provided by the client, + command line arguments specified at publish time, or no command line + arguments at all. Possible values include: 'DoNotAllow', 'Allow', + 'Require' + :type command_line_setting: str or + ~azure.mgmt.desktopvirtualization.models.CommandLineSetting + :param command_line_arguments: Command Line Arguments for Application. + :type command_line_arguments: str + :param show_in_portal: Specifies whether to show the RemoteApp program in + the RD Web Access server. + :type show_in_portal: bool + :param icon_path: Path to icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ApplicationPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.file_path = kwargs.get('file_path', None) + self.command_line_setting = kwargs.get('command_line_setting', None) + self.command_line_arguments = kwargs.get('command_line_arguments', None) + self.show_in_portal = kwargs.get('show_in_portal', None) + self.icon_path = kwargs.get('icon_path', None) + self.icon_index = kwargs.get('icon_index', None) + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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 + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class Desktop(Resource): + """Schema for Desktop properties. + + 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 + :param description: Description of Desktop. + :type description: str + :param friendly_name: Friendly name of Desktop. + :type friendly_name: str + :ivar icon_hash: Hash of the icon. + :vartype icon_hash: str + :ivar icon_content: The icon a 64 bit string as a byte array. + :vartype icon_content: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'icon_hash': {'readonly': True}, + 'icon_content': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, + 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, + } + + def __init__(self, **kwargs): + super(Desktop, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.icon_hash = None + self.icon_content = None + + +class DesktopList(Model): + """DesktopList. + + List of Desktop definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of Desktop definitions. + :type value: list[~azure.mgmt.desktopvirtualization.models.Desktop] + :ivar next_link: Link to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Desktop]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DesktopList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class DesktopPatch(Model): + """Desktop properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Desktop. + :type description: str + :param friendly_name: Friendly name of Desktop. + :type friendly_name: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DesktopPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + + +class HostPool(TrackedResource): + """Represents a HostPool definition. + + 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 friendly_name: Friendly name of HostPool. + :type friendly_name: str + :param description: Description of HostPool. + :type description: str + :param host_pool_type: Required. HostPool type for desktop. Possible + values include: 'Personal', 'Pooled' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param personal_desktop_assignment_type: PersonalDesktopAssignment type + for HostPool. Possible values include: 'Automatic', 'Direct' + :type personal_desktop_assignment_type: str or + ~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType + :param custom_rdp_property: Custom rdp property of HostPool. + :type custom_rdp_property: str + :param max_session_limit: The max session limit of HostPool. + :type max_session_limit: int + :param load_balancer_type: Required. The type of the load balancer. + Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + :type load_balancer_type: str or + ~azure.mgmt.desktopvirtualization.models.LoadBalancerType + :param ring: The ring number of HostPool. + :type ring: int + :param validation_environment: Is validation environment. + :type validation_environment: bool + :param registration_info: The registration info of HostPool. + :type registration_info: + ~azure.mgmt.desktopvirtualization.models.RegistrationInfo + :param vm_template: VM template for sessionhosts configuration within + hostpool. + :type vm_template: str + :ivar application_group_references: List of applicationGroup links. + :vartype application_group_references: list[str] + :param sso_context: Path to keyvault containing ssoContext secret. + :type sso_context: str + :param preferred_app_group_type: Required. The type of preferred + application group type, default to Desktop Application Group. Possible + values include: 'None', 'Desktop', 'RailApplications' + :type preferred_app_group_type: str or + ~azure.mgmt.desktopvirtualization.models.PreferredAppGroupType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_pool_type': {'required': True}, + 'load_balancer_type': {'required': True}, + 'application_group_references': {'readonly': True}, + 'preferred_app_group_type': {'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'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, + 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, + 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, + 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, + 'ring': {'key': 'properties.ring', 'type': 'int'}, + 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, + 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfo'}, + 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + 'sso_context': {'key': 'properties.ssoContext', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HostPool, self).__init__(**kwargs) + self.friendly_name = kwargs.get('friendly_name', None) + self.description = kwargs.get('description', None) + self.host_pool_type = kwargs.get('host_pool_type', None) + self.personal_desktop_assignment_type = kwargs.get('personal_desktop_assignment_type', None) + self.custom_rdp_property = kwargs.get('custom_rdp_property', None) + self.max_session_limit = kwargs.get('max_session_limit', None) + self.load_balancer_type = kwargs.get('load_balancer_type', None) + self.ring = kwargs.get('ring', None) + self.validation_environment = kwargs.get('validation_environment', None) + self.registration_info = kwargs.get('registration_info', None) + self.vm_template = kwargs.get('vm_template', None) + self.application_group_references = None + self.sso_context = kwargs.get('sso_context', None) + self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) + + +class HostPoolPatch(Resource): + """HostPool properties that can be patched. + + 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 + :param tags: tags to be updated + :type tags: dict[str, str] + :param friendly_name: Friendly name of HostPool. + :type friendly_name: str + :param description: Description of HostPool. + :type description: str + :param custom_rdp_property: Custom rdp property of HostPool. + :type custom_rdp_property: str + :param max_session_limit: The max session limit of HostPool. + :type max_session_limit: int + :param personal_desktop_assignment_type: PersonalDesktopAssignment type + for HostPool. Possible values include: 'Automatic', 'Direct' + :type personal_desktop_assignment_type: str or + ~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType + :param load_balancer_type: The type of the load balancer. Possible values + include: 'BreadthFirst', 'DepthFirst', 'Persistent' + :type load_balancer_type: str or + ~azure.mgmt.desktopvirtualization.models.LoadBalancerType + :param ring: The ring number of HostPool. + :type ring: int + :param validation_environment: Is validation environment. + :type validation_environment: bool + :param registration_info: The registration info of HostPool. + :type registration_info: + ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch + :param vm_template: VM template for sessionhosts configuration within + hostpool. + :type vm_template: str + :param sso_context: Path to keyvault containing ssoContext secret. + :type sso_context: str + :param preferred_app_group_type: The type of preferred application group + type, default to Desktop Application Group. Possible values include: + 'None', 'Desktop', 'RailApplications' + :type preferred_app_group_type: str or + ~azure.mgmt.desktopvirtualization.models.PreferredAppGroupType + """ + + _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}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, + 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, + 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, + 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, + 'ring': {'key': 'properties.ring', 'type': 'int'}, + 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, + 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, + 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, + 'sso_context': {'key': 'properties.ssoContext', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(HostPoolPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.description = kwargs.get('description', None) + self.custom_rdp_property = kwargs.get('custom_rdp_property', None) + self.max_session_limit = kwargs.get('max_session_limit', None) + self.personal_desktop_assignment_type = kwargs.get('personal_desktop_assignment_type', None) + self.load_balancer_type = kwargs.get('load_balancer_type', None) + self.ring = kwargs.get('ring', None) + self.validation_environment = kwargs.get('validation_environment', None) + self.registration_info = kwargs.get('registration_info', None) + self.vm_template = kwargs.get('vm_template', None) + self.sso_context = kwargs.get('sso_context', None) + self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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(ProxyResource, self).__init__(**kwargs) + + +class RegistrationInfo(Model): + """Represents a RegistrationInfo definition. + + :param expiration_time: Expiration time of registration token. + :type expiration_time: datetime + :param token: The registration token base64 encoded string. + :type token: str + :param registration_token_operation: The type of resetting the token. + Possible values include: 'Delete', 'None', 'Update' + :type registration_token_operation: str or + ~azure.mgmt.desktopvirtualization.models.RegistrationTokenOperation + """ + + _attribute_map = { + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'token': {'key': 'token', 'type': 'str'}, + 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationInfo, self).__init__(**kwargs) + self.expiration_time = kwargs.get('expiration_time', None) + self.token = kwargs.get('token', None) + self.registration_token_operation = kwargs.get('registration_token_operation', None) + + +class RegistrationInfoPatch(Model): + """Represents a RegistrationInfo definition. + + :param expiration_time: Expiration time of registration token. + :type expiration_time: datetime + :param registration_token_operation: The type of resetting the token. + Possible values include: 'Delete', 'None', 'Update' + :type registration_token_operation: str or + ~azure.mgmt.desktopvirtualization.models.RegistrationTokenOperation + """ + + _attribute_map = { + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RegistrationInfoPatch, self).__init__(**kwargs) + self.expiration_time = kwargs.get('expiration_time', None) + self.registration_token_operation = kwargs.get('registration_token_operation', None) + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.desktopvirtualization.models.ResourceProviderOperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'ResourceProviderOperationDisplay'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Desktop Virtualization. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this 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) + + +class ResourceProviderOperationList(Model): + """Result of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.desktopvirtualization.models.ResourceProviderOperation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + } + + def __init__(self, **kwargs): + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class SendMessage(Model): + """Represents message sent to a UserSession. + + :param message_title: Title of message. + :type message_title: str + :param message_body: Body of message. + :type message_body: str + """ + + _attribute_map = { + 'message_title': {'key': 'messageTitle', 'type': 'str'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SendMessage, self).__init__(**kwargs) + self.message_title = kwargs.get('message_title', None) + self.message_body = kwargs.get('message_body', None) + + +class SessionHost(Resource): + """Represents a SessionHost definition. + + 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 + :param last_heart_beat: Last heart beat from SessionHost. + :type last_heart_beat: datetime + :param sessions: Number of sessions on SessionHost. + :type sessions: int + :param agent_version: Version of agent on SessionHost. + :type agent_version: str + :param allow_new_session: Allow a new session. + :type allow_new_session: bool + :ivar virtual_machine_id: Virtual Machine Id of SessionHost's underlying + virtual machine. + :vartype virtual_machine_id: str + :ivar resource_id: Resource Id of SessionHost's underlying virtual + machine. + :vartype resource_id: str + :param assigned_user: User assigned to SessionHost. + :type assigned_user: str + :param status: Status for a SessionHost. Possible values include: + 'Available', 'Unavailable', 'Shutdown', 'Disconnected', 'Upgrading', + 'UpgradeFailed' + :type status: str or ~azure.mgmt.desktopvirtualization.models.Status + :ivar status_timestamp: The timestamp of the status. + :vartype status_timestamp: datetime + :param os_version: The version of the OS on the session host. + :type os_version: str + :param sx_sstack_version: The version of the side by side stack on the + session host. + :type sx_sstack_version: str + :param update_state: Update state of a SessionHost. Possible values + include: 'Initial', 'Pending', 'Started', 'Succeeded', 'Failed' + :type update_state: str or + ~azure.mgmt.desktopvirtualization.models.UpdateState + :ivar last_update_time: The timestamp of the last update. + :vartype last_update_time: datetime + :param update_error_message: The error message. + :type update_error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_machine_id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'status_timestamp': {'readonly': True}, + 'last_update_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'iso-8601'}, + 'sessions': {'key': 'properties.sessions', 'type': 'int'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, + 'virtual_machine_id': {'key': 'properties.virtualMachineId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'sx_sstack_version': {'key': 'properties.sxSStackVersion', 'type': 'str'}, + 'update_state': {'key': 'properties.updateState', 'type': 'str'}, + 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, + 'update_error_message': {'key': 'properties.updateErrorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SessionHost, self).__init__(**kwargs) + self.last_heart_beat = kwargs.get('last_heart_beat', None) + self.sessions = kwargs.get('sessions', None) + self.agent_version = kwargs.get('agent_version', None) + self.allow_new_session = kwargs.get('allow_new_session', None) + self.virtual_machine_id = None + self.resource_id = None + self.assigned_user = kwargs.get('assigned_user', None) + self.status = kwargs.get('status', None) + self.status_timestamp = None + self.os_version = kwargs.get('os_version', None) + self.sx_sstack_version = kwargs.get('sx_sstack_version', None) + self.update_state = kwargs.get('update_state', None) + self.last_update_time = None + self.update_error_message = kwargs.get('update_error_message', None) + + +class SessionHostPatch(Resource): + """SessionHost properties that can be patched. + + 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 + :param allow_new_session: Allow a new session. + :type allow_new_session: bool + :param assigned_user: User assigned to SessionHost. + :type assigned_user: 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'}, + 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, + 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SessionHostPatch, self).__init__(**kwargs) + self.allow_new_session = kwargs.get('allow_new_session', None) + self.assigned_user = kwargs.get('assigned_user', None) + + +class StartMenuItem(Resource): + """Represents a StartMenuItem definition. + + 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 + :param app_alias: Alias of StartMenuItem. + :type app_alias: str + :param friendly_name: Friendly name of StartMenuItem. + :type friendly_name: str + :param file_path: Path to the file of StartMenuItem. + :type file_path: str + :param command_line_arguments: Command line arguments for StartMenuItem. + :type command_line_arguments: str + :param icon_path: Path to the icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + """ + + _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'}, + 'app_alias': {'key': 'properties.appAlias', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StartMenuItem, self).__init__(**kwargs) + self.app_alias = kwargs.get('app_alias', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.file_path = kwargs.get('file_path', None) + self.command_line_arguments = kwargs.get('command_line_arguments', None) + self.icon_path = kwargs.get('icon_path', None) + self.icon_index = kwargs.get('icon_index', None) + + +class UserSession(Resource): + """Represents a UserSession definition. + + 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 + :param user_principal_name: The user principal name. + :type user_principal_name: str + :param application_type: Application type of application. Possible values + include: 'RemoteApp', 'Desktop' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.ApplicationType + :param session_state: State of user session. Possible values include: + 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', + 'UserProfileDiskMounted' + :type session_state: str or + ~azure.mgmt.desktopvirtualization.models.SessionState + :param active_directory_user_name: The active directory user name. + :type active_directory_user_name: str + :param create_time: The timestamp of the user session create. + :type create_time: datetime + """ + + _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'}, + 'user_principal_name': {'key': 'properties.userPrincipalName', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, + 'session_state': {'key': 'properties.sessionState', 'type': 'str'}, + 'active_directory_user_name': {'key': 'properties.activeDirectoryUserName', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(UserSession, self).__init__(**kwargs) + self.user_principal_name = kwargs.get('user_principal_name', None) + self.application_type = kwargs.get('application_type', None) + self.session_state = kwargs.get('session_state', None) + self.active_directory_user_name = kwargs.get('active_directory_user_name', None) + self.create_time = kwargs.get('create_time', None) + + +class Workspace(TrackedResource): + """Represents a Workspace definition. + + 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 description: Description of Workspace. + :type description: str + :param friendly_name: Friendly name of Workspace. + :type friendly_name: str + :param application_group_references: List of applicationGroup resource + Ids. + :type application_group_references: list[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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Workspace, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.application_group_references = kwargs.get('application_group_references', None) + + +class WorkspacePatch(Model): + """Workspace properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Workspace. + :type description: str + :param friendly_name: Friendly name of Workspace. + :type friendly_name: str + :param application_group_references: List of applicationGroup links. + :type application_group_references: list[str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(WorkspacePatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.application_group_references = kwargs.get('application_group_references', None) diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py new file mode 100644 index 000000000000..1336f258de52 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py @@ -0,0 +1,1221 @@ +# 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 Resource(Model): + """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. 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 Application(Resource): + """Schema for Application properties. + + 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 description: Description of Application. + :type description: str + :param friendly_name: Friendly name of Application. + :type friendly_name: str + :param file_path: Specifies a path for the executable file for the + application. + :type file_path: str + :param command_line_setting: Required. Specifies whether this published + application can be launched with command line arguments provided by the + client, command line arguments specified at publish time, or no command + line arguments at all. Possible values include: 'DoNotAllow', 'Allow', + 'Require' + :type command_line_setting: str or + ~azure.mgmt.desktopvirtualization.models.CommandLineSetting + :param command_line_arguments: Command Line Arguments for Application. + :type command_line_arguments: str + :param show_in_portal: Specifies whether to show the RemoteApp program in + the RD Web Access server. + :type show_in_portal: bool + :param icon_path: Path to icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + :ivar icon_hash: Hash of the icon. + :vartype icon_hash: str + :ivar icon_content: the icon a 64 bit string as a byte array. + :vartype icon_content: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'command_line_setting': {'required': True}, + 'icon_hash': {'readonly': True}, + 'icon_content': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, + 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, + } + + def __init__(self, *, command_line_setting, description: str=None, friendly_name: str=None, file_path: str=None, command_line_arguments: str=None, show_in_portal: bool=None, icon_path: str=None, icon_index: int=None, **kwargs) -> None: + super(Application, self).__init__(**kwargs) + self.description = description + self.friendly_name = friendly_name + self.file_path = file_path + self.command_line_setting = command_line_setting + self.command_line_arguments = command_line_arguments + self.show_in_portal = show_in_portal + self.icon_path = icon_path + self.icon_index = icon_index + self.icon_hash = None + self.icon_content = 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, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class ApplicationGroup(TrackedResource): + """Represents a ApplicationGroup definition. + + 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 description: Description of ApplicationGroup. + :type description: str + :param friendly_name: Friendly name of ApplicationGroup. + :type friendly_name: str + :param host_pool_arm_path: Required. HostPool arm path of + ApplicationGroup. + :type host_pool_arm_path: str + :ivar workspace_arm_path: Workspace arm path of ApplicationGroup. + :vartype workspace_arm_path: str + :param application_group_type: Required. Resource Type of + ApplicationGroup. Possible values include: 'RemoteApp', 'Desktop' + :type application_group_type: str or + ~azure.mgmt.desktopvirtualization.models.ApplicationGroupType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_pool_arm_path': {'required': True}, + 'workspace_arm_path': {'readonly': True}, + 'application_group_type': {'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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'host_pool_arm_path': {'key': 'properties.hostPoolArmPath', 'type': 'str'}, + 'workspace_arm_path': {'key': 'properties.workspaceArmPath', 'type': 'str'}, + 'application_group_type': {'key': 'properties.applicationGroupType', 'type': 'str'}, + } + + def __init__(self, *, location: str, host_pool_arm_path: str, application_group_type, tags=None, description: str=None, friendly_name: str=None, **kwargs) -> None: + super(ApplicationGroup, self).__init__(tags=tags, location=location, **kwargs) + self.description = description + self.friendly_name = friendly_name + self.host_pool_arm_path = host_pool_arm_path + self.workspace_arm_path = None + self.application_group_type = application_group_type + + +class ApplicationGroupPatch(Resource): + """ApplicationGroup properties that can be patched. + + 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 + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of ApplicationGroup. + :type description: str + :param friendly_name: Friendly name of ApplicationGroup. + :type friendly_name: 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}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, **kwargs) -> None: + super(ApplicationGroupPatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.friendly_name = friendly_name + + +class ApplicationPatch(Model): + """Application properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Application. + :type description: str + :param friendly_name: Friendly name of Application. + :type friendly_name: str + :param file_path: Specifies a path for the executable file for the + application. + :type file_path: str + :param command_line_setting: Specifies whether this published application + can be launched with command line arguments provided by the client, + command line arguments specified at publish time, or no command line + arguments at all. Possible values include: 'DoNotAllow', 'Allow', + 'Require' + :type command_line_setting: str or + ~azure.mgmt.desktopvirtualization.models.CommandLineSetting + :param command_line_arguments: Command Line Arguments for Application. + :type command_line_arguments: str + :param show_in_portal: Specifies whether to show the RemoteApp program in + the RD Web Access server. + :type show_in_portal: bool + :param icon_path: Path to icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_setting': {'key': 'properties.commandLineSetting', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'show_in_portal': {'key': 'properties.showInPortal', 'type': 'bool'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + } + + def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, file_path: str=None, command_line_setting=None, command_line_arguments: str=None, show_in_portal: bool=None, icon_path: str=None, icon_index: int=None, **kwargs) -> None: + super(ApplicationPatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.friendly_name = friendly_name + self.file_path = file_path + self.command_line_setting = command_line_setting + self.command_line_arguments = command_line_arguments + self.show_in_portal = show_in_portal + self.icon_path = icon_path + self.icon_index = icon_index + + +class AzureEntityResource(Resource): + """The resource model definition for a Azure Resource Manager resource with an + etag. + + 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 + :ivar etag: Resource Etag. + :vartype etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AzureEntityResource, self).__init__(**kwargs) + self.etag = None + + +class CloudError(Model): + """Error response of an operation failure. + + :param code: Error code + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str=None, message: str=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class Desktop(Resource): + """Schema for Desktop properties. + + 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 + :param description: Description of Desktop. + :type description: str + :param friendly_name: Friendly name of Desktop. + :type friendly_name: str + :ivar icon_hash: Hash of the icon. + :vartype icon_hash: str + :ivar icon_content: The icon a 64 bit string as a byte array. + :vartype icon_content: bytearray + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'icon_hash': {'readonly': True}, + 'icon_content': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'icon_hash': {'key': 'properties.iconHash', 'type': 'str'}, + 'icon_content': {'key': 'properties.iconContent', 'type': 'bytearray'}, + } + + def __init__(self, *, description: str=None, friendly_name: str=None, **kwargs) -> None: + super(Desktop, self).__init__(**kwargs) + self.description = description + self.friendly_name = friendly_name + self.icon_hash = None + self.icon_content = None + + +class DesktopList(Model): + """DesktopList. + + List of Desktop definitions. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: List of Desktop definitions. + :type value: list[~azure.mgmt.desktopvirtualization.models.Desktop] + :ivar next_link: Link to the next page of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Desktop]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(DesktopList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class DesktopPatch(Model): + """Desktop properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Desktop. + :type description: str + :param friendly_name: Friendly name of Desktop. + :type friendly_name: str + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + } + + def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, **kwargs) -> None: + super(DesktopPatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.friendly_name = friendly_name + + +class HostPool(TrackedResource): + """Represents a HostPool definition. + + 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 friendly_name: Friendly name of HostPool. + :type friendly_name: str + :param description: Description of HostPool. + :type description: str + :param host_pool_type: Required. HostPool type for desktop. Possible + values include: 'Personal', 'Pooled' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param personal_desktop_assignment_type: PersonalDesktopAssignment type + for HostPool. Possible values include: 'Automatic', 'Direct' + :type personal_desktop_assignment_type: str or + ~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType + :param custom_rdp_property: Custom rdp property of HostPool. + :type custom_rdp_property: str + :param max_session_limit: The max session limit of HostPool. + :type max_session_limit: int + :param load_balancer_type: Required. The type of the load balancer. + Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + :type load_balancer_type: str or + ~azure.mgmt.desktopvirtualization.models.LoadBalancerType + :param ring: The ring number of HostPool. + :type ring: int + :param validation_environment: Is validation environment. + :type validation_environment: bool + :param registration_info: The registration info of HostPool. + :type registration_info: + ~azure.mgmt.desktopvirtualization.models.RegistrationInfo + :param vm_template: VM template for sessionhosts configuration within + hostpool. + :type vm_template: str + :ivar application_group_references: List of applicationGroup links. + :vartype application_group_references: list[str] + :param sso_context: Path to keyvault containing ssoContext secret. + :type sso_context: str + :param preferred_app_group_type: Required. The type of preferred + application group type, default to Desktop Application Group. Possible + values include: 'None', 'Desktop', 'RailApplications' + :type preferred_app_group_type: str or + ~azure.mgmt.desktopvirtualization.models.PreferredAppGroupType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'host_pool_type': {'required': True}, + 'load_balancer_type': {'required': True}, + 'application_group_references': {'readonly': True}, + 'preferred_app_group_type': {'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'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, + 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, + 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, + 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, + 'ring': {'key': 'properties.ring', 'type': 'int'}, + 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, + 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfo'}, + 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + 'sso_context': {'key': 'properties.ssoContext', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + } + + def __init__(self, *, location: str, host_pool_type, load_balancer_type, preferred_app_group_type, tags=None, friendly_name: str=None, description: str=None, personal_desktop_assignment_type=None, custom_rdp_property: str=None, max_session_limit: int=None, ring: int=None, validation_environment: bool=None, registration_info=None, vm_template: str=None, sso_context: str=None, **kwargs) -> None: + super(HostPool, self).__init__(tags=tags, location=location, **kwargs) + self.friendly_name = friendly_name + self.description = description + self.host_pool_type = host_pool_type + self.personal_desktop_assignment_type = personal_desktop_assignment_type + self.custom_rdp_property = custom_rdp_property + self.max_session_limit = max_session_limit + self.load_balancer_type = load_balancer_type + self.ring = ring + self.validation_environment = validation_environment + self.registration_info = registration_info + self.vm_template = vm_template + self.application_group_references = None + self.sso_context = sso_context + self.preferred_app_group_type = preferred_app_group_type + + +class HostPoolPatch(Resource): + """HostPool properties that can be patched. + + 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 + :param tags: tags to be updated + :type tags: dict[str, str] + :param friendly_name: Friendly name of HostPool. + :type friendly_name: str + :param description: Description of HostPool. + :type description: str + :param custom_rdp_property: Custom rdp property of HostPool. + :type custom_rdp_property: str + :param max_session_limit: The max session limit of HostPool. + :type max_session_limit: int + :param personal_desktop_assignment_type: PersonalDesktopAssignment type + for HostPool. Possible values include: 'Automatic', 'Direct' + :type personal_desktop_assignment_type: str or + ~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType + :param load_balancer_type: The type of the load balancer. Possible values + include: 'BreadthFirst', 'DepthFirst', 'Persistent' + :type load_balancer_type: str or + ~azure.mgmt.desktopvirtualization.models.LoadBalancerType + :param ring: The ring number of HostPool. + :type ring: int + :param validation_environment: Is validation environment. + :type validation_environment: bool + :param registration_info: The registration info of HostPool. + :type registration_info: + ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch + :param vm_template: VM template for sessionhosts configuration within + hostpool. + :type vm_template: str + :param sso_context: Path to keyvault containing ssoContext secret. + :type sso_context: str + :param preferred_app_group_type: The type of preferred application group + type, default to Desktop Application Group. Possible values include: + 'None', 'Desktop', 'RailApplications' + :type preferred_app_group_type: str or + ~azure.mgmt.desktopvirtualization.models.PreferredAppGroupType + """ + + _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}'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'custom_rdp_property': {'key': 'properties.customRdpProperty', 'type': 'str'}, + 'max_session_limit': {'key': 'properties.maxSessionLimit', 'type': 'int'}, + 'personal_desktop_assignment_type': {'key': 'properties.personalDesktopAssignmentType', 'type': 'str'}, + 'load_balancer_type': {'key': 'properties.loadBalancerType', 'type': 'str'}, + 'ring': {'key': 'properties.ring', 'type': 'int'}, + 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, + 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, + 'vm_template': {'key': 'properties.vmTemplate', 'type': 'str'}, + 'sso_context': {'key': 'properties.ssoContext', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + } + + def __init__(self, *, tags=None, friendly_name: str=None, description: str=None, custom_rdp_property: str=None, max_session_limit: int=None, personal_desktop_assignment_type=None, load_balancer_type=None, ring: int=None, validation_environment: bool=None, registration_info=None, vm_template: str=None, sso_context: str=None, preferred_app_group_type=None, **kwargs) -> None: + super(HostPoolPatch, self).__init__(**kwargs) + self.tags = tags + self.friendly_name = friendly_name + self.description = description + self.custom_rdp_property = custom_rdp_property + self.max_session_limit = max_session_limit + self.personal_desktop_assignment_type = personal_desktop_assignment_type + self.load_balancer_type = load_balancer_type + self.ring = ring + self.validation_environment = validation_environment + self.registration_info = registration_info + self.vm_template = vm_template + self.sso_context = sso_context + self.preferred_app_group_type = preferred_app_group_type + + +class ProxyResource(Resource): + """The resource model definition for a ARM proxy resource. It will have + everything other than required location and tags. + + 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(ProxyResource, self).__init__(**kwargs) + + +class RegistrationInfo(Model): + """Represents a RegistrationInfo definition. + + :param expiration_time: Expiration time of registration token. + :type expiration_time: datetime + :param token: The registration token base64 encoded string. + :type token: str + :param registration_token_operation: The type of resetting the token. + Possible values include: 'Delete', 'None', 'Update' + :type registration_token_operation: str or + ~azure.mgmt.desktopvirtualization.models.RegistrationTokenOperation + """ + + _attribute_map = { + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'token': {'key': 'token', 'type': 'str'}, + 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, + } + + def __init__(self, *, expiration_time=None, token: str=None, registration_token_operation=None, **kwargs) -> None: + super(RegistrationInfo, self).__init__(**kwargs) + self.expiration_time = expiration_time + self.token = token + self.registration_token_operation = registration_token_operation + + +class RegistrationInfoPatch(Model): + """Represents a RegistrationInfo definition. + + :param expiration_time: Expiration time of registration token. + :type expiration_time: datetime + :param registration_token_operation: The type of resetting the token. + Possible values include: 'Delete', 'None', 'Update' + :type registration_token_operation: str or + ~azure.mgmt.desktopvirtualization.models.RegistrationTokenOperation + """ + + _attribute_map = { + 'expiration_time': {'key': 'expirationTime', 'type': 'iso-8601'}, + 'registration_token_operation': {'key': 'registrationTokenOperation', 'type': 'str'}, + } + + def __init__(self, *, expiration_time=None, registration_token_operation=None, **kwargs) -> None: + super(RegistrationInfoPatch, self).__init__(**kwargs) + self.expiration_time = expiration_time + self.registration_token_operation = registration_token_operation + + +class ResourceProviderOperation(Model): + """Supported operation of this resource provider. + + :param name: Operation name, in format of + {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: + ~azure.mgmt.desktopvirtualization.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(ResourceProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class ResourceProviderOperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Resource provider: Microsoft Desktop Virtualization. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Description of this 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 + + +class ResourceProviderOperationList(Model): + """Result of the request to list operations. + + :param value: List of operations supported by this resource provider. + :type value: + list[~azure.mgmt.desktopvirtualization.models.ResourceProviderOperation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ResourceProviderOperation]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(ResourceProviderOperationList, self).__init__(**kwargs) + self.value = value + + +class SendMessage(Model): + """Represents message sent to a UserSession. + + :param message_title: Title of message. + :type message_title: str + :param message_body: Body of message. + :type message_body: str + """ + + _attribute_map = { + 'message_title': {'key': 'messageTitle', 'type': 'str'}, + 'message_body': {'key': 'messageBody', 'type': 'str'}, + } + + def __init__(self, *, message_title: str=None, message_body: str=None, **kwargs) -> None: + super(SendMessage, self).__init__(**kwargs) + self.message_title = message_title + self.message_body = message_body + + +class SessionHost(Resource): + """Represents a SessionHost definition. + + 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 + :param last_heart_beat: Last heart beat from SessionHost. + :type last_heart_beat: datetime + :param sessions: Number of sessions on SessionHost. + :type sessions: int + :param agent_version: Version of agent on SessionHost. + :type agent_version: str + :param allow_new_session: Allow a new session. + :type allow_new_session: bool + :ivar virtual_machine_id: Virtual Machine Id of SessionHost's underlying + virtual machine. + :vartype virtual_machine_id: str + :ivar resource_id: Resource Id of SessionHost's underlying virtual + machine. + :vartype resource_id: str + :param assigned_user: User assigned to SessionHost. + :type assigned_user: str + :param status: Status for a SessionHost. Possible values include: + 'Available', 'Unavailable', 'Shutdown', 'Disconnected', 'Upgrading', + 'UpgradeFailed' + :type status: str or ~azure.mgmt.desktopvirtualization.models.Status + :ivar status_timestamp: The timestamp of the status. + :vartype status_timestamp: datetime + :param os_version: The version of the OS on the session host. + :type os_version: str + :param sx_sstack_version: The version of the side by side stack on the + session host. + :type sx_sstack_version: str + :param update_state: Update state of a SessionHost. Possible values + include: 'Initial', 'Pending', 'Started', 'Succeeded', 'Failed' + :type update_state: str or + ~azure.mgmt.desktopvirtualization.models.UpdateState + :ivar last_update_time: The timestamp of the last update. + :vartype last_update_time: datetime + :param update_error_message: The error message. + :type update_error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'virtual_machine_id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'status_timestamp': {'readonly': True}, + 'last_update_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'last_heart_beat': {'key': 'properties.lastHeartBeat', 'type': 'iso-8601'}, + 'sessions': {'key': 'properties.sessions', 'type': 'int'}, + 'agent_version': {'key': 'properties.agentVersion', 'type': 'str'}, + 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, + 'virtual_machine_id': {'key': 'properties.virtualMachineId', 'type': 'str'}, + 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, + 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, + 'os_version': {'key': 'properties.osVersion', 'type': 'str'}, + 'sx_sstack_version': {'key': 'properties.sxSStackVersion', 'type': 'str'}, + 'update_state': {'key': 'properties.updateState', 'type': 'str'}, + 'last_update_time': {'key': 'properties.lastUpdateTime', 'type': 'iso-8601'}, + 'update_error_message': {'key': 'properties.updateErrorMessage', 'type': 'str'}, + } + + def __init__(self, *, last_heart_beat=None, sessions: int=None, agent_version: str=None, allow_new_session: bool=None, assigned_user: str=None, status=None, os_version: str=None, sx_sstack_version: str=None, update_state=None, update_error_message: str=None, **kwargs) -> None: + super(SessionHost, self).__init__(**kwargs) + self.last_heart_beat = last_heart_beat + self.sessions = sessions + self.agent_version = agent_version + self.allow_new_session = allow_new_session + self.virtual_machine_id = None + self.resource_id = None + self.assigned_user = assigned_user + self.status = status + self.status_timestamp = None + self.os_version = os_version + self.sx_sstack_version = sx_sstack_version + self.update_state = update_state + self.last_update_time = None + self.update_error_message = update_error_message + + +class SessionHostPatch(Resource): + """SessionHost properties that can be patched. + + 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 + :param allow_new_session: Allow a new session. + :type allow_new_session: bool + :param assigned_user: User assigned to SessionHost. + :type assigned_user: 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'}, + 'allow_new_session': {'key': 'properties.allowNewSession', 'type': 'bool'}, + 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, + } + + def __init__(self, *, allow_new_session: bool=None, assigned_user: str=None, **kwargs) -> None: + super(SessionHostPatch, self).__init__(**kwargs) + self.allow_new_session = allow_new_session + self.assigned_user = assigned_user + + +class StartMenuItem(Resource): + """Represents a StartMenuItem definition. + + 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 + :param app_alias: Alias of StartMenuItem. + :type app_alias: str + :param friendly_name: Friendly name of StartMenuItem. + :type friendly_name: str + :param file_path: Path to the file of StartMenuItem. + :type file_path: str + :param command_line_arguments: Command line arguments for StartMenuItem. + :type command_line_arguments: str + :param icon_path: Path to the icon. + :type icon_path: str + :param icon_index: Index of the icon. + :type icon_index: int + """ + + _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'}, + 'app_alias': {'key': 'properties.appAlias', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'file_path': {'key': 'properties.filePath', 'type': 'str'}, + 'command_line_arguments': {'key': 'properties.commandLineArguments', 'type': 'str'}, + 'icon_path': {'key': 'properties.iconPath', 'type': 'str'}, + 'icon_index': {'key': 'properties.iconIndex', 'type': 'int'}, + } + + def __init__(self, *, app_alias: str=None, friendly_name: str=None, file_path: str=None, command_line_arguments: str=None, icon_path: str=None, icon_index: int=None, **kwargs) -> None: + super(StartMenuItem, self).__init__(**kwargs) + self.app_alias = app_alias + self.friendly_name = friendly_name + self.file_path = file_path + self.command_line_arguments = command_line_arguments + self.icon_path = icon_path + self.icon_index = icon_index + + +class UserSession(Resource): + """Represents a UserSession definition. + + 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 + :param user_principal_name: The user principal name. + :type user_principal_name: str + :param application_type: Application type of application. Possible values + include: 'RemoteApp', 'Desktop' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.ApplicationType + :param session_state: State of user session. Possible values include: + 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', + 'UserProfileDiskMounted' + :type session_state: str or + ~azure.mgmt.desktopvirtualization.models.SessionState + :param active_directory_user_name: The active directory user name. + :type active_directory_user_name: str + :param create_time: The timestamp of the user session create. + :type create_time: datetime + """ + + _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'}, + 'user_principal_name': {'key': 'properties.userPrincipalName', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, + 'session_state': {'key': 'properties.sessionState', 'type': 'str'}, + 'active_directory_user_name': {'key': 'properties.activeDirectoryUserName', 'type': 'str'}, + 'create_time': {'key': 'properties.createTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, user_principal_name: str=None, application_type=None, session_state=None, active_directory_user_name: str=None, create_time=None, **kwargs) -> None: + super(UserSession, self).__init__(**kwargs) + self.user_principal_name = user_principal_name + self.application_type = application_type + self.session_state = session_state + self.active_directory_user_name = active_directory_user_name + self.create_time = create_time + + +class Workspace(TrackedResource): + """Represents a Workspace definition. + + 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 description: Description of Workspace. + :type description: str + :param friendly_name: Friendly name of Workspace. + :type friendly_name: str + :param application_group_references: List of applicationGroup resource + Ids. + :type application_group_references: list[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'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + } + + def __init__(self, *, location: str, tags=None, description: str=None, friendly_name: str=None, application_group_references=None, **kwargs) -> None: + super(Workspace, self).__init__(tags=tags, location=location, **kwargs) + self.description = description + self.friendly_name = friendly_name + self.application_group_references = application_group_references + + +class WorkspacePatch(Model): + """Workspace properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of Workspace. + :type description: str + :param friendly_name: Friendly name of Workspace. + :type friendly_name: str + :param application_group_references: List of applicationGroup links. + :type application_group_references: list[str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'application_group_references': {'key': 'properties.applicationGroupReferences', 'type': '[str]'}, + } + + def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, application_group_references=None, **kwargs) -> None: + super(WorkspacePatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.friendly_name = friendly_name + self.application_group_references = application_group_references diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_paged_models.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_paged_models.py new file mode 100644 index 000000000000..e8abe8e6c38d --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_paged_models.py @@ -0,0 +1,105 @@ +# 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 WorkspacePaged(Paged): + """ + A paging container for iterating over a list of :class:`Workspace ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Workspace]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkspacePaged, self).__init__(*args, **kwargs) +class ApplicationGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApplicationGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApplicationGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationGroupPaged, self).__init__(*args, **kwargs) +class StartMenuItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`StartMenuItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StartMenuItem]'} + } + + def __init__(self, *args, **kwargs): + + super(StartMenuItemPaged, self).__init__(*args, **kwargs) +class ApplicationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Application ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Application]'} + } + + def __init__(self, *args, **kwargs): + + super(ApplicationPaged, self).__init__(*args, **kwargs) +class HostPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`HostPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[HostPool]'} + } + + def __init__(self, *args, **kwargs): + + super(HostPoolPaged, self).__init__(*args, **kwargs) +class UserSessionPaged(Paged): + """ + A paging container for iterating over a list of :class:`UserSession ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[UserSession]'} + } + + def __init__(self, *args, **kwargs): + + super(UserSessionPaged, self).__init__(*args, **kwargs) +class SessionHostPaged(Paged): + """ + A paging container for iterating over a list of :class:`SessionHost ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SessionHost]'} + } + + def __init__(self, *args, **kwargs): + + super(SessionHostPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py new file mode 100644 index 000000000000..0e5394eb938c --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py @@ -0,0 +1,32 @@ +# 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 ._operations import Operations +from ._workspaces_operations import WorkspacesOperations +from ._application_groups_operations import ApplicationGroupsOperations +from ._start_menu_items_operations import StartMenuItemsOperations +from ._applications_operations import ApplicationsOperations +from ._desktops_operations import DesktopsOperations +from ._host_pools_operations import HostPoolsOperations +from ._user_sessions_operations import UserSessionsOperations +from ._session_hosts_operations import SessionHostsOperations + +__all__ = [ + 'Operations', + 'WorkspacesOperations', + 'ApplicationGroupsOperations', + 'StartMenuItemsOperations', + 'ApplicationsOperations', + 'DesktopsOperations', + 'HostPoolsOperations', + 'UserSessionsOperations', + 'SessionHostsOperations', +] diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py new file mode 100644 index 000000000000..a23e1712c434 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py @@ -0,0 +1,447 @@ +# 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 ApplicationGroupsOperations(object): + """ApplicationGroupsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, application_group_name, custom_headers=None, raw=False, **operation_config): + """Get an application group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_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: ApplicationGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} + + def create_or_update( + self, resource_group_name, application_group_name, application_group, custom_headers=None, raw=False, **operation_config): + """Create or update an applicationGroup. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_group: Object containing ApplicationGroup + definitions. + :type application_group: + ~azure.mgmt.desktopvirtualization.models.ApplicationGroup + :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: ApplicationGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(application_group, 'ApplicationGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('ApplicationGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} + + def delete( + self, resource_group_name, application_group_name, custom_headers=None, raw=False, **operation_config): + """Remove an applicationGroup. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} + + def update( + self, resource_group_name, application_group_name, application_group=None, custom_headers=None, raw=False, **operation_config): + """Update an applicationGroup. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_group: Object containing ApplicationGroup + definitions. + :type application_group: + ~azure.mgmt.desktopvirtualization.models.ApplicationGroupPatch + :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: ApplicationGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if application_group is not None: + body_content = self._serialize.body(application_group, 'ApplicationGroupPatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApplicationGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}'} + + def list_by_resource_group( + self, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List applicationGroups. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param filter: OData filter expression. Valid properties for filtering + are applicationGroupType. + :type filter: 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 ApplicationGroup + :rtype: + ~azure.mgmt.desktopvirtualization.models.ApplicationGroupPaged[~azure.mgmt.desktopvirtualization.models.ApplicationGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ApplicationGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups'} + + def list_by_subscription( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """List applicationGroups in subscription. + + :param filter: OData filter expression. Valid properties for filtering + are applicationGroupType. + :type filter: 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 ApplicationGroup + :rtype: + ~azure.mgmt.desktopvirtualization.models.ApplicationGroupPaged[~azure.mgmt.desktopvirtualization.models.ApplicationGroup] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ApplicationGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/applicationGroups'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py new file mode 100644 index 000000000000..e6bad83d551f --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py @@ -0,0 +1,388 @@ +# 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 ApplicationsOperations(object): + """ApplicationsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, application_group_name, application_name, custom_headers=None, raw=False, **operation_config): + """Get an application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_name: The name of the application within the + specified application group + :type application_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: Application or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Application or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Application', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} + + def create_or_update( + self, resource_group_name, application_group_name, application_name, application, custom_headers=None, raw=False, **operation_config): + """Create or update an application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_name: The name of the application within the + specified application group + :type application_name: str + :param application: Object containing Application definitions. + :type application: + ~azure.mgmt.desktopvirtualization.models.Application + :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: Application or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Application or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(application, 'Application') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Application', response) + if response.status_code == 201: + deserialized = self._deserialize('Application', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} + + def delete( + self, resource_group_name, application_group_name, application_name, custom_headers=None, raw=False, **operation_config): + """Remove an application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_name: The name of the application within the + specified application group + :type application_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} + + def update( + self, resource_group_name, application_group_name, application_name, application=None, custom_headers=None, raw=False, **operation_config): + """Update an application. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param application_name: The name of the application within the + specified application group + :type application_name: str + :param application: Object containing Application definitions. + :type application: + ~azure.mgmt.desktopvirtualization.models.ApplicationPatch + :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: Application or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Application or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'applicationName': self._serialize.url("application_name", application_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if application is not None: + body_content = self._serialize.body(application, 'ApplicationPatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Application', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}'} + + def list( + self, resource_group_name, application_group_name, custom_headers=None, raw=False, **operation_config): + """List applications. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_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 Application + :rtype: + ~azure.mgmt.desktopvirtualization.models.ApplicationPaged[~azure.mgmt.desktopvirtualization.models.Application] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ApplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py new file mode 100644 index 000000000000..257d8aca11ee --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py @@ -0,0 +1,243 @@ +# 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 DesktopsOperations(object): + """DesktopsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, application_group_name, desktop_name, custom_headers=None, raw=False, **operation_config): + """Get a desktop. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param desktop_name: The name of the desktop within the specified + desktop group + :type desktop_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: Desktop or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Desktop or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Desktop', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} + + def update( + self, resource_group_name, application_group_name, desktop_name, desktop=None, custom_headers=None, raw=False, **operation_config): + """Update a desktop. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_group_name: str + :param desktop_name: The name of the desktop within the specified + desktop group + :type desktop_name: str + :param desktop: Object containing Desktop definitions. + :type desktop: ~azure.mgmt.desktopvirtualization.models.DesktopPatch + :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: Desktop or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Desktop or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3), + 'desktopName': self._serialize.url("desktop_name", desktop_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if desktop is not None: + body_content = self._serialize.body(desktop, 'DesktopPatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Desktop', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}'} + + def list( + self, resource_group_name, application_group_name, custom_headers=None, raw=False, **operation_config): + """List desktops. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_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: DesktopList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.DesktopList or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DesktopList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py new file mode 100644 index 000000000000..96531f671577 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py @@ -0,0 +1,442 @@ +# 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 HostPoolsOperations(object): + """HostPoolsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, host_pool_name, custom_headers=None, raw=False, **operation_config): + """Get a host pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_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: HostPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.HostPool or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HostPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} + + def create_or_update( + self, resource_group_name, host_pool_name, host_pool, custom_headers=None, raw=False, **operation_config): + """Create or update a host pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param host_pool: Object containing HostPool definitions. + :type host_pool: ~azure.mgmt.desktopvirtualization.models.HostPool + :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: HostPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.HostPool or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(host_pool, 'HostPool') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HostPool', response) + if response.status_code == 201: + deserialized = self._deserialize('HostPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} + + def delete( + self, resource_group_name, host_pool_name, force=None, custom_headers=None, raw=False, **operation_config): + """Remove a host pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param force: Force flag to delete sessionHost. + :type force: bool + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} + + def update( + self, resource_group_name, host_pool_name, host_pool=None, custom_headers=None, raw=False, **operation_config): + """Update a host pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param host_pool: Object containing HostPool definitions. + :type host_pool: + ~azure.mgmt.desktopvirtualization.models.HostPoolPatch + :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: HostPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.HostPool or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if host_pool is not None: + body_content = self._serialize.body(host_pool, 'HostPoolPatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('HostPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List hostPools. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 HostPool + :rtype: + ~azure.mgmt.desktopvirtualization.models.HostPoolPaged[~azure.mgmt.desktopvirtualization.models.HostPool] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.HostPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List hostPools in 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 HostPool + :rtype: + ~azure.mgmt.desktopvirtualization.models.HostPoolPaged[~azure.mgmt.desktopvirtualization.models.HostPool] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.HostPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py new file mode 100644 index 000000000000..cfbf6886128b --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py @@ -0,0 +1,94 @@ +# 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. + + 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """List all of the available operations the Desktop Virtualization + resource provider supports. + + :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: ResourceProviderOperationList or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.desktopvirtualization.models.ResourceProviderOperationList + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ResourceProviderOperationList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.DesktopVirtualization/operations'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py new file mode 100644 index 000000000000..0d3c032cda5a --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py @@ -0,0 +1,327 @@ +# 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 SessionHostsOperations(object): + """SessionHostsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, host_pool_name, session_host_name, custom_headers=None, raw=False, **operation_config): + """Get a session host. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_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: SessionHost or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SessionHost', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} + + def delete( + self, resource_group_name, host_pool_name, session_host_name, force=None, custom_headers=None, raw=False, **operation_config): + """Remove a SessionHost. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param force: Force flag to force sessionHost deletion even when + userSession exists. + :type force: bool + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3) + } + 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', min_length=1) + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} + + def update( + self, resource_group_name, host_pool_name, session_host_name, allow_new_session=None, assigned_user=None, custom_headers=None, raw=False, **operation_config): + """Update a session host. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param allow_new_session: Allow a new session. + :type allow_new_session: bool + :param assigned_user: User assigned to SessionHost. + :type assigned_user: 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: SessionHost or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + session_host = None + if allow_new_session is not None or assigned_user is not None: + session_host = models.SessionHostPatch(allow_new_session=allow_new_session, assigned_user=assigned_user) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if session_host is not None: + body_content = self._serialize.body(session_host, 'SessionHostPatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SessionHost', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}'} + + def list( + self, resource_group_name, host_pool_name, custom_headers=None, raw=False, **operation_config): + """List sessionHosts. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_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 SessionHost + :rtype: + ~azure.mgmt.desktopvirtualization.models.SessionHostPaged[~azure.mgmt.desktopvirtualization.models.SessionHost] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.SessionHostPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py new file mode 100644 index 000000000000..63b1cc4c2a7b --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py @@ -0,0 +1,113 @@ +# 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 StartMenuItemsOperations(object): + """StartMenuItemsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def list( + self, resource_group_name, application_group_name, custom_headers=None, raw=False, **operation_config): + """List start menu items in the given application group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param application_group_name: The name of the application group + :type application_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 StartMenuItem + :rtype: + ~azure.mgmt.desktopvirtualization.models.StartMenuItemPaged[~azure.mgmt.desktopvirtualization.models.StartMenuItem] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'applicationGroupName': self._serialize.url("application_group_name", application_group_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.StartMenuItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py new file mode 100644 index 000000000000..afab7d07c90b --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py @@ -0,0 +1,476 @@ +# 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 UserSessionsOperations(object): + """UserSessionsOperations 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def list_by_host_pool( + self, resource_group_name, host_pool_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List userSessions. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param filter: OData filter expression. Valid properties for filtering + are userprincipalname and sessionstate. + :type filter: 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 UserSession + :rtype: + ~azure.mgmt.desktopvirtualization.models.UserSessionPaged[~azure.mgmt.desktopvirtualization.models.UserSession] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_host_pool.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.UserSessionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/userSessions'} + + def get( + self, resource_group_name, host_pool_name, session_host_name, user_session_id, custom_headers=None, raw=False, **operation_config): + """Get a userSession. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param user_session_id: The name of the user session within the + specified session host + :type user_session_id: 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: UserSession or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.UserSession or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), + 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UserSession', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} + + def delete( + self, resource_group_name, host_pool_name, session_host_name, user_session_id, force=None, custom_headers=None, raw=False, **operation_config): + """Remove a userSession. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param user_session_id: The name of the user session within the + specified session host + :type user_session_id: str + :param force: Force flag to login off userSession. + :type force: bool + :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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), + 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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', min_length=1) + if force is not None: + query_parameters['force'] = self._serialize.query("force", force, 'bool') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}'} + + def list( + self, resource_group_name, host_pool_name, session_host_name, custom_headers=None, raw=False, **operation_config): + """List userSessions. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_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 UserSession + :rtype: + ~azure.mgmt.desktopvirtualization.models.UserSessionPaged[~azure.mgmt.desktopvirtualization.models.UserSession] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3) + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.UserSessionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions'} + + def disconnect( + self, resource_group_name, host_pool_name, session_host_name, user_session_id, custom_headers=None, raw=False, **operation_config): + """Disconnect a userSession. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param user_session_id: The name of the user session within the + specified session host + :type user_session_id: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disconnect.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), + 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + disconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect'} + + def send_message_method( + self, resource_group_name, host_pool_name, session_host_name, user_session_id, message_title=None, message_body=None, custom_headers=None, raw=False, **operation_config): + """Send a message to a user. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param host_pool_name: The name of the host pool within the specified + resource group + :type host_pool_name: str + :param session_host_name: The name of the session host within the + specified host pool + :type session_host_name: str + :param user_session_id: The name of the user session within the + specified session host + :type user_session_id: str + :param message_title: Title of message. + :type message_title: str + :param message_body: Body of message. + :type message_body: 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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + send_message = None + if message_title is not None or message_body is not None: + send_message = models.SendMessage(message_title=message_title, message_body=message_body) + + # Construct URL + url = self.send_message_method.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'sessionHostName': self._serialize.url("session_host_name", session_host_name, 'str', max_length=48, min_length=3), + 'userSessionId': self._serialize.url("user_session_id", user_session_id, 'str', max_length=24, 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', min_length=1) + + # 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 + if send_message is not None: + body_content = self._serialize.body(send_message, 'SendMessage') + else: + body_content = None + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + send_message_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py new file mode 100644 index 000000000000..564425d283d6 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py @@ -0,0 +1,434 @@ +# 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 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. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for this operation. Constant value: "2019-12-10-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-12-10-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get a workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: Workspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Workspace or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} + + def create_or_update( + self, resource_group_name, workspace_name, workspace, custom_headers=None, raw=False, **operation_config): + """Create or update a workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param workspace: Object containing Workspace definitions. + :type workspace: ~azure.mgmt.desktopvirtualization.models.Workspace + :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: Workspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Workspace or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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(workspace, 'Workspace') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', response) + if response.status_code == 201: + deserialized = self._deserialize('Workspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} + + def delete( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Remove a workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} + + def update( + self, resource_group_name, workspace_name, workspace=None, custom_headers=None, raw=False, **operation_config): + """Update a workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param workspace: Object containing Workspace definitions. + :type workspace: + ~azure.mgmt.desktopvirtualization.models.WorkspacePatch + :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: Workspace or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.Workspace or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str', max_length=24, min_length=3) + } + 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', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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 + if workspace is not None: + body_content = self._serialize.body(workspace, 'WorkspacePatch') + else: + body_content = None + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Workspace', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List workspaces. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 Workspace + :rtype: + ~azure.mgmt.desktopvirtualization.models.WorkspacePaged[~azure.mgmt.desktopvirtualization.models.Workspace] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$') + } + 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """List workspaces in 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 Workspace + :rtype: + ~azure.mgmt.desktopvirtualization.models.WorkspacePaged[~azure.mgmt.desktopvirtualization.models.Workspace] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', 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', min_length=1) + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 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]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.WorkspacePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/version.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/version.py new file mode 100644 index 000000000000..9bd1dfac7ecb --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/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.2.0" + diff --git a/sdk/azure-mgmt-desktopvirtualization/sdk_packaging.toml b/sdk/azure-mgmt-desktopvirtualization/sdk_packaging.toml new file mode 100644 index 000000000000..74bd813051a9 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/sdk_packaging.toml @@ -0,0 +1,8 @@ +[packaging] +package_name = "azure-mgmt-desktopvirtualization" +package_nspkg = "azure-mgmt-nspkg" +package_pprint_name = "MyService Management" +package_doc_id = "" +is_stable = false +is_arm = true +need_msrestazure = true diff --git a/sdk/azure-mgmt-desktopvirtualization/setup.cfg b/sdk/azure-mgmt-desktopvirtualization/setup.cfg new file mode 100644 index 000000000000..3c6e79cf31da --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/sdk/azure-mgmt-desktopvirtualization/setup.py b/sdk/azure-mgmt-desktopvirtualization/setup.py new file mode 100644 index 000000000000..fe03193eacab --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/setup.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python + +#------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +#-------------------------------------------------------------------------- + +import re +import os.path +from io import open +from setuptools import find_packages, setup + +# Change the PACKAGE_NAME only to change folder and different name +PACKAGE_NAME = "azure-mgmt-desktopvirtualization" +PACKAGE_PPRINT_NAME = "MyService Management" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace('-', '/') +# a-b-c => a.b.c +namespace_name = PACKAGE_NAME.replace('-', '.') + +# azure v0.x is not compatible with this package +# azure v0.x used to have a __version__ attribute (newer versions don't) +try: + import azure + try: + ver = azure.__version__ + raise Exception( + 'This package is incompatible with azure=={}. '.format(ver) + + 'Uninstall it with "pip uninstall azure".' + ) + except AttributeError: + pass +except ImportError: + pass + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', + fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError('Cannot find version information') + +with open('README.md', encoding='utf-8') as f: + readme = f.read() +with open('CHANGELOG.md', encoding='utf-8') as f: + changelog = f.read() + +setup( + name=PACKAGE_NAME, + version=version, + description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), + long_description=readme + '\n\n' + changelog, + long_description_content_type='text/markdown', + license='MIT License', + author='Microsoft Corporation', + author_email='azpysdkhelp@microsoft.com', + url='https://github.com/Azure/azure-sdk-for-python', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', + ], + zip_safe=False, + packages=find_packages(exclude=[ + 'tests', + # Exclude packages that will be covered by PEP420 or nspkg + 'azure', + 'azure.mgmt', + ]), + install_requires=[ + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', + 'azure-common~=1.1', + ], + extras_require={ + ":python_version<'3.0'": ['azure-mgmt-nspkg'], + } +)