From 046698dd0b589d252e68c49bd9d2bd388be063c7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 24 Feb 2021 02:10:34 +0000 Subject: [PATCH] CodeGen from PR 13068 in Azure/azure-rest-api-specs BYODesktop (#13068) * BYODesktop * try to add to all --- .../mgmt/desktopvirtualization/__init__.py | 19 + .../desktopvirtualization/_configuration.py | 48 + .../_desktop_virtualization_api_client.py | 104 + .../desktopvirtualization/models/__init__.py | 186 ++ ...desktop_virtualization_api_client_enums.py | 149 ++ .../desktopvirtualization/models/_models.py | 1971 +++++++++++++++++ .../models/_models_py3.py | 1971 +++++++++++++++++ .../models/_paged_models.py | 144 ++ .../operations/__init__.py | 38 + .../_application_groups_operations.py | 447 ++++ .../operations/_applications_operations.py | 388 ++++ .../operations/_desktops_operations.py | 243 ++ .../operations/_host_pools_operations.py | 505 +++++ .../operations/_msix_images_operations.py | 122 + .../operations/_msix_packages_operations.py | 393 ++++ .../operations/_operations.py | 94 + .../operations/_scaling_plans_operations.py | 509 +++++ .../operations/_session_hosts_operations.py | 327 +++ .../_start_menu_items_operations.py | 113 + .../operations/_user_sessions_operations.py | 476 ++++ .../operations/_workspaces_operations.py | 434 ++++ .../mgmt/desktopvirtualization/version.py | 13 + 22 files changed, 8694 insertions(+) create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_api_client.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_paged_models.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py create mode 100644 sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/version.py 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..4253ad5d81c4 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_api_client.py @@ -0,0 +1,104 @@ +# 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 ScalingPlansOperations +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 .operations import MSIXPackagesOperations +from .operations import MsixImagesOperations +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 scaling_plans: ScalingPlans operations + :vartype scaling_plans: azure.mgmt.desktopvirtualization.operations.ScalingPlansOperations + :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 + :ivar msix_packages: MSIXPackages operations + :vartype msix_packages: azure.mgmt.desktopvirtualization.operations.MSIXPackagesOperations + :ivar msix_images: MsixImages operations + :vartype msix_images: azure.mgmt.desktopvirtualization.operations.MsixImagesOperations + + :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 = '2021-02-01-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.scaling_plans = ScalingPlansOperations( + 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) + self.msix_packages = MSIXPackagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.msix_images = MsixImagesOperations( + 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..e26d5079bd6f --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py @@ -0,0 +1,186 @@ +# 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 CloudErrorProperties + from ._models_py3 import Desktop + from ._models_py3 import DesktopList + from ._models_py3 import DesktopPatch + from ._models_py3 import ExpandMsixImage + from ._models_py3 import HostPool + from ._models_py3 import HostPoolPatch + from ._models_py3 import MSIXImageURI + from ._models_py3 import MSIXPackage + from ._models_py3 import MsixPackageApplications + from ._models_py3 import MsixPackageDependencies + from ._models_py3 import MSIXPackagePatch + 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 ScalingHostPoolReference + from ._models_py3 import ScalingPlan + from ._models_py3 import ScalingPlanPatch + from ._models_py3 import ScalingSchedule + from ._models_py3 import SendMessage + from ._models_py3 import SessionHost + from ._models_py3 import SessionHostHealthCheckFailureDetails + from ._models_py3 import SessionHostHealthCheckReport + 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 CloudErrorProperties + from ._models import Desktop + from ._models import DesktopList + from ._models import DesktopPatch + from ._models import ExpandMsixImage + from ._models import HostPool + from ._models import HostPoolPatch + from ._models import MSIXImageURI + from ._models import MSIXPackage + from ._models import MsixPackageApplications + from ._models import MsixPackageDependencies + from ._models import MSIXPackagePatch + 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 ScalingHostPoolReference + from ._models import ScalingPlan + from ._models import ScalingPlanPatch + from ._models import ScalingSchedule + from ._models import SendMessage + from ._models import SessionHost + from ._models import SessionHostHealthCheckFailureDetails + from ._models import SessionHostHealthCheckReport + 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 ExpandMsixImagePaged +from ._paged_models import HostPoolPaged +from ._paged_models import MSIXPackagePaged +from ._paged_models import ScalingPlanPaged +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, + SSOSecretType, + PreferredAppGroupType, + RemoteApplicationType, + CommandLineSetting, + Status, + UpdateState, + HealthCheckName, + HealthCheckResult, + ApplicationType, + SessionState, + SessionHostLoadBalancingAlgorithm, + StopHostsWhen, +) + +__all__ = [ + 'Application', + 'ApplicationGroup', + 'ApplicationGroupPatch', + 'ApplicationPatch', + 'AzureEntityResource', + 'CloudErrorProperties', + 'Desktop', + 'DesktopList', + 'DesktopPatch', + 'ExpandMsixImage', + 'HostPool', + 'HostPoolPatch', + 'MSIXImageURI', + 'MSIXPackage', + 'MsixPackageApplications', + 'MsixPackageDependencies', + 'MSIXPackagePatch', + 'ProxyResource', + 'RegistrationInfo', + 'RegistrationInfoPatch', + 'Resource', + 'ResourceProviderOperation', + 'ResourceProviderOperationDisplay', + 'ResourceProviderOperationList', + 'ScalingHostPoolReference', + 'ScalingPlan', + 'ScalingPlanPatch', + 'ScalingSchedule', + 'SendMessage', + 'SessionHost', + 'SessionHostHealthCheckFailureDetails', + 'SessionHostHealthCheckReport', + 'SessionHostPatch', + 'StartMenuItem', + 'TrackedResource', + 'UserSession', + 'Workspace', + 'WorkspacePatch', + 'WorkspacePaged', + 'ScalingPlanPaged', + 'ApplicationGroupPaged', + 'StartMenuItemPaged', + 'ApplicationPaged', + 'HostPoolPaged', + 'UserSessionPaged', + 'SessionHostPaged', + 'MSIXPackagePaged', + 'ExpandMsixImagePaged', + 'ApplicationGroupType', + 'HostPoolType', + 'PersonalDesktopAssignmentType', + 'LoadBalancerType', + 'RegistrationTokenOperation', + 'SSOSecretType', + 'PreferredAppGroupType', + 'RemoteApplicationType', + 'CommandLineSetting', + 'Status', + 'UpdateState', + 'HealthCheckName', + 'HealthCheckResult', + 'ApplicationType', + 'SessionState', + 'SessionHostLoadBalancingAlgorithm', + 'StopHostsWhen', +] 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..33fae6b4da0c --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_api_client_enums.py @@ -0,0 +1,149 @@ +# 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" #: Users will be assigned a SessionHost either by administrators (PersonalDesktopAssignmentType = Direct) or upon connecting to the pool (PersonalDesktopAssignmentType = Automatic). They will always be redirected to their assigned SessionHost. + pooled = "Pooled" #: Users get a new (random) SessionHost every time it connects to the HostPool. + byo_desktop = "BYODesktop" #: Users assign their own machines, load balancing logic remains the same as Personal. PersonalDesktopAssignmentType must be Direct. + + +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 SSOSecretType(str, Enum): + + shared_key = "SharedKey" + certificate = "Certificate" + shared_key_in_key_vault = "SharedKeyInKeyVault" + certificate_in_key_vault = "CertificateInKeyVault" + + +class PreferredAppGroupType(str, Enum): + + none = "None" + desktop = "Desktop" + rail_applications = "RailApplications" + + +class RemoteApplicationType(str, Enum): + + in_built = "InBuilt" + msix_application = "MsixApplication" + + +class CommandLineSetting(str, Enum): + + do_not_allow = "DoNotAllow" + allow = "Allow" + require = "Require" + + +class Status(str, Enum): + + available = "Available" #: Session Host has passed all the health checks and is available to handle connections. + unavailable = "Unavailable" #: Session Host is either turned off or has failed critical health checks which is causing service not to be able to route connections to this session host. Note this replaces previous 'NoHeartBeat' status. + shutdown = "Shutdown" #: Session Host is shutdown - RD Agent reported session host to be stopped or deallocated. + disconnected = "Disconnected" #: The Session Host is unavailable because it is currently disconnected. + upgrading = "Upgrading" #: Session Host is unavailable because currently an upgrade of RDAgent/side-by-side stack is in progress. Note: this state will be removed once the upgrade completes and the host is able to accept connections. + upgrade_failed = "UpgradeFailed" #: Session Host is unavailable because the critical component upgrade (agent, side-by-side stack, etc.) failed. + no_heartbeat = "NoHeartbeat" #: The Session Host is not heart beating. + not_joined_to_domain = "NotJoinedToDomain" #: SessionHost is not joined to domain. + domain_trust_relationship_lost = "DomainTrustRelationshipLost" #: SessionHost's domain trust relationship lost + sx_sstack_listener_not_ready = "SxSStackListenerNotReady" #: SxS stack installed on the SessionHost is not ready to receive connections. + fs_logix_not_healthy = "FSLogixNotHealthy" #: FSlogix is in an unhealthy state on the session host. + needs_assistance = "NeedsAssistance" #: New status to inform admins that the health on their endpoint needs to be fixed. The connections might not fail, as these issues are not fatal. + + +class UpdateState(str, Enum): + + initial = "Initial" + pending = "Pending" + started = "Started" + succeeded = "Succeeded" + failed = "Failed" + + +class HealthCheckName(str, Enum): + + domain_joined_check = "DomainJoinedCheck" #: Verifies the SessionHost is joined to a domain. If this check fails is classified as fatal as no connection can succeed if the SessionHost is not joined to the domain. + domain_trust_check = "DomainTrustCheck" #: Verifies the SessionHost is not experiencing domain trust issues that will prevent authentication on SessionHost at connection time when session is created. If this check fails is classified as fatal as no connection can succeed if we cannot reach the domain for authentication on the SessionHost. + fs_logix_health_check = "FSLogixHealthCheck" #: Verifies the FSLogix service is up and running to make sure users' profiles are loaded in the session. If this check fails is classified as fatal as even if the connection can succeed, user experience is bad as the user profile cannot be loaded and user will get a temporary profile in the session. + sx_sstack_listener_check = "SxSStackListenerCheck" #: Verifies that the SxS stack is up and running so connections can succeed. If this check fails is classified as fatal as no connection can succeed if the SxS stack is not ready. + urls_accessible_check = "UrlsAccessibleCheck" #: Verifies that the required WVD service and Geneva URLs are reachable from the SessionHost. These URLs are: RdTokenUri, RdBrokerURI, RdDiagnosticsUri and storage blob URLs for agent monitoring (geneva). If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is unable to store warm path data (logs, operations ...). + monitoring_agent_check = "MonitoringAgentCheck" #: Verifies that the required Geneva agent is running. If this check fails, it is non fatal and the machine still can service connections, main issue may be that monitoring agent is missing or running (possibly) older version. + domain_reachable = "DomainReachable" #: Verifies the domain the SessionHost is joined to is still reachable. If this check fails is classified as fatal as no connection can succeed if the domain the SessionHost is joined is not reachable at the time of connection. + web_rtc_redirector_check = "WebRTCRedirectorCheck" #: Verifies whether the WebRTCRedirector component is healthy. The WebRTCRedirector component is used to optimize video and audio performance in Microsoft Teams. This checks whether the component is still running, and whether there is a higher version available. If this check fails, it is non fatal and the machine still can service connections, main issue may be the WebRTCRedirector component has to be restarted or updated. + supported_encryption_check = "SupportedEncryptionCheck" #: Verifies the value of SecurityLayer registration key. If the value is 0 (SecurityLayer.RDP) this check fails with Error code = NativeMethodErrorCode.E_FAIL and is fatal. If the value is 1 (SecurityLayer.Negotiate) this check fails with Error code = NativeMethodErrorCode.ERROR_SUCCESS and is non fatal. + meta_data_service_check = "MetaDataServiceCheck" #: Verifies the metadata service is accessible and return compute properties. + app_attach_health_check = "AppAttachHealthCheck" #: Verifies that the AppAttachService is healthy (there were no issues during package staging). The AppAttachService is used to enable the staging/registration (and eventual deregistration/destaging) of MSIX apps that have been set up by the tenant admin. This checks whether the component had any failures during package staging. Failures in staging will prevent some MSIX apps from working properly for the end user. If this check fails, it is non fatal and the machine still can service connections, main issue may be certain apps will not work for end-users. + + +class HealthCheckResult(str, Enum): + + unknown = "Unknown" #: Health check result is not currently known. + health_check_succeeded = "HealthCheckSucceeded" #: Health check passed. + health_check_failed = "HealthCheckFailed" #: Health check failed. + session_host_shutdown = "SessionHostShutdown" #: We received a Shutdown notification. + + +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" + + +class SessionHostLoadBalancingAlgorithm(str, Enum): + + breadth_first = "BreadthFirst" + depth_first = "DepthFirst" + + +class StopHostsWhen(str, Enum): + + zero_sessions = "ZeroSessions" + zero_active_sessions = "ZeroActiveSessions" 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..db1546495751 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models.py @@ -0,0 +1,1971 @@ +# 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. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "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. E.g. + "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 msix_package_family_name: Specifies the package family name for + MSIX applications + :type msix_package_family_name: str + :param msix_package_application_id: Specifies the package application Id + for MSIX applications + :type msix_package_application_id: str + :param application_type: Resource Type of Application. Possible values + include: 'InBuilt', 'MsixApplication' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.RemoteApplicationType + :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'}, + 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, + 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', '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.msix_package_family_name = kwargs.get('msix_package_family_name', None) + self.msix_package_application_id = kwargs.get('msix_package_application_id', None) + self.application_type = kwargs.get('application_type', 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): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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. E.g. + "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. E.g. + "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. E.g. + "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 + :param msix_package_family_name: Specifies the package family name for + MSIX applications + :type msix_package_family_name: str + :param msix_package_application_id: Specifies the package application Id + for MSIX applications + :type msix_package_application_id: str + :param application_type: Resource Type of Application. Possible values + include: 'InBuilt', 'MsixApplication' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.RemoteApplicationType + """ + + _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'}, + 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, + 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, + } + + 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) + self.msix_package_family_name = kwargs.get('msix_package_family_name', None) + self.msix_package_application_id = kwargs.get('msix_package_application_id', None) + self.application_type = kwargs.get('application_type', None) + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an 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. E.g. + "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): + """CloudError. + + :param error: + :type error: ~azure.mgmt.desktopvirtualization.models.CloudErrorProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorProperties'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', 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 CloudErrorProperties(Model): + """CloudErrorProperties. + + :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(CloudErrorProperties, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +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. E.g. + "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 ExpandMsixImage(Resource): + """Represents the definition of contents retrieved after expanding the MSIX + Image. . + + 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param package_alias: Alias of MSIX Package. + :type package_alias: str + :param image_path: VHD/CIM image path on Network Share. + :type image_path: str + :param package_name: Package Name from appxmanifest.xml. + :type package_name: str + :param package_family_name: Package Family Name from appxmanifest.xml. + Contains Package Name and Publisher name. + :type package_family_name: str + :param package_full_name: Package Full Name from appxmanifest.xml. + :type package_full_name: str + :param display_name: User friendly Name to be displayed in the portal. + :type display_name: str + :param package_relative_path: Relative Path to the package inside the + image. + :type package_relative_path: str + :param is_regular_registration: Specifies how to register Package in feed. + :type is_regular_registration: bool + :param is_active: Make this version of the package the active one across + the hostpool. + :type is_active: bool + :param package_dependencies: List of package dependencies. + :type package_dependencies: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies] + :param version: Package Version found in the appxmanifest.xml. + :type version: str + :param last_updated: Date Package was last updated, found in the + appxmanifest.xml. + :type last_updated: datetime + :param package_applications: List of package applications. + :type package_applications: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageApplications] + """ + + _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'}, + 'package_alias': {'key': 'properties.packageAlias', 'type': 'str'}, + 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, + 'package_name': {'key': 'properties.packageName', 'type': 'str'}, + 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, + 'package_full_name': {'key': 'properties.packageFullName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, + } + + def __init__(self, **kwargs): + super(ExpandMsixImage, self).__init__(**kwargs) + self.package_alias = kwargs.get('package_alias', None) + self.image_path = kwargs.get('image_path', None) + self.package_name = kwargs.get('package_name', None) + self.package_family_name = kwargs.get('package_family_name', None) + self.package_full_name = kwargs.get('package_full_name', None) + self.display_name = kwargs.get('display_name', None) + self.package_relative_path = kwargs.get('package_relative_path', None) + self.is_regular_registration = kwargs.get('is_regular_registration', None) + self.is_active = kwargs.get('is_active', None) + self.package_dependencies = kwargs.get('package_dependencies', None) + self.version = kwargs.get('version', None) + self.last_updated = kwargs.get('last_updated', None) + self.package_applications = kwargs.get('package_applications', 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. E.g. + "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', 'BYODesktop' + :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 ssoadfs_authority: URL to customer ADFS server for signing WVD SSO + certificates. + :type ssoadfs_authority: str + :param sso_client_id: ClientId for the registered Relying Party used to + issue WVD SSO certificates. + :type sso_client_id: str + :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing + the secret used for communication to ADFS. + :type sso_client_secret_key_vault_path: str + :param sso_secret_type: The type of single sign on Secret Type. Possible + values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + 'CertificateInKeyVault' + :type sso_secret_type: str or + ~azure.mgmt.desktopvirtualization.models.SSOSecretType + :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 + :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect + feature. + :type start_vm_on_connect: bool + """ + + _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'}, + 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, + 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, + 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, + 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, + } + + 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.ssoadfs_authority = kwargs.get('ssoadfs_authority', None) + self.sso_client_id = kwargs.get('sso_client_id', None) + self.sso_client_secret_key_vault_path = kwargs.get('sso_client_secret_key_vault_path', None) + self.sso_secret_type = kwargs.get('sso_secret_type', None) + self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) + self.start_vm_on_connect = kwargs.get('start_vm_on_connect', 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. E.g. + "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 ssoadfs_authority: URL to customer ADFS server for signing WVD SSO + certificates. + :type ssoadfs_authority: str + :param sso_client_id: ClientId for the registered Relying Party used to + issue WVD SSO certificates. + :type sso_client_id: str + :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing + the secret used for communication to ADFS. + :type sso_client_secret_key_vault_path: str + :param sso_secret_type: The type of single sign on Secret Type. Possible + values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + 'CertificateInKeyVault' + :type sso_secret_type: str or + ~azure.mgmt.desktopvirtualization.models.SSOSecretType + :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 + :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect + feature. + :type start_vm_on_connect: bool + """ + + _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'}, + 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, + 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, + 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, + 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, + } + + 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.ssoadfs_authority = kwargs.get('ssoadfs_authority', None) + self.sso_client_id = kwargs.get('sso_client_id', None) + self.sso_client_secret_key_vault_path = kwargs.get('sso_client_secret_key_vault_path', None) + self.sso_secret_type = kwargs.get('sso_secret_type', None) + self.preferred_app_group_type = kwargs.get('preferred_app_group_type', None) + self.start_vm_on_connect = kwargs.get('start_vm_on_connect', None) + + +class MSIXImageURI(Model): + """Represents URI referring to MSIX Image. + + :param uri: URI to Image + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MSIXImageURI, self).__init__(**kwargs) + self.uri = kwargs.get('uri', None) + + +class MSIXPackage(Resource): + """Schema for MSIX Package 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param image_path: VHD/CIM image path on Network Share. + :type image_path: str + :param package_name: Package Name from appxmanifest.xml. + :type package_name: str + :param package_family_name: Package Family Name from appxmanifest.xml. + Contains Package Name and Publisher name. + :type package_family_name: str + :param display_name: User friendly Name to be displayed in the portal. + :type display_name: str + :param package_relative_path: Relative Path to the package inside the + image. + :type package_relative_path: str + :param is_regular_registration: Specifies how to register Package in feed. + :type is_regular_registration: bool + :param is_active: Make this version of the package the active one across + the hostpool. + :type is_active: bool + :param package_dependencies: List of package dependencies. + :type package_dependencies: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies] + :param version: Package Version found in the appxmanifest.xml. + :type version: str + :param last_updated: Date Package was last updated, found in the + appxmanifest.xml. + :type last_updated: datetime + :param package_applications: List of package applications. + :type package_applications: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageApplications] + """ + + _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'}, + 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, + 'package_name': {'key': 'properties.packageName', 'type': 'str'}, + 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, + } + + def __init__(self, **kwargs): + super(MSIXPackage, self).__init__(**kwargs) + self.image_path = kwargs.get('image_path', None) + self.package_name = kwargs.get('package_name', None) + self.package_family_name = kwargs.get('package_family_name', None) + self.display_name = kwargs.get('display_name', None) + self.package_relative_path = kwargs.get('package_relative_path', None) + self.is_regular_registration = kwargs.get('is_regular_registration', None) + self.is_active = kwargs.get('is_active', None) + self.package_dependencies = kwargs.get('package_dependencies', None) + self.version = kwargs.get('version', None) + self.last_updated = kwargs.get('last_updated', None) + self.package_applications = kwargs.get('package_applications', None) + + +class MsixPackageApplications(Model): + """Schema for MSIX Package Application properties. + + :param app_id: Package Application Id, found in appxmanifest.xml. + :type app_id: str + :param description: Description of Package Application. + :type description: str + :param app_user_model_id: Used to activate Package Application. Consists + of Package Name and ApplicationID. Found in appxmanifest.xml. + :type app_user_model_id: str + :param friendly_name: User friendly name. + :type friendly_name: str + :param icon_image_name: User friendly name. + :type icon_image_name: str + :param raw_icon: the icon a 64 bit string as a byte array. + :type raw_icon: bytearray + :param raw_png: the icon a 64 bit string as a byte array. + :type raw_png: bytearray + """ + + _attribute_map = { + 'app_id': {'key': 'appId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'app_user_model_id': {'key': 'appUserModelID', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'icon_image_name': {'key': 'iconImageName', 'type': 'str'}, + 'raw_icon': {'key': 'rawIcon', 'type': 'bytearray'}, + 'raw_png': {'key': 'rawPng', 'type': 'bytearray'}, + } + + def __init__(self, **kwargs): + super(MsixPackageApplications, self).__init__(**kwargs) + self.app_id = kwargs.get('app_id', None) + self.description = kwargs.get('description', None) + self.app_user_model_id = kwargs.get('app_user_model_id', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.icon_image_name = kwargs.get('icon_image_name', None) + self.raw_icon = kwargs.get('raw_icon', None) + self.raw_png = kwargs.get('raw_png', None) + + +class MsixPackageDependencies(Model): + """Schema for MSIX Package Dependencies properties. + + :param dependency_name: Name of package dependency. + :type dependency_name: str + :param publisher: Name of dependency publisher. + :type publisher: str + :param min_version: Dependency version required. + :type min_version: str + """ + + _attribute_map = { + 'dependency_name': {'key': 'dependencyName', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'min_version': {'key': 'minVersion', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MsixPackageDependencies, self).__init__(**kwargs) + self.dependency_name = kwargs.get('dependency_name', None) + self.publisher = kwargs.get('publisher', None) + self.min_version = kwargs.get('min_version', None) + + +class MSIXPackagePatch(Resource): + """MSIX Package 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param is_active: Set a version of the package to be active across + hostpool. + :type is_active: bool + :param is_regular_registration: Set Registration mode. Regular or Delayed. + :type is_regular_registration: bool + :param display_name: Display name for MSIX Package. + :type display_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'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MSIXPackagePatch, self).__init__(**kwargs) + self.is_active = kwargs.get('is_active', None) + self.is_regular_registration = kwargs.get('is_regular_registration', None) + self.display_name = kwargs.get('display_name', None) + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + 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. E.g. + "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 ScalingHostPoolReference(Model): + """Scaling plan reference to hostpool. + + :param host_pool_arm_path: Arm path of referenced hostpool. + :type host_pool_arm_path: str + :param scaling_plan_enabled: Is the scaling plan enabled for this + hostpool. + :type scaling_plan_enabled: bool + """ + + _attribute_map = { + 'host_pool_arm_path': {'key': 'hostPoolArmPath', 'type': 'str'}, + 'scaling_plan_enabled': {'key': 'scalingPlanEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ScalingHostPoolReference, self).__init__(**kwargs) + self.host_pool_arm_path = kwargs.get('host_pool_arm_path', None) + self.scaling_plan_enabled = kwargs.get('scaling_plan_enabled', None) + + +class ScalingPlan(TrackedResource): + """ScalingPlan. + + Represents a scaling plan 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. E.g. + "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 scaling plan. + :type description: str + :param friendly_name: User friendly name of scaling plan. + :type friendly_name: str + :param time_zone: Timezone of the scaling plan. + :type time_zone: str + :param host_pool_type: HostPool type for desktop. Possible values include: + 'Personal', 'Pooled', 'BYODesktop' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param exclusion_tag: Exclusion tag for scaling plan. + :type exclusion_tag: str + :param schedules: List of ScalingSchedule definitions. + :type schedules: + list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule] + :param host_pool_references: List of ScalingHostPoolReference definitions. + :type host_pool_references: + list[~azure.mgmt.desktopvirtualization.models.ScalingHostPoolReference] + """ + + _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'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, + 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, + } + + def __init__(self, **kwargs): + super(ScalingPlan, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.time_zone = kwargs.get('time_zone', None) + self.host_pool_type = kwargs.get('host_pool_type', None) + self.exclusion_tag = kwargs.get('exclusion_tag', None) + self.schedules = kwargs.get('schedules', None) + self.host_pool_references = kwargs.get('host_pool_references', None) + + +class ScalingPlanPatch(Model): + """Scaling plan properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of scaling plan. + :type description: str + :param friendly_name: User friendly name of scaling plan. + :type friendly_name: str + :param time_zone: Timezone of the scaling plan. + :type time_zone: str + :param host_pool_type: HostPool type for desktop. Possible values include: + 'Personal', 'Pooled', 'BYODesktop' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param exclusion_tag: Exclusion tag for scaling plan. + :type exclusion_tag: str + :param schedules: List of ScalingSchedule definitions. + :type schedules: + list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule] + :param host_pool_references: List of ScalingHostPoolReference definitions. + :type host_pool_references: + list[~azure.mgmt.desktopvirtualization.models.ScalingHostPoolReference] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, + 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, + } + + def __init__(self, **kwargs): + super(ScalingPlanPatch, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.description = kwargs.get('description', None) + self.friendly_name = kwargs.get('friendly_name', None) + self.time_zone = kwargs.get('time_zone', None) + self.host_pool_type = kwargs.get('host_pool_type', None) + self.exclusion_tag = kwargs.get('exclusion_tag', None) + self.schedules = kwargs.get('schedules', None) + self.host_pool_references = kwargs.get('host_pool_references', None) + + +class ScalingSchedule(Model): + """Scaling plan schedule. + + :param name: Name of the scaling schedule. + :type name: str + :param days_of_week: Set of days of the week on which this schedule is + active. + :type days_of_week: list[str] + :param ramp_up_start_time: Starting time for ramp up period. + :type ramp_up_start_time: datetime + :param ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp + up period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type ramp_up_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up + period. + :type ramp_up_minimum_hosts_pct: int + :param ramp_up_capacity_threshold_pct: Capacity threshold for ramp up + period. + :type ramp_up_capacity_threshold_pct: int + :param peak_start_time: Starting time for peak period. + :type peak_start_time: datetime + :param peak_load_balancing_algorithm: Load balancing algorithm for peak + period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type peak_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_down_start_time: Starting time for ramp down period. + :type ramp_down_start_time: datetime + :param ramp_down_load_balancing_algorithm: Load balancing algorithm for + ramp down period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type ramp_down_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down + period. + :type ramp_down_minimum_hosts_pct: int + :param ramp_down_capacity_threshold_pct: Capacity threshold for ramp down + period. + :type ramp_down_capacity_threshold_pct: int + :param ramp_down_force_logoff_users: Should users be logged off forcefully + from hosts. + :type ramp_down_force_logoff_users: bool + :param ramp_down_stop_hosts_when: Specifies when to stop hosts during ramp + down period. Possible values include: 'ZeroSessions', 'ZeroActiveSessions' + :type ramp_down_stop_hosts_when: str or + ~azure.mgmt.desktopvirtualization.models.StopHostsWhen + :param ramp_down_wait_time_minutes: Number of minutes to wait to stop + hosts during ramp down period. + :type ramp_down_wait_time_minutes: int + :param ramp_down_notification_message: Notification message for users + during ramp down period. + :type ramp_down_notification_message: str + :param off_peak_start_time: Starting time for off-peak period. + :type off_peak_start_time: datetime + :param off_peak_load_balancing_algorithm: Load balancing algorithm for + off-peak period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type off_peak_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + """ + + _validation = { + 'ramp_up_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_up_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_down_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_down_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'days_of_week': {'key': 'daysOfWeek', 'type': '[str]'}, + 'ramp_up_start_time': {'key': 'rampUpStartTime', 'type': 'iso-8601'}, + 'ramp_up_load_balancing_algorithm': {'key': 'rampUpLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_up_minimum_hosts_pct': {'key': 'rampUpMinimumHostsPct', 'type': 'int'}, + 'ramp_up_capacity_threshold_pct': {'key': 'rampUpCapacityThresholdPct', 'type': 'int'}, + 'peak_start_time': {'key': 'peakStartTime', 'type': 'iso-8601'}, + 'peak_load_balancing_algorithm': {'key': 'peakLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_down_start_time': {'key': 'rampDownStartTime', 'type': 'iso-8601'}, + 'ramp_down_load_balancing_algorithm': {'key': 'rampDownLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_down_minimum_hosts_pct': {'key': 'rampDownMinimumHostsPct', 'type': 'int'}, + 'ramp_down_capacity_threshold_pct': {'key': 'rampDownCapacityThresholdPct', 'type': 'int'}, + 'ramp_down_force_logoff_users': {'key': 'rampDownForceLogoffUsers', 'type': 'bool'}, + 'ramp_down_stop_hosts_when': {'key': 'rampDownStopHostsWhen', 'type': 'str'}, + 'ramp_down_wait_time_minutes': {'key': 'rampDownWaitTimeMinutes', 'type': 'int'}, + 'ramp_down_notification_message': {'key': 'rampDownNotificationMessage', 'type': 'str'}, + 'off_peak_start_time': {'key': 'offPeakStartTime', 'type': 'iso-8601'}, + 'off_peak_load_balancing_algorithm': {'key': 'offPeakLoadBalancingAlgorithm', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ScalingSchedule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.days_of_week = kwargs.get('days_of_week', None) + self.ramp_up_start_time = kwargs.get('ramp_up_start_time', None) + self.ramp_up_load_balancing_algorithm = kwargs.get('ramp_up_load_balancing_algorithm', None) + self.ramp_up_minimum_hosts_pct = kwargs.get('ramp_up_minimum_hosts_pct', None) + self.ramp_up_capacity_threshold_pct = kwargs.get('ramp_up_capacity_threshold_pct', None) + self.peak_start_time = kwargs.get('peak_start_time', None) + self.peak_load_balancing_algorithm = kwargs.get('peak_load_balancing_algorithm', None) + self.ramp_down_start_time = kwargs.get('ramp_down_start_time', None) + self.ramp_down_load_balancing_algorithm = kwargs.get('ramp_down_load_balancing_algorithm', None) + self.ramp_down_minimum_hosts_pct = kwargs.get('ramp_down_minimum_hosts_pct', None) + self.ramp_down_capacity_threshold_pct = kwargs.get('ramp_down_capacity_threshold_pct', None) + self.ramp_down_force_logoff_users = kwargs.get('ramp_down_force_logoff_users', None) + self.ramp_down_stop_hosts_when = kwargs.get('ramp_down_stop_hosts_when', None) + self.ramp_down_wait_time_minutes = kwargs.get('ramp_down_wait_time_minutes', None) + self.ramp_down_notification_message = kwargs.get('ramp_down_notification_message', None) + self.off_peak_start_time = kwargs.get('off_peak_start_time', None) + self.off_peak_load_balancing_algorithm = kwargs.get('off_peak_load_balancing_algorithm', 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. E.g. + "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', 'NoHeartbeat', 'NotJoinedToDomain', + 'DomainTrustRelationshipLost', 'SxSStackListenerNotReady', + 'FSLogixNotHealthy', 'NeedsAssistance' + :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 + :ivar session_host_health_check_results: List of + SessionHostHealthCheckReports + :vartype session_host_health_check_results: + list[~azure.mgmt.desktopvirtualization.models.SessionHostHealthCheckReport] + """ + + _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}, + 'session_host_health_check_results': {'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'}, + 'session_host_health_check_results': {'key': 'properties.sessionHostHealthCheckResults', 'type': '[SessionHostHealthCheckReport]'}, + } + + 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) + self.session_host_health_check_results = None + + +class SessionHostHealthCheckFailureDetails(Model): + """Contains details on the failure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: Failure message: hints on what is wrong and how to recover. + :vartype message: str + :ivar error_code: Error code corresponding for the failure. + :vartype error_code: int + :ivar last_health_check_date_time: The timestamp of the last update. + :vartype last_health_check_date_time: datetime + """ + + _validation = { + 'message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'last_health_check_date_time': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'last_health_check_date_time': {'key': 'lastHealthCheckDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SessionHostHealthCheckFailureDetails, self).__init__(**kwargs) + self.message = None + self.error_code = None + self.last_health_check_date_time = None + + +class SessionHostHealthCheckReport(Model): + """The report for session host information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_check_name: Represents the name of the health check operation + performed. Possible values include: 'DomainJoinedCheck', + 'DomainTrustCheck', 'FSLogixHealthCheck', 'SxSStackListenerCheck', + 'UrlsAccessibleCheck', 'MonitoringAgentCheck', 'DomainReachable', + 'WebRTCRedirectorCheck', 'SupportedEncryptionCheck', + 'MetaDataServiceCheck', 'AppAttachHealthCheck' + :vartype health_check_name: str or + ~azure.mgmt.desktopvirtualization.models.HealthCheckName + :ivar health_check_result: Represents the Health state of the health check + we performed. Possible values include: 'Unknown', 'HealthCheckSucceeded', + 'HealthCheckFailed', 'SessionHostShutdown' + :vartype health_check_result: str or + ~azure.mgmt.desktopvirtualization.models.HealthCheckResult + :ivar additional_failure_details: Additional detailed information on the + failure. + :vartype additional_failure_details: + ~azure.mgmt.desktopvirtualization.models.SessionHostHealthCheckFailureDetails + """ + + _validation = { + 'health_check_name': {'readonly': True}, + 'health_check_result': {'readonly': True}, + 'additional_failure_details': {'readonly': True}, + } + + _attribute_map = { + 'health_check_name': {'key': 'healthCheckName', 'type': 'str'}, + 'health_check_result': {'key': 'healthCheckResult', 'type': 'str'}, + 'additional_failure_details': {'key': 'additionalFailureDetails', 'type': 'SessionHostHealthCheckFailureDetails'}, + } + + def __init__(self, **kwargs): + super(SessionHostHealthCheckReport, self).__init__(**kwargs) + self.health_check_name = None + self.health_check_result = None + self.additional_failure_details = 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. E.g. + "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. E.g. + "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. E.g. + "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. E.g. + "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..51a5be8d6fd7 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py @@ -0,0 +1,1971 @@ +# 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. + + Common fields that are returned in the response for all Azure Resource + Manager resources. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "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. E.g. + "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 msix_package_family_name: Specifies the package family name for + MSIX applications + :type msix_package_family_name: str + :param msix_package_application_id: Specifies the package application Id + for MSIX applications + :type msix_package_application_id: str + :param application_type: Resource Type of Application. Possible values + include: 'InBuilt', 'MsixApplication' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.RemoteApplicationType + :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'}, + 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, + 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', '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, msix_package_family_name: str=None, msix_package_application_id: str=None, application_type=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.msix_package_family_name = msix_package_family_name + self.msix_package_application_id = msix_package_application_id + self.application_type = application_type + 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): + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. + + 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. E.g. + "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. E.g. + "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. E.g. + "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 + :param msix_package_family_name: Specifies the package family name for + MSIX applications + :type msix_package_family_name: str + :param msix_package_application_id: Specifies the package application Id + for MSIX applications + :type msix_package_application_id: str + :param application_type: Resource Type of Application. Possible values + include: 'InBuilt', 'MsixApplication' + :type application_type: str or + ~azure.mgmt.desktopvirtualization.models.RemoteApplicationType + """ + + _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'}, + 'msix_package_family_name': {'key': 'properties.msixPackageFamilyName', 'type': 'str'}, + 'msix_package_application_id': {'key': 'properties.msixPackageApplicationId', 'type': 'str'}, + 'application_type': {'key': 'properties.applicationType', 'type': 'str'}, + } + + 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, msix_package_family_name: str=None, msix_package_application_id: str=None, application_type=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 + self.msix_package_family_name = msix_package_family_name + self.msix_package_application_id = msix_package_application_id + self.application_type = application_type + + +class AzureEntityResource(Resource): + """Entity Resource. + + The resource model definition for an 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. E.g. + "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): + """CloudError. + + :param error: + :type error: ~azure.mgmt.desktopvirtualization.models.CloudErrorProperties + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorProperties'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +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 CloudErrorProperties(Model): + """CloudErrorProperties. + + :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(CloudErrorProperties, self).__init__(**kwargs) + self.code = code + self.message = message + + +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. E.g. + "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 ExpandMsixImage(Resource): + """Represents the definition of contents retrieved after expanding the MSIX + Image. . + + 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param package_alias: Alias of MSIX Package. + :type package_alias: str + :param image_path: VHD/CIM image path on Network Share. + :type image_path: str + :param package_name: Package Name from appxmanifest.xml. + :type package_name: str + :param package_family_name: Package Family Name from appxmanifest.xml. + Contains Package Name and Publisher name. + :type package_family_name: str + :param package_full_name: Package Full Name from appxmanifest.xml. + :type package_full_name: str + :param display_name: User friendly Name to be displayed in the portal. + :type display_name: str + :param package_relative_path: Relative Path to the package inside the + image. + :type package_relative_path: str + :param is_regular_registration: Specifies how to register Package in feed. + :type is_regular_registration: bool + :param is_active: Make this version of the package the active one across + the hostpool. + :type is_active: bool + :param package_dependencies: List of package dependencies. + :type package_dependencies: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies] + :param version: Package Version found in the appxmanifest.xml. + :type version: str + :param last_updated: Date Package was last updated, found in the + appxmanifest.xml. + :type last_updated: datetime + :param package_applications: List of package applications. + :type package_applications: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageApplications] + """ + + _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'}, + 'package_alias': {'key': 'properties.packageAlias', 'type': 'str'}, + 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, + 'package_name': {'key': 'properties.packageName', 'type': 'str'}, + 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, + 'package_full_name': {'key': 'properties.packageFullName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, + } + + def __init__(self, *, package_alias: str=None, image_path: str=None, package_name: str=None, package_family_name: str=None, package_full_name: str=None, display_name: str=None, package_relative_path: str=None, is_regular_registration: bool=None, is_active: bool=None, package_dependencies=None, version: str=None, last_updated=None, package_applications=None, **kwargs) -> None: + super(ExpandMsixImage, self).__init__(**kwargs) + self.package_alias = package_alias + self.image_path = image_path + self.package_name = package_name + self.package_family_name = package_family_name + self.package_full_name = package_full_name + self.display_name = display_name + self.package_relative_path = package_relative_path + self.is_regular_registration = is_regular_registration + self.is_active = is_active + self.package_dependencies = package_dependencies + self.version = version + self.last_updated = last_updated + self.package_applications = package_applications + + +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. E.g. + "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', 'BYODesktop' + :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 ssoadfs_authority: URL to customer ADFS server for signing WVD SSO + certificates. + :type ssoadfs_authority: str + :param sso_client_id: ClientId for the registered Relying Party used to + issue WVD SSO certificates. + :type sso_client_id: str + :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing + the secret used for communication to ADFS. + :type sso_client_secret_key_vault_path: str + :param sso_secret_type: The type of single sign on Secret Type. Possible + values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + 'CertificateInKeyVault' + :type sso_secret_type: str or + ~azure.mgmt.desktopvirtualization.models.SSOSecretType + :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 + :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect + feature. + :type start_vm_on_connect: bool + """ + + _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'}, + 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, + 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, + 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, + 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, + } + + 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, ssoadfs_authority: str=None, sso_client_id: str=None, sso_client_secret_key_vault_path: str=None, sso_secret_type=None, start_vm_on_connect: bool=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.ssoadfs_authority = ssoadfs_authority + self.sso_client_id = sso_client_id + self.sso_client_secret_key_vault_path = sso_client_secret_key_vault_path + self.sso_secret_type = sso_secret_type + self.preferred_app_group_type = preferred_app_group_type + self.start_vm_on_connect = start_vm_on_connect + + +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. E.g. + "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 ssoadfs_authority: URL to customer ADFS server for signing WVD SSO + certificates. + :type ssoadfs_authority: str + :param sso_client_id: ClientId for the registered Relying Party used to + issue WVD SSO certificates. + :type sso_client_id: str + :param sso_client_secret_key_vault_path: Path to Azure KeyVault storing + the secret used for communication to ADFS. + :type sso_client_secret_key_vault_path: str + :param sso_secret_type: The type of single sign on Secret Type. Possible + values include: 'SharedKey', 'Certificate', 'SharedKeyInKeyVault', + 'CertificateInKeyVault' + :type sso_secret_type: str or + ~azure.mgmt.desktopvirtualization.models.SSOSecretType + :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 + :param start_vm_on_connect: The flag to turn on/off StartVMOnConnect + feature. + :type start_vm_on_connect: bool + """ + + _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'}, + 'ssoadfs_authority': {'key': 'properties.ssoadfsAuthority', 'type': 'str'}, + 'sso_client_id': {'key': 'properties.ssoClientId', 'type': 'str'}, + 'sso_client_secret_key_vault_path': {'key': 'properties.ssoClientSecretKeyVaultPath', 'type': 'str'}, + 'sso_secret_type': {'key': 'properties.ssoSecretType', 'type': 'str'}, + 'preferred_app_group_type': {'key': 'properties.preferredAppGroupType', 'type': 'str'}, + 'start_vm_on_connect': {'key': 'properties.startVMOnConnect', 'type': 'bool'}, + } + + 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, ssoadfs_authority: str=None, sso_client_id: str=None, sso_client_secret_key_vault_path: str=None, sso_secret_type=None, preferred_app_group_type=None, start_vm_on_connect: bool=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.ssoadfs_authority = ssoadfs_authority + self.sso_client_id = sso_client_id + self.sso_client_secret_key_vault_path = sso_client_secret_key_vault_path + self.sso_secret_type = sso_secret_type + self.preferred_app_group_type = preferred_app_group_type + self.start_vm_on_connect = start_vm_on_connect + + +class MSIXImageURI(Model): + """Represents URI referring to MSIX Image. + + :param uri: URI to Image + :type uri: str + """ + + _attribute_map = { + 'uri': {'key': 'uri', 'type': 'str'}, + } + + def __init__(self, *, uri: str=None, **kwargs) -> None: + super(MSIXImageURI, self).__init__(**kwargs) + self.uri = uri + + +class MSIXPackage(Resource): + """Schema for MSIX Package 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param image_path: VHD/CIM image path on Network Share. + :type image_path: str + :param package_name: Package Name from appxmanifest.xml. + :type package_name: str + :param package_family_name: Package Family Name from appxmanifest.xml. + Contains Package Name and Publisher name. + :type package_family_name: str + :param display_name: User friendly Name to be displayed in the portal. + :type display_name: str + :param package_relative_path: Relative Path to the package inside the + image. + :type package_relative_path: str + :param is_regular_registration: Specifies how to register Package in feed. + :type is_regular_registration: bool + :param is_active: Make this version of the package the active one across + the hostpool. + :type is_active: bool + :param package_dependencies: List of package dependencies. + :type package_dependencies: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies] + :param version: Package Version found in the appxmanifest.xml. + :type version: str + :param last_updated: Date Package was last updated, found in the + appxmanifest.xml. + :type last_updated: datetime + :param package_applications: List of package applications. + :type package_applications: + list[~azure.mgmt.desktopvirtualization.models.MsixPackageApplications] + """ + + _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'}, + 'image_path': {'key': 'properties.imagePath', 'type': 'str'}, + 'package_name': {'key': 'properties.packageName', 'type': 'str'}, + 'package_family_name': {'key': 'properties.packageFamilyName', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'package_relative_path': {'key': 'properties.packageRelativePath', 'type': 'str'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'package_dependencies': {'key': 'properties.packageDependencies', 'type': '[MsixPackageDependencies]'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'package_applications': {'key': 'properties.packageApplications', 'type': '[MsixPackageApplications]'}, + } + + def __init__(self, *, image_path: str=None, package_name: str=None, package_family_name: str=None, display_name: str=None, package_relative_path: str=None, is_regular_registration: bool=None, is_active: bool=None, package_dependencies=None, version: str=None, last_updated=None, package_applications=None, **kwargs) -> None: + super(MSIXPackage, self).__init__(**kwargs) + self.image_path = image_path + self.package_name = package_name + self.package_family_name = package_family_name + self.display_name = display_name + self.package_relative_path = package_relative_path + self.is_regular_registration = is_regular_registration + self.is_active = is_active + self.package_dependencies = package_dependencies + self.version = version + self.last_updated = last_updated + self.package_applications = package_applications + + +class MsixPackageApplications(Model): + """Schema for MSIX Package Application properties. + + :param app_id: Package Application Id, found in appxmanifest.xml. + :type app_id: str + :param description: Description of Package Application. + :type description: str + :param app_user_model_id: Used to activate Package Application. Consists + of Package Name and ApplicationID. Found in appxmanifest.xml. + :type app_user_model_id: str + :param friendly_name: User friendly name. + :type friendly_name: str + :param icon_image_name: User friendly name. + :type icon_image_name: str + :param raw_icon: the icon a 64 bit string as a byte array. + :type raw_icon: bytearray + :param raw_png: the icon a 64 bit string as a byte array. + :type raw_png: bytearray + """ + + _attribute_map = { + 'app_id': {'key': 'appId', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'app_user_model_id': {'key': 'appUserModelID', 'type': 'str'}, + 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, + 'icon_image_name': {'key': 'iconImageName', 'type': 'str'}, + 'raw_icon': {'key': 'rawIcon', 'type': 'bytearray'}, + 'raw_png': {'key': 'rawPng', 'type': 'bytearray'}, + } + + def __init__(self, *, app_id: str=None, description: str=None, app_user_model_id: str=None, friendly_name: str=None, icon_image_name: str=None, raw_icon: bytearray=None, raw_png: bytearray=None, **kwargs) -> None: + super(MsixPackageApplications, self).__init__(**kwargs) + self.app_id = app_id + self.description = description + self.app_user_model_id = app_user_model_id + self.friendly_name = friendly_name + self.icon_image_name = icon_image_name + self.raw_icon = raw_icon + self.raw_png = raw_png + + +class MsixPackageDependencies(Model): + """Schema for MSIX Package Dependencies properties. + + :param dependency_name: Name of package dependency. + :type dependency_name: str + :param publisher: Name of dependency publisher. + :type publisher: str + :param min_version: Dependency version required. + :type min_version: str + """ + + _attribute_map = { + 'dependency_name': {'key': 'dependencyName', 'type': 'str'}, + 'publisher': {'key': 'publisher', 'type': 'str'}, + 'min_version': {'key': 'minVersion', 'type': 'str'}, + } + + def __init__(self, *, dependency_name: str=None, publisher: str=None, min_version: str=None, **kwargs) -> None: + super(MsixPackageDependencies, self).__init__(**kwargs) + self.dependency_name = dependency_name + self.publisher = publisher + self.min_version = min_version + + +class MSIXPackagePatch(Resource): + """MSIX Package 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. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param is_active: Set a version of the package to be active across + hostpool. + :type is_active: bool + :param is_regular_registration: Set Registration mode. Regular or Delayed. + :type is_regular_registration: bool + :param display_name: Display name for MSIX Package. + :type display_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'}, + 'is_active': {'key': 'properties.isActive', 'type': 'bool'}, + 'is_regular_registration': {'key': 'properties.isRegularRegistration', 'type': 'bool'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, *, is_active: bool=None, is_regular_registration: bool=None, display_name: str=None, **kwargs) -> None: + super(MSIXPackagePatch, self).__init__(**kwargs) + self.is_active = is_active + self.is_regular_registration = is_regular_registration + self.display_name = display_name + + +class ProxyResource(Resource): + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. + + 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. E.g. + "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 ScalingHostPoolReference(Model): + """Scaling plan reference to hostpool. + + :param host_pool_arm_path: Arm path of referenced hostpool. + :type host_pool_arm_path: str + :param scaling_plan_enabled: Is the scaling plan enabled for this + hostpool. + :type scaling_plan_enabled: bool + """ + + _attribute_map = { + 'host_pool_arm_path': {'key': 'hostPoolArmPath', 'type': 'str'}, + 'scaling_plan_enabled': {'key': 'scalingPlanEnabled', 'type': 'bool'}, + } + + def __init__(self, *, host_pool_arm_path: str=None, scaling_plan_enabled: bool=None, **kwargs) -> None: + super(ScalingHostPoolReference, self).__init__(**kwargs) + self.host_pool_arm_path = host_pool_arm_path + self.scaling_plan_enabled = scaling_plan_enabled + + +class ScalingPlan(TrackedResource): + """ScalingPlan. + + Represents a scaling plan 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. E.g. + "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 scaling plan. + :type description: str + :param friendly_name: User friendly name of scaling plan. + :type friendly_name: str + :param time_zone: Timezone of the scaling plan. + :type time_zone: str + :param host_pool_type: HostPool type for desktop. Possible values include: + 'Personal', 'Pooled', 'BYODesktop' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param exclusion_tag: Exclusion tag for scaling plan. + :type exclusion_tag: str + :param schedules: List of ScalingSchedule definitions. + :type schedules: + list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule] + :param host_pool_references: List of ScalingHostPoolReference definitions. + :type host_pool_references: + list[~azure.mgmt.desktopvirtualization.models.ScalingHostPoolReference] + """ + + _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'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, + 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, + } + + def __init__(self, *, location: str, tags=None, description: str=None, friendly_name: str=None, time_zone: str=None, host_pool_type=None, exclusion_tag: str=None, schedules=None, host_pool_references=None, **kwargs) -> None: + super(ScalingPlan, self).__init__(tags=tags, location=location, **kwargs) + self.description = description + self.friendly_name = friendly_name + self.time_zone = time_zone + self.host_pool_type = host_pool_type + self.exclusion_tag = exclusion_tag + self.schedules = schedules + self.host_pool_references = host_pool_references + + +class ScalingPlanPatch(Model): + """Scaling plan properties that can be patched. + + :param tags: tags to be updated + :type tags: dict[str, str] + :param description: Description of scaling plan. + :type description: str + :param friendly_name: User friendly name of scaling plan. + :type friendly_name: str + :param time_zone: Timezone of the scaling plan. + :type time_zone: str + :param host_pool_type: HostPool type for desktop. Possible values include: + 'Personal', 'Pooled', 'BYODesktop' + :type host_pool_type: str or + ~azure.mgmt.desktopvirtualization.models.HostPoolType + :param exclusion_tag: Exclusion tag for scaling plan. + :type exclusion_tag: str + :param schedules: List of ScalingSchedule definitions. + :type schedules: + list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule] + :param host_pool_references: List of ScalingHostPoolReference definitions. + :type host_pool_references: + list[~azure.mgmt.desktopvirtualization.models.ScalingHostPoolReference] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'friendly_name': {'key': 'properties.friendlyName', 'type': 'str'}, + 'time_zone': {'key': 'properties.timeZone', 'type': 'str'}, + 'host_pool_type': {'key': 'properties.hostPoolType', 'type': 'str'}, + 'exclusion_tag': {'key': 'properties.exclusionTag', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[ScalingSchedule]'}, + 'host_pool_references': {'key': 'properties.hostPoolReferences', 'type': '[ScalingHostPoolReference]'}, + } + + def __init__(self, *, tags=None, description: str=None, friendly_name: str=None, time_zone: str=None, host_pool_type=None, exclusion_tag: str=None, schedules=None, host_pool_references=None, **kwargs) -> None: + super(ScalingPlanPatch, self).__init__(**kwargs) + self.tags = tags + self.description = description + self.friendly_name = friendly_name + self.time_zone = time_zone + self.host_pool_type = host_pool_type + self.exclusion_tag = exclusion_tag + self.schedules = schedules + self.host_pool_references = host_pool_references + + +class ScalingSchedule(Model): + """Scaling plan schedule. + + :param name: Name of the scaling schedule. + :type name: str + :param days_of_week: Set of days of the week on which this schedule is + active. + :type days_of_week: list[str] + :param ramp_up_start_time: Starting time for ramp up period. + :type ramp_up_start_time: datetime + :param ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp + up period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type ramp_up_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up + period. + :type ramp_up_minimum_hosts_pct: int + :param ramp_up_capacity_threshold_pct: Capacity threshold for ramp up + period. + :type ramp_up_capacity_threshold_pct: int + :param peak_start_time: Starting time for peak period. + :type peak_start_time: datetime + :param peak_load_balancing_algorithm: Load balancing algorithm for peak + period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type peak_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_down_start_time: Starting time for ramp down period. + :type ramp_down_start_time: datetime + :param ramp_down_load_balancing_algorithm: Load balancing algorithm for + ramp down period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type ramp_down_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + :param ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down + period. + :type ramp_down_minimum_hosts_pct: int + :param ramp_down_capacity_threshold_pct: Capacity threshold for ramp down + period. + :type ramp_down_capacity_threshold_pct: int + :param ramp_down_force_logoff_users: Should users be logged off forcefully + from hosts. + :type ramp_down_force_logoff_users: bool + :param ramp_down_stop_hosts_when: Specifies when to stop hosts during ramp + down period. Possible values include: 'ZeroSessions', 'ZeroActiveSessions' + :type ramp_down_stop_hosts_when: str or + ~azure.mgmt.desktopvirtualization.models.StopHostsWhen + :param ramp_down_wait_time_minutes: Number of minutes to wait to stop + hosts during ramp down period. + :type ramp_down_wait_time_minutes: int + :param ramp_down_notification_message: Notification message for users + during ramp down period. + :type ramp_down_notification_message: str + :param off_peak_start_time: Starting time for off-peak period. + :type off_peak_start_time: datetime + :param off_peak_load_balancing_algorithm: Load balancing algorithm for + off-peak period. Possible values include: 'BreadthFirst', 'DepthFirst' + :type off_peak_load_balancing_algorithm: str or + ~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm + """ + + _validation = { + 'ramp_up_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_up_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_down_minimum_hosts_pct': {'maximum': 100, 'minimum': 0}, + 'ramp_down_capacity_threshold_pct': {'maximum': 100, 'minimum': 0}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'days_of_week': {'key': 'daysOfWeek', 'type': '[str]'}, + 'ramp_up_start_time': {'key': 'rampUpStartTime', 'type': 'iso-8601'}, + 'ramp_up_load_balancing_algorithm': {'key': 'rampUpLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_up_minimum_hosts_pct': {'key': 'rampUpMinimumHostsPct', 'type': 'int'}, + 'ramp_up_capacity_threshold_pct': {'key': 'rampUpCapacityThresholdPct', 'type': 'int'}, + 'peak_start_time': {'key': 'peakStartTime', 'type': 'iso-8601'}, + 'peak_load_balancing_algorithm': {'key': 'peakLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_down_start_time': {'key': 'rampDownStartTime', 'type': 'iso-8601'}, + 'ramp_down_load_balancing_algorithm': {'key': 'rampDownLoadBalancingAlgorithm', 'type': 'str'}, + 'ramp_down_minimum_hosts_pct': {'key': 'rampDownMinimumHostsPct', 'type': 'int'}, + 'ramp_down_capacity_threshold_pct': {'key': 'rampDownCapacityThresholdPct', 'type': 'int'}, + 'ramp_down_force_logoff_users': {'key': 'rampDownForceLogoffUsers', 'type': 'bool'}, + 'ramp_down_stop_hosts_when': {'key': 'rampDownStopHostsWhen', 'type': 'str'}, + 'ramp_down_wait_time_minutes': {'key': 'rampDownWaitTimeMinutes', 'type': 'int'}, + 'ramp_down_notification_message': {'key': 'rampDownNotificationMessage', 'type': 'str'}, + 'off_peak_start_time': {'key': 'offPeakStartTime', 'type': 'iso-8601'}, + 'off_peak_load_balancing_algorithm': {'key': 'offPeakLoadBalancingAlgorithm', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, days_of_week=None, ramp_up_start_time=None, ramp_up_load_balancing_algorithm=None, ramp_up_minimum_hosts_pct: int=None, ramp_up_capacity_threshold_pct: int=None, peak_start_time=None, peak_load_balancing_algorithm=None, ramp_down_start_time=None, ramp_down_load_balancing_algorithm=None, ramp_down_minimum_hosts_pct: int=None, ramp_down_capacity_threshold_pct: int=None, ramp_down_force_logoff_users: bool=None, ramp_down_stop_hosts_when=None, ramp_down_wait_time_minutes: int=None, ramp_down_notification_message: str=None, off_peak_start_time=None, off_peak_load_balancing_algorithm=None, **kwargs) -> None: + super(ScalingSchedule, self).__init__(**kwargs) + self.name = name + self.days_of_week = days_of_week + self.ramp_up_start_time = ramp_up_start_time + self.ramp_up_load_balancing_algorithm = ramp_up_load_balancing_algorithm + self.ramp_up_minimum_hosts_pct = ramp_up_minimum_hosts_pct + self.ramp_up_capacity_threshold_pct = ramp_up_capacity_threshold_pct + self.peak_start_time = peak_start_time + self.peak_load_balancing_algorithm = peak_load_balancing_algorithm + self.ramp_down_start_time = ramp_down_start_time + self.ramp_down_load_balancing_algorithm = ramp_down_load_balancing_algorithm + self.ramp_down_minimum_hosts_pct = ramp_down_minimum_hosts_pct + self.ramp_down_capacity_threshold_pct = ramp_down_capacity_threshold_pct + self.ramp_down_force_logoff_users = ramp_down_force_logoff_users + self.ramp_down_stop_hosts_when = ramp_down_stop_hosts_when + self.ramp_down_wait_time_minutes = ramp_down_wait_time_minutes + self.ramp_down_notification_message = ramp_down_notification_message + self.off_peak_start_time = off_peak_start_time + self.off_peak_load_balancing_algorithm = off_peak_load_balancing_algorithm + + +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. E.g. + "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', 'NoHeartbeat', 'NotJoinedToDomain', + 'DomainTrustRelationshipLost', 'SxSStackListenerNotReady', + 'FSLogixNotHealthy', 'NeedsAssistance' + :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 + :ivar session_host_health_check_results: List of + SessionHostHealthCheckReports + :vartype session_host_health_check_results: + list[~azure.mgmt.desktopvirtualization.models.SessionHostHealthCheckReport] + """ + + _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}, + 'session_host_health_check_results': {'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'}, + 'session_host_health_check_results': {'key': 'properties.sessionHostHealthCheckResults', 'type': '[SessionHostHealthCheckReport]'}, + } + + 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 + self.session_host_health_check_results = None + + +class SessionHostHealthCheckFailureDetails(Model): + """Contains details on the failure. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar message: Failure message: hints on what is wrong and how to recover. + :vartype message: str + :ivar error_code: Error code corresponding for the failure. + :vartype error_code: int + :ivar last_health_check_date_time: The timestamp of the last update. + :vartype last_health_check_date_time: datetime + """ + + _validation = { + 'message': {'readonly': True}, + 'error_code': {'readonly': True}, + 'last_health_check_date_time': {'readonly': True}, + } + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'last_health_check_date_time': {'key': 'lastHealthCheckDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(SessionHostHealthCheckFailureDetails, self).__init__(**kwargs) + self.message = None + self.error_code = None + self.last_health_check_date_time = None + + +class SessionHostHealthCheckReport(Model): + """The report for session host information. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar health_check_name: Represents the name of the health check operation + performed. Possible values include: 'DomainJoinedCheck', + 'DomainTrustCheck', 'FSLogixHealthCheck', 'SxSStackListenerCheck', + 'UrlsAccessibleCheck', 'MonitoringAgentCheck', 'DomainReachable', + 'WebRTCRedirectorCheck', 'SupportedEncryptionCheck', + 'MetaDataServiceCheck', 'AppAttachHealthCheck' + :vartype health_check_name: str or + ~azure.mgmt.desktopvirtualization.models.HealthCheckName + :ivar health_check_result: Represents the Health state of the health check + we performed. Possible values include: 'Unknown', 'HealthCheckSucceeded', + 'HealthCheckFailed', 'SessionHostShutdown' + :vartype health_check_result: str or + ~azure.mgmt.desktopvirtualization.models.HealthCheckResult + :ivar additional_failure_details: Additional detailed information on the + failure. + :vartype additional_failure_details: + ~azure.mgmt.desktopvirtualization.models.SessionHostHealthCheckFailureDetails + """ + + _validation = { + 'health_check_name': {'readonly': True}, + 'health_check_result': {'readonly': True}, + 'additional_failure_details': {'readonly': True}, + } + + _attribute_map = { + 'health_check_name': {'key': 'healthCheckName', 'type': 'str'}, + 'health_check_result': {'key': 'healthCheckResult', 'type': 'str'}, + 'additional_failure_details': {'key': 'additionalFailureDetails', 'type': 'SessionHostHealthCheckFailureDetails'}, + } + + def __init__(self, **kwargs) -> None: + super(SessionHostHealthCheckReport, self).__init__(**kwargs) + self.health_check_name = None + self.health_check_result = None + self.additional_failure_details = 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. E.g. + "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. E.g. + "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. E.g. + "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. E.g. + "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..ad25c287a2a1 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_paged_models.py @@ -0,0 +1,144 @@ +# 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 ScalingPlanPaged(Paged): + """ + A paging container for iterating over a list of :class:`ScalingPlan ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ScalingPlan]'} + } + + def __init__(self, *args, **kwargs): + + super(ScalingPlanPaged, 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) +class MSIXPackagePaged(Paged): + """ + A paging container for iterating over a list of :class:`MSIXPackage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MSIXPackage]'} + } + + def __init__(self, *args, **kwargs): + + super(MSIXPackagePaged, self).__init__(*args, **kwargs) +class ExpandMsixImagePaged(Paged): + """ + A paging container for iterating over a list of :class:`ExpandMsixImage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExpandMsixImage]'} + } + + def __init__(self, *args, **kwargs): + + super(ExpandMsixImagePaged, 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..330fee8b62fc --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._workspaces_operations import WorkspacesOperations +from ._scaling_plans_operations import ScalingPlansOperations +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 +from ._msix_packages_operations import MSIXPackagesOperations +from ._msix_images_operations import MsixImagesOperations + +__all__ = [ + 'Operations', + 'WorkspacesOperations', + 'ScalingPlansOperations', + 'ApplicationGroupsOperations', + 'StartMenuItemsOperations', + 'ApplicationsOperations', + 'DesktopsOperations', + 'HostPoolsOperations', + 'UserSessionsOperations', + 'SessionHostsOperations', + 'MSIXPackagesOperations', + 'MsixImagesOperations', +] 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..3219b0c75edb --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..e16fd80a2b2c --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..6d9b081af01f --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..b835bb558aca --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py @@ -0,0 +1,505 @@ +# 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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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'} + + def retrieve_registration_token( + self, resource_group_name, host_pool_name, custom_headers=None, raw=False, **operation_config): + """Registration token of the 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: RegistrationInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.RegistrationInfo or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.retrieve_registration_token.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.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 + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RegistrationInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + retrieve_registration_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/retrieveRegistrationToken'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py new file mode 100644 index 000000000000..56d5dbc19663 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py @@ -0,0 +1,122 @@ +# 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 MsixImagesOperations(object): + """MsixImagesOperations 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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def expand( + self, resource_group_name, host_pool_name, uri=None, custom_headers=None, raw=False, **operation_config): + """Expands and Lists MSIX packages in an Image, given the Image Path. + + :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 uri: URI to Image + :type uri: 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 ExpandMsixImage + :rtype: + ~azure.mgmt.desktopvirtualization.models.ExpandMsixImagePaged[~azure.mgmt.desktopvirtualization.models.ExpandMsixImage] + :raises: :class:`CloudError` + """ + msix_image_uri = models.MSIXImageURI(uri=uri) + + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.expand.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' + 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(msix_image_uri, 'MSIXImageURI') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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.ExpandMsixImagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + expand.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/expandMsixImage'} diff --git a/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py new file mode 100644 index 000000000000..d8e0c2173368 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py @@ -0,0 +1,393 @@ +# 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 MSIXPackagesOperations(object): + """MSIXPackagesOperations 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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, host_pool_name, msix_package_full_name, custom_headers=None, raw=False, **operation_config): + """Get a msixpackage. + + :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 msix_package_full_name: The version specific package full name + of the MSIX package within specified hostpool + :type msix_package_full_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: MSIXPackage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage 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), + 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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('MSIXPackage', 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}/msixPackages/{msixPackageFullName}'} + + def create_or_update( + self, resource_group_name, host_pool_name, msix_package_full_name, msix_package, custom_headers=None, raw=False, **operation_config): + """Create or update a MSIX package. + + :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 msix_package_full_name: The version specific package full name + of the MSIX package within specified hostpool + :type msix_package_full_name: str + :param msix_package: Object containing MSIX Package definitions. + :type msix_package: + ~azure.mgmt.desktopvirtualization.models.MSIXPackage + :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: MSIXPackage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage 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), + 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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(msix_package, 'MSIXPackage') + + # 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('MSIXPackage', response) + if response.status_code == 201: + deserialized = self._deserialize('MSIXPackage', 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}/msixPackages/{msixPackageFullName}'} + + def delete( + self, resource_group_name, host_pool_name, msix_package_full_name, custom_headers=None, raw=False, **operation_config): + """Remove an MSIX Package. + + :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 msix_package_full_name: The version specific package full name + of the MSIX package within specified hostpool + :type msix_package_full_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\._\(\)]+$'), + 'hostPoolName': self._serialize.url("host_pool_name", host_pool_name, 'str', max_length=24, min_length=3), + 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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/hostPools/{hostPoolName}/msixPackages/{msixPackageFullName}'} + + def update( + self, resource_group_name, host_pool_name, msix_package_full_name, msix_package=None, custom_headers=None, raw=False, **operation_config): + """Update an MSIX Package. + + :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 msix_package_full_name: The version specific package full name + of the MSIX package within specified hostpool + :type msix_package_full_name: str + :param msix_package: Object containing MSIX Package definitions. + :type msix_package: + ~azure.mgmt.desktopvirtualization.models.MSIXPackagePatch + :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: MSIXPackage or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage 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), + 'msixPackageFullName': self._serialize.url("msix_package_full_name", msix_package_full_name, 'str', max_length=100, 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 msix_package is not None: + body_content = self._serialize.body(msix_package, 'MSIXPackagePatch') + 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('MSIXPackage', 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}/msixPackages/{msixPackageFullName}'} + + def list( + self, resource_group_name, host_pool_name, custom_headers=None, raw=False, **operation_config): + """List MSIX packages in hostpool. + + :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 MSIXPackage + :rtype: + ~azure.mgmt.desktopvirtualization.models.MSIXPackagePaged[~azure.mgmt.desktopvirtualization.models.MSIXPackage] + :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.MSIXPackagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/msixPackages'} 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..2dbdf198493e --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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/_scaling_plans_operations.py b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py new file mode 100644 index 000000000000..656997b4dfb6 --- /dev/null +++ b/sdk/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py @@ -0,0 +1,509 @@ +# 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 ScalingPlansOperations(object): + """ScalingPlansOperations 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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, scaling_plan_name, custom_headers=None, raw=False, **operation_config): + """Get a scaling plan. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scaling_plan_name: The name of the scaling plan. + :type scaling_plan_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: ScalingPlan or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan 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\._\(\)]+$'), + 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_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('ScalingPlan', 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/scalingPlans/{scalingPlanName}'} + + def create( + self, resource_group_name, scaling_plan_name, scaling_plan, custom_headers=None, raw=False, **operation_config): + """Create or update a scaling plan. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scaling_plan_name: The name of the scaling plan. + :type scaling_plan_name: str + :param scaling_plan: Object containing scaling plan definitions. + :type scaling_plan: + ~azure.mgmt.desktopvirtualization.models.ScalingPlan + :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: ScalingPlan or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create.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\._\(\)]+$'), + 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_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(scaling_plan, 'ScalingPlan') + + # 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('ScalingPlan', response) + if response.status_code == 201: + deserialized = self._deserialize('ScalingPlan', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}'} + + def delete( + self, resource_group_name, scaling_plan_name, custom_headers=None, raw=False, **operation_config): + """Remove a scaling plan. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scaling_plan_name: The name of the scaling plan. + :type scaling_plan_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\._\(\)]+$'), + 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_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/scalingPlans/{scalingPlanName}'} + + def update( + self, resource_group_name, scaling_plan_name, scaling_plan=None, custom_headers=None, raw=False, **operation_config): + """Update a scaling plan. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param scaling_plan_name: The name of the scaling plan. + :type scaling_plan_name: str + :param scaling_plan: Object containing scaling plan definitions. + :type scaling_plan: + ~azure.mgmt.desktopvirtualization.models.ScalingPlanPatch + :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: ScalingPlan or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan 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\._\(\)]+$'), + 'scalingPlanName': self._serialize.url("scaling_plan_name", scaling_plan_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 scaling_plan is not None: + body_content = self._serialize.body(scaling_plan, 'ScalingPlanPatch') + 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('ScalingPlan', 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/scalingPlans/{scalingPlanName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """List scaling plans. + + :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 ScalingPlan + :rtype: + ~azure.mgmt.desktopvirtualization.models.ScalingPlanPaged[~azure.mgmt.desktopvirtualization.models.ScalingPlan] + :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.ScalingPlanPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans'} + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """List scaling plans 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 ScalingPlan + :rtype: + ~azure.mgmt.desktopvirtualization.models.ScalingPlanPaged[~azure.mgmt.desktopvirtualization.models.ScalingPlan] + :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.ScalingPlanPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/scalingPlans'} + + def list_by_host_pool( + self, resource_group_name, host_pool_name, custom_headers=None, raw=False, **operation_config): + """List scaling plan associated with hostpool. + + :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 ScalingPlan + :rtype: + ~azure.mgmt.desktopvirtualization.models.ScalingPlanPaged[~azure.mgmt.desktopvirtualization.models.ScalingPlan] + :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) + + 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.ScalingPlanPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_host_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/scalingPlans'} 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..7bcdce164ec5 --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..47f166574cb6 --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..17198a7e1c05 --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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..323867a0f74b --- /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: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-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" +