From baa7a661b650474f8c00c0e66b8b80c944d0c46f Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Tue, 16 Jun 2020 01:02:15 +0000 Subject: [PATCH] Generated from 693f6d67c87c428fd9d394eeac024901cd4a574f remove get activeApp, get appGroupAssignments --- .../_desktop_virtualization_api_client.py | 10 -- .../desktopvirtualization/models/__init__.py | 2 + ...desktop_virtualization_api_client_enums.py | 7 + .../desktopvirtualization/models/_models.py | 19 +++ .../models/_models_py3.py | 25 +++- .../operations/__init__.py | 4 - .../_active_applications_operations.py | 123 ------------------ ...pplication_group_assignments_operations.py | 118 ----------------- 8 files changed, 50 insertions(+), 258 deletions(-) delete mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_applications_operations.py delete mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_group_assignments_operations.py 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 index 96db46a790ef..1036243bc524 100644 --- 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 @@ -15,7 +15,6 @@ from ._configuration import DesktopVirtualizationAPIClientConfiguration from .operations import Operations from .operations import WorkspacesOperations -from .operations import ApplicationGroupAssignmentsOperations from .operations import ApplicationGroupsOperations from .operations import StartMenuItemsOperations from .operations import ApplicationsOperations @@ -23,7 +22,6 @@ from .operations import HostPoolsOperations from .operations import UserSessionsOperations from .operations import SessionHostsOperations -from .operations import ActiveApplicationsOperations from . import models @@ -37,8 +35,6 @@ class DesktopVirtualizationAPIClient(SDKClient): :vartype operations: azure.mgmt.desktopvirtualization.operations.Operations :ivar workspaces: Workspaces operations :vartype workspaces: azure.mgmt.desktopvirtualization.operations.WorkspacesOperations - :ivar application_group_assignments: ApplicationGroupAssignments operations - :vartype application_group_assignments: azure.mgmt.desktopvirtualization.operations.ApplicationGroupAssignmentsOperations :ivar application_groups: ApplicationGroups operations :vartype application_groups: azure.mgmt.desktopvirtualization.operations.ApplicationGroupsOperations :ivar start_menu_items: StartMenuItems operations @@ -53,8 +49,6 @@ class DesktopVirtualizationAPIClient(SDKClient): :vartype user_sessions: azure.mgmt.desktopvirtualization.operations.UserSessionsOperations :ivar session_hosts: SessionHosts operations :vartype session_hosts: azure.mgmt.desktopvirtualization.operations.SessionHostsOperations - :ivar active_applications: ActiveApplications operations - :vartype active_applications: azure.mgmt.desktopvirtualization.operations.ActiveApplicationsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -79,8 +73,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations( self._client, self.config, self._serialize, self._deserialize) - self.application_group_assignments = ApplicationGroupAssignmentsOperations( - 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( @@ -95,5 +87,3 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.session_hosts = SessionHostsOperations( self._client, self.config, self._serialize, self._deserialize) - self.active_applications = ActiveApplicationsOperations( - 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 index 1b8c4beb64a4..04c2751ca2b3 100644 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py @@ -76,6 +76,7 @@ PersonalDesktopAssignmentType, LoadBalancerType, RegistrationTokenOperation, + PreferredAppGroupType, CommandLineSetting, Status, UpdateState, @@ -122,6 +123,7 @@ 'PersonalDesktopAssignmentType', 'LoadBalancerType', 'RegistrationTokenOperation', + 'PreferredAppGroupType', 'CommandLineSetting', 'Status', 'UpdateState', 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 index e2cabf5846aa..04052cd1efed 100644 --- 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 @@ -44,6 +44,13 @@ class RegistrationTokenOperation(str, Enum): update = "Update" +class PreferredAppGroupType(str, Enum): + + none = "None" + desktop = "Desktop" + rail_applications = "RailApplications" + + class CommandLineSetting(str, Enum): do_not_allow = "DoNotAllow" diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py index a8eff1dafcec..6add434de2a9 100644 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py @@ -569,6 +569,11 @@ class HostPool(TrackedResource): :vartype application_group_references: list[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 = { @@ -601,6 +606,7 @@ class HostPool(TrackedResource): '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): @@ -618,6 +624,7 @@ def __init__(self, **kwargs): 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): @@ -661,6 +668,11 @@ class HostPoolPatch(Resource): ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch :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 = { @@ -684,6 +696,7 @@ class HostPoolPatch(Resource): 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, 'sso_context': {'key': 'properties.ssoContext', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, } def __init__(self, **kwargs): @@ -699,6 +712,7 @@ def __init__(self, **kwargs): self.validation_environment = kwargs.get('validation_environment', None) self.registration_info = kwargs.get('registration_info', None) self.sso_context = kwargs.get('sso_context', None) + self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) class ProxyResource(Resource): @@ -891,6 +905,9 @@ class SessionHost(Resource): :type agent_version: str :param allow_new_session: Allow a new session. :type allow_new_session: bool + :param virtual_machine_id: Resource Id of SessionHost's underlying virtual + machine. + :type virtual_machine_id: str :param assigned_user: User assigned to SessionHost. :type assigned_user: str :param status: Status for a SessionHost. Possible values include: @@ -930,6 +947,7 @@ class SessionHost(Resource): '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'}, 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, @@ -946,6 +964,7 @@ def __init__(self, **kwargs): 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 = kwargs.get('virtual_machine_id', None) self.assigned_user = kwargs.get('assigned_user', None) self.status = kwargs.get('status', None) self.status_timestamp = 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 index 45688df772a6..18494421b14d 100644 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py @@ -569,6 +569,11 @@ class HostPool(TrackedResource): :vartype application_group_references: list[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 = { @@ -601,9 +606,10 @@ class HostPool(TrackedResource): '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, personal_desktop_assignment_type, load_balancer_type, tags=None, friendly_name: str=None, description: str=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: + def __init__(self, *, location: str, host_pool_type, personal_desktop_assignment_type, load_balancer_type, tags=None, friendly_name: str=None, description: str=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, preferred_app_group_type=None, **kwargs) -> None: super(HostPool, self).__init__(tags=tags, location=location, **kwargs) self.friendly_name = friendly_name self.description = description @@ -618,6 +624,7 @@ def __init__(self, *, location: str, host_pool_type, personal_desktop_assignment 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): @@ -661,6 +668,11 @@ class HostPoolPatch(Resource): ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch :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 = { @@ -684,9 +696,10 @@ class HostPoolPatch(Resource): 'validation_environment': {'key': 'properties.validationEnvironment', 'type': 'bool'}, 'registration_info': {'key': 'properties.registrationInfo', 'type': 'RegistrationInfoPatch'}, '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, sso_context: str=None, **kwargs) -> None: + 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, sso_context: str=None, preferred_app_group_type=None, **kwargs) -> None: super(HostPoolPatch, self).__init__(**kwargs) self.tags = tags self.friendly_name = friendly_name @@ -699,6 +712,7 @@ def __init__(self, *, tags=None, friendly_name: str=None, description: str=None, self.validation_environment = validation_environment self.registration_info = registration_info self.sso_context = sso_context + self.preferred_app_group_type = preferred_app_group_type class ProxyResource(Resource): @@ -891,6 +905,9 @@ class SessionHost(Resource): :type agent_version: str :param allow_new_session: Allow a new session. :type allow_new_session: bool + :param virtual_machine_id: Resource Id of SessionHost's underlying virtual + machine. + :type virtual_machine_id: str :param assigned_user: User assigned to SessionHost. :type assigned_user: str :param status: Status for a SessionHost. Possible values include: @@ -930,6 +947,7 @@ class SessionHost(Resource): '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'}, 'assigned_user': {'key': 'properties.assignedUser', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, 'status_timestamp': {'key': 'properties.statusTimestamp', 'type': 'iso-8601'}, @@ -940,12 +958,13 @@ class SessionHost(Resource): '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: + def __init__(self, *, last_heart_beat=None, sessions: int=None, agent_version: str=None, allow_new_session: bool=None, virtual_machine_id: str=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 = virtual_machine_id self.assigned_user = assigned_user self.status = status self.status_timestamp = None diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py index 9948029b30bf..0e5394eb938c 100644 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py @@ -11,7 +11,6 @@ from ._operations import Operations from ._workspaces_operations import WorkspacesOperations -from ._application_group_assignments_operations import ApplicationGroupAssignmentsOperations from ._application_groups_operations import ApplicationGroupsOperations from ._start_menu_items_operations import StartMenuItemsOperations from ._applications_operations import ApplicationsOperations @@ -19,12 +18,10 @@ from ._host_pools_operations import HostPoolsOperations from ._user_sessions_operations import UserSessionsOperations from ._session_hosts_operations import SessionHostsOperations -from ._active_applications_operations import ActiveApplicationsOperations __all__ = [ 'Operations', 'WorkspacesOperations', - 'ApplicationGroupAssignmentsOperations', 'ApplicationGroupsOperations', 'StartMenuItemsOperations', 'ApplicationsOperations', @@ -32,5 +29,4 @@ 'HostPoolsOperations', 'UserSessionsOperations', 'SessionHostsOperations', - 'ActiveApplicationsOperations', ] diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_applications_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_applications_operations.py deleted file mode 100644 index 9be077bf162c..000000000000 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_applications_operations.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class ActiveApplicationsOperations(object): - """ActiveApplicationsOperations 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_session_host( - self, resource_group_name, host_pool_name, session_host_name, filter=None, custom_headers=None, raw=False, **operation_config): - """List applications for the given 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 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 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_by_session_host.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 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.ApplicationPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_session_host.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/activeApplications'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_group_assignments_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_group_assignments_operations.py deleted file mode 100644 index 62f0766e8a85..000000000000 --- a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_group_assignments_operations.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class ApplicationGroupAssignmentsOperations(object): - """ApplicationGroupAssignmentsOperations 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 workspace_level_list( - self, resource_group_name, workspace_name, filter=None, custom_headers=None, raw=False, **operation_config): - """List application group that user can use. - - :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 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.workspace_level_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\._\(\)]+$'), - '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) - 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 - workspace_level_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/userApplicationGroupAssignments'}