diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/_meta.json b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/_meta.json
index e7cc76c50156..1c3339c4108a 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/_meta.json
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/_meta.json
@@ -1,11 +1,11 @@
{
- "commit": "f1e65f90e77a72258801439e757fc76ecb13a7fc",
+ "commit": "ebd40aee03b3006a30213900bd9e7eeac9b478f7",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
- "@autorest/python@6.19.0",
+ "@autorest/python@6.26.4",
"@autorest/modelerfour@4.27.0"
],
- "autorest_command": "autorest specification/desktopvirtualization/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --tag=package-2024-04 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
+ "autorest_command": "autorest specification/desktopvirtualization/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.26.4 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/desktopvirtualization/resource-manager/readme.md"
}
\ No newline at end of file
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py
index 8a587f87b999..23116ec32b46 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/__init__.py
@@ -5,15 +5,21 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._desktop_virtualization_mgmt_client import DesktopVirtualizationMgmtClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._desktop_virtualization_mgmt_client import DesktopVirtualizationMgmtClient # type: ignore
from ._version import VERSION
__version__ = VERSION
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -21,6 +27,6 @@
__all__ = [
"DesktopVirtualizationMgmtClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py
index 835e232059af..9e747efe2ef2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_configuration.py
@@ -14,7 +14,6 @@
from ._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
@@ -28,13 +27,13 @@ class DesktopVirtualizationMgmtClientConfiguration: # pylint: disable=too-many-
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-04-03". Note that overriding this
- default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2024-08-08-preview". Note that overriding
+ this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-04-03")
+ api_version: str = kwargs.pop("api_version", "2024-08-08-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_mgmt_client.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_mgmt_client.py
index 0205fa978041..d7767035fe00 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_mgmt_client.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_desktop_virtualization_mgmt_client.py
@@ -19,12 +19,15 @@
from ._configuration import DesktopVirtualizationMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
+ ActiveSessionHostConfigurationsOperations,
AppAttachPackageInfoOperations,
AppAttachPackageOperations,
ApplicationGroupsOperations,
ApplicationsOperations,
+ ControlSessionHostUpdateOperations,
DesktopsOperations,
HostPoolsOperations,
+ InitiateSessionHostUpdateOperations,
MSIXPackagesOperations,
MsixImagesOperations,
Operations,
@@ -33,6 +36,10 @@
ScalingPlanPersonalSchedulesOperations,
ScalingPlanPooledSchedulesOperations,
ScalingPlansOperations,
+ SessionHostConfigurationsOperations,
+ SessionHostManagementsOperations,
+ SessionHostManagementsUpdateStatusOperations,
+ SessionHostOperations,
SessionHostsOperations,
StartMenuItemsOperations,
UserSessionsOperations,
@@ -40,11 +47,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
-class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class DesktopVirtualizationMgmtClient: # pylint: disable=too-many-instance-attributes
"""DesktopVirtualizationMgmtClient.
:ivar operations: Operations operations
@@ -76,10 +82,31 @@ class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-ver
:vartype desktops: azure.mgmt.desktopvirtualization.operations.DesktopsOperations
:ivar host_pools: HostPoolsOperations operations
:vartype host_pools: azure.mgmt.desktopvirtualization.operations.HostPoolsOperations
+ :ivar session_host_managements: SessionHostManagementsOperations operations
+ :vartype session_host_managements:
+ azure.mgmt.desktopvirtualization.operations.SessionHostManagementsOperations
+ :ivar initiate_session_host_update: InitiateSessionHostUpdateOperations operations
+ :vartype initiate_session_host_update:
+ azure.mgmt.desktopvirtualization.operations.InitiateSessionHostUpdateOperations
+ :ivar control_session_host_update: ControlSessionHostUpdateOperations operations
+ :vartype control_session_host_update:
+ azure.mgmt.desktopvirtualization.operations.ControlSessionHostUpdateOperations
+ :ivar session_host_managements_update_status: SessionHostManagementsUpdateStatusOperations
+ operations
+ :vartype session_host_managements_update_status:
+ azure.mgmt.desktopvirtualization.operations.SessionHostManagementsUpdateStatusOperations
+ :ivar session_host_configurations: SessionHostConfigurationsOperations operations
+ :vartype session_host_configurations:
+ azure.mgmt.desktopvirtualization.operations.SessionHostConfigurationsOperations
+ :ivar active_session_host_configurations: ActiveSessionHostConfigurationsOperations operations
+ :vartype active_session_host_configurations:
+ azure.mgmt.desktopvirtualization.operations.ActiveSessionHostConfigurationsOperations
:ivar user_sessions: UserSessionsOperations operations
:vartype user_sessions: azure.mgmt.desktopvirtualization.operations.UserSessionsOperations
:ivar session_hosts: SessionHostsOperations operations
:vartype session_hosts: azure.mgmt.desktopvirtualization.operations.SessionHostsOperations
+ :ivar session_host: SessionHostOperations operations
+ :vartype session_host: azure.mgmt.desktopvirtualization.operations.SessionHostOperations
:ivar msix_packages: MSIXPackagesOperations operations
:vartype msix_packages: azure.mgmt.desktopvirtualization.operations.MSIXPackagesOperations
:ivar app_attach_package_info: AppAttachPackageInfoOperations operations
@@ -96,9 +123,11 @@ class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-ver
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-04-03". Note that overriding this
- default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2024-08-08-preview". Note that overriding
+ this default value may result in unsupported behavior.
:paramtype api_version: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
"""
def __init__(
@@ -157,8 +186,27 @@ def __init__(
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.session_host_managements = SessionHostManagementsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.initiate_session_host_update = InitiateSessionHostUpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.control_session_host_update = ControlSessionHostUpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.session_host_managements_update_status = SessionHostManagementsUpdateStatusOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.session_host_configurations = SessionHostConfigurationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.active_session_host_configurations = ActiveSessionHostConfigurationsOperations(
+ 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.session_host = SessionHostOperations(self._client, self._config, self._serialize, self._deserialize)
self.msix_packages = MSIXPackagesOperations(self._client, self._config, self._serialize, self._deserialize)
self.app_attach_package_info = AppAttachPackageInfoOperations(
self._client, self._config, self._serialize, self._deserialize
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_serialization.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_serialization.py
index 8139854b97bb..ce17d1798ce7 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_serialization.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_serialization.py
@@ -1,3 +1,4 @@
+# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -24,7 +25,6 @@
#
# --------------------------------------------------------------------------
-# pylint: skip-file
# pyright: reportUnnecessaryTypeIgnoreComment=false
from base64 import b64decode, b64encode
@@ -52,7 +52,6 @@
MutableMapping,
Type,
List,
- Mapping,
)
try:
@@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
:param data: Input, could be bytes or stream (will be decoded with UTF8) or text
:type data: str or bytes or IO
:param str content_type: The content type.
+ :return: The deserialized data.
+ :rtype: object
"""
if hasattr(data, "read"):
# Assume a stream
@@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type:
try:
return json.loads(data_as_str)
except ValueError as err:
- raise DeserializationError("JSON is invalid: {}".format(err), err)
+ raise DeserializationError("JSON is invalid: {}".format(err), err) from err
elif "xml" in (content_type or []):
try:
@@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
Use bytes and headers to NOT use any requests/aiohttp or whatever
specific implementation.
Headers will tested for "content-type"
+
+ :param bytes body_bytes: The body of the response.
+ :param dict headers: The headers of the response.
+ :returns: The deserialized data.
+ :rtype: object
"""
# Try to use content-type from headers if available
content_type = None
@@ -184,15 +190,30 @@ class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""
def utcoffset(self, dt):
- """UTF offset for UTC is 0."""
+ """UTF offset for UTC is 0.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The offset
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(0)
def tzname(self, dt):
- """Timestamp representation."""
+ """Timestamp representation.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The timestamp representation
+ :rtype: str
+ """
return "Z"
def dst(self, dt):
- """No daylight saving for UTC."""
+ """No daylight saving for UTC.
+
+ :param datetime.datetime dt: The datetime
+ :returns: The daylight saving time
+ :rtype: datetime.timedelta
+ """
return datetime.timedelta(hours=1)
@@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore
:param datetime.timedelta offset: offset in timedelta format
"""
- def __init__(self, offset):
+ def __init__(self, offset) -> None:
self.__offset = offset
def utcoffset(self, dt):
@@ -235,24 +256,26 @@ def __getinitargs__(self):
_FLATTEN = re.compile(r"(? None:
self.additional_properties: Optional[Dict[str, Any]] = {}
- for k in kwargs:
+ for k in kwargs: # pylint: disable=consider-using-dict-items
if k not in self._attribute_map:
_LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__)
elif k in self._validation and self._validation[k].get("readonly", False):
@@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None:
setattr(self, k, kwargs[k])
def __eq__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are equal
+ :rtype: bool
+ """
if isinstance(other, self.__class__):
return self.__dict__ == other.__dict__
return False
def __ne__(self, other: Any) -> bool:
- """Compare objects by comparing all attributes."""
+ """Compare objects by comparing all attributes.
+
+ :param object other: The object to compare
+ :returns: True if objects are not equal
+ :rtype: bool
+ """
return not self.__eq__(other)
def __str__(self) -> str:
@@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool:
@classmethod
def _create_xml_node(cls):
- """Create XML node."""
+ """Create XML node.
+
+ :returns: The XML node
+ :rtype: xml.etree.ElementTree.Element
+ """
try:
xml_map = cls._xml_map # type: ignore
except AttributeError:
@@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, keep_readonly=keep_readonly, **kwargs
+ )
def as_dict(
self,
@@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value):
If you want XML serialization, you can pass the kwargs is_xml=True.
+ :param bool keep_readonly: If you want to serialize the readonly attributes
:param function key_transformer: A key transformer function.
:returns: A dict JSON compatible object
:rtype: dict
"""
serializer = Serializer(self._infer_class_models())
- return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore
+ return serializer._serialize( # type: ignore # pylint: disable=protected-access
+ self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs
+ )
@classmethod
def _infer_class_models(cls):
@@ -395,7 +444,7 @@ def _infer_class_models(cls):
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
if cls.__name__ not in client_models:
raise ValueError("Not Autorest generated code")
- except Exception:
+ except Exception: # pylint: disable=broad-exception-caught
# Assume it's not Autorest generated (tests?). Add ourselves as dependencies.
client_models = {cls.__name__: cls}
return client_models
@@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
return deserializer(cls.__name__, data, content_type=content_type) # type: ignore
@@ -426,9 +476,11 @@ def from_dict(
and last_rest_key_case_insensitive_extractor)
:param dict data: A dict using RestAPI structure
+ :param function key_extractors: A key extractor function.
:param str content_type: JSON by default, set application/xml if XML.
:returns: An instance of this model
:raises: DeserializationError if something went wrong
+ :rtype: ModelType
"""
deserializer = Deserializer(cls._infer_class_models())
deserializer.key_extractors = ( # type: ignore
@@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects):
return {}
result = dict(cls._subtype_map[key])
for valuetype in cls._subtype_map[key].values():
- result.update(objects[valuetype]._flatten_subtype(key, objects))
+ result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access
return result
@classmethod
def _classify(cls, response, objects):
"""Check the class _subtype_map for any child classes.
We want to ignore any inherited _subtype_maps.
- Remove the polymorphic key from the initial data.
+
+ :param dict response: The initial data
+ :param dict objects: The class objects
+ :returns: The class to be used
+ :rtype: class
"""
for subtype_key in cls.__dict__.get("_subtype_map", {}).keys():
subtype_value = None
if not isinstance(response, ET.Element):
rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1]
- subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None)
+ subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None)
else:
subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response)
if subtype_value:
@@ -501,11 +557,13 @@ def _decode_attribute_map_key(key):
inside the received data.
:param str key: A key string from the generated code
+ :returns: The decoded key
+ :rtype: str
"""
return key.replace("\\.", ".")
-class Serializer(object):
+class Serializer(object): # pylint: disable=too-many-public-methods
"""Request object model serializer."""
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
@@ -540,7 +598,7 @@ class Serializer(object):
"multiple": lambda x, y: x % y != 0,
}
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.serialize_type = {
"iso-8601": Serializer.serialize_iso,
"rfc-1123": Serializer.serialize_rfc,
@@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None):
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True
- def _serialize(self, target_obj, data_type=None, **kwargs):
+ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals
+ self, target_obj, data_type=None, **kwargs
+ ):
"""Serialize data into a string according to type.
- :param target_obj: The data to be serialized.
+ :param object target_obj: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str, dict
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
"""
key_transformer = kwargs.get("key_transformer", self.key_transformer)
keep_readonly = kwargs.get("keep_readonly", False)
@@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
serialized = {}
if is_xml_model_serialization:
- serialized = target_obj._create_xml_node()
+ serialized = target_obj._create_xml_node() # pylint: disable=protected-access
try:
- attributes = target_obj._attribute_map
+ attributes = target_obj._attribute_map # pylint: disable=protected-access
for attr, attr_desc in attributes.items():
attr_name = attr
- if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False):
+ if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access
+ attr_name, {}
+ ).get("readonly", False):
continue
if attr_name == "additional_properties" and attr_desc["key"] == "":
@@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
if isinstance(new_attr, list):
serialized.extend(new_attr) # type: ignore
elif isinstance(new_attr, ET.Element):
- # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces.
+ # If the down XML has no XML/Name,
+ # we MUST replace the tag with the local tag. But keeping the namespaces.
if "name" not in getattr(orig_attr, "_xml_map", {}):
splitted_tag = new_attr.tag.split("}")
if len(splitted_tag) == 2: # Namespace
@@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs):
except (AttributeError, KeyError, TypeError) as err:
msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj))
raise SerializationError(msg) from err
- else:
- return serialized
+ return serialized
def body(self, data, data_type, **kwargs):
"""Serialize data intended for a request body.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: dict
:raises: SerializationError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized request body
"""
# Just in case this is a dict
@@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs):
attribute_key_case_insensitive_extractor,
last_rest_key_case_insensitive_extractor,
]
- data = deserializer._deserialize(data_type, data)
+ data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access
except DeserializationError as err:
raise SerializationError("Unable to build a model: " + str(err)) from err
@@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs):
def url(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL path.
- :param data: The data to be serialized.
+ :param str name: The name of the URL path parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
+ :returns: The serialized URL path
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
"""
@@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs):
output = output.replace("{", quote("{")).replace("}", quote("}"))
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return output
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return output
def query(self, name, data, data_type, **kwargs):
"""Serialize data intended for a URL query.
- :param data: The data to be serialized.
+ :param str name: The name of the query parameter.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :keyword bool skip_quote: Whether to skip quote the serialized result.
- Defaults to False.
:rtype: str, list
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized query parameter
"""
try:
# Treat the list aside, since we don't want to encode the div separator
@@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs):
output = str(output)
else:
output = quote(str(output), safe="")
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def header(self, name, data, data_type, **kwargs):
"""Serialize data intended for a request header.
- :param data: The data to be serialized.
+ :param str name: The name of the header.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
:rtype: str
:raises: TypeError if serialization fails.
:raises: ValueError if data is None
+ :returns: The serialized header
"""
try:
if data_type in ["[str]"]:
@@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs):
output = self.serialize_data(data, data_type, **kwargs)
if data_type == "bool":
output = json.dumps(output)
- except SerializationError:
- raise TypeError("{} must be type {}.".format(name, data_type))
- else:
- return str(output)
+ except SerializationError as exc:
+ raise TypeError("{} must be type {}.".format(name, data_type)) from exc
+ return str(output)
def serialize_data(self, data, data_type, **kwargs):
"""Serialize generic data according to supplied data type.
- :param data: The data to be serialized.
+ :param object data: The data to be serialized.
:param str data_type: The type to be serialized from.
- :param bool required: Whether it's essential that the data not be
- empty or None
:raises: AttributeError if required data is None.
:raises: ValueError if data is None
:raises: SerializationError if serialization fails.
+ :returns: The serialized data.
+ :rtype: str, int, float, bool, dict, list
"""
if data is None:
raise ValueError("No value for given attribute")
@@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs):
if data_type in self.basic_types.values():
return self.serialize_basic(data, data_type, **kwargs)
- elif data_type in self.serialize_type:
+ if data_type in self.serialize_type:
return self.serialize_type[data_type](data, **kwargs)
# If dependencies is empty, try with current data class
@@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs):
except (ValueError, TypeError) as err:
msg = "Unable to serialize value: {!r} as type: {!r}."
raise SerializationError(msg.format(data, data_type)) from err
- else:
- return self._serialize(data, **kwargs)
+ return self._serialize(data, **kwargs)
@classmethod
- def _get_custom_serializers(cls, data_type, **kwargs):
+ def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements
custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type)
if custom_serializer:
return custom_serializer
@@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs):
- basic_types_serializers dict[str, callable] : If set, use the callable as serializer
- is_xml bool : If set, use xml_basic_types_serializers
- :param data: Object to be serialized.
+ :param obj data: Object to be serialized.
:param str data_type: Type of object in the iterable.
+ :rtype: str, int, float, bool
+ :return: serialized object
"""
custom_serializer = cls._get_custom_serializers(data_type, **kwargs)
if custom_serializer:
return custom_serializer(data)
if data_type == "str":
return cls.serialize_unicode(data)
- return eval(data_type)(data) # nosec
+ return eval(data_type)(data) # nosec # pylint: disable=eval-used
@classmethod
def serialize_unicode(cls, data):
"""Special handling for serializing unicode strings in Py2.
Encode to UTF-8 if unicode, otherwise handle as a str.
- :param data: Object to be serialized.
+ :param str data: Object to be serialized.
:rtype: str
+ :return: serialized object
"""
try: # If I received an enum, return its value
return data.value
@@ -871,8 +938,7 @@ def serialize_unicode(cls, data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
def serialize_iter(self, data, iter_type, div=None, **kwargs):
"""Serialize iterable.
@@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs):
serialization_ctxt['type'] should be same as data_type.
- is_xml bool : If set, serialize as XML
- :param list attr: Object to be serialized.
+ :param list data: Object to be serialized.
:param str iter_type: Type of object in the iterable.
- :param bool required: Whether the objects in the iterable must
- not be None or empty.
:param str div: If set, this str will be used to combine the elements
in the iterable into a combined string. Default is 'None'.
- :keyword bool do_quote: Whether to quote the serialized result of each iterable element.
Defaults to False.
:rtype: list, str
+ :return: serialized iterable
"""
if isinstance(data, str):
raise SerializationError("Refuse str type as a valid iter type.")
@@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs):
:param dict attr: Object to be serialized.
:param str dict_type: Type of object in the dictionary.
- :param bool required: Whether the objects in the dictionary must
- not be None or empty.
:rtype: dict
+ :return: serialized dictionary
"""
serialization_ctxt = kwargs.get("serialization_ctxt", {})
serialized = {}
@@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs):
return serialized
- def serialize_object(self, attr, **kwargs):
+ def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
@@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs):
:param dict attr: Object to be serialized.
:rtype: dict or str
+ :return: serialized object
"""
if attr is None:
return None
@@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs):
return self.serialize_decimal(attr)
# If it's a model or I know this dependency, serialize as a Model
- elif obj_type in self.dependencies.values() or isinstance(attr, Model):
+ if obj_type in self.dependencies.values() or isinstance(attr, Model):
return self._serialize(attr)
if obj_type == dict:
@@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None):
try:
enum_obj(result) # type: ignore
return result
- except ValueError:
+ except ValueError as exc:
for enum_value in enum_obj: # type: ignore
if enum_value.value.lower() == str(attr).lower():
return enum_value.value
error = "{!r} is not valid value for enum {!r}"
- raise SerializationError(error.format(attr, enum_obj))
+ raise SerializationError(error.format(attr, enum_obj)) from exc
@staticmethod
- def serialize_bytearray(attr, **kwargs):
+ def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize bytearray into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
return b64encode(attr).decode()
@staticmethod
- def serialize_base64(attr, **kwargs):
+ def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize str into base-64 string.
- :param attr: Object to be serialized.
+ :param str attr: Object to be serialized.
:rtype: str
+ :return: serialized base64
"""
encoded = b64encode(attr).decode("ascii")
return encoded.strip("=").replace("+", "-").replace("/", "_")
@staticmethod
- def serialize_decimal(attr, **kwargs):
+ def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Decimal object to float.
- :param attr: Object to be serialized.
+ :param decimal attr: Object to be serialized.
:rtype: float
+ :return: serialized decimal
"""
return float(attr)
@staticmethod
- def serialize_long(attr, **kwargs):
+ def serialize_long(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize long (Py2) or int (Py3).
- :param attr: Object to be serialized.
+ :param int attr: Object to be serialized.
:rtype: int/long
+ :return: serialized long
"""
return _long_type(attr)
@staticmethod
- def serialize_date(attr, **kwargs):
+ def serialize_date(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Date object into ISO-8601 formatted string.
:param Date attr: Object to be serialized.
:rtype: str
+ :return: serialized date
"""
if isinstance(attr, str):
attr = isodate.parse_date(attr)
@@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs):
return t
@staticmethod
- def serialize_time(attr, **kwargs):
+ def serialize_time(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Time object into ISO-8601 formatted string.
:param datetime.time attr: Object to be serialized.
:rtype: str
+ :return: serialized time
"""
if isinstance(attr, str):
attr = isodate.parse_time(attr)
@@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs):
return t
@staticmethod
- def serialize_duration(attr, **kwargs):
+ def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize TimeDelta object into ISO-8601 formatted string.
:param TimeDelta attr: Object to be serialized.
:rtype: str
+ :return: serialized duration
"""
if isinstance(attr, str):
attr = isodate.parse_duration(attr)
return isodate.duration_isoformat(attr)
@staticmethod
- def serialize_rfc(attr, **kwargs):
+ def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into RFC-1123 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: TypeError if format invalid.
+ :return: serialized rfc
"""
try:
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
utc = attr.utctimetuple()
- except AttributeError:
- raise TypeError("RFC1123 object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("RFC1123 object must be valid Datetime object.") from exc
return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format(
Serializer.days[utc.tm_wday],
@@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs):
)
@staticmethod
- def serialize_iso(attr, **kwargs):
+ def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into ISO-8601 formatted string.
:param Datetime attr: Object to be serialized.
:rtype: str
:raises: SerializationError if format invalid.
+ :return: serialized iso
"""
if isinstance(attr, str):
attr = isodate.parse_datetime(attr)
@@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs):
raise TypeError(msg) from err
@staticmethod
- def serialize_unix(attr, **kwargs):
+ def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument
"""Serialize Datetime object into IntTime format.
This is represented as seconds.
:param Datetime attr: Object to be serialized.
:rtype: int
:raises: SerializationError if format invalid
+ :return: serialied unix
"""
if isinstance(attr, int):
return attr
@@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs):
if not attr.tzinfo:
_LOGGER.warning("Datetime with no tzinfo will be considered UTC.")
return int(calendar.timegm(attr.utctimetuple()))
- except AttributeError:
- raise TypeError("Unix time object must be valid Datetime object.")
+ except AttributeError as exc:
+ raise TypeError("Unix time object must be valid Datetime object.") from exc
-def rest_key_extractor(attr, attr_desc, data):
+def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
key = attr_desc["key"]
working_data = data
@@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data):
return working_data.get(key)
-def rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements
+ attr, attr_desc, data
+):
key = attr_desc["key"]
working_data = data
@@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data):
return attribute_key_case_insensitive_extractor(key, None, working_data)
-def last_rest_key_extractor(attr, attr_desc, data):
- """Extract the attribute in "data" based on the last part of the JSON path key."""
+def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
+ """Extract the attribute in "data" based on the last part of the JSON path key.
+
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
+ """
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
return attribute_key_extractor(dict_keys[-1], None, data)
-def last_rest_key_case_insensitive_extractor(attr, attr_desc, data):
+def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument
"""Extract the attribute in "data" based on the last part of the JSON path key.
This is the case insensitive version of "last_rest_key_extractor"
+ :param str attr: The attribute to extract
+ :param dict attr_desc: The attribute description
+ :param dict data: The data to extract from
+ :rtype: object
+ :returns: The extracted attribute
"""
key = attr_desc["key"]
dict_keys = _FLATTEN.split(key)
@@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type):
return xml_name
-def xml_key_extractor(attr, attr_desc, data):
+def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements
if isinstance(data, dict):
return None
@@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data):
if is_iter_type:
if is_wrapped:
return None # is_wrapped no node, we want None
- else:
- return [] # not wrapped, assume empty list
+ return [] # not wrapped, assume empty list
return None # Assume it's not there, maybe an optional node.
# If is_iter_type and not wrapped, return all found children
if is_iter_type:
if not is_wrapped:
return children
- else: # Iter and wrapped, should have found one node only (the wrap one)
- if len(children) != 1:
- raise DeserializationError(
- "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format(
- xml_name
- )
+ # Iter and wrapped, should have found one node only (the wrap one)
+ if len(children) != 1:
+ raise DeserializationError(
+ "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long
+ xml_name
)
- return list(children[0]) # Might be empty list and that's ok.
+ )
+ return list(children[0]) # Might be empty list and that's ok.
# Here it's not a itertype, we should have found one element only or empty
if len(children) > 1:
@@ -1363,9 +1450,9 @@ class Deserializer(object):
basic_types = {str: "str", int: "int", bool: "bool", float: "float"}
- valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
+ valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?")
- def __init__(self, classes: Optional[Mapping[str, type]] = None):
+ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
self.deserialize_type = {
"iso-8601": Deserializer.deserialize_iso,
"rfc-1123": Deserializer.deserialize_rfc,
@@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None):
:param str content_type: Swagger "produces" if available.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
data = self._unpack_content(response_data, content_type)
return self._deserialize(target_obj, data)
- def _deserialize(self, target_obj, data):
+ def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements
"""Call the deserializer on a model.
Data needs to be already deserialized as JSON or XML ElementTree
@@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data):
:param object data: Object to deserialize.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
# This is already a model, go recursive just in case
if hasattr(data, "_attribute_map"):
constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")]
try:
- for attr, mapconfig in data._attribute_map.items():
+ for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access
if attr in constants:
continue
value = getattr(data, attr)
@@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data):
if isinstance(response, str):
return self.deserialize_data(data, response)
- elif isinstance(response, type) and issubclass(response, Enum):
+ if isinstance(response, type) and issubclass(response, Enum):
return self.deserialize_enum(data, response)
if data is None or data is CoreNull:
return data
try:
- attributes = response._attribute_map # type: ignore
+ attributes = response._attribute_map # type: ignore # pylint: disable=protected-access
d_attrs = {}
for attr, attr_desc in attributes.items():
# Check empty string. If it's not empty, someone has a real "additionalProperties"...
@@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data):
except (AttributeError, TypeError, KeyError) as err:
msg = "Unable to deserialize to object: " + class_name # type: ignore
raise DeserializationError(msg) from err
- else:
- additional_properties = self._build_additional_properties(attributes, data)
- return self._instantiate_model(response, d_attrs, additional_properties)
+ additional_properties = self._build_additional_properties(attributes, data)
+ return self._instantiate_model(response, d_attrs, additional_properties)
def _build_additional_properties(self, attribute_map, data):
if not self.additional_properties_detection:
@@ -1505,6 +1593,8 @@ def _classify_target(self, target, data):
:param str target: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
+ :return: The classified target object and its class name.
+ :rtype: tuple
"""
if target is None:
return None, None
@@ -1516,7 +1606,7 @@ def _classify_target(self, target, data):
return target, target
try:
- target = target._classify(data, self.dependencies) # type: ignore
+ target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access
except AttributeError:
pass # Target is not a Model, no classify
return target, target.__class__.__name__ # type: ignore
@@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
:param str target_obj: The target object type to deserialize to.
:param str/dict data: The response data to deserialize.
:param str content_type: Swagger "produces" if available.
+ :return: Deserialized object.
+ :rtype: object
"""
try:
return self(target_obj, data, content_type=content_type)
- except:
+ except: # pylint: disable=bare-except
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
@@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None):
If raw_data is something else, bypass all logic and return it directly.
- :param raw_data: Data to be processed.
- :param content_type: How to parse if raw_data is a string/bytes.
+ :param obj raw_data: Data to be processed.
+ :param str content_type: How to parse if raw_data is a string/bytes.
:raises JSONDecodeError: If JSON is requested and parsing is impossible.
:raises UnicodeDecodeError: If bytes is not UTF8
+ :rtype: object
+ :return: Unpacked content.
"""
# Assume this is enough to detect a Pipeline Response without importing it
context = getattr(raw_data, "context", {})
@@ -1579,14 +1673,21 @@ def _unpack_content(raw_data, content_type=None):
def _instantiate_model(self, response, attrs, additional_properties=None):
"""Instantiate a response model passing in deserialized args.
- :param response: The response model class.
- :param d_attrs: The deserialized response attributes.
+ :param Response response: The response model class.
+ :param dict attrs: The deserialized response attributes.
+ :param dict additional_properties: Additional properties to be set.
+ :rtype: Response
+ :return: The instantiated response model.
"""
if callable(response):
subtype = getattr(response, "_subtype_map", {})
try:
- readonly = [k for k, v in response._validation.items() if v.get("readonly")]
- const = [k for k, v in response._validation.items() if v.get("constant")]
+ readonly = [
+ k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access
+ ]
+ const = [
+ k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access
+ ]
kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const}
response_obj = response(**kwargs)
for attr in readonly:
@@ -1596,7 +1697,7 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
return response_obj
except TypeError as err:
msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore
- raise DeserializationError(msg + str(err))
+ raise DeserializationError(msg + str(err)) from err
else:
try:
for attr, value in attrs.items():
@@ -1605,15 +1706,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None):
except Exception as exp:
msg = "Unable to populate response model. "
msg += "Type: {}, Error: {}".format(type(response), exp)
- raise DeserializationError(msg)
+ raise DeserializationError(msg) from exp
- def deserialize_data(self, data, data_type):
+ def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements
"""Process data for deserialization according to data type.
:param str data: The response string to be deserialized.
:param str data_type: The type to deserialize to.
:raises: DeserializationError if deserialization fails.
:return: Deserialized object.
+ :rtype: object
"""
if data is None:
return data
@@ -1627,7 +1729,11 @@ def deserialize_data(self, data, data_type):
if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())):
return data
- is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"]
+ is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment
+ "object",
+ "[]",
+ r"{}",
+ ]
if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text:
return None
data_val = self.deserialize_type[data_type](data)
@@ -1647,14 +1753,14 @@ def deserialize_data(self, data, data_type):
msg = "Unable to deserialize response data."
msg += " Data: {}, {}".format(data, data_type)
raise DeserializationError(msg) from err
- else:
- return self._deserialize(obj_type, data)
+ return self._deserialize(obj_type, data)
def deserialize_iter(self, attr, iter_type):
"""Deserialize an iterable.
:param list attr: Iterable to be deserialized.
:param str iter_type: The type of object in the iterable.
+ :return: Deserialized iterable.
:rtype: list
"""
if attr is None:
@@ -1671,6 +1777,7 @@ def deserialize_dict(self, attr, dict_type):
:param dict/list attr: Dictionary to be deserialized. Also accepts
a list of key, value pairs.
:param str dict_type: The object type of the items in the dictionary.
+ :return: Deserialized dictionary.
:rtype: dict
"""
if isinstance(attr, list):
@@ -1681,11 +1788,12 @@ def deserialize_dict(self, attr, dict_type):
attr = {el.tag: el.text for el in attr}
return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()}
- def deserialize_object(self, attr, **kwargs):
+ def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements
"""Deserialize a generic object.
This will be handled as a dictionary.
:param dict attr: Dictionary to be deserialized.
+ :return: Deserialized object.
:rtype: dict
:raises: TypeError if non-builtin datatype encountered.
"""
@@ -1720,11 +1828,10 @@ def deserialize_object(self, attr, **kwargs):
pass
return deserialized
- else:
- error = "Cannot deserialize generic object with type: "
- raise TypeError(error + str(obj_type))
+ error = "Cannot deserialize generic object with type: "
+ raise TypeError(error + str(obj_type))
- def deserialize_basic(self, attr, data_type):
+ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements
"""Deserialize basic builtin data type from string.
Will attempt to convert to str, int, float and bool.
This function will also accept '1', '0', 'true' and 'false' as
@@ -1732,6 +1839,7 @@ def deserialize_basic(self, attr, data_type):
:param str attr: response string to be deserialized.
:param str data_type: deserialization data type.
+ :return: Deserialized basic type.
:rtype: str, int, float or bool
:raises: TypeError if string format is not valid.
"""
@@ -1743,24 +1851,23 @@ def deserialize_basic(self, attr, data_type):
if data_type == "str":
# None or '', node is empty string.
return ""
- else:
- # None or '', node with a strong type is None.
- # Don't try to model "empty bool" or "empty int"
- return None
+ # None or '', node with a strong type is None.
+ # Don't try to model "empty bool" or "empty int"
+ return None
if data_type == "bool":
if attr in [True, False, 1, 0]:
return bool(attr)
- elif isinstance(attr, str):
+ if isinstance(attr, str):
if attr.lower() in ["true", "1"]:
return True
- elif attr.lower() in ["false", "0"]:
+ if attr.lower() in ["false", "0"]:
return False
raise TypeError("Invalid boolean value: {}".format(attr))
if data_type == "str":
return self.deserialize_unicode(attr)
- return eval(data_type)(attr) # nosec
+ return eval(data_type)(attr) # nosec # pylint: disable=eval-used
@staticmethod
def deserialize_unicode(data):
@@ -1768,6 +1875,7 @@ def deserialize_unicode(data):
as a string.
:param str data: response string to be deserialized.
+ :return: Deserialized string.
:rtype: str or unicode
"""
# We might be here because we have an enum modeled as string,
@@ -1781,8 +1889,7 @@ def deserialize_unicode(data):
return data
except NameError:
return str(data)
- else:
- return str(data)
+ return str(data)
@staticmethod
def deserialize_enum(data, enum_obj):
@@ -1794,6 +1901,7 @@ def deserialize_enum(data, enum_obj):
:param str data: Response string to be deserialized. If this value is
None or invalid it will be returned as-is.
:param Enum enum_obj: Enum object to deserialize to.
+ :return: Deserialized enum object.
:rtype: Enum
"""
if isinstance(data, enum_obj) or data is None:
@@ -1804,9 +1912,9 @@ def deserialize_enum(data, enum_obj):
# Workaround. We might consider remove it in the future.
try:
return list(enum_obj.__members__.values())[data]
- except IndexError:
+ except IndexError as exc:
error = "{!r} is not a valid index for enum {!r}"
- raise DeserializationError(error.format(data, enum_obj))
+ raise DeserializationError(error.format(data, enum_obj)) from exc
try:
return enum_obj(str(data))
except ValueError:
@@ -1822,6 +1930,7 @@ def deserialize_bytearray(attr):
"""Deserialize string into bytearray.
:param str attr: response string to be deserialized.
+ :return: Deserialized bytearray
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1834,6 +1943,7 @@ def deserialize_base64(attr):
"""Deserialize base64 encoded string into string.
:param str attr: response string to be deserialized.
+ :return: Deserialized base64 string
:rtype: bytearray
:raises: TypeError if string format invalid.
"""
@@ -1849,8 +1959,9 @@ def deserialize_decimal(attr):
"""Deserialize string into Decimal object.
:param str attr: response string to be deserialized.
- :rtype: Decimal
+ :return: Deserialized decimal
:raises: DeserializationError if string format invalid.
+ :rtype: decimal
"""
if isinstance(attr, ET.Element):
attr = attr.text
@@ -1865,6 +1976,7 @@ def deserialize_long(attr):
"""Deserialize string into long (Py2) or int (Py3).
:param str attr: response string to be deserialized.
+ :return: Deserialized int
:rtype: long or int
:raises: ValueError if string format invalid.
"""
@@ -1877,6 +1989,7 @@ def deserialize_duration(attr):
"""Deserialize ISO-8601 formatted string into TimeDelta object.
:param str attr: response string to be deserialized.
+ :return: Deserialized duration
:rtype: TimeDelta
:raises: DeserializationError if string format invalid.
"""
@@ -1887,14 +2000,14 @@ def deserialize_duration(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize duration object."
raise DeserializationError(msg) from err
- else:
- return duration
+ return duration
@staticmethod
def deserialize_date(attr):
"""Deserialize ISO-8601 formatted string into Date object.
:param str attr: response string to be deserialized.
+ :return: Deserialized date
:rtype: Date
:raises: DeserializationError if string format invalid.
"""
@@ -1910,6 +2023,7 @@ def deserialize_time(attr):
"""Deserialize ISO-8601 formatted string into time object.
:param str attr: response string to be deserialized.
+ :return: Deserialized time
:rtype: datetime.time
:raises: DeserializationError if string format invalid.
"""
@@ -1924,6 +2038,7 @@ def deserialize_rfc(attr):
"""Deserialize RFC-1123 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized RFC datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1939,14 +2054,14 @@ def deserialize_rfc(attr):
except ValueError as err:
msg = "Cannot deserialize to rfc datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_iso(attr):
"""Deserialize ISO-8601 formatted string into Datetime object.
:param str attr: response string to be deserialized.
+ :return: Deserialized ISO datetime
:rtype: Datetime
:raises: DeserializationError if string format invalid.
"""
@@ -1976,8 +2091,7 @@ def deserialize_iso(attr):
except (ValueError, OverflowError, AttributeError) as err:
msg = "Cannot deserialize datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
@staticmethod
def deserialize_unix(attr):
@@ -1985,6 +2099,7 @@ def deserialize_unix(attr):
This is represented as seconds.
:param int attr: Object to be serialized.
+ :return: Deserialized datetime
:rtype: Datetime
:raises: DeserializationError if format invalid
"""
@@ -1996,5 +2111,4 @@ def deserialize_unix(attr):
except ValueError as err:
msg = "Cannot deserialize to unix datetime object."
raise DeserializationError(msg) from err
- else:
- return date_obj
+ return date_obj
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_version.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_version.py
index 48944bf3938a..e5754a47ce68 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_version.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/_version.py
@@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
-VERSION = "2.0.0"
+VERSION = "1.0.0b1"
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/__init__.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/__init__.py
index 224638cef30a..0a80cf6d1a10 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/__init__.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/__init__.py
@@ -5,12 +5,18 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._desktop_virtualization_mgmt_client import DesktopVirtualizationMgmtClient
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._desktop_virtualization_mgmt_client import DesktopVirtualizationMgmtClient # type: ignore
try:
from ._patch import __all__ as _patch_all
- from ._patch import * # pylint: disable=unused-wildcard-import
+ from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
@@ -18,6 +24,6 @@
__all__ = [
"DesktopVirtualizationMgmtClient",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_configuration.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_configuration.py
index 50ef97143926..8e750faf23e5 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_configuration.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_configuration.py
@@ -14,7 +14,6 @@
from .._version import VERSION
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
@@ -28,13 +27,13 @@ class DesktopVirtualizationMgmtClientConfiguration: # pylint: disable=too-many-
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
- :keyword api_version: Api Version. Default value is "2024-04-03". Note that overriding this
- default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2024-08-08-preview". Note that overriding
+ this default value may result in unsupported behavior.
:paramtype api_version: str
"""
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
- api_version: str = kwargs.pop("api_version", "2024-04-03")
+ api_version: str = kwargs.pop("api_version", "2024-08-08-preview")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_desktop_virtualization_mgmt_client.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_desktop_virtualization_mgmt_client.py
index 459f270b399e..f86c78e03bd6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_desktop_virtualization_mgmt_client.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/_desktop_virtualization_mgmt_client.py
@@ -19,12 +19,15 @@
from .._serialization import Deserializer, Serializer
from ._configuration import DesktopVirtualizationMgmtClientConfiguration
from .operations import (
+ ActiveSessionHostConfigurationsOperations,
AppAttachPackageInfoOperations,
AppAttachPackageOperations,
ApplicationGroupsOperations,
ApplicationsOperations,
+ ControlSessionHostUpdateOperations,
DesktopsOperations,
HostPoolsOperations,
+ InitiateSessionHostUpdateOperations,
MSIXPackagesOperations,
MsixImagesOperations,
Operations,
@@ -33,6 +36,10 @@
ScalingPlanPersonalSchedulesOperations,
ScalingPlanPooledSchedulesOperations,
ScalingPlansOperations,
+ SessionHostConfigurationsOperations,
+ SessionHostManagementsOperations,
+ SessionHostManagementsUpdateStatusOperations,
+ SessionHostOperations,
SessionHostsOperations,
StartMenuItemsOperations,
UserSessionsOperations,
@@ -40,11 +47,10 @@
)
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
-class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
+class DesktopVirtualizationMgmtClient: # pylint: disable=too-many-instance-attributes
"""DesktopVirtualizationMgmtClient.
:ivar operations: Operations operations
@@ -77,10 +83,31 @@ class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-ver
:vartype desktops: azure.mgmt.desktopvirtualization.aio.operations.DesktopsOperations
:ivar host_pools: HostPoolsOperations operations
:vartype host_pools: azure.mgmt.desktopvirtualization.aio.operations.HostPoolsOperations
+ :ivar session_host_managements: SessionHostManagementsOperations operations
+ :vartype session_host_managements:
+ azure.mgmt.desktopvirtualization.aio.operations.SessionHostManagementsOperations
+ :ivar initiate_session_host_update: InitiateSessionHostUpdateOperations operations
+ :vartype initiate_session_host_update:
+ azure.mgmt.desktopvirtualization.aio.operations.InitiateSessionHostUpdateOperations
+ :ivar control_session_host_update: ControlSessionHostUpdateOperations operations
+ :vartype control_session_host_update:
+ azure.mgmt.desktopvirtualization.aio.operations.ControlSessionHostUpdateOperations
+ :ivar session_host_managements_update_status: SessionHostManagementsUpdateStatusOperations
+ operations
+ :vartype session_host_managements_update_status:
+ azure.mgmt.desktopvirtualization.aio.operations.SessionHostManagementsUpdateStatusOperations
+ :ivar session_host_configurations: SessionHostConfigurationsOperations operations
+ :vartype session_host_configurations:
+ azure.mgmt.desktopvirtualization.aio.operations.SessionHostConfigurationsOperations
+ :ivar active_session_host_configurations: ActiveSessionHostConfigurationsOperations operations
+ :vartype active_session_host_configurations:
+ azure.mgmt.desktopvirtualization.aio.operations.ActiveSessionHostConfigurationsOperations
:ivar user_sessions: UserSessionsOperations operations
:vartype user_sessions: azure.mgmt.desktopvirtualization.aio.operations.UserSessionsOperations
:ivar session_hosts: SessionHostsOperations operations
:vartype session_hosts: azure.mgmt.desktopvirtualization.aio.operations.SessionHostsOperations
+ :ivar session_host: SessionHostOperations operations
+ :vartype session_host: azure.mgmt.desktopvirtualization.aio.operations.SessionHostOperations
:ivar msix_packages: MSIXPackagesOperations operations
:vartype msix_packages: azure.mgmt.desktopvirtualization.aio.operations.MSIXPackagesOperations
:ivar app_attach_package_info: AppAttachPackageInfoOperations operations
@@ -97,9 +124,11 @@ class DesktopVirtualizationMgmtClient: # pylint: disable=client-accepts-api-ver
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
- :keyword api_version: Api Version. Default value is "2024-04-03". Note that overriding this
- default value may result in unsupported behavior.
+ :keyword api_version: Api Version. Default value is "2024-08-08-preview". Note that overriding
+ this default value may result in unsupported behavior.
:paramtype api_version: str
+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
+ Retry-After header is present.
"""
def __init__(
@@ -158,8 +187,27 @@ def __init__(
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.session_host_managements = SessionHostManagementsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.initiate_session_host_update = InitiateSessionHostUpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.control_session_host_update = ControlSessionHostUpdateOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.session_host_managements_update_status = SessionHostManagementsUpdateStatusOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.session_host_configurations = SessionHostConfigurationsOperations(
+ self._client, self._config, self._serialize, self._deserialize
+ )
+ self.active_session_host_configurations = ActiveSessionHostConfigurationsOperations(
+ 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.session_host = SessionHostOperations(self._client, self._config, self._serialize, self._deserialize)
self.msix_packages = MSIXPackagesOperations(self._client, self._config, self._serialize, self._deserialize)
self.app_attach_package_info = AppAttachPackageInfoOperations(
self._client, self._config, self._serialize, self._deserialize
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/__init__.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/__init__.py
index df927dd95440..37f2db6a6d53 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/__init__.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/__init__.py
@@ -5,28 +5,41 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._operations import Operations
-from ._workspaces_operations import WorkspacesOperations
-from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
-from ._private_link_resources_operations import PrivateLinkResourcesOperations
-from ._scaling_plans_operations import ScalingPlansOperations
-from ._scaling_plan_pooled_schedules_operations import ScalingPlanPooledSchedulesOperations
-from ._scaling_plan_personal_schedules_operations import ScalingPlanPersonalSchedulesOperations
-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 ._app_attach_package_info_operations import AppAttachPackageInfoOperations
-from ._msix_images_operations import MsixImagesOperations
-from ._app_attach_package_operations import AppAttachPackageOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._workspaces_operations import WorkspacesOperations # type: ignore
+from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore
+from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore
+from ._scaling_plans_operations import ScalingPlansOperations # type: ignore
+from ._scaling_plan_pooled_schedules_operations import ScalingPlanPooledSchedulesOperations # type: ignore
+from ._scaling_plan_personal_schedules_operations import ScalingPlanPersonalSchedulesOperations # type: ignore
+from ._application_groups_operations import ApplicationGroupsOperations # type: ignore
+from ._start_menu_items_operations import StartMenuItemsOperations # type: ignore
+from ._applications_operations import ApplicationsOperations # type: ignore
+from ._desktops_operations import DesktopsOperations # type: ignore
+from ._host_pools_operations import HostPoolsOperations # type: ignore
+from ._session_host_managements_operations import SessionHostManagementsOperations # type: ignore
+from ._initiate_session_host_update_operations import InitiateSessionHostUpdateOperations # type: ignore
+from ._control_session_host_update_operations import ControlSessionHostUpdateOperations # type: ignore
+from ._session_host_managements_update_status_operations import SessionHostManagementsUpdateStatusOperations # type: ignore
+from ._session_host_configurations_operations import SessionHostConfigurationsOperations # type: ignore
+from ._active_session_host_configurations_operations import ActiveSessionHostConfigurationsOperations # type: ignore
+from ._user_sessions_operations import UserSessionsOperations # type: ignore
+from ._session_hosts_operations import SessionHostsOperations # type: ignore
+from ._session_host_operations import SessionHostOperations # type: ignore
+from ._msix_packages_operations import MSIXPackagesOperations # type: ignore
+from ._app_attach_package_info_operations import AppAttachPackageInfoOperations # type: ignore
+from ._msix_images_operations import MsixImagesOperations # type: ignore
+from ._app_attach_package_operations import AppAttachPackageOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -42,12 +55,19 @@
"ApplicationsOperations",
"DesktopsOperations",
"HostPoolsOperations",
+ "SessionHostManagementsOperations",
+ "InitiateSessionHostUpdateOperations",
+ "ControlSessionHostUpdateOperations",
+ "SessionHostManagementsUpdateStatusOperations",
+ "SessionHostConfigurationsOperations",
+ "ActiveSessionHostConfigurationsOperations",
"UserSessionsOperations",
"SessionHostsOperations",
+ "SessionHostOperations",
"MSIXPackagesOperations",
"AppAttachPackageInfoOperations",
"MsixImagesOperations",
"AppAttachPackageOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_active_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_active_session_host_configurations_operations.py
new file mode 100644
index 000000000000..a912a00eb59a
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_active_session_host_configurations_operations.py
@@ -0,0 +1,203 @@
+# 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 sys
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._active_session_host_configurations_operations import (
+ build_get_request,
+ build_list_by_host_pool_request,
+)
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ActiveSessionHostConfigurationsOperations: # pylint: disable=name-too-long
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`active_session_host_configurations` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> _models.ActiveSessionHostConfiguration:
+ """Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update
+ operations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: ActiveSessionHostConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ActiveSessionHostConfiguration] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ActiveSessionHostConfiguration", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> AsyncIterable["_models.ActiveSessionHostConfiguration"]:
+ # pylint: disable=line-too-long
+ """List activeSessionHostConfigurations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either ActiveSessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ActiveSessionHostConfigurationList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("ActiveSessionHostConfigurationList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_info_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_info_operations.py
index 508d45e2de01..822f56747e39 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_info_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_info_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -146,7 +145,7 @@ def import_method(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_operations.py
index e15d1700b12f..54a2b1fc974a 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_app_attach_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -73,13 +72,13 @@ async def get(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:return: AppAttachPackage or the result of cls(response)
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -137,7 +136,7 @@ async def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Required.
:type app_attach_package: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
@@ -164,7 +163,7 @@ async def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Required.
:type app_attach_package: IO[bytes]
@@ -189,7 +188,7 @@ async def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Is either a
AppAttachPackage type or a IO[bytes] type. Required.
@@ -199,7 +198,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -255,21 +254,23 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, app_attach_package_name: str, **kwargs: Any
+ async def delete(
+ self, resource_group_name: str, app_attach_package_name: str, force: Optional[bool] = None, **kwargs: Any
) -> None:
"""Remove an App Attach Package.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
+ :param force: Force flag to delete App Attach package. Default value is None.
+ :type force: bool
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -287,6 +288,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
resource_group_name=resource_group_name,
app_attach_package_name=app_attach_package_name,
subscription_id=self._config.subscription_id,
+ force=force,
api_version=api_version,
headers=_headers,
params=_params,
@@ -323,7 +325,7 @@ async def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Default value
is None.
@@ -351,7 +353,7 @@ async def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Default value
is None.
@@ -377,7 +379,7 @@ async def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Is either a
AppAttachPackagePatch type or a IO[bytes] type. Default value is None.
@@ -387,7 +389,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -454,8 +456,8 @@ def list_by_resource_group(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param filter: OData filter expression. Valid properties for filtering are package name and
- host pool. Default value is None.
+ :param filter: OData filter expression. Valid properties for filtering are package name, host
+ pool, package owner name, and custom data. Default value is None.
:type filter: str
:return: An iterator like instance of either AppAttachPackage or the result of cls(response)
:rtype:
@@ -468,7 +470,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -537,8 +539,8 @@ def list_by_subscription(
) -> AsyncIterable["_models.AppAttachPackage"]:
"""List App Attach packages in subscription.
- :param filter: OData filter expression. Valid properties for filtering are package name, host
- pool, and resource group. Default value is None.
+ :param filter: OData filter expression. Valid properties for filtering are package name,
+ resource group, host pool, package owner name, and custom data. Default value is None.
:type filter: str
:return: An iterator like instance of either AppAttachPackage or the result of cls(response)
:rtype:
@@ -551,7 +553,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_application_groups_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_application_groups_operations.py
index 85b9c639ab72..1585cfaffc3c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_application_groups_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_application_groups_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -79,7 +78,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -197,7 +196,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,9 +251,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, application_group_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, application_group_name: str, **kwargs: Any) -> None:
"""Remove an applicationGroup.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -266,7 +263,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -383,7 +380,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -475,7 +472,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationGroupList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -560,7 +557,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationGroupList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_applications_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_applications_operations.py
index d21375e40c45..d4198266e4a1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_applications_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_applications_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -81,7 +80,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -212,7 +211,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -268,7 +267,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, application_group_name: str, application_name: str, **kwargs: Any
) -> None:
"""Remove an application.
@@ -285,7 +284,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -412,7 +411,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -504,7 +503,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_control_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_control_session_host_update_operations.py
new file mode 100644
index 000000000000..ef178abdb66d
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_control_session_host_update_operations.py
@@ -0,0 +1,254 @@
+# 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 io import IOBase
+import sys
+from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ...operations._control_session_host_update_operations import build_post_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class ControlSessionHostUpdateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`control_session_host_update` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ async def _post_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: Union[_models.HostPoolUpdateControlParameter, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(host_pool_update_control_parameter, (IOBase, bytes)):
+ _content = host_pool_update_control_parameter
+ else:
+ _json = self._serialize.body(host_pool_update_control_parameter, "HostPoolUpdateControlParameter")
+
+ _request = build_post_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: _models.HostPoolUpdateControlParameter,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Required.
+ :type host_pool_update_control_parameter:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateControlParameter
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Required.
+ :type host_pool_update_control_parameter: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: Union[_models.HostPoolUpdateControlParameter, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Is either a HostPoolUpdateControlParameter type or a IO[bytes] type. Required.
+ :type host_pool_update_control_parameter:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateControlParameter or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.AsyncLROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._post_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ host_pool_update_control_parameter=host_pool_update_control_parameter,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_desktops_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_desktops_operations.py
index fb1790ae3681..a4ccccf63747 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_desktops_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_desktops_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -33,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -74,7 +73,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.Desktop
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -202,7 +201,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Desktop
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -294,7 +293,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DesktopList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_host_pools_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_host_pools_operations.py
index 6c02ad1f5973..ad1a7d1800ea 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_host_pools_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_host_pools_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -79,7 +78,7 @@ async def get(self, resource_group_name: str, host_pool_name: str, **kwargs: Any
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -197,7 +196,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -252,7 +251,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, host_pool_name: str, force: Optional[bool] = None, **kwargs: Any
) -> None:
"""Remove a host pool.
@@ -268,7 +267,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -383,7 +382,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -471,7 +470,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.HostPoolList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -562,7 +561,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.HostPoolList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -640,7 +639,7 @@ async def retrieve_registration_token(
:rtype: ~azure.mgmt.desktopvirtualization.models.RegistrationInfo
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -697,7 +696,7 @@ async def list_registration_tokens(
:rtype: ~azure.mgmt.desktopvirtualization.models.RegistrationTokenList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_initiate_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_initiate_session_host_update_operations.py
new file mode 100644
index 000000000000..cdcdc762f482
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_initiate_session_host_update_operations.py
@@ -0,0 +1,189 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._initiate_session_host_update_operations import build_post_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class InitiateSessionHostUpdateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`initiate_session_host_update` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @overload
+ async def post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[_models.UpdateSessionHostsRequestBody] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Default value is None.
+ :type update_session_hosts_request_body:
+ ~azure.mgmt.desktopvirtualization.models.UpdateSessionHostsRequestBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Default value is None.
+ :type update_session_hosts_request_body: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[Union[_models.UpdateSessionHostsRequestBody, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Is either a UpdateSessionHostsRequestBody type or a
+ IO[bytes] type. Default value is None.
+ :type update_session_hosts_request_body:
+ ~azure.mgmt.desktopvirtualization.models.UpdateSessionHostsRequestBody or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(update_session_hosts_request_body, (IOBase, bytes)):
+ _content = update_session_hosts_request_body
+ else:
+ if update_session_hosts_request_body is not None:
+ _json = self._serialize.body(update_session_hosts_request_body, "UpdateSessionHostsRequestBody")
+ else:
+ _json = None
+
+ _request = build_post_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_images_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_images_operations.py
index e773c50662e3..8722050ce74b 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_images_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_images_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -142,7 +141,7 @@ def expand(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ExpandMsixImageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_packages_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_packages_operations.py
index 600fd5c5dc8d..82edb5c94e01 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_packages_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_msix_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -81,7 +80,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -212,7 +211,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -268,7 +267,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, host_pool_name: str, msix_package_full_name: str, **kwargs: Any
) -> None:
"""Remove an MSIX Package.
@@ -285,7 +284,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -412,7 +411,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -504,7 +503,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MSIXPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_operations.py
index c48bca8240e1..9448ea3dbbc6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -71,7 +70,7 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.ResourceProviderOperatio
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ResourceProviderOperationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_endpoint_connections_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_endpoint_connections_operations.py
index 1a2a1c1208c8..a19536df00fd 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_endpoint_connections_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_endpoint_connections_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -42,7 +41,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -70,6 +69,7 @@ def __init__(self, *args, **kwargs) -> None:
def list_by_workspace(
self, resource_group_name: str, workspace_name: str, **kwargs: Any
) -> AsyncIterable["_models.PrivateEndpointConnectionWithSystemData"]:
+ # pylint: disable=line-too-long
"""List private endpoint connections.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -89,7 +89,7 @@ def list_by_workspace(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionListResultWithSystemData] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -169,7 +169,7 @@ async def get_by_workspace(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -213,7 +213,7 @@ async def get_by_workspace(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_by_workspace( # pylint: disable=inconsistent-return-statements
+ async def delete_by_workspace(
self, resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> None:
"""Remove a connection.
@@ -230,7 +230,7 @@ async def delete_by_workspace( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -358,7 +358,7 @@ async def update_by_workspace(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -423,6 +423,7 @@ def list_by_host_pool(
initial_skip: Optional[int] = None,
**kwargs: Any
) -> AsyncIterable["_models.PrivateEndpointConnectionWithSystemData"]:
+ # pylint: disable=line-too-long
"""List private endpoint connections associated with hostpool.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -448,7 +449,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionListResultWithSystemData] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -531,7 +532,7 @@ async def get_by_host_pool(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -575,7 +576,7 @@ async def get_by_host_pool(
return deserialized # type: ignore
@distributed_trace_async
- async def delete_by_host_pool( # pylint: disable=inconsistent-return-statements
+ async def delete_by_host_pool(
self, resource_group_name: str, host_pool_name: str, private_endpoint_connection_name: str, **kwargs: Any
) -> None:
"""Remove a connection.
@@ -592,7 +593,7 @@ async def delete_by_host_pool( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -720,7 +721,7 @@ async def update_by_host_pool(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_link_resources_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_link_resources_operations.py
index f47e7e19d506..99546dc3ea8c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_link_resources_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_private_link_resources_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -34,7 +33,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -92,7 +91,7 @@ def list_by_workspace(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -191,7 +190,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_personal_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_personal_schedules_operations.py
index 621c61afe6ed..1c540310c8b6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_personal_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_personal_schedules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +79,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -212,7 +211,7 @@ async def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -268,7 +267,7 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, scaling_plan_name: str, scaling_plan_schedule_name: str, **kwargs: Any
) -> None:
"""Remove a ScalingPlanPersonalSchedule.
@@ -284,7 +283,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -412,7 +411,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -505,7 +504,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanPersonalScheduleList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_pooled_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_pooled_schedules_operations.py
index 4f2c8e715a3c..c05b8bff6309 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_pooled_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plan_pooled_schedules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -39,7 +38,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +79,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -211,7 +210,7 @@ async def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -267,7 +266,7 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self, resource_group_name: str, scaling_plan_name: str, scaling_plan_schedule_name: str, **kwargs: Any
) -> None:
"""Remove a ScalingPlanPooledSchedule.
@@ -283,7 +282,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -411,7 +410,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -504,7 +503,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanPooledScheduleList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plans_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plans_operations.py
index 1cdf85e4fd44..add8d84af88f 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plans_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_scaling_plans_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -41,7 +40,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -78,7 +77,7 @@ async def get(self, resource_group_name: str, scaling_plan_name: str, **kwargs:
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -196,7 +195,7 @@ async def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -251,9 +250,7 @@ async def create(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, scaling_plan_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, scaling_plan_name: str, **kwargs: Any) -> None:
"""Remove a scaling plan.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -265,7 +262,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -379,7 +376,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -467,7 +464,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -558,7 +555,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -655,7 +652,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_configurations_operations.py
new file mode 100644
index 000000000000..6653980866f8
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_configurations_operations.py
@@ -0,0 +1,646 @@
+# 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 io import IOBase
+import sys
+from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
+
+from ... import models as _models
+from ...operations._session_host_configurations_operations import (
+ build_create_or_update_request,
+ build_get_request,
+ build_list_by_host_pool_request,
+ build_update_request,
+)
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class SessionHostConfigurationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_configurations` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ async def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Union[_models.SessionHostConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_configuration, (IOBase, bytes)):
+ _content = session_host_configuration
+ else:
+ _json = self._serialize.body(session_host_configuration, "SessionHostConfiguration")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: _models.SessionHostConfiguration,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Required.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Required.
+ :type session_host_configuration: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Union[_models.SessionHostConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions. Is
+ either a SessionHostConfiguration type or a IO[bytes] type. Required.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_configuration=session_host_configuration,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod,
+ AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs),
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.SessionHostConfiguration].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.SessionHostConfiguration](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ async def _update_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[Union[_models.SessionHostConfigurationPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> AsyncIterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_configuration, (IOBase, bytes)):
+ _content = session_host_configuration
+ else:
+ if session_host_configuration is not None:
+ _json = self._serialize.body(session_host_configuration, "SessionHostConfigurationPatch")
+ else:
+ _json = None
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ await response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[_models.SessionHostConfigurationPatch] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Default value is None.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfigurationPatch
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Default value is None.
+ :type session_host_configuration: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[Union[_models.SessionHostConfigurationPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> AsyncLROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions. Is
+ either a SessionHostConfigurationPatch type or a IO[bytes] type. Default value is None.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfigurationPatch or IO[bytes]
+ :return: An instance of AsyncLROPoller that returns either SessionHostConfiguration or the
+ result of cls(response)
+ :rtype:
+ ~azure.core.polling.AsyncLROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+ polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = await self._update_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_configuration=session_host_configuration,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ await raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: AsyncPollingMethod = cast(
+ AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(AsyncPollingMethod, AsyncNoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return AsyncLROPoller[_models.SessionHostConfiguration].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return AsyncLROPoller[_models.SessionHostConfiguration](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> _models.SessionHostConfiguration:
+ """Get a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> AsyncIterable["_models.SessionHostConfiguration"]:
+ """List sessionHostConfigurations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostConfigurationList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("SessionHostConfigurationList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_operations.py
new file mode 100644
index 000000000000..0d5419f16f71
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_operations.py
@@ -0,0 +1,470 @@
+# 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 io import IOBase
+import sys
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.async_paging import AsyncItemPaged, AsyncList
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._session_host_managements_operations import (
+ build_create_or_update_request,
+ build_get_request,
+ build_list_by_host_pool_request,
+ build_update_request,
+)
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class SessionHostManagementsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_managements` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def get(self, resource_group_name: str, host_pool_name: str, **kwargs: Any) -> _models.SessionHostManagement:
+ """Get a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: _models.SessionHostManagement,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Required.
+ :type session_host_management: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Required.
+ :type session_host_management: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Union[_models.SessionHostManagement, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Is either
+ a SessionHostManagement type or a IO[bytes] type. Required.
+ :type session_host_management: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ or IO[bytes]
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_management, (IOBase, bytes)):
+ _content = session_host_management
+ else:
+ _json = self._serialize.body(session_host_management, "SessionHostManagement")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ async def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[_models.SessionHostManagementPatch] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Default
+ value is None.
+ :type session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementPatch
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ async def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Default
+ value is None.
+ :type session_host_management: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace_async
+ async def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[Union[_models.SessionHostManagementPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Is either
+ a SessionHostManagementPatch type or a IO[bytes] type. Default value is None.
+ :type session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementPatch or IO[bytes]
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_management, (IOBase, bytes)):
+ _content = session_host_management
+ else:
+ if session_host_management is not None:
+ _json = self._serialize.body(session_host_management, "SessionHostManagementPatch")
+ else:
+ _json = None
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> AsyncIterable["_models.SessionHostManagement"]:
+ """List SessionHostManagements by hostPool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either SessionHostManagement or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHostManagement]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagementList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ async def extract_data(pipeline_response):
+ deserialized = self._deserialize("SessionHostManagementList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, AsyncList(list_of_elem)
+
+ async def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return AsyncItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_update_status_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_update_status_operations.py
new file mode 100644
index 000000000000..0dbcba5e84bf
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_managements_update_status_operations.py
@@ -0,0 +1,111 @@
+# 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 sys
+from typing import Any, Callable, Dict, Optional, TypeVar
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._session_host_managements_update_status_operations import build_get_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class SessionHostManagementsUpdateStatusOperations: # pylint: disable=name-too-long
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_managements_update_status` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def get(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> _models.SessionHostManagementUpdateStatus:
+ """Get the session host update status for a given hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostManagementUpdateStatus or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagementUpdateStatus
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagementUpdateStatus] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagementUpdateStatus", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_operations.py
new file mode 100644
index 000000000000..27d3ba2a9267
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_host_operations.py
@@ -0,0 +1,110 @@
+# 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 sys
+from typing import Any, Callable, Dict, Optional, TypeVar
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import AsyncHttpResponse, HttpRequest
+from azure.core.tracing.decorator_async import distributed_trace_async
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from ... import models as _models
+from ...operations._session_host_operations import build_retry_provisioning_request
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
+
+
+class SessionHostOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.aio.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs) -> None:
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace_async
+ async def retry_provisioning(
+ self, resource_group_name: str, host_pool_name: str, session_host_name: str, **kwargs: Any
+ ) -> None:
+ """Retry provisioning on a SessionHost.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_name: The name of the session host within the specified host pool.
+ Required.
+ :type session_host_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_retry_provisioning_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_name=session_host_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_hosts_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_hosts_operations.py
index 55d5d6e8fbf5..ea7c1e8c5c26 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_hosts_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_session_hosts_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -38,7 +37,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -80,7 +79,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -124,7 +123,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self,
resource_group_name: str,
host_pool_name: str,
@@ -149,7 +148,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -289,7 +288,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -356,6 +355,7 @@ def list(
page_size: Optional[int] = None,
is_descending: Optional[bool] = None,
initial_skip: Optional[int] = None,
+ vm_path: Optional[str] = None,
**kwargs: Any
) -> AsyncIterable["_models.SessionHost"]:
"""List sessionHosts.
@@ -371,6 +371,8 @@ def list(
:type is_descending: bool
:param initial_skip: Initial number of items to skip. Default value is None.
:type initial_skip: int
+ :param vm_path: The path to the VM. Default value is None.
+ :type vm_path: str
:return: An iterator like instance of either SessionHost or the result of cls(response)
:rtype:
~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHost]
@@ -382,7 +384,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SessionHostList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -400,6 +402,7 @@ def prepare_request(next_link=None):
page_size=page_size,
is_descending=is_descending,
initial_skip=initial_skip,
+ vm_path=vm_path,
api_version=api_version,
headers=_headers,
params=_params,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_start_menu_items_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_start_menu_items_operations.py
index ac7671a50014..34a75c5f51ae 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_start_menu_items_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_start_menu_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar
+from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -89,7 +88,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.StartMenuItemList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_user_sessions_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_user_sessions_operations.py
index 05aeae0749fe..885737ef78ce 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_user_sessions_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_user_sessions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -102,7 +101,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UserSessionList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -189,7 +188,7 @@ async def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.UserSession
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -234,7 +233,7 @@ async def get(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
+ async def delete(
self,
resource_group_name: str,
host_pool_name: str,
@@ -262,7 +261,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -341,7 +340,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UserSessionList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -408,7 +407,7 @@ async def get_next(next_link=None):
return AsyncItemPaged(get_next, extract_data)
@distributed_trace_async
- async def disconnect( # pylint: disable=inconsistent-return-statements
+ async def disconnect(
self, resource_group_name: str, host_pool_name: str, session_host_name: str, user_session_id: str, **kwargs: Any
) -> None:
"""Disconnect a userSession.
@@ -428,7 +427,7 @@ async def disconnect( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -469,7 +468,7 @@ async def disconnect( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@overload
- async def send_message( # pylint: disable=inconsistent-return-statements
+ async def send_message(
self,
resource_group_name: str,
host_pool_name: str,
@@ -505,7 +504,7 @@ async def send_message( # pylint: disable=inconsistent-return-statements
"""
@overload
- async def send_message( # pylint: disable=inconsistent-return-statements
+ async def send_message(
self,
resource_group_name: str,
host_pool_name: str,
@@ -541,7 +540,7 @@ async def send_message( # pylint: disable=inconsistent-return-statements
"""
@distributed_trace_async
- async def send_message( # pylint: disable=inconsistent-return-statements
+ async def send_message(
self,
resource_group_name: str,
host_pool_name: str,
@@ -570,7 +569,7 @@ async def send_message( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_workspaces_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_workspaces_operations.py
index c75eaf26869a..a9fa9b11ecac 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_workspaces_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/aio/operations/_workspaces_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload
+from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
@@ -40,7 +39,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
@@ -77,7 +76,7 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -195,7 +194,7 @@ async def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -250,9 +249,7 @@ async def create_or_update(
return deserialized # type: ignore
@distributed_trace_async
- async def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, workspace_name: str, **kwargs: Any
- ) -> None:
+ async def delete(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> None:
"""Remove a workspace.
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -264,7 +261,7 @@ async def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -378,7 +375,7 @@ async def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -466,7 +463,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -545,7 +542,7 @@ def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Workspac
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py
index e4e4586e68ad..ab43fd9c2e3e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/__init__.py
@@ -5,135 +5,197 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._models_py3 import AgentUpdatePatchProperties
-from ._models_py3 import AgentUpdateProperties
-from ._models_py3 import AppAttachPackage
-from ._models_py3 import AppAttachPackageInfoProperties
-from ._models_py3 import AppAttachPackageList
-from ._models_py3 import AppAttachPackagePatch
-from ._models_py3 import AppAttachPackagePatchProperties
-from ._models_py3 import AppAttachPackageProperties
-from ._models_py3 import Application
-from ._models_py3 import ApplicationGroup
-from ._models_py3 import ApplicationGroupList
-from ._models_py3 import ApplicationGroupPatch
-from ._models_py3 import ApplicationList
-from ._models_py3 import ApplicationPatch
-from ._models_py3 import CloudErrorProperties
-from ._models_py3 import Desktop
-from ._models_py3 import DesktopList
-from ._models_py3 import DesktopPatch
-from ._models_py3 import ErrorAdditionalInfo
-from ._models_py3 import ErrorDetail
-from ._models_py3 import ErrorResponse
-from ._models_py3 import ExpandMsixImage
-from ._models_py3 import ExpandMsixImageList
-from ._models_py3 import HostPool
-from ._models_py3 import HostPoolList
-from ._models_py3 import HostPoolPatch
-from ._models_py3 import Identity
-from ._models_py3 import ImportPackageInfoRequest
-from ._models_py3 import LogSpecification
-from ._models_py3 import MSIXImageURI
-from ._models_py3 import MSIXPackage
-from ._models_py3 import MSIXPackageList
-from ._models_py3 import MSIXPackagePatch
-from ._models_py3 import MaintenanceWindowPatchProperties
-from ._models_py3 import MaintenanceWindowProperties
-from ._models_py3 import MsixPackageApplications
-from ._models_py3 import MsixPackageDependencies
-from ._models_py3 import OperationProperties
-from ._models_py3 import Plan
-from ._models_py3 import PrivateEndpoint
-from ._models_py3 import PrivateEndpointConnection
-from ._models_py3 import PrivateEndpointConnectionListResultWithSystemData
-from ._models_py3 import PrivateEndpointConnectionWithSystemData
-from ._models_py3 import PrivateLinkResource
-from ._models_py3 import PrivateLinkResourceListResult
-from ._models_py3 import PrivateLinkServiceConnectionState
-from ._models_py3 import ProxyResource
-from ._models_py3 import RegistrationInfo
-from ._models_py3 import RegistrationInfoPatch
-from ._models_py3 import RegistrationTokenList
-from ._models_py3 import RegistrationTokenMinimal
-from ._models_py3 import Resource
-from ._models_py3 import ResourceModelWithAllowedPropertySet
-from ._models_py3 import ResourceModelWithAllowedPropertySetIdentity
-from ._models_py3 import ResourceModelWithAllowedPropertySetPlan
-from ._models_py3 import ResourceModelWithAllowedPropertySetSku
-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 ScalingPlanList
-from ._models_py3 import ScalingPlanPatch
-from ._models_py3 import ScalingPlanPersonalSchedule
-from ._models_py3 import ScalingPlanPersonalScheduleList
-from ._models_py3 import ScalingPlanPersonalSchedulePatch
-from ._models_py3 import ScalingPlanPooledSchedule
-from ._models_py3 import ScalingPlanPooledScheduleList
-from ._models_py3 import ScalingPlanPooledSchedulePatch
-from ._models_py3 import ScalingSchedule
-from ._models_py3 import SendMessage
-from ._models_py3 import ServiceSpecification
-from ._models_py3 import SessionHost
-from ._models_py3 import SessionHostHealthCheckFailureDetails
-from ._models_py3 import SessionHostHealthCheckReport
-from ._models_py3 import SessionHostList
-from ._models_py3 import SessionHostPatch
-from ._models_py3 import Sku
-from ._models_py3 import StartMenuItem
-from ._models_py3 import StartMenuItemList
-from ._models_py3 import SystemData
-from ._models_py3 import Time
-from ._models_py3 import TrackedResource
-from ._models_py3 import UserSession
-from ._models_py3 import UserSessionList
-from ._models_py3 import Workspace
-from ._models_py3 import WorkspaceList
-from ._models_py3 import WorkspacePatch
+from typing import TYPE_CHECKING
-from ._desktop_virtualization_mgmt_client_enums import AppAttachPackageArchitectures
-from ._desktop_virtualization_mgmt_client_enums import ApplicationGroupType
-from ._desktop_virtualization_mgmt_client_enums import ApplicationType
-from ._desktop_virtualization_mgmt_client_enums import CommandLineSetting
-from ._desktop_virtualization_mgmt_client_enums import CreatedByType
-from ._desktop_virtualization_mgmt_client_enums import DayOfWeek
-from ._desktop_virtualization_mgmt_client_enums import FailHealthCheckOnStagingFailure
-from ._desktop_virtualization_mgmt_client_enums import HealthCheckName
-from ._desktop_virtualization_mgmt_client_enums import HealthCheckResult
-from ._desktop_virtualization_mgmt_client_enums import HostPoolType
-from ._desktop_virtualization_mgmt_client_enums import HostpoolPublicNetworkAccess
-from ._desktop_virtualization_mgmt_client_enums import LoadBalancerType
-from ._desktop_virtualization_mgmt_client_enums import PackageTimestamped
-from ._desktop_virtualization_mgmt_client_enums import PersonalDesktopAssignmentType
-from ._desktop_virtualization_mgmt_client_enums import PreferredAppGroupType
-from ._desktop_virtualization_mgmt_client_enums import PrivateEndpointConnectionProvisioningState
-from ._desktop_virtualization_mgmt_client_enums import PrivateEndpointServiceConnectionStatus
-from ._desktop_virtualization_mgmt_client_enums import ProvisioningState
-from ._desktop_virtualization_mgmt_client_enums import PublicNetworkAccess
-from ._desktop_virtualization_mgmt_client_enums import RegistrationTokenOperation
-from ._desktop_virtualization_mgmt_client_enums import RemoteApplicationType
-from ._desktop_virtualization_mgmt_client_enums import SSOSecretType
-from ._desktop_virtualization_mgmt_client_enums import ScalingHostPoolType
-from ._desktop_virtualization_mgmt_client_enums import ScalingScheduleDaysOfWeekItem
-from ._desktop_virtualization_mgmt_client_enums import SessionHandlingOperation
-from ._desktop_virtualization_mgmt_client_enums import SessionHostComponentUpdateType
-from ._desktop_virtualization_mgmt_client_enums import SessionHostLoadBalancingAlgorithm
-from ._desktop_virtualization_mgmt_client_enums import SessionState
-from ._desktop_virtualization_mgmt_client_enums import SetStartVMOnConnect
-from ._desktop_virtualization_mgmt_client_enums import SkuTier
-from ._desktop_virtualization_mgmt_client_enums import StartupBehavior
-from ._desktop_virtualization_mgmt_client_enums import Status
-from ._desktop_virtualization_mgmt_client_enums import StopHostsWhen
-from ._desktop_virtualization_mgmt_client_enums import UpdateState
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+
+from ._models_py3 import ( # type: ignore
+ ActiveDirectoryInfoPatchProperties,
+ ActiveDirectoryInfoProperties,
+ ActiveSessionHostConfiguration,
+ ActiveSessionHostConfigurationList,
+ AgentUpdatePatchProperties,
+ AgentUpdateProperties,
+ AppAttachPackage,
+ AppAttachPackageInfoProperties,
+ AppAttachPackageList,
+ AppAttachPackagePatch,
+ AppAttachPackagePatchProperties,
+ AppAttachPackageProperties,
+ Application,
+ ApplicationGroup,
+ ApplicationGroupList,
+ ApplicationGroupPatch,
+ ApplicationList,
+ ApplicationPatch,
+ AzureActiveDirectoryInfoProperties,
+ BootDiagnosticsInfoPatchProperties,
+ BootDiagnosticsInfoProperties,
+ CloudErrorProperties,
+ CustomInfoPatchProperties,
+ CustomInfoProperties,
+ Desktop,
+ DesktopList,
+ DesktopPatch,
+ DiskInfoPatchProperties,
+ DiskInfoProperties,
+ DomainInfoPatchProperties,
+ DomainInfoProperties,
+ ErrorAdditionalInfo,
+ ErrorDetail,
+ ErrorResponse,
+ ExpandMsixImage,
+ ExpandMsixImageList,
+ HostPool,
+ HostPoolList,
+ HostPoolPatch,
+ HostPoolUpdateConfigurationPatchProperties,
+ HostPoolUpdateConfigurationProperties,
+ HostPoolUpdateControlParameter,
+ HostPoolUpdateFault,
+ ImageInfoPatchProperties,
+ ImageInfoProperties,
+ ImportPackageInfoRequest,
+ KeyVaultCredentialsPatchProperties,
+ KeyVaultCredentialsProperties,
+ LogSpecification,
+ MSIXImageURI,
+ MSIXPackage,
+ MSIXPackageList,
+ MSIXPackagePatch,
+ MaintenanceWindowPatchProperties,
+ MaintenanceWindowProperties,
+ ManagedServiceIdentity,
+ MarketplaceInfoPatchProperties,
+ MarketplaceInfoProperties,
+ MsixPackageApplications,
+ MsixPackageDependencies,
+ NetworkInfoPatchProperties,
+ NetworkInfoProperties,
+ OperationProperties,
+ Plan,
+ PrivateEndpoint,
+ PrivateEndpointConnection,
+ PrivateEndpointConnectionListResultWithSystemData,
+ PrivateEndpointConnectionWithSystemData,
+ PrivateLinkResource,
+ PrivateLinkResourceListResult,
+ PrivateLinkServiceConnectionState,
+ ProxyResource,
+ RegistrationInfo,
+ RegistrationInfoPatch,
+ RegistrationTokenList,
+ RegistrationTokenMinimal,
+ Resource,
+ ResourceModelWithAllowedPropertySet,
+ ResourceProviderOperation,
+ ResourceProviderOperationDisplay,
+ ResourceProviderOperationList,
+ ScalingHostPoolReference,
+ ScalingPlan,
+ ScalingPlanList,
+ ScalingPlanPatch,
+ ScalingPlanPersonalSchedule,
+ ScalingPlanPersonalScheduleList,
+ ScalingPlanPersonalSchedulePatch,
+ ScalingPlanPooledSchedule,
+ ScalingPlanPooledScheduleList,
+ ScalingPlanPooledSchedulePatch,
+ ScalingSchedule,
+ SecurityInfoPatchProperties,
+ SecurityInfoProperties,
+ SendMessage,
+ ServiceSpecification,
+ SessionHost,
+ SessionHostConfiguration,
+ SessionHostConfigurationList,
+ SessionHostConfigurationPatch,
+ SessionHostHealthCheckFailureDetails,
+ SessionHostHealthCheckReport,
+ SessionHostList,
+ SessionHostManagement,
+ SessionHostManagementList,
+ SessionHostManagementOperationProgress,
+ SessionHostManagementPatch,
+ SessionHostManagementUpdateStatus,
+ SessionHostPatch,
+ Sku,
+ StartMenuItem,
+ StartMenuItemList,
+ SystemData,
+ Time,
+ TrackedResource,
+ UpdateSessionHostsRequestBody,
+ UserAssignedIdentity,
+ UserSession,
+ UserSessionList,
+ Workspace,
+ WorkspaceList,
+ WorkspacePatch,
+)
+
+from ._desktop_virtualization_mgmt_client_enums import ( # type: ignore
+ AppAttachPackageArchitectures,
+ ApplicationGroupType,
+ ApplicationType,
+ CommandLineSetting,
+ CreatedByType,
+ DayOfWeek,
+ DirectUDP,
+ DomainJoinType,
+ FailHealthCheckOnStagingFailure,
+ FaultType,
+ HealthCheckName,
+ HealthCheckResult,
+ HostPoolType,
+ HostPoolUpdateAction,
+ HostpoolPublicNetworkAccess,
+ LoadBalancerType,
+ ManagedPrivateUDP,
+ ManagedServiceIdentityType,
+ ManagementType,
+ OperationTypeSHM,
+ PackageTimestamped,
+ PersonalDesktopAssignmentType,
+ PreferredAppGroupType,
+ PrivateEndpointConnectionProvisioningState,
+ PrivateEndpointServiceConnectionStatus,
+ ProvisioningState,
+ ProvisioningStateSHC,
+ PublicNetworkAccess,
+ PublicUDP,
+ RegistrationTokenOperation,
+ RelayUDP,
+ RemoteApplicationType,
+ SSOSecretType,
+ ScalingHostPoolType,
+ SessionHandlingOperation,
+ SessionHostComponentUpdateType,
+ SessionHostLoadBalancingAlgorithm,
+ SessionState,
+ SetStartVMOnConnect,
+ SkuTier,
+ StartupBehavior,
+ Status,
+ StopHostsWhen,
+ Type,
+ UpdateState,
+ VirtualMachineDiskType,
+ VirtualMachineSecurityType,
+)
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
+ "ActiveDirectoryInfoPatchProperties",
+ "ActiveDirectoryInfoProperties",
+ "ActiveSessionHostConfiguration",
+ "ActiveSessionHostConfigurationList",
"AgentUpdatePatchProperties",
"AgentUpdateProperties",
"AppAttachPackage",
@@ -148,10 +210,19 @@
"ApplicationGroupPatch",
"ApplicationList",
"ApplicationPatch",
+ "AzureActiveDirectoryInfoProperties",
+ "BootDiagnosticsInfoPatchProperties",
+ "BootDiagnosticsInfoProperties",
"CloudErrorProperties",
+ "CustomInfoPatchProperties",
+ "CustomInfoProperties",
"Desktop",
"DesktopList",
"DesktopPatch",
+ "DiskInfoPatchProperties",
+ "DiskInfoProperties",
+ "DomainInfoPatchProperties",
+ "DomainInfoProperties",
"ErrorAdditionalInfo",
"ErrorDetail",
"ErrorResponse",
@@ -160,8 +231,15 @@
"HostPool",
"HostPoolList",
"HostPoolPatch",
- "Identity",
+ "HostPoolUpdateConfigurationPatchProperties",
+ "HostPoolUpdateConfigurationProperties",
+ "HostPoolUpdateControlParameter",
+ "HostPoolUpdateFault",
+ "ImageInfoPatchProperties",
+ "ImageInfoProperties",
"ImportPackageInfoRequest",
+ "KeyVaultCredentialsPatchProperties",
+ "KeyVaultCredentialsProperties",
"LogSpecification",
"MSIXImageURI",
"MSIXPackage",
@@ -169,8 +247,13 @@
"MSIXPackagePatch",
"MaintenanceWindowPatchProperties",
"MaintenanceWindowProperties",
+ "ManagedServiceIdentity",
+ "MarketplaceInfoPatchProperties",
+ "MarketplaceInfoProperties",
"MsixPackageApplications",
"MsixPackageDependencies",
+ "NetworkInfoPatchProperties",
+ "NetworkInfoProperties",
"OperationProperties",
"Plan",
"PrivateEndpoint",
@@ -187,9 +270,6 @@
"RegistrationTokenMinimal",
"Resource",
"ResourceModelWithAllowedPropertySet",
- "ResourceModelWithAllowedPropertySetIdentity",
- "ResourceModelWithAllowedPropertySetPlan",
- "ResourceModelWithAllowedPropertySetSku",
"ResourceProviderOperation",
"ResourceProviderOperationDisplay",
"ResourceProviderOperationList",
@@ -204,12 +284,22 @@
"ScalingPlanPooledScheduleList",
"ScalingPlanPooledSchedulePatch",
"ScalingSchedule",
+ "SecurityInfoPatchProperties",
+ "SecurityInfoProperties",
"SendMessage",
"ServiceSpecification",
"SessionHost",
+ "SessionHostConfiguration",
+ "SessionHostConfigurationList",
+ "SessionHostConfigurationPatch",
"SessionHostHealthCheckFailureDetails",
"SessionHostHealthCheckReport",
"SessionHostList",
+ "SessionHostManagement",
+ "SessionHostManagementList",
+ "SessionHostManagementOperationProgress",
+ "SessionHostManagementPatch",
+ "SessionHostManagementUpdateStatus",
"SessionHostPatch",
"Sku",
"StartMenuItem",
@@ -217,6 +307,8 @@
"SystemData",
"Time",
"TrackedResource",
+ "UpdateSessionHostsRequestBody",
+ "UserAssignedIdentity",
"UserSession",
"UserSessionList",
"Workspace",
@@ -228,24 +320,34 @@
"CommandLineSetting",
"CreatedByType",
"DayOfWeek",
+ "DirectUDP",
+ "DomainJoinType",
"FailHealthCheckOnStagingFailure",
+ "FaultType",
"HealthCheckName",
"HealthCheckResult",
"HostPoolType",
+ "HostPoolUpdateAction",
"HostpoolPublicNetworkAccess",
"LoadBalancerType",
+ "ManagedPrivateUDP",
+ "ManagedServiceIdentityType",
+ "ManagementType",
+ "OperationTypeSHM",
"PackageTimestamped",
"PersonalDesktopAssignmentType",
"PreferredAppGroupType",
"PrivateEndpointConnectionProvisioningState",
"PrivateEndpointServiceConnectionStatus",
"ProvisioningState",
+ "ProvisioningStateSHC",
"PublicNetworkAccess",
+ "PublicUDP",
"RegistrationTokenOperation",
+ "RelayUDP",
"RemoteApplicationType",
"SSOSecretType",
"ScalingHostPoolType",
- "ScalingScheduleDaysOfWeekItem",
"SessionHandlingOperation",
"SessionHostComponentUpdateType",
"SessionHostLoadBalancingAlgorithm",
@@ -255,7 +357,10 @@
"StartupBehavior",
"Status",
"StopHostsWhen",
+ "Type",
"UpdateState",
+ "VirtualMachineDiskType",
+ "VirtualMachineSecurityType",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_mgmt_client_enums.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_mgmt_client_enums.py
index 81bb4af5b02b..627a7c622acc 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_mgmt_client_enums.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_desktop_virtualization_mgmt_client_enums.py
@@ -68,6 +68,27 @@ class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta):
SUNDAY = "Sunday"
+class DirectUDP(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will
+ attempt this connection type when making connections. This means that this connection is
+ possible, but is not guaranteed, as there are other factors that may prevent this connection
+ type, Disabled: UDP will not attempt this connection type when making connections.
+ """
+
+ DEFAULT = "Default"
+ ENABLED = "Enabled"
+ DISABLED = "Disabled"
+
+
+class DomainJoinType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of domain join done by the virtual machine."""
+
+ ACTIVE_DIRECTORY = "ActiveDirectory"
+ """Using microsoft active directory."""
+ AZURE_ACTIVE_DIRECTORY = "AzureActiveDirectory"
+ """Using microsoft azure active directory."""
+
+
class FailHealthCheckOnStagingFailure(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Parameter indicating how the health check should behave if this package fails staging."""
@@ -76,6 +97,15 @@ class FailHealthCheckOnStagingFailure(str, Enum, metaclass=CaseInsensitiveEnumMe
DO_NOT_FAIL = "DoNotFail"
+class FaultType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Hostpool update fault type."""
+
+ SERVICE_ERROR = "ServiceError"
+ """Fault caused by service error."""
+ USER_ERROR = "UserError"
+ """Fault caused by user error."""
+
+
class HealthCheckName(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Represents the name of the health check operation performed."""
@@ -171,12 +201,67 @@ class HostPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
PersonalDesktopAssignmentType must be Direct."""
+class HostPoolUpdateAction(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Action types for controlling hostpool update."""
+
+ START = "Start"
+ """Start the hostpool update."""
+ PAUSE = "Pause"
+ """Pause the hostpool update."""
+ CANCEL = "Cancel"
+ """Cancel the hostpool update."""
+ RETRY = "Retry"
+ """Retry the hostpool update."""
+ RESUME = "Resume"
+ """Resume the hostpool update."""
+
+
class LoadBalancerType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of the load balancer."""
BREADTH_FIRST = "BreadthFirst"
DEPTH_FIRST = "DepthFirst"
PERSISTENT = "Persistent"
+ MULTIPLE_PERSISTENT = "MultiplePersistent"
+
+
+class ManagedPrivateUDP(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will
+ attempt this connection type when making connections. This means that this connection is
+ possible, but is not guaranteed, as there are other factors that may prevent this connection
+ type, Disabled: UDP will not attempt this connection type when making connections.
+ """
+
+ DEFAULT = "Default"
+ ENABLED = "Enabled"
+ DISABLED = "Disabled"
+
+
+class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Type of managed service identity (where both SystemAssigned and UserAssigned types are
+ allowed).
+ """
+
+ NONE = "None"
+ SYSTEM_ASSIGNED = "SystemAssigned"
+ USER_ASSIGNED = "UserAssigned"
+ SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned"
+
+
+class ManagementType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of management for this hostpool, Automated or Standard. The default value is
+ Automated.
+ """
+
+ AUTOMATED = "Automated"
+ STANDARD = "Standard"
+
+
+class OperationTypeSHM(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """OperationTypeSHM."""
+
+ INITIATE_SESSION_HOST_UPDATE = "InitiateSessionHostUpdate"
+ VALIDATE_SESSION_HOST_UPDATE = "ValidateSessionHostUpdate"
class PackageTimestamped(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -197,8 +282,13 @@ class PreferredAppGroupType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of preferred application group type, default to Desktop Application Group."""
NONE = "None"
+ """This value is read only, it is not accepted on input."""
DESKTOP = "Desktop"
+ """Users access the full Windows desktop from a session host. Available with pooled or personal
+ host pools."""
RAIL_APPLICATIONS = "RailApplications"
+ """Users access individual applications you select and publish to the application group. Available
+ with pooled host pools only."""
class PrivateEndpointConnectionProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -227,6 +317,15 @@ class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
CANCELED = "Canceled"
+class ProvisioningStateSHC(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Provisioning state of the Session Host Configuration."""
+
+ SUCCEEDED = "Succeeded"
+ FAILED = "Failed"
+ CANCELED = "Canceled"
+ PROVISIONING = "Provisioning"
+
+
class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Enabled allows this resource to be accessed from both public and private networks, Disabled
allows this resource to only be accessed via private endpoints.
@@ -236,6 +335,18 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta):
DISABLED = "Disabled"
+class PublicUDP(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will
+ attempt this connection type when making connections. This means that this connection is
+ possible, but is not guaranteed, as there are other factors that may prevent this connection
+ type, Disabled: UDP will not attempt this connection type when making connections.
+ """
+
+ DEFAULT = "Default"
+ ENABLED = "Enabled"
+ DISABLED = "Disabled"
+
+
class RegistrationTokenOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""The type of resetting the token."""
@@ -244,6 +355,18 @@ class RegistrationTokenOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
UPDATE = "Update"
+class RelayUDP(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """Default: AVD-wide settings are used to determine connection availability, Enabled: UDP will
+ attempt this connection type when making connections. This means that this connection is
+ possible, but is not guaranteed, as there are other factors that may prevent this connection
+ type, Disabled: UDP will not attempt this connection type when making connections.
+ """
+
+ DEFAULT = "Default"
+ ENABLED = "Enabled"
+ DISABLED = "Disabled"
+
+
class RemoteApplicationType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Resource Type of Application."""
@@ -256,18 +379,10 @@ class ScalingHostPoolType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
POOLED = "Pooled"
"""Users get a new (random) SessionHost every time it connects to the HostPool."""
-
-
-class ScalingScheduleDaysOfWeekItem(str, Enum, metaclass=CaseInsensitiveEnumMeta):
- """ScalingScheduleDaysOfWeekItem."""
-
- SUNDAY = "Sunday"
- MONDAY = "Monday"
- TUESDAY = "Tuesday"
- WEDNESDAY = "Wednesday"
- THURSDAY = "Thursday"
- FRIDAY = "Friday"
- SATURDAY = "Saturday"
+ 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."""
class SessionHandlingOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta):
@@ -389,6 +504,15 @@ class StopHostsWhen(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ZERO_ACTIVE_SESSIONS = "ZeroActiveSessions"
+class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The type of image session hosts use in the hostpool."""
+
+ MARKETPLACE = "Marketplace"
+ """Using default marketplace images offered by Azure Marketplace."""
+ CUSTOM = "Custom"
+ """Using a custom image."""
+
+
class UpdateState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Update state of a SessionHost."""
@@ -397,3 +521,26 @@ class UpdateState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
STARTED = "Started"
SUCCEEDED = "Succeeded"
FAILED = "Failed"
+
+
+class VirtualMachineDiskType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The disk type used by virtual machine in hostpool session host."""
+
+ STANDARD_LRS = "Standard_LRS"
+ """Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access."""
+ PREMIUM_LRS = "Premium_LRS"
+ """Premium SSD locally redundant storage. Best for production and performance sensitive workloads."""
+ STANDARD_SSD_LRS = "StandardSSD_LRS"
+ """Standard SSD locally redundant storage. Best for web servers, lightly used enterprise
+ applications and dev/test."""
+
+
+class VirtualMachineSecurityType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
+ """The security type used by virtual machine in hostpool session host. Default is Standard."""
+
+ STANDARD = "Standard"
+ """Standard security protocol. No additional parameters"""
+ TRUSTED_LAUNCH = "TrustedLaunch"
+ """TrustedLaunch allows for secure boot adn vTPM"""
+ CONFIDENTIAL_VM = "ConfidentialVM"
+ """Confidential Virtual Machine security protocol"""
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py
index fa56640fb1de..77520bbf5114 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/models/_models_py3.py
@@ -1,5 +1,5 @@
-# coding=utf-8
# pylint: disable=too-many-lines
+# 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.
@@ -8,15 +8,337 @@
# --------------------------------------------------------------------------
import datetime
-from typing import Any, Dict, List, Literal, Optional, TYPE_CHECKING, Union
+from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union
from .. import _serialization
if TYPE_CHECKING:
- # pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
+class ActiveDirectoryInfoPatchProperties(_serialization.Model):
+ """Active directory info. Only one should be populated based on the join type.
+
+ :ivar domain_credentials: Credentials needed to create the virtual machine.
+ :vartype domain_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsPatchProperties
+ """
+
+ _attribute_map = {
+ "domain_credentials": {"key": "domainCredentials", "type": "KeyVaultCredentialsPatchProperties"},
+ }
+
+ def __init__(
+ self, *, domain_credentials: Optional["_models.KeyVaultCredentialsPatchProperties"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword domain_credentials: Credentials needed to create the virtual machine.
+ :paramtype domain_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.domain_credentials = domain_credentials
+
+
+class ActiveDirectoryInfoProperties(_serialization.Model):
+ """Active directory info. Only one should be populated based on the join type.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar domain_credentials: Credentials needed to create the virtual machine. Required.
+ :vartype domain_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :ivar ou_path: The organizational unit(OU) path. Required.
+ :vartype ou_path: str
+ :ivar domain_name: The domain a virtual machine connected to a hostpool will join.
+ :vartype domain_name: str
+ """
+
+ _validation = {
+ "domain_credentials": {"required": True},
+ "ou_path": {"required": True},
+ }
+
+ _attribute_map = {
+ "domain_credentials": {"key": "domainCredentials", "type": "KeyVaultCredentialsProperties"},
+ "ou_path": {"key": "ouPath", "type": "str"},
+ "domain_name": {"key": "domainName", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ domain_credentials: "_models.KeyVaultCredentialsProperties",
+ ou_path: str,
+ domain_name: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword domain_credentials: Credentials needed to create the virtual machine. Required.
+ :paramtype domain_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :keyword ou_path: The organizational unit(OU) path. Required.
+ :paramtype ou_path: str
+ :keyword domain_name: The domain a virtual machine connected to a hostpool will join.
+ :paramtype domain_name: str
+ """
+ super().__init__(**kwargs)
+ self.domain_credentials = domain_credentials
+ self.ou_path = ou_path
+ self.domain_name = domain_name
+
+
+class Resource(_serialization.Model):
+ """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. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.id = None
+ self.name = None
+ self.type = None
+ self.system_data = None
+
+
+class ActiveSessionHostConfiguration(Resource):
+ """Represents a ActiveSessionHostConfiguration definition. This has all of the
+ sessionHostConfiguration properties except provisioningState.
+
+ 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ :ivar version: The timestamp of the last update.
+ :vartype version: ~datetime.datetime
+ :ivar friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :vartype friendly_name: str
+ :ivar vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :vartype vm_tags: dict[str, str]
+ :ivar vm_location: The Location for the session host to be created in. It will default to the
+ location of the hostpool if not provided.
+ :vartype vm_location: str
+ :ivar vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :vartype vm_resource_group: str
+ :ivar vm_name_prefix: The prefix that should be associated with session host names. Required.
+ :vartype vm_name_prefix: str
+ :ivar availability_zones: Value for availability zones to be used by the session host. Should
+ be from [1,2,3].
+ :vartype availability_zones: list[int]
+ :ivar network_info: Network information. Required.
+ :vartype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoProperties
+ :ivar vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6. Required.
+ :vartype vm_size_id: str
+ :ivar disk_info: Disk information. Required.
+ :vartype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoProperties
+ :ivar custom_configuration_script_url: The uri to the storage blob containing the arm template
+ to be run on the virtual machine after provisioning.
+ :vartype custom_configuration_script_url: str
+ :ivar image_info: Image configurations of HostPool. Required.
+ :vartype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoProperties
+ :ivar domain_info: Domain configurations of session hosts. Required.
+ :vartype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoProperties
+ :ivar security_info: Security information.
+ :vartype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoProperties
+ :ivar vm_admin_credentials: Local Admin credentials for session hosts. Required.
+ :vartype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :ivar boot_diagnostics_info: Boot Diagnostics information.
+ :vartype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "version": {"readonly": True},
+ "friendly_name": {"max_length": 260},
+ "vm_name_prefix": {"required": True, "max_length": 11},
+ "network_info": {"required": True},
+ "vm_size_id": {"required": True},
+ "disk_info": {"required": True},
+ "image_info": {"required": True},
+ "domain_info": {"required": True},
+ "vm_admin_credentials": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "version": {"key": "properties.version", "type": "iso-8601"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "vm_tags": {"key": "properties.vmTags", "type": "{str}"},
+ "vm_location": {"key": "properties.vmLocation", "type": "str"},
+ "vm_resource_group": {"key": "properties.vmResourceGroup", "type": "str"},
+ "vm_name_prefix": {"key": "properties.vmNamePrefix", "type": "str"},
+ "availability_zones": {"key": "properties.availabilityZones", "type": "[int]"},
+ "network_info": {"key": "properties.networkInfo", "type": "NetworkInfoProperties"},
+ "vm_size_id": {"key": "properties.vmSizeId", "type": "str"},
+ "disk_info": {"key": "properties.diskInfo", "type": "DiskInfoProperties"},
+ "custom_configuration_script_url": {"key": "properties.customConfigurationScriptUrl", "type": "str"},
+ "image_info": {"key": "properties.imageInfo", "type": "ImageInfoProperties"},
+ "domain_info": {"key": "properties.domainInfo", "type": "DomainInfoProperties"},
+ "security_info": {"key": "properties.securityInfo", "type": "SecurityInfoProperties"},
+ "vm_admin_credentials": {"key": "properties.vmAdminCredentials", "type": "KeyVaultCredentialsProperties"},
+ "boot_diagnostics_info": {"key": "properties.bootDiagnosticsInfo", "type": "BootDiagnosticsInfoProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ vm_name_prefix: str,
+ network_info: "_models.NetworkInfoProperties",
+ vm_size_id: str,
+ disk_info: "_models.DiskInfoProperties",
+ image_info: "_models.ImageInfoProperties",
+ domain_info: "_models.DomainInfoProperties",
+ vm_admin_credentials: "_models.KeyVaultCredentialsProperties",
+ friendly_name: Optional[str] = None,
+ vm_tags: Optional[Dict[str, str]] = None,
+ vm_location: Optional[str] = None,
+ vm_resource_group: Optional[str] = None,
+ availability_zones: Optional[List[int]] = None,
+ custom_configuration_script_url: Optional[str] = None,
+ security_info: Optional["_models.SecurityInfoProperties"] = None,
+ boot_diagnostics_info: Optional["_models.BootDiagnosticsInfoProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :paramtype friendly_name: str
+ :keyword vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :paramtype vm_tags: dict[str, str]
+ :keyword vm_location: The Location for the session host to be created in. It will default to
+ the location of the hostpool if not provided.
+ :paramtype vm_location: str
+ :keyword vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :paramtype vm_resource_group: str
+ :keyword vm_name_prefix: The prefix that should be associated with session host names.
+ Required.
+ :paramtype vm_name_prefix: str
+ :keyword availability_zones: Value for availability zones to be used by the session host.
+ Should be from [1,2,3].
+ :paramtype availability_zones: list[int]
+ :keyword network_info: Network information. Required.
+ :paramtype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoProperties
+ :keyword vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6. Required.
+ :paramtype vm_size_id: str
+ :keyword disk_info: Disk information. Required.
+ :paramtype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoProperties
+ :keyword custom_configuration_script_url: The uri to the storage blob containing the arm
+ template to be run on the virtual machine after provisioning.
+ :paramtype custom_configuration_script_url: str
+ :keyword image_info: Image configurations of HostPool. Required.
+ :paramtype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoProperties
+ :keyword domain_info: Domain configurations of session hosts. Required.
+ :paramtype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoProperties
+ :keyword security_info: Security information.
+ :paramtype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoProperties
+ :keyword vm_admin_credentials: Local Admin credentials for session hosts. Required.
+ :paramtype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :keyword boot_diagnostics_info: Boot Diagnostics information.
+ :paramtype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoProperties
+ """
+ super().__init__(**kwargs)
+ self.version = None
+ self.friendly_name = friendly_name
+ self.vm_tags = vm_tags
+ self.vm_location = vm_location
+ self.vm_resource_group = vm_resource_group
+ self.vm_name_prefix = vm_name_prefix
+ self.availability_zones = availability_zones
+ self.network_info = network_info
+ self.vm_size_id = vm_size_id
+ self.disk_info = disk_info
+ self.custom_configuration_script_url = custom_configuration_script_url
+ self.image_info = image_info
+ self.domain_info = domain_info
+ self.security_info = security_info
+ self.vm_admin_credentials = vm_admin_credentials
+ self.boot_diagnostics_info = boot_diagnostics_info
+
+
+class ActiveSessionHostConfigurationList(_serialization.Model):
+ """List of ActiveSessionHostConfiguration definitions.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: List of ActiveSessionHostConfiguration definitions.
+ :vartype value: list[~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration]
+ :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": "[ActiveSessionHostConfiguration]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(
+ self, *, value: Optional[List["_models.ActiveSessionHostConfiguration"]] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword value: List of ActiveSessionHostConfiguration definitions.
+ :paramtype value: list[~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
class AgentUpdatePatchProperties(_serialization.Model):
"""The session host configuration for updating agent, monitoring agent, and stack component.
@@ -127,47 +449,6 @@ def __init__(
self.maintenance_windows = maintenance_windows
-class Resource(_serialization.Model):
- """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. E.g.
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
- :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
- information.
- :vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
- """
-
- _validation = {
- "id": {"readonly": True},
- "name": {"readonly": True},
- "type": {"readonly": True},
- "system_data": {"readonly": True},
- }
-
- _attribute_map = {
- "id": {"key": "id", "type": "str"},
- "name": {"key": "name", "type": "str"},
- "type": {"key": "type", "type": "str"},
- "system_data": {"key": "systemData", "type": "SystemData"},
- }
-
- def __init__(self, **kwargs: Any) -> None:
- """ """
- super().__init__(**kwargs)
- self.id = None
- self.name = None
- self.type = None
- self.system_data = None
-
-
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top level resource which
has 'tags' and a 'location'.
@@ -287,19 +568,20 @@ def __init__(
self.properties = properties
-class AppAttachPackageInfoProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class AppAttachPackageInfoProperties(_serialization.Model):
"""Schema for Import Package Information properties.
:ivar package_alias: Alias of App Attach Package. Assigned at import time.
:vartype package_alias: str
- :ivar image_path: VHD/CIM image path on Network Share.
+ :ivar image_path: VHD/CIM/APP-V image path on Network Share.
:vartype image_path: str
:ivar package_name: Package Name from appxmanifest.xml.
:vartype package_name: str
- :ivar package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name and
- Publisher name.
+ :ivar package_family_name: Identifier not including the package version, for Msix packages it
+ is the family name from the appxmanifest.xml.
:vartype package_family_name: str
- :ivar package_full_name: Package Full Name from appxmanifest.xml.
+ :ivar package_full_name: Identifier including the package version, for Msix packages it is the
+ full name from the appxmanifest.xml.
:vartype package_full_name: str
:ivar display_name: User friendly Name to be displayed in the portal.
:vartype display_name: str
@@ -312,9 +594,10 @@ class AppAttachPackageInfoProperties(_serialization.Model): # pylint: disable=t
:ivar package_dependencies: List of package dependencies.
:vartype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :ivar version: Package version found in the appxmanifest.xml.
+ :ivar version: Package Version found in the appxmanifest.xml.
:vartype version: str
- :ivar last_updated: Date Package was last updated, found in the appxmanifest.xml.
+ :ivar last_updated: Date the package source was last updated, for Msix packages this is found
+ in the appxmanifest.xml.
:vartype last_updated: ~datetime.datetime
:ivar package_applications: List of package applications.
:vartype package_applications:
@@ -372,14 +655,15 @@ def __init__(
"""
:keyword package_alias: Alias of App Attach Package. Assigned at import time.
:paramtype package_alias: str
- :keyword image_path: VHD/CIM image path on Network Share.
+ :keyword image_path: VHD/CIM/APP-V image path on Network Share.
:paramtype image_path: str
:keyword package_name: Package Name from appxmanifest.xml.
:paramtype package_name: str
- :keyword package_family_name: Package Family Name from appxmanifest.xml. Contains Package Name
- and Publisher name.
+ :keyword package_family_name: Identifier not including the package version, for Msix packages
+ it is the family name from the appxmanifest.xml.
:paramtype package_family_name: str
- :keyword package_full_name: Package Full Name from appxmanifest.xml.
+ :keyword package_full_name: Identifier including the package version, for Msix packages it is
+ the full name from the appxmanifest.xml.
:paramtype package_full_name: str
:keyword display_name: User friendly Name to be displayed in the portal.
:paramtype display_name: str
@@ -392,9 +676,10 @@ def __init__(
:keyword package_dependencies: List of package dependencies.
:paramtype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :keyword version: Package version found in the appxmanifest.xml.
+ :keyword version: Package Version found in the appxmanifest.xml.
:paramtype version: str
- :keyword last_updated: Date Package was last updated, found in the appxmanifest.xml.
+ :keyword last_updated: Date the package source was last updated, for Msix packages this is
+ found in the appxmanifest.xml.
:paramtype last_updated: ~datetime.datetime
:keyword package_applications: List of package applications.
:paramtype package_applications:
@@ -458,7 +743,7 @@ def __init__(self, *, value: Optional[List["_models.AppAttachPackage"]] = None,
class AppAttachPackagePatch(Resource):
- """Schema for updatable App Attach Package properties.
+ """Schema for patchable App Attach Package properties.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -473,6 +758,8 @@ class AppAttachPackagePatch(Resource):
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ :ivar tags: tags to be updated.
+ :vartype tags: dict[str, str]
:ivar properties: Detailed properties for App Attach Package.
:vartype properties: ~azure.mgmt.desktopvirtualization.models.AppAttachPackagePatchProperties
"""
@@ -489,17 +776,25 @@ class AppAttachPackagePatch(Resource):
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
+ "tags": {"key": "tags", "type": "{str}"},
"properties": {"key": "properties", "type": "AppAttachPackagePatchProperties"},
}
def __init__(
- self, *, properties: Optional["_models.AppAttachPackagePatchProperties"] = None, **kwargs: Any
+ self,
+ *,
+ tags: Optional[Dict[str, str]] = None,
+ properties: Optional["_models.AppAttachPackagePatchProperties"] = None,
+ **kwargs: Any
) -> None:
"""
+ :keyword tags: tags to be updated.
+ :paramtype tags: dict[str, str]
:keyword properties: Detailed properties for App Attach Package.
:paramtype properties: ~azure.mgmt.desktopvirtualization.models.AppAttachPackagePatchProperties
"""
super().__init__(**kwargs)
+ self.tags = tags
self.properties = properties
@@ -510,13 +805,19 @@ class AppAttachPackagePatchProperties(_serialization.Model):
:vartype image: ~azure.mgmt.desktopvirtualization.models.AppAttachPackageInfoProperties
:ivar host_pool_references: List of Hostpool resource Ids.
:vartype host_pool_references: list[str]
- :ivar key_vault_url: URL path to certificate name located in keyVault.
+ :ivar key_vault_url: URL of keyvault location to store certificate.
:vartype key_vault_url: str
:ivar fail_health_check_on_staging_failure: Parameter indicating how the health check should
behave if this package fails staging. Known values are: "Unhealthy", "NeedsAssistance", and
"DoNotFail".
:vartype fail_health_check_on_staging_failure: str or
~azure.mgmt.desktopvirtualization.models.FailHealthCheckOnStagingFailure
+ :ivar package_lookback_url: Lookback url to third party control plane, should be null for first
+ party packages.
+ :vartype package_lookback_url: str
+ :ivar custom_data: Field that can be populated with custom data and filtered on in list GET
+ calls.
+ :vartype custom_data: str
"""
_attribute_map = {
@@ -524,6 +825,8 @@ class AppAttachPackagePatchProperties(_serialization.Model):
"host_pool_references": {"key": "hostPoolReferences", "type": "[str]"},
"key_vault_url": {"key": "keyVaultURL", "type": "str"},
"fail_health_check_on_staging_failure": {"key": "failHealthCheckOnStagingFailure", "type": "str"},
+ "package_lookback_url": {"key": "packageLookbackUrl", "type": "str"},
+ "custom_data": {"key": "customData", "type": "str"},
}
def __init__(
@@ -533,6 +836,8 @@ def __init__(
host_pool_references: Optional[List[str]] = None,
key_vault_url: Optional[str] = None,
fail_health_check_on_staging_failure: Optional[Union[str, "_models.FailHealthCheckOnStagingFailure"]] = None,
+ package_lookback_url: Optional[str] = None,
+ custom_data: Optional[str] = None,
**kwargs: Any
) -> None:
"""
@@ -540,19 +845,27 @@ def __init__(
:paramtype image: ~azure.mgmt.desktopvirtualization.models.AppAttachPackageInfoProperties
:keyword host_pool_references: List of Hostpool resource Ids.
:paramtype host_pool_references: list[str]
- :keyword key_vault_url: URL path to certificate name located in keyVault.
+ :keyword key_vault_url: URL of keyvault location to store certificate.
:paramtype key_vault_url: str
:keyword fail_health_check_on_staging_failure: Parameter indicating how the health check should
behave if this package fails staging. Known values are: "Unhealthy", "NeedsAssistance", and
"DoNotFail".
:paramtype fail_health_check_on_staging_failure: str or
~azure.mgmt.desktopvirtualization.models.FailHealthCheckOnStagingFailure
+ :keyword package_lookback_url: Lookback url to third party control plane, should be null for
+ first party packages.
+ :paramtype package_lookback_url: str
+ :keyword custom_data: Field that can be populated with custom data and filtered on in list GET
+ calls.
+ :paramtype custom_data: str
"""
super().__init__(**kwargs)
self.image = image
self.host_pool_references = host_pool_references
self.key_vault_url = key_vault_url
self.fail_health_check_on_staging_failure = fail_health_check_on_staging_failure
+ self.package_lookback_url = package_lookback_url
+ self.custom_data = custom_data
class AppAttachPackageProperties(_serialization.Model):
@@ -567,13 +880,22 @@ class AppAttachPackageProperties(_serialization.Model):
:vartype image: ~azure.mgmt.desktopvirtualization.models.AppAttachPackageInfoProperties
:ivar host_pool_references: List of Hostpool resource Ids.
:vartype host_pool_references: list[str]
- :ivar key_vault_url: URL path to certificate name located in keyVault.
+ :ivar key_vault_url: URL of keyvault location to store certificate.
:vartype key_vault_url: str
:ivar fail_health_check_on_staging_failure: Parameter indicating how the health check should
behave if this package fails staging. Known values are: "Unhealthy", "NeedsAssistance", and
"DoNotFail".
:vartype fail_health_check_on_staging_failure: str or
~azure.mgmt.desktopvirtualization.models.FailHealthCheckOnStagingFailure
+ :ivar package_owner_name: Specific name of package owner, is "AppAttach" for native app attach
+ packages.
+ :vartype package_owner_name: str
+ :ivar package_lookback_url: Lookback url to third party control plane, is null for native app
+ attach packages.
+ :vartype package_lookback_url: str
+ :ivar custom_data: Field that can be populated with custom data and filtered on in list GET
+ calls.
+ :vartype custom_data: str
"""
_validation = {
@@ -586,6 +908,9 @@ class AppAttachPackageProperties(_serialization.Model):
"host_pool_references": {"key": "hostPoolReferences", "type": "[str]"},
"key_vault_url": {"key": "keyVaultURL", "type": "str"},
"fail_health_check_on_staging_failure": {"key": "failHealthCheckOnStagingFailure", "type": "str"},
+ "package_owner_name": {"key": "packageOwnerName", "type": "str"},
+ "package_lookback_url": {"key": "packageLookbackUrl", "type": "str"},
+ "custom_data": {"key": "customData", "type": "str"},
}
def __init__(
@@ -595,6 +920,9 @@ def __init__(
host_pool_references: Optional[List[str]] = None,
key_vault_url: Optional[str] = None,
fail_health_check_on_staging_failure: Optional[Union[str, "_models.FailHealthCheckOnStagingFailure"]] = None,
+ package_owner_name: Optional[str] = None,
+ package_lookback_url: Optional[str] = None,
+ custom_data: Optional[str] = None,
**kwargs: Any
) -> None:
"""
@@ -602,13 +930,22 @@ def __init__(
:paramtype image: ~azure.mgmt.desktopvirtualization.models.AppAttachPackageInfoProperties
:keyword host_pool_references: List of Hostpool resource Ids.
:paramtype host_pool_references: list[str]
- :keyword key_vault_url: URL path to certificate name located in keyVault.
+ :keyword key_vault_url: URL of keyvault location to store certificate.
:paramtype key_vault_url: str
:keyword fail_health_check_on_staging_failure: Parameter indicating how the health check should
behave if this package fails staging. Known values are: "Unhealthy", "NeedsAssistance", and
"DoNotFail".
:paramtype fail_health_check_on_staging_failure: str or
~azure.mgmt.desktopvirtualization.models.FailHealthCheckOnStagingFailure
+ :keyword package_owner_name: Specific name of package owner, is "AppAttach" for native app
+ attach packages.
+ :paramtype package_owner_name: str
+ :keyword package_lookback_url: Lookback url to third party control plane, is null for native
+ app attach packages.
+ :paramtype package_lookback_url: str
+ :keyword custom_data: Field that can be populated with custom data and filtered on in list GET
+ calls.
+ :paramtype custom_data: str
"""
super().__init__(**kwargs)
self.provisioning_state = None
@@ -616,9 +953,12 @@ def __init__(
self.host_pool_references = host_pool_references
self.key_vault_url = key_vault_url
self.fail_health_check_on_staging_failure = fail_health_check_on_staging_failure
+ self.package_owner_name = package_owner_name
+ self.package_lookback_url = package_lookback_url
+ self.custom_data = custom_data
-class Application(Resource): # pylint: disable=too-many-instance-attributes
+class Application(Resource):
"""Schema for Application properties.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -770,7 +1110,7 @@ def __init__(
self.icon_content = None
-class ResourceModelWithAllowedPropertySet(TrackedResource): # pylint: disable=too-many-instance-attributes
+class ResourceModelWithAllowedPropertySet(TrackedResource):
"""The resource model definition containing the full set of allowed properties for a resource.
Except properties bag, there cannot be a top level property outside of this set.
@@ -808,13 +1148,12 @@ class ResourceModelWithAllowedPropertySet(TrackedResource): # pylint: disable=t
the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range
(section 14.27) header fields.
:vartype etag: str
- :ivar identity:
- :vartype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :ivar sku:
- :vartype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :ivar plan:
- :vartype plan: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :ivar identity: Managed service identity (system assigned and/or user assigned identities).
+ :vartype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :ivar sku: The resource model definition representing SKU.
+ :vartype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :ivar plan: Plan for the resource.
+ :vartype plan: ~azure.mgmt.desktopvirtualization.models.Plan
"""
_validation = {
@@ -837,9 +1176,9 @@ class ResourceModelWithAllowedPropertySet(TrackedResource): # pylint: disable=t
"managed_by": {"key": "managedBy", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"etag": {"key": "etag", "type": "str"},
- "identity": {"key": "identity", "type": "ResourceModelWithAllowedPropertySetIdentity"},
- "sku": {"key": "sku", "type": "ResourceModelWithAllowedPropertySetSku"},
- "plan": {"key": "plan", "type": "ResourceModelWithAllowedPropertySetPlan"},
+ "identity": {"key": "identity", "type": "ManagedServiceIdentity"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "plan": {"key": "plan", "type": "Plan"},
}
def __init__(
@@ -849,9 +1188,9 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
managed_by: Optional[str] = None,
kind: Optional[str] = None,
- identity: Optional["_models.ResourceModelWithAllowedPropertySetIdentity"] = None,
- sku: Optional["_models.ResourceModelWithAllowedPropertySetSku"] = None,
- plan: Optional["_models.ResourceModelWithAllowedPropertySetPlan"] = None,
+ identity: Optional["_models.ManagedServiceIdentity"] = None,
+ sku: Optional["_models.Sku"] = None,
+ plan: Optional["_models.Plan"] = None,
**kwargs: Any
) -> None:
"""
@@ -868,14 +1207,12 @@ def __init__(
resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported,
the resource provider must validate and persist this value.
:paramtype kind: str
- :keyword identity:
- :paramtype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :keyword sku:
- :paramtype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :keyword plan:
- :paramtype plan:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :keyword identity: Managed service identity (system assigned and/or user assigned identities).
+ :paramtype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :keyword sku: The resource model definition representing SKU.
+ :paramtype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :keyword plan: Plan for the resource.
+ :paramtype plan: ~azure.mgmt.desktopvirtualization.models.Plan
"""
super().__init__(tags=tags, location=location, **kwargs)
self.managed_by = managed_by
@@ -886,7 +1223,7 @@ def __init__(
self.plan = plan
-class ApplicationGroup(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many-instance-attributes
+class ApplicationGroup(ResourceModelWithAllowedPropertySet):
"""Represents a ApplicationGroup definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -923,13 +1260,12 @@ class ApplicationGroup(ResourceModelWithAllowedPropertySet): # pylint: disable=
the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range
(section 14.27) header fields.
:vartype etag: str
- :ivar identity:
- :vartype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :ivar sku:
- :vartype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :ivar plan:
- :vartype plan: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :ivar identity: Managed service identity (system assigned and/or user assigned identities).
+ :vartype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :ivar sku: The resource model definition representing SKU.
+ :vartype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :ivar plan: Plan for the resource.
+ :vartype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:ivar object_id: ObjectId of ApplicationGroup. (internal use).
:vartype object_id: str
:ivar description: Description of ApplicationGroup.
@@ -975,9 +1311,9 @@ class ApplicationGroup(ResourceModelWithAllowedPropertySet): # pylint: disable=
"managed_by": {"key": "managedBy", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"etag": {"key": "etag", "type": "str"},
- "identity": {"key": "identity", "type": "ResourceModelWithAllowedPropertySetIdentity"},
- "sku": {"key": "sku", "type": "ResourceModelWithAllowedPropertySetSku"},
- "plan": {"key": "plan", "type": "ResourceModelWithAllowedPropertySetPlan"},
+ "identity": {"key": "identity", "type": "ManagedServiceIdentity"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "plan": {"key": "plan", "type": "Plan"},
"object_id": {"key": "properties.objectId", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
@@ -997,9 +1333,9 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
managed_by: Optional[str] = None,
kind: Optional[str] = None,
- identity: Optional["_models.ResourceModelWithAllowedPropertySetIdentity"] = None,
- sku: Optional["_models.ResourceModelWithAllowedPropertySetSku"] = None,
- plan: Optional["_models.ResourceModelWithAllowedPropertySetPlan"] = None,
+ identity: Optional["_models.ManagedServiceIdentity"] = None,
+ sku: Optional["_models.Sku"] = None,
+ plan: Optional["_models.Plan"] = None,
description: Optional[str] = None,
friendly_name: Optional[str] = None,
show_in_feed: Optional[bool] = None,
@@ -1019,14 +1355,12 @@ def __init__(
resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported,
the resource provider must validate and persist this value.
:paramtype kind: str
- :keyword identity:
- :paramtype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :keyword sku:
- :paramtype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :keyword plan:
- :paramtype plan:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :keyword identity: Managed service identity (system assigned and/or user assigned identities).
+ :paramtype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :keyword sku: The resource model definition representing SKU.
+ :paramtype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :keyword plan: Plan for the resource.
+ :paramtype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:keyword description: Description of ApplicationGroup.
:paramtype description: str
:keyword friendly_name: Friendly name of ApplicationGroup.
@@ -1190,7 +1524,7 @@ def __init__(self, *, value: Optional[List["_models.Application"]] = None, **kwa
self.next_link = None
-class ApplicationPatch(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ApplicationPatch(_serialization.Model):
"""Application properties that can be patched.
:ivar tags: tags to be updated.
@@ -1307,6 +1641,98 @@ def __init__(
self.application_type = application_type
+class AzureActiveDirectoryInfoProperties(_serialization.Model):
+ """Azure Active directory info. Only one should be populated based on the join type.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar mdm_provider_guid: The Mobile Device Management(MDM) guid. Required.
+ :vartype mdm_provider_guid: str
+ """
+
+ _validation = {
+ "mdm_provider_guid": {"required": True},
+ }
+
+ _attribute_map = {
+ "mdm_provider_guid": {"key": "mdmProviderGuid", "type": "str"},
+ }
+
+ def __init__(self, *, mdm_provider_guid: str, **kwargs: Any) -> None:
+ """
+ :keyword mdm_provider_guid: The Mobile Device Management(MDM) guid. Required.
+ :paramtype mdm_provider_guid: str
+ """
+ super().__init__(**kwargs)
+ self.mdm_provider_guid = mdm_provider_guid
+
+
+class BootDiagnosticsInfoPatchProperties(_serialization.Model):
+ """Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot
+ to diagnose VM status. :code:`
`:code:`
` You can easily view the output of your console
+ log. :code:`
`:code:`
` Azure also enables you to see a screenshot of the VM from the
+ hypervisor.
+
+ :ivar enabled: Whether boot diagnostics should be enabled on the Virtual Machine.
+ :vartype enabled: bool
+ :ivar storage_uri: Uri of the storage account to use for placing the console output and
+ screenshot. :code:`
`:code:`
`If storageUri is not specified while enabling boot
+ diagnostics, managed storage will be used.
+ :vartype storage_uri: str
+ """
+
+ _attribute_map = {
+ "enabled": {"key": "enabled", "type": "bool"},
+ "storage_uri": {"key": "storageUri", "type": "str"},
+ }
+
+ def __init__(self, *, enabled: Optional[bool] = None, storage_uri: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword enabled: Whether boot diagnostics should be enabled on the Virtual Machine.
+ :paramtype enabled: bool
+ :keyword storage_uri: Uri of the storage account to use for placing the console output and
+ screenshot. :code:`
`:code:`
`If storageUri is not specified while enabling boot
+ diagnostics, managed storage will be used.
+ :paramtype storage_uri: str
+ """
+ super().__init__(**kwargs)
+ self.enabled = enabled
+ self.storage_uri = storage_uri
+
+
+class BootDiagnosticsInfoProperties(_serialization.Model):
+ """Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot
+ to diagnose VM status. :code:`
`:code:`
` You can easily view the output of your console
+ log. :code:`
`:code:`
` Azure also enables you to see a screenshot of the VM from the
+ hypervisor.
+
+ :ivar enabled: Whether boot diagnostics should be enabled on the Virtual Machine.
+ :vartype enabled: bool
+ :ivar storage_uri: Uri of the storage account to use for placing the console output and
+ screenshot. :code:`
`:code:`
`If storageUri is not specified while enabling boot
+ diagnostics, managed storage will be used.
+ :vartype storage_uri: str
+ """
+
+ _attribute_map = {
+ "enabled": {"key": "enabled", "type": "bool"},
+ "storage_uri": {"key": "storageUri", "type": "str"},
+ }
+
+ def __init__(self, *, enabled: Optional[bool] = None, storage_uri: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword enabled: Whether boot diagnostics should be enabled on the Virtual Machine.
+ :paramtype enabled: bool
+ :keyword storage_uri: Uri of the storage account to use for placing the console output and
+ screenshot. :code:`
`:code:`
`If storageUri is not specified while enabling boot
+ diagnostics, managed storage will be used.
+ :paramtype storage_uri: str
+ """
+ super().__init__(**kwargs)
+ self.enabled = enabled
+ self.storage_uri = storage_uri
+
+
class CloudErrorProperties(_serialization.Model):
"""Cloud error object properties.
@@ -1333,20 +1759,66 @@ def __init__(self, *, code: Optional[str] = None, message: Optional[str] = None,
self.message = message
-class Desktop(Resource):
- """Schema for Desktop properties.
+class CustomInfoPatchProperties(_serialization.Model):
+ """Custom image information.
- Variables are only populated by the server, and will be ignored when sending a request.
+ :ivar resource_id: The resource id of the custom image.
+ :vartype resource_id: str
+ """
- :ivar id: Fully qualified resource ID for the resource. E.g.
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
- :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ _attribute_map = {
+ "resource_id": {"key": "resourceId", "type": "str"},
+ }
+
+ def __init__(self, *, resource_id: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword resource_id: The resource id of the custom image.
+ :paramtype resource_id: str
+ """
+ super().__init__(**kwargs)
+ self.resource_id = resource_id
+
+
+class CustomInfoProperties(_serialization.Model):
+ """Custom image information.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar resource_id: The resource id of the custom image. Required.
+ :vartype resource_id: str
+ """
+
+ _validation = {
+ "resource_id": {"required": True},
+ }
+
+ _attribute_map = {
+ "resource_id": {"key": "resourceId", "type": "str"},
+ }
+
+ def __init__(self, *, resource_id: str, **kwargs: Any) -> None:
+ """
+ :keyword resource_id: The resource id of the custom image. Required.
+ :paramtype resource_id: str
+ """
+ super().__init__(**kwargs)
+ self.resource_id = resource_id
+
+
+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. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
:ivar object_id: ObjectId of Desktop. (internal use).
@@ -1469,6 +1941,140 @@ def __init__(
self.friendly_name = friendly_name
+class DiskInfoPatchProperties(_serialization.Model):
+ """Disk information.
+
+ :ivar type: The disk type used by virtual machine in hostpool session host. Known values are:
+ "Standard_LRS", "Premium_LRS", and "StandardSSD_LRS".
+ :vartype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineDiskType
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(self, *, type: Optional[Union[str, "_models.VirtualMachineDiskType"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword type: The disk type used by virtual machine in hostpool session host. Known values
+ are: "Standard_LRS", "Premium_LRS", and "StandardSSD_LRS".
+ :paramtype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineDiskType
+ """
+ super().__init__(**kwargs)
+ self.type = type
+
+
+class DiskInfoProperties(_serialization.Model):
+ """Disk information.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar type: The disk type used by virtual machine in hostpool session host. Required. Known
+ values are: "Standard_LRS", "Premium_LRS", and "StandardSSD_LRS".
+ :vartype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineDiskType
+ """
+
+ _validation = {
+ "type": {"required": True},
+ }
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ }
+
+ def __init__(self, *, type: Union[str, "_models.VirtualMachineDiskType"], **kwargs: Any) -> None:
+ """
+ :keyword type: The disk type used by virtual machine in hostpool session host. Required. Known
+ values are: "Standard_LRS", "Premium_LRS", and "StandardSSD_LRS".
+ :paramtype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineDiskType
+ """
+ super().__init__(**kwargs)
+ self.type = type
+
+
+class DomainInfoPatchProperties(_serialization.Model):
+ """Domain configurations of session hosts.
+
+ :ivar active_directory_info: Active directory info. Only one should be populated based on the
+ join type.
+ :vartype active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.ActiveDirectoryInfoPatchProperties
+ """
+
+ _attribute_map = {
+ "active_directory_info": {"key": "activeDirectoryInfo", "type": "ActiveDirectoryInfoPatchProperties"},
+ }
+
+ def __init__(
+ self, *, active_directory_info: Optional["_models.ActiveDirectoryInfoPatchProperties"] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword active_directory_info: Active directory info. Only one should be populated based on
+ the join type.
+ :paramtype active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.ActiveDirectoryInfoPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.active_directory_info = active_directory_info
+
+
+class DomainInfoProperties(_serialization.Model):
+ """Domain configurations of session hosts.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar join_type: The type of domain join done by the virtual machine. Required. Known values
+ are: "ActiveDirectory" and "AzureActiveDirectory".
+ :vartype join_type: str or ~azure.mgmt.desktopvirtualization.models.DomainJoinType
+ :ivar active_directory_info: Active directory info. Only one should be populated based on the
+ join type.
+ :vartype active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.ActiveDirectoryInfoProperties
+ :ivar azure_active_directory_info: Azure active directory info. Only one should be populated
+ based on the join type.
+ :vartype azure_active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.AzureActiveDirectoryInfoProperties
+ """
+
+ _validation = {
+ "join_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "join_type": {"key": "joinType", "type": "str"},
+ "active_directory_info": {"key": "activeDirectoryInfo", "type": "ActiveDirectoryInfoProperties"},
+ "azure_active_directory_info": {
+ "key": "azureActiveDirectoryInfo",
+ "type": "AzureActiveDirectoryInfoProperties",
+ },
+ }
+
+ def __init__(
+ self,
+ *,
+ join_type: Union[str, "_models.DomainJoinType"],
+ active_directory_info: Optional["_models.ActiveDirectoryInfoProperties"] = None,
+ azure_active_directory_info: Optional["_models.AzureActiveDirectoryInfoProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword join_type: The type of domain join done by the virtual machine. Required. Known values
+ are: "ActiveDirectory" and "AzureActiveDirectory".
+ :paramtype join_type: str or ~azure.mgmt.desktopvirtualization.models.DomainJoinType
+ :keyword active_directory_info: Active directory info. Only one should be populated based on
+ the join type.
+ :paramtype active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.ActiveDirectoryInfoProperties
+ :keyword azure_active_directory_info: Azure active directory info. Only one should be populated
+ based on the join type.
+ :paramtype azure_active_directory_info:
+ ~azure.mgmt.desktopvirtualization.models.AzureActiveDirectoryInfoProperties
+ """
+ super().__init__(**kwargs)
+ self.join_type = join_type
+ self.active_directory_info = active_directory_info
+ self.azure_active_directory_info = azure_active_directory_info
+
+
class ErrorAdditionalInfo(_serialization.Model):
"""The resource management error additional info.
@@ -1561,7 +2167,7 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A
self.error = error
-class ExpandMsixImage(Resource): # pylint: disable=too-many-instance-attributes
+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.
@@ -1599,7 +2205,7 @@ class ExpandMsixImage(Resource): # pylint: disable=too-many-instance-attributes
:ivar package_dependencies: List of package dependencies.
:vartype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :ivar version: Package version found in the appxmanifest.xml.
+ :ivar version: Package Version found in the appxmanifest.xml.
:vartype version: str
:ivar last_updated: Date Package was last updated, found in the appxmanifest.xml.
:vartype last_updated: ~datetime.datetime
@@ -1684,7 +2290,7 @@ def __init__(
:keyword package_dependencies: List of package dependencies.
:paramtype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :keyword version: Package version found in the appxmanifest.xml.
+ :keyword version: Package Version found in the appxmanifest.xml.
:paramtype version: str
:keyword last_updated: Date Package was last updated, found in the appxmanifest.xml.
:paramtype last_updated: ~datetime.datetime
@@ -1744,7 +2350,7 @@ def __init__(self, *, value: Optional[List["_models.ExpandMsixImage"]] = None, *
self.next_link = None
-class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many-instance-attributes
+class HostPool(ResourceModelWithAllowedPropertySet):
"""Represents a HostPool definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -1781,13 +2387,12 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range
(section 14.27) header fields.
:vartype etag: str
- :ivar identity:
- :vartype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :ivar sku:
- :vartype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :ivar plan:
- :vartype plan: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :ivar identity: Managed service identity (system assigned and/or user assigned identities).
+ :vartype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :ivar sku: The resource model definition representing SKU.
+ :vartype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :ivar plan: Plan for the resource.
+ :vartype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:ivar object_id: ObjectId of HostPool. (internal use).
:vartype object_id: str
:ivar friendly_name: Friendly name of HostPool.
@@ -1806,16 +2411,21 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
:ivar max_session_limit: The max session limit of HostPool.
:vartype max_session_limit: int
:ivar load_balancer_type: The type of the load balancer. Required. Known values are:
- "BreadthFirst", "DepthFirst", and "Persistent".
+ "BreadthFirst", "DepthFirst", "Persistent", and "MultiplePersistent".
:vartype load_balancer_type: str or ~azure.mgmt.desktopvirtualization.models.LoadBalancerType
:ivar ring: The ring number of HostPool.
:vartype ring: int
:ivar validation_environment: Is validation environment.
:vartype validation_environment: bool
- :ivar registration_info: The registration info of HostPool.
+ :ivar registration_info: The registration info of HostPool. This is not returned on GET. In
+ order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens
+ POST calls.
:vartype registration_info: ~azure.mgmt.desktopvirtualization.models.RegistrationInfo
:ivar vm_template: VM template for sessionhosts configuration within hostpool.
:vartype vm_template: str
+ :ivar management_type: The type of management for this hostpool, Automated or Standard. The
+ default value is Automated. Known values are: "Automated" and "Standard".
+ :vartype management_type: str or ~azure.mgmt.desktopvirtualization.models.ManagementType
:ivar application_group_references: List of applicationGroup links.
:vartype application_group_references: list[str]
:ivar app_attach_package_references: List of App Attach Package links.
@@ -1853,6 +2463,30 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
specified resource.
:vartype private_endpoint_connections:
list[~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnection]
+ :ivar managed_private_udp: Default: AVD-wide settings are used to determine connection
+ availability, Enabled: UDP will attempt this connection type when making connections. This
+ means that this connection is possible, but is not guaranteed, as there are other factors that
+ may prevent this connection type, Disabled: UDP will not attempt this connection type when
+ making connections. Known values are: "Default", "Enabled", and "Disabled".
+ :vartype managed_private_udp: str or ~azure.mgmt.desktopvirtualization.models.ManagedPrivateUDP
+ :ivar direct_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype direct_udp: str or ~azure.mgmt.desktopvirtualization.models.DirectUDP
+ :ivar public_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype public_udp: str or ~azure.mgmt.desktopvirtualization.models.PublicUDP
+ :ivar relay_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype relay_udp: str or ~azure.mgmt.desktopvirtualization.models.RelayUDP
"""
_validation = {
@@ -1883,9 +2517,9 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
"managed_by": {"key": "managedBy", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"etag": {"key": "etag", "type": "str"},
- "identity": {"key": "identity", "type": "ResourceModelWithAllowedPropertySetIdentity"},
- "sku": {"key": "sku", "type": "ResourceModelWithAllowedPropertySetSku"},
- "plan": {"key": "plan", "type": "ResourceModelWithAllowedPropertySetPlan"},
+ "identity": {"key": "identity", "type": "ManagedServiceIdentity"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "plan": {"key": "plan", "type": "Plan"},
"object_id": {"key": "properties.objectId", "type": "str"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
@@ -1898,6 +2532,7 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
"validation_environment": {"key": "properties.validationEnvironment", "type": "bool"},
"registration_info": {"key": "properties.registrationInfo", "type": "RegistrationInfo"},
"vm_template": {"key": "properties.vmTemplate", "type": "str"},
+ "management_type": {"key": "properties.managementType", "type": "str"},
"application_group_references": {"key": "properties.applicationGroupReferences", "type": "[str]"},
"app_attach_package_references": {"key": "properties.appAttachPackageReferences", "type": "[str]"},
"ssoadfs_authority": {"key": "properties.ssoadfsAuthority", "type": "str"},
@@ -1913,6 +2548,10 @@ class HostPool(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many
"key": "properties.privateEndpointConnections",
"type": "[PrivateEndpointConnection]",
},
+ "managed_private_udp": {"key": "properties.managedPrivateUDP", "type": "str"},
+ "direct_udp": {"key": "properties.directUDP", "type": "str"},
+ "public_udp": {"key": "properties.publicUDP", "type": "str"},
+ "relay_udp": {"key": "properties.relayUDP", "type": "str"},
}
def __init__( # pylint: disable=too-many-locals
@@ -1925,9 +2564,9 @@ def __init__( # pylint: disable=too-many-locals
tags: Optional[Dict[str, str]] = None,
managed_by: Optional[str] = None,
kind: Optional[str] = None,
- identity: Optional["_models.ResourceModelWithAllowedPropertySetIdentity"] = None,
- sku: Optional["_models.ResourceModelWithAllowedPropertySetSku"] = None,
- plan: Optional["_models.ResourceModelWithAllowedPropertySetPlan"] = None,
+ identity: Optional["_models.ManagedServiceIdentity"] = None,
+ sku: Optional["_models.Sku"] = None,
+ plan: Optional["_models.Plan"] = None,
friendly_name: Optional[str] = None,
description: Optional[str] = None,
personal_desktop_assignment_type: Optional[Union[str, "_models.PersonalDesktopAssignmentType"]] = None,
@@ -1937,6 +2576,7 @@ def __init__( # pylint: disable=too-many-locals
validation_environment: Optional[bool] = None,
registration_info: Optional["_models.RegistrationInfo"] = None,
vm_template: Optional[str] = None,
+ management_type: Optional[Union[str, "_models.ManagementType"]] = None,
ssoadfs_authority: Optional[str] = None,
sso_client_id: Optional[str] = None,
sso_client_secret_key_vault_path: Optional[str] = None,
@@ -1944,6 +2584,10 @@ def __init__( # pylint: disable=too-many-locals
start_vm_on_connect: Optional[bool] = None,
public_network_access: Optional[Union[str, "_models.HostpoolPublicNetworkAccess"]] = None,
agent_update: Optional["_models.AgentUpdateProperties"] = None,
+ managed_private_udp: Optional[Union[str, "_models.ManagedPrivateUDP"]] = None,
+ direct_udp: Optional[Union[str, "_models.DirectUDP"]] = None,
+ public_udp: Optional[Union[str, "_models.PublicUDP"]] = None,
+ relay_udp: Optional[Union[str, "_models.RelayUDP"]] = None,
**kwargs: Any
) -> None:
"""
@@ -1960,14 +2604,12 @@ def __init__( # pylint: disable=too-many-locals
resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported,
the resource provider must validate and persist this value.
:paramtype kind: str
- :keyword identity:
- :paramtype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :keyword sku:
- :paramtype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :keyword plan:
- :paramtype plan:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :keyword identity: Managed service identity (system assigned and/or user assigned identities).
+ :paramtype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :keyword sku: The resource model definition representing SKU.
+ :paramtype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :keyword plan: Plan for the resource.
+ :paramtype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:keyword friendly_name: Friendly name of HostPool.
:paramtype friendly_name: str
:keyword description: Description of HostPool.
@@ -1984,16 +2626,21 @@ def __init__( # pylint: disable=too-many-locals
:keyword max_session_limit: The max session limit of HostPool.
:paramtype max_session_limit: int
:keyword load_balancer_type: The type of the load balancer. Required. Known values are:
- "BreadthFirst", "DepthFirst", and "Persistent".
+ "BreadthFirst", "DepthFirst", "Persistent", and "MultiplePersistent".
:paramtype load_balancer_type: str or ~azure.mgmt.desktopvirtualization.models.LoadBalancerType
:keyword ring: The ring number of HostPool.
:paramtype ring: int
:keyword validation_environment: Is validation environment.
:paramtype validation_environment: bool
- :keyword registration_info: The registration info of HostPool.
+ :keyword registration_info: The registration info of HostPool. This is not returned on GET. In
+ order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens
+ POST calls.
:paramtype registration_info: ~azure.mgmt.desktopvirtualization.models.RegistrationInfo
:keyword vm_template: VM template for sessionhosts configuration within hostpool.
:paramtype vm_template: str
+ :keyword management_type: The type of management for this hostpool, Automated or Standard. The
+ default value is Automated. Known values are: "Automated" and "Standard".
+ :paramtype management_type: str or ~azure.mgmt.desktopvirtualization.models.ManagementType
:keyword ssoadfs_authority: URL to customer ADFS server for signing WVD SSO certificates.
:paramtype ssoadfs_authority: str
:keyword sso_client_id: ClientId for the registered Relying Party used to issue WVD SSO
@@ -2021,6 +2668,31 @@ def __init__( # pylint: disable=too-many-locals
:keyword agent_update: The session host configuration for updating agent, monitoring agent, and
stack component.
:paramtype agent_update: ~azure.mgmt.desktopvirtualization.models.AgentUpdateProperties
+ :keyword managed_private_udp: Default: AVD-wide settings are used to determine connection
+ availability, Enabled: UDP will attempt this connection type when making connections. This
+ means that this connection is possible, but is not guaranteed, as there are other factors that
+ may prevent this connection type, Disabled: UDP will not attempt this connection type when
+ making connections. Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype managed_private_udp: str or
+ ~azure.mgmt.desktopvirtualization.models.ManagedPrivateUDP
+ :keyword direct_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype direct_udp: str or ~azure.mgmt.desktopvirtualization.models.DirectUDP
+ :keyword public_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype public_udp: str or ~azure.mgmt.desktopvirtualization.models.PublicUDP
+ :keyword relay_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype relay_udp: str or ~azure.mgmt.desktopvirtualization.models.RelayUDP
"""
super().__init__(
tags=tags,
@@ -2044,6 +2716,7 @@ def __init__( # pylint: disable=too-many-locals
self.validation_environment = validation_environment
self.registration_info = registration_info
self.vm_template = vm_template
+ self.management_type = management_type
self.application_group_references = None
self.app_attach_package_references = None
self.ssoadfs_authority = ssoadfs_authority
@@ -2056,6 +2729,10 @@ def __init__( # pylint: disable=too-many-locals
self.public_network_access = public_network_access
self.agent_update = agent_update
self.private_endpoint_connections = None
+ self.managed_private_udp = managed_private_udp
+ self.direct_udp = direct_udp
+ self.public_udp = public_udp
+ self.relay_udp = relay_udp
class HostPoolList(_serialization.Model):
@@ -2088,7 +2765,7 @@ def __init__(self, *, value: Optional[List["_models.HostPool"]] = None, **kwargs
self.next_link = None
-class HostPoolPatch(Resource): # pylint: disable=too-many-instance-attributes
+class HostPoolPatch(Resource):
"""HostPool properties that can be patched.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -2119,13 +2796,15 @@ class HostPoolPatch(Resource): # pylint: disable=too-many-instance-attributes
:vartype personal_desktop_assignment_type: str or
~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType
:ivar load_balancer_type: The type of the load balancer. Known values are: "BreadthFirst",
- "DepthFirst", and "Persistent".
+ "DepthFirst", "Persistent", and "MultiplePersistent".
:vartype load_balancer_type: str or ~azure.mgmt.desktopvirtualization.models.LoadBalancerType
:ivar ring: The ring number of HostPool.
:vartype ring: int
:ivar validation_environment: Is validation environment.
:vartype validation_environment: bool
- :ivar registration_info: The registration info of HostPool.
+ :ivar registration_info: The registration info of HostPool. This is not returned on GET. In
+ order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens
+ POST calls.
:vartype registration_info: ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch
:ivar vm_template: VM template for sessionhosts configuration within hostpool.
:vartype vm_template: str
@@ -2154,6 +2833,30 @@ class HostPoolPatch(Resource): # pylint: disable=too-many-instance-attributes
:ivar agent_update: The session host configuration for updating agent, monitoring agent, and
stack component.
:vartype agent_update: ~azure.mgmt.desktopvirtualization.models.AgentUpdatePatchProperties
+ :ivar managed_private_udp: Default: AVD-wide settings are used to determine connection
+ availability, Enabled: UDP will attempt this connection type when making connections. This
+ means that this connection is possible, but is not guaranteed, as there are other factors that
+ may prevent this connection type, Disabled: UDP will not attempt this connection type when
+ making connections. Known values are: "Default", "Enabled", and "Disabled".
+ :vartype managed_private_udp: str or ~azure.mgmt.desktopvirtualization.models.ManagedPrivateUDP
+ :ivar direct_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype direct_udp: str or ~azure.mgmt.desktopvirtualization.models.DirectUDP
+ :ivar public_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype public_udp: str or ~azure.mgmt.desktopvirtualization.models.PublicUDP
+ :ivar relay_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :vartype relay_udp: str or ~azure.mgmt.desktopvirtualization.models.RelayUDP
"""
_validation = {
@@ -2187,9 +2890,13 @@ class HostPoolPatch(Resource): # pylint: disable=too-many-instance-attributes
"start_vm_on_connect": {"key": "properties.startVMOnConnect", "type": "bool"},
"public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"},
"agent_update": {"key": "properties.agentUpdate", "type": "AgentUpdatePatchProperties"},
+ "managed_private_udp": {"key": "properties.managedPrivateUDP", "type": "str"},
+ "direct_udp": {"key": "properties.directUDP", "type": "str"},
+ "public_udp": {"key": "properties.publicUDP", "type": "str"},
+ "relay_udp": {"key": "properties.relayUDP", "type": "str"},
}
- def __init__(
+ def __init__( # pylint: disable=too-many-locals
self,
*,
tags: Optional[Dict[str, str]] = None,
@@ -2211,6 +2918,10 @@ def __init__(
start_vm_on_connect: Optional[bool] = None,
public_network_access: Optional[Union[str, "_models.HostpoolPublicNetworkAccess"]] = None,
agent_update: Optional["_models.AgentUpdatePatchProperties"] = None,
+ managed_private_udp: Optional[Union[str, "_models.ManagedPrivateUDP"]] = None,
+ direct_udp: Optional[Union[str, "_models.DirectUDP"]] = None,
+ public_udp: Optional[Union[str, "_models.PublicUDP"]] = None,
+ relay_udp: Optional[Union[str, "_models.RelayUDP"]] = None,
**kwargs: Any
) -> None:
"""
@@ -2229,13 +2940,15 @@ def __init__(
:paramtype personal_desktop_assignment_type: str or
~azure.mgmt.desktopvirtualization.models.PersonalDesktopAssignmentType
:keyword load_balancer_type: The type of the load balancer. Known values are: "BreadthFirst",
- "DepthFirst", and "Persistent".
+ "DepthFirst", "Persistent", and "MultiplePersistent".
:paramtype load_balancer_type: str or ~azure.mgmt.desktopvirtualization.models.LoadBalancerType
:keyword ring: The ring number of HostPool.
:paramtype ring: int
:keyword validation_environment: Is validation environment.
:paramtype validation_environment: bool
- :keyword registration_info: The registration info of HostPool.
+ :keyword registration_info: The registration info of HostPool. This is not returned on GET. In
+ order to get the registration token use the retrieveRegistrationToken or listRegistrationTokens
+ POST calls.
:paramtype registration_info: ~azure.mgmt.desktopvirtualization.models.RegistrationInfoPatch
:keyword vm_template: VM template for sessionhosts configuration within hostpool.
:paramtype vm_template: str
@@ -2264,6 +2977,31 @@ def __init__(
:keyword agent_update: The session host configuration for updating agent, monitoring agent, and
stack component.
:paramtype agent_update: ~azure.mgmt.desktopvirtualization.models.AgentUpdatePatchProperties
+ :keyword managed_private_udp: Default: AVD-wide settings are used to determine connection
+ availability, Enabled: UDP will attempt this connection type when making connections. This
+ means that this connection is possible, but is not guaranteed, as there are other factors that
+ may prevent this connection type, Disabled: UDP will not attempt this connection type when
+ making connections. Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype managed_private_udp: str or
+ ~azure.mgmt.desktopvirtualization.models.ManagedPrivateUDP
+ :keyword direct_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype direct_udp: str or ~azure.mgmt.desktopvirtualization.models.DirectUDP
+ :keyword public_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype public_udp: str or ~azure.mgmt.desktopvirtualization.models.PublicUDP
+ :keyword relay_udp: Default: AVD-wide settings are used to determine connection availability,
+ Enabled: UDP will attempt this connection type when making connections. This means that this
+ connection is possible, but is not guaranteed, as there are other factors that may prevent this
+ connection type, Disabled: UDP will not attempt this connection type when making connections.
+ Known values are: "Default", "Enabled", and "Disabled".
+ :paramtype relay_udp: str or ~azure.mgmt.desktopvirtualization.models.RelayUDP
"""
super().__init__(**kwargs)
self.tags = tags
@@ -2285,41 +3023,305 @@ def __init__(
self.start_vm_on_connect = start_vm_on_connect
self.public_network_access = public_network_access
self.agent_update = agent_update
+ self.managed_private_udp = managed_private_udp
+ self.direct_udp = direct_udp
+ self.public_udp = public_udp
+ self.relay_udp = relay_udp
+
+
+class HostPoolUpdateConfigurationPatchProperties(_serialization.Model): # pylint: disable=name-too-long
+ """The configurations of a hostpool update.
+
+ :ivar delete_original_vm: Whether not to save original disk. False by default.
+ :vartype delete_original_vm: bool
+ :ivar max_vms_removed: The maximum number of virtual machines to be removed during hostpool
+ update.
+ :vartype max_vms_removed: int
+ :ivar log_off_delay_minutes: Grace period before logging off users in minutes.
+ :vartype log_off_delay_minutes: int
+ :ivar log_off_message: Log off message sent to user for logoff.
+ :vartype log_off_message: str
+ """
+
+ _validation = {
+ "max_vms_removed": {"minimum": 1},
+ "log_off_message": {"max_length": 260},
+ }
+
+ _attribute_map = {
+ "delete_original_vm": {"key": "deleteOriginalVm", "type": "bool"},
+ "max_vms_removed": {"key": "maxVmsRemoved", "type": "int"},
+ "log_off_delay_minutes": {"key": "logOffDelayMinutes", "type": "int"},
+ "log_off_message": {"key": "logOffMessage", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ delete_original_vm: Optional[bool] = None,
+ max_vms_removed: Optional[int] = None,
+ log_off_delay_minutes: Optional[int] = None,
+ log_off_message: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword delete_original_vm: Whether not to save original disk. False by default.
+ :paramtype delete_original_vm: bool
+ :keyword max_vms_removed: The maximum number of virtual machines to be removed during hostpool
+ update.
+ :paramtype max_vms_removed: int
+ :keyword log_off_delay_minutes: Grace period before logging off users in minutes.
+ :paramtype log_off_delay_minutes: int
+ :keyword log_off_message: Log off message sent to user for logoff.
+ :paramtype log_off_message: str
+ """
+ super().__init__(**kwargs)
+ self.delete_original_vm = delete_original_vm
+ self.max_vms_removed = max_vms_removed
+ self.log_off_delay_minutes = log_off_delay_minutes
+ self.log_off_message = log_off_message
-class Identity(_serialization.Model):
- """Identity for the resource.
+class HostPoolUpdateConfigurationProperties(_serialization.Model):
+ """The configurations of a hostpool update.
- 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 server.
- :ivar principal_id: The principal ID of resource identity. The value must be an UUID.
- :vartype principal_id: str
- :ivar tenant_id: The tenant ID of resource. The value must be an UUID.
- :vartype tenant_id: str
- :ivar type: The identity type. Default value is "SystemAssigned".
- :vartype type: str
+ :ivar delete_original_vm: Whether not to save original disk. False by default.
+ :vartype delete_original_vm: bool
+ :ivar max_vms_removed: The maximum number of virtual machines to be removed during hostpool
+ update. Required.
+ :vartype max_vms_removed: int
+ :ivar log_off_delay_minutes: Grace period before logging off users in minutes. Required.
+ :vartype log_off_delay_minutes: int
+ :ivar log_off_message: Log off message sent to user for logoff. Default value is an empty
+ string.
+ :vartype log_off_message: str
"""
_validation = {
- "principal_id": {"readonly": True},
- "tenant_id": {"readonly": True},
+ "max_vms_removed": {"required": True, "minimum": 1},
+ "log_off_delay_minutes": {"required": True},
+ "log_off_message": {"max_length": 260},
}
_attribute_map = {
- "principal_id": {"key": "principalId", "type": "str"},
- "tenant_id": {"key": "tenantId", "type": "str"},
- "type": {"key": "type", "type": "str"},
+ "delete_original_vm": {"key": "deleteOriginalVm", "type": "bool"},
+ "max_vms_removed": {"key": "maxVmsRemoved", "type": "int"},
+ "log_off_delay_minutes": {"key": "logOffDelayMinutes", "type": "int"},
+ "log_off_message": {"key": "logOffMessage", "type": "str"},
}
- def __init__(self, *, type: Optional[Literal["SystemAssigned"]] = None, **kwargs: Any) -> None:
+ def __init__(
+ self,
+ *,
+ max_vms_removed: int,
+ log_off_delay_minutes: int,
+ delete_original_vm: Optional[bool] = None,
+ log_off_message: str = "",
+ **kwargs: Any
+ ) -> None:
"""
- :keyword type: The identity type. Default value is "SystemAssigned".
- :paramtype type: str
+ :keyword delete_original_vm: Whether not to save original disk. False by default.
+ :paramtype delete_original_vm: bool
+ :keyword max_vms_removed: The maximum number of virtual machines to be removed during hostpool
+ update. Required.
+ :paramtype max_vms_removed: int
+ :keyword log_off_delay_minutes: Grace period before logging off users in minutes. Required.
+ :paramtype log_off_delay_minutes: int
+ :keyword log_off_message: Log off message sent to user for logoff. Default value is an empty
+ string.
+ :paramtype log_off_message: str
"""
super().__init__(**kwargs)
- self.principal_id = None
- self.tenant_id = None
- self.type = type
+ self.delete_original_vm = delete_original_vm
+ self.max_vms_removed = max_vms_removed
+ self.log_off_delay_minutes = log_off_delay_minutes
+ self.log_off_message = log_off_message
+
+
+class HostPoolUpdateControlParameter(_serialization.Model):
+ """Represents properties for a hostpool update control request.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar action: Action types for controlling hostpool update. Required. Known values are:
+ "Start", "Pause", "Cancel", "Retry", and "Resume".
+ :vartype action: str or ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateAction
+ :ivar cancel_message: The cancel message sent to the user on the session host. This is can only
+ be specified if the action is 'Cancel'.
+ :vartype cancel_message: str
+ """
+
+ _validation = {
+ "action": {"required": True},
+ "cancel_message": {"max_length": 260},
+ }
+
+ _attribute_map = {
+ "action": {"key": "action", "type": "str"},
+ "cancel_message": {"key": "cancelMessage", "type": "str"},
+ }
+
+ def __init__(
+ self, *, action: Union[str, "_models.HostPoolUpdateAction"], cancel_message: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword action: Action types for controlling hostpool update. Required. Known values are:
+ "Start", "Pause", "Cancel", "Retry", and "Resume".
+ :paramtype action: str or ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateAction
+ :keyword cancel_message: The cancel message sent to the user on the session host. This is can
+ only be specified if the action is 'Cancel'.
+ :paramtype cancel_message: str
+ """
+ super().__init__(**kwargs)
+ self.action = action
+ self.cancel_message = cancel_message
+
+
+class HostPoolUpdateFault(_serialization.Model):
+ """Hostpool update fault information.
+
+ :ivar fault_type: Hostpool update fault type. Known values are: "ServiceError" and "UserError".
+ :vartype fault_type: str or ~azure.mgmt.desktopvirtualization.models.FaultType
+ :ivar fault_code: Hostpool update fault code.
+ :vartype fault_code: str
+ :ivar fault_text: Hostpool update fault text.
+ :vartype fault_text: str
+ :ivar fault_context: Hostpool update fault context.
+ :vartype fault_context: str
+ """
+
+ _attribute_map = {
+ "fault_type": {"key": "faultType", "type": "str"},
+ "fault_code": {"key": "faultCode", "type": "str"},
+ "fault_text": {"key": "faultText", "type": "str"},
+ "fault_context": {"key": "faultContext", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ fault_type: Optional[Union[str, "_models.FaultType"]] = None,
+ fault_code: Optional[str] = None,
+ fault_text: Optional[str] = None,
+ fault_context: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword fault_type: Hostpool update fault type. Known values are: "ServiceError" and
+ "UserError".
+ :paramtype fault_type: str or ~azure.mgmt.desktopvirtualization.models.FaultType
+ :keyword fault_code: Hostpool update fault code.
+ :paramtype fault_code: str
+ :keyword fault_text: Hostpool update fault text.
+ :paramtype fault_text: str
+ :keyword fault_context: Hostpool update fault context.
+ :paramtype fault_context: str
+ """
+ super().__init__(**kwargs)
+ self.fault_type = fault_type
+ self.fault_code = fault_code
+ self.fault_text = fault_text
+ self.fault_context = fault_context
+
+
+class ImageInfoPatchProperties(_serialization.Model):
+ """Image configurations of session host in a HostPool.
+
+ :ivar image_type: The type of image session hosts use in the hostpool. Known values are:
+ "Marketplace" and "Custom".
+ :vartype image_type: str or ~azure.mgmt.desktopvirtualization.models.Type
+ :ivar marketplace_info: The values to uniquely identify a marketplace image. Only one should be
+ populated based on the image type.
+ :vartype marketplace_info:
+ ~azure.mgmt.desktopvirtualization.models.MarketplaceInfoPatchProperties
+ :ivar custom_info: The values to uniquely identify a custom image. Only one should be populated
+ based on the image type.
+ :vartype custom_info: ~azure.mgmt.desktopvirtualization.models.CustomInfoPatchProperties
+ """
+
+ _attribute_map = {
+ "image_type": {"key": "type", "type": "str"},
+ "marketplace_info": {"key": "marketplaceInfo", "type": "MarketplaceInfoPatchProperties"},
+ "custom_info": {"key": "customInfo", "type": "CustomInfoPatchProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ image_type: Optional[Union[str, "_models.Type"]] = None,
+ marketplace_info: Optional["_models.MarketplaceInfoPatchProperties"] = None,
+ custom_info: Optional["_models.CustomInfoPatchProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword image_type: The type of image session hosts use in the hostpool. Known values are:
+ "Marketplace" and "Custom".
+ :paramtype image_type: str or ~azure.mgmt.desktopvirtualization.models.Type
+ :keyword marketplace_info: The values to uniquely identify a marketplace image. Only one should
+ be populated based on the image type.
+ :paramtype marketplace_info:
+ ~azure.mgmt.desktopvirtualization.models.MarketplaceInfoPatchProperties
+ :keyword custom_info: The values to uniquely identify a custom image. Only one should be
+ populated based on the image type.
+ :paramtype custom_info: ~azure.mgmt.desktopvirtualization.models.CustomInfoPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.image_type = image_type
+ self.marketplace_info = marketplace_info
+ self.custom_info = custom_info
+
+
+class ImageInfoProperties(_serialization.Model):
+ """Image configurations of session host in a HostPool.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar image_type: The type of image session hosts use in the hostpool. Required. Known values
+ are: "Marketplace" and "Custom".
+ :vartype image_type: str or ~azure.mgmt.desktopvirtualization.models.Type
+ :ivar marketplace_info: The values to uniquely identify a marketplace image. Only one should be
+ populated based on the image type.
+ :vartype marketplace_info: ~azure.mgmt.desktopvirtualization.models.MarketplaceInfoProperties
+ :ivar custom_info: The values to uniquely identify a custom image. Only one should be populated
+ based on the image type.
+ :vartype custom_info: ~azure.mgmt.desktopvirtualization.models.CustomInfoProperties
+ """
+
+ _validation = {
+ "image_type": {"required": True},
+ }
+
+ _attribute_map = {
+ "image_type": {"key": "type", "type": "str"},
+ "marketplace_info": {"key": "marketplaceInfo", "type": "MarketplaceInfoProperties"},
+ "custom_info": {"key": "customInfo", "type": "CustomInfoProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ image_type: Union[str, "_models.Type"],
+ marketplace_info: Optional["_models.MarketplaceInfoProperties"] = None,
+ custom_info: Optional["_models.CustomInfoProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword image_type: The type of image session hosts use in the hostpool. Required. Known
+ values are: "Marketplace" and "Custom".
+ :paramtype image_type: str or ~azure.mgmt.desktopvirtualization.models.Type
+ :keyword marketplace_info: The values to uniquely identify a marketplace image. Only one should
+ be populated based on the image type.
+ :paramtype marketplace_info: ~azure.mgmt.desktopvirtualization.models.MarketplaceInfoProperties
+ :keyword custom_info: The values to uniquely identify a custom image. Only one should be
+ populated based on the image type.
+ :paramtype custom_info: ~azure.mgmt.desktopvirtualization.models.CustomInfoProperties
+ """
+ super().__init__(**kwargs)
+ self.image_type = image_type
+ self.marketplace_info = marketplace_info
+ self.custom_info = custom_info
class ImportPackageInfoRequest(_serialization.Model):
@@ -2358,6 +3360,81 @@ def __init__(
self.package_architecture = package_architecture
+class KeyVaultCredentialsPatchProperties(_serialization.Model):
+ """Credentials kept in the keyvault.
+
+ :ivar username_key_vault_secret_uri: The uri to access the secret that the username is stored
+ in.
+ :vartype username_key_vault_secret_uri: str
+ :ivar password_key_vault_secret_uri: The uri to access the secret that the password is stored
+ in.
+ :vartype password_key_vault_secret_uri: str
+ """
+
+ _attribute_map = {
+ "username_key_vault_secret_uri": {"key": "usernameKeyVaultSecretUri", "type": "str"},
+ "password_key_vault_secret_uri": {"key": "passwordKeyVaultSecretUri", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ username_key_vault_secret_uri: Optional[str] = None,
+ password_key_vault_secret_uri: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword username_key_vault_secret_uri: The uri to access the secret that the username is
+ stored in.
+ :paramtype username_key_vault_secret_uri: str
+ :keyword password_key_vault_secret_uri: The uri to access the secret that the password is
+ stored in.
+ :paramtype password_key_vault_secret_uri: str
+ """
+ super().__init__(**kwargs)
+ self.username_key_vault_secret_uri = username_key_vault_secret_uri
+ self.password_key_vault_secret_uri = password_key_vault_secret_uri
+
+
+class KeyVaultCredentialsProperties(_serialization.Model):
+ """Credentials kept in the keyvault.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar username_key_vault_secret_uri: The uri to access the secret that the username is stored
+ in. Required.
+ :vartype username_key_vault_secret_uri: str
+ :ivar password_key_vault_secret_uri: The uri to access the secret that the password is stored
+ in. Required.
+ :vartype password_key_vault_secret_uri: str
+ """
+
+ _validation = {
+ "username_key_vault_secret_uri": {"required": True},
+ "password_key_vault_secret_uri": {"required": True},
+ }
+
+ _attribute_map = {
+ "username_key_vault_secret_uri": {"key": "usernameKeyVaultSecretUri", "type": "str"},
+ "password_key_vault_secret_uri": {"key": "passwordKeyVaultSecretUri", "type": "str"},
+ }
+
+ def __init__(
+ self, *, username_key_vault_secret_uri: str, password_key_vault_secret_uri: str, **kwargs: Any
+ ) -> None:
+ """
+ :keyword username_key_vault_secret_uri: The uri to access the secret that the username is
+ stored in. Required.
+ :paramtype username_key_vault_secret_uri: str
+ :keyword password_key_vault_secret_uri: The uri to access the secret that the password is
+ stored in. Required.
+ :paramtype password_key_vault_secret_uri: str
+ """
+ super().__init__(**kwargs)
+ self.username_key_vault_secret_uri = username_key_vault_secret_uri
+ self.password_key_vault_secret_uri = password_key_vault_secret_uri
+
+
class LogSpecification(_serialization.Model):
"""Specifications of the Log for Azure Monitoring.
@@ -2465,27 +3542,184 @@ def __init__(
self.day_of_week = day_of_week
-class MSIXImageURI(_serialization.Model):
- """Represents URI referring to MSIX Image.
+class ManagedServiceIdentity(_serialization.Model):
+ """Managed service identity (system assigned and/or user assigned identities).
- :ivar uri: URI to Image.
- :vartype uri: str
- """
+ Variables are only populated by the server, and will be ignored when sending a request.
- _attribute_map = {
- "uri": {"key": "uri", "type": "str"},
- }
+ All required parameters must be populated in order to send to server.
- def __init__(self, *, uri: Optional[str] = None, **kwargs: Any) -> None:
- """
- :keyword uri: URI to Image.
+ :ivar principal_id: The service principal ID of the system assigned identity. This property
+ will only be provided for a system assigned identity.
+ :vartype principal_id: str
+ :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be
+ provided for a system assigned identity.
+ :vartype tenant_id: str
+ :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types
+ are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and
+ "SystemAssigned,UserAssigned".
+ :vartype type: str or ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentityType
+ :ivar user_assigned_identities: The set of user assigned identities associated with the
+ resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form:
+ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long
+ The dictionary values can be empty objects ({}) in requests.
+ :vartype user_assigned_identities: dict[str,
+ ~azure.mgmt.desktopvirtualization.models.UserAssignedIdentity]
+ """
+
+ _validation = {
+ "principal_id": {"readonly": True},
+ "tenant_id": {"readonly": True},
+ "type": {"required": True},
+ }
+
+ _attribute_map = {
+ "principal_id": {"key": "principalId", "type": "str"},
+ "tenant_id": {"key": "tenantId", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Union[str, "_models.ManagedServiceIdentityType"],
+ user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned
+ types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and
+ "SystemAssigned,UserAssigned".
+ :paramtype type: str or ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentityType
+ :keyword user_assigned_identities: The set of user assigned identities associated with the
+ resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form:
+ '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long
+ The dictionary values can be empty objects ({}) in requests.
+ :paramtype user_assigned_identities: dict[str,
+ ~azure.mgmt.desktopvirtualization.models.UserAssignedIdentity]
+ """
+ super().__init__(**kwargs)
+ self.principal_id = None
+ self.tenant_id = None
+ self.type = type
+ self.user_assigned_identities = user_assigned_identities
+
+
+class MarketplaceInfoPatchProperties(_serialization.Model):
+ """Marketplace image information.
+
+ :ivar offer: The offer of the image.
+ :vartype offer: str
+ :ivar publisher: The publisher of the image.
+ :vartype publisher: str
+ :ivar sku: The sku of the image.
+ :vartype sku: str
+ :ivar exact_version: The exact version of the image.
+ :vartype exact_version: str
+ """
+
+ _attribute_map = {
+ "offer": {"key": "offer", "type": "str"},
+ "publisher": {"key": "publisher", "type": "str"},
+ "sku": {"key": "sku", "type": "str"},
+ "exact_version": {"key": "exactVersion", "type": "str"},
+ }
+
+ def __init__(
+ self,
+ *,
+ offer: Optional[str] = None,
+ publisher: Optional[str] = None,
+ sku: Optional[str] = None,
+ exact_version: Optional[str] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword offer: The offer of the image.
+ :paramtype offer: str
+ :keyword publisher: The publisher of the image.
+ :paramtype publisher: str
+ :keyword sku: The sku of the image.
+ :paramtype sku: str
+ :keyword exact_version: The exact version of the image.
+ :paramtype exact_version: str
+ """
+ super().__init__(**kwargs)
+ self.offer = offer
+ self.publisher = publisher
+ self.sku = sku
+ self.exact_version = exact_version
+
+
+class MarketplaceInfoProperties(_serialization.Model):
+ """Marketplace image information.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar offer: The offer of the image. Required.
+ :vartype offer: str
+ :ivar publisher: The publisher of the image. Required.
+ :vartype publisher: str
+ :ivar sku: The sku of the image. Required.
+ :vartype sku: str
+ :ivar exact_version: The exact version of the image. Required.
+ :vartype exact_version: str
+ """
+
+ _validation = {
+ "offer": {"required": True},
+ "publisher": {"required": True},
+ "sku": {"required": True},
+ "exact_version": {"required": True},
+ }
+
+ _attribute_map = {
+ "offer": {"key": "offer", "type": "str"},
+ "publisher": {"key": "publisher", "type": "str"},
+ "sku": {"key": "sku", "type": "str"},
+ "exact_version": {"key": "exactVersion", "type": "str"},
+ }
+
+ def __init__(self, *, offer: str, publisher: str, sku: str, exact_version: str, **kwargs: Any) -> None:
+ """
+ :keyword offer: The offer of the image. Required.
+ :paramtype offer: str
+ :keyword publisher: The publisher of the image. Required.
+ :paramtype publisher: str
+ :keyword sku: The sku of the image. Required.
+ :paramtype sku: str
+ :keyword exact_version: The exact version of the image. Required.
+ :paramtype exact_version: str
+ """
+ super().__init__(**kwargs)
+ self.offer = offer
+ self.publisher = publisher
+ self.sku = sku
+ self.exact_version = exact_version
+
+
+class MSIXImageURI(_serialization.Model):
+ """Represents URI referring to MSIX Image.
+
+ :ivar uri: URI to Image.
+ :vartype uri: str
+ """
+
+ _attribute_map = {
+ "uri": {"key": "uri", "type": "str"},
+ }
+
+ def __init__(self, *, uri: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword uri: URI to Image.
:paramtype uri: str
"""
super().__init__(**kwargs)
self.uri = uri
-class MSIXPackage(Resource): # pylint: disable=too-many-instance-attributes
+class MSIXPackage(Resource):
"""Schema for MSIX Package properties.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -2519,7 +3753,7 @@ class MSIXPackage(Resource): # pylint: disable=too-many-instance-attributes
:ivar package_dependencies: List of package dependencies.
:vartype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :ivar version: Package version found in the appxmanifest.xml.
+ :ivar version: Package Version found in the appxmanifest.xml.
:vartype version: str
:ivar last_updated: Date Package was last updated, found in the appxmanifest.xml.
:vartype last_updated: ~datetime.datetime
@@ -2588,7 +3822,7 @@ def __init__(
:keyword package_dependencies: List of package dependencies.
:paramtype package_dependencies:
list[~azure.mgmt.desktopvirtualization.models.MsixPackageDependencies]
- :keyword version: Package version found in the appxmanifest.xml.
+ :keyword version: Package Version found in the appxmanifest.xml.
:paramtype version: str
:keyword last_updated: Date Package was last updated, found in the appxmanifest.xml.
:paramtype last_updated: ~datetime.datetime
@@ -2682,7 +3916,9 @@ def __init__(
class MsixPackageDependencies(_serialization.Model):
"""Schema for MSIX Package Dependencies properties.
- :ivar dependency_name: Name of package dependency.
+ :ivar dependency_name: Name of the package dependency. For Msix packages, this is the other
+ packages this package depends upon, for APP-V packages this is the locations of the user and
+ deployment config files.
:vartype dependency_name: str
:ivar publisher: Name of dependency publisher.
:vartype publisher: str
@@ -2705,7 +3941,9 @@ def __init__(
**kwargs: Any
) -> None:
"""
- :keyword dependency_name: Name of package dependency.
+ :keyword dependency_name: Name of the package dependency. For Msix packages, this is the other
+ packages this package depends upon, for APP-V packages this is the locations of the user and
+ deployment config files.
:paramtype dependency_name: str
:keyword publisher: Name of dependency publisher.
:paramtype publisher: str
@@ -2811,6 +4049,70 @@ def __init__(
self.display_name = display_name
+class NetworkInfoPatchProperties(_serialization.Model):
+ """Network information.
+
+ :ivar subnet_id: The resource ID of the subnet.
+ :vartype subnet_id: str
+ :ivar security_group_id: The resource ID of the security group. Any allowable/open ports should
+ be specified in the Network Security Group(NSG).
+ :vartype security_group_id: str
+ """
+
+ _attribute_map = {
+ "subnet_id": {"key": "subnetId", "type": "str"},
+ "security_group_id": {"key": "securityGroupId", "type": "str"},
+ }
+
+ def __init__(
+ self, *, subnet_id: Optional[str] = None, security_group_id: Optional[str] = None, **kwargs: Any
+ ) -> None:
+ """
+ :keyword subnet_id: The resource ID of the subnet.
+ :paramtype subnet_id: str
+ :keyword security_group_id: The resource ID of the security group. Any allowable/open ports
+ should be specified in the Network Security Group(NSG).
+ :paramtype security_group_id: str
+ """
+ super().__init__(**kwargs)
+ self.subnet_id = subnet_id
+ self.security_group_id = security_group_id
+
+
+class NetworkInfoProperties(_serialization.Model):
+ """Network information.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar subnet_id: The resource ID of the subnet. Required.
+ :vartype subnet_id: str
+ :ivar security_group_id: The resource ID of the security group. Any allowable/open ports should
+ be specified in the Network Security Group(NSG).
+ :vartype security_group_id: str
+ """
+
+ _validation = {
+ "subnet_id": {"required": True},
+ }
+
+ _attribute_map = {
+ "subnet_id": {"key": "subnetId", "type": "str"},
+ "security_group_id": {"key": "securityGroupId", "type": "str"},
+ }
+
+ def __init__(self, *, subnet_id: str, security_group_id: Optional[str] = None, **kwargs: Any) -> None:
+ """
+ :keyword subnet_id: The resource ID of the subnet. Required.
+ :paramtype subnet_id: str
+ :keyword security_group_id: The resource ID of the security group. Any allowable/open ports
+ should be specified in the Network Security Group(NSG).
+ :paramtype security_group_id: str
+ """
+ super().__init__(**kwargs)
+ self.subnet_id = subnet_id
+ self.security_group_id = security_group_id
+
+
class OperationProperties(_serialization.Model):
"""Properties of the operation.
@@ -3214,7 +4516,9 @@ class ProxyResource(Resource):
class RegistrationInfo(_serialization.Model):
- """Represents a RegistrationInfo definition.
+ """Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to
+ get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST
+ calls.
:ivar expiration_time: Expiration time of registration token.
:vartype expiration_time: ~datetime.datetime
@@ -3257,7 +4561,9 @@ def __init__(
class RegistrationInfoPatch(_serialization.Model):
- """Represents a RegistrationInfo definition.
+ """Represents a RegistrationInfo definition. This is not returned on HostPool GET. In order to
+ get the registration token use the retrieveRegistrationToken or listRegistrationTokens POST
+ calls.
:ivar expiration_time: Expiration time of registration token.
:vartype expiration_time: ~datetime.datetime
@@ -3350,133 +4656,6 @@ def __init__(
self.token = token
-class ResourceModelWithAllowedPropertySetIdentity(Identity): # pylint: disable=name-too-long
- """ResourceModelWithAllowedPropertySetIdentity.
-
- Variables are only populated by the server, and will be ignored when sending a request.
-
- :ivar principal_id: The principal ID of resource identity. The value must be an UUID.
- :vartype principal_id: str
- :ivar tenant_id: The tenant ID of resource. The value must be an UUID.
- :vartype tenant_id: str
- :ivar type: The identity type. Default value is "SystemAssigned".
- :vartype type: str
- """
-
-
-class ResourceModelWithAllowedPropertySetPlan(Plan):
- """ResourceModelWithAllowedPropertySetPlan.
-
- All required parameters must be populated in order to send to server.
-
- :ivar name: A user defined name of the 3rd Party Artifact that is being procured. Required.
- :vartype name: str
- :ivar publisher: The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic.
- Required.
- :vartype publisher: str
- :ivar product: The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to
- the OfferID specified for the artifact at the time of Data Market onboarding. Required.
- :vartype product: str
- :ivar promotion_code: A publisher provided promotion code as provisioned in Data Market for the
- said product/artifact.
- :vartype promotion_code: str
- :ivar version: The version of the desired product/artifact.
- :vartype version: str
- """
-
-
-class Sku(_serialization.Model):
- """The resource model definition representing SKU.
-
- All required parameters must be populated in order to send to server.
-
- :ivar name: The name of the SKU. E.g. P3. It is typically a letter+number code. Required.
- :vartype name: str
- :ivar tier: This field is required to be implemented by the Resource Provider if the service
- has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic",
- "Standard", and "Premium".
- :vartype tier: str or ~azure.mgmt.desktopvirtualization.models.SkuTier
- :ivar size: The SKU size. When the name field is the combination of tier and some other value,
- this would be the standalone code.
- :vartype size: str
- :ivar family: If the service has different generations of hardware, for the same SKU, then that
- can be captured here.
- :vartype family: str
- :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included.
- If scale out/in is not possible for the resource this may be omitted.
- :vartype capacity: int
- """
-
- _validation = {
- "name": {"required": True},
- }
-
- _attribute_map = {
- "name": {"key": "name", "type": "str"},
- "tier": {"key": "tier", "type": "str"},
- "size": {"key": "size", "type": "str"},
- "family": {"key": "family", "type": "str"},
- "capacity": {"key": "capacity", "type": "int"},
- }
-
- def __init__(
- self,
- *,
- name: str,
- tier: Optional[Union[str, "_models.SkuTier"]] = None,
- size: Optional[str] = None,
- family: Optional[str] = None,
- capacity: Optional[int] = None,
- **kwargs: Any
- ) -> None:
- """
- :keyword name: The name of the SKU. E.g. P3. It is typically a letter+number code. Required.
- :paramtype name: str
- :keyword tier: This field is required to be implemented by the Resource Provider if the service
- has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic",
- "Standard", and "Premium".
- :paramtype tier: str or ~azure.mgmt.desktopvirtualization.models.SkuTier
- :keyword size: The SKU size. When the name field is the combination of tier and some other
- value, this would be the standalone code.
- :paramtype size: str
- :keyword family: If the service has different generations of hardware, for the same SKU, then
- that can be captured here.
- :paramtype family: str
- :keyword capacity: If the SKU supports scale out/in then the capacity integer should be
- included. If scale out/in is not possible for the resource this may be omitted.
- :paramtype capacity: int
- """
- super().__init__(**kwargs)
- self.name = name
- self.tier = tier
- self.size = size
- self.family = family
- self.capacity = capacity
-
-
-class ResourceModelWithAllowedPropertySetSku(Sku):
- """ResourceModelWithAllowedPropertySetSku.
-
- All required parameters must be populated in order to send to server.
-
- :ivar name: The name of the SKU. E.g. P3. It is typically a letter+number code. Required.
- :vartype name: str
- :ivar tier: This field is required to be implemented by the Resource Provider if the service
- has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic",
- "Standard", and "Premium".
- :vartype tier: str or ~azure.mgmt.desktopvirtualization.models.SkuTier
- :ivar size: The SKU size. When the name field is the combination of tier and some other value,
- this would be the standalone code.
- :vartype size: str
- :ivar family: If the service has different generations of hardware, for the same SKU, then that
- can be captured here.
- :vartype family: str
- :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included.
- If scale out/in is not possible for the resource this may be omitted.
- :vartype capacity: int
- """
-
-
class ResourceProviderOperation(_serialization.Model):
"""Supported operation of this resource provider.
@@ -3627,7 +4806,7 @@ def __init__(
self.scaling_plan_enabled = scaling_plan_enabled
-class ScalingPlan(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many-instance-attributes
+class ScalingPlan(ResourceModelWithAllowedPropertySet):
"""Represents a scaling plan definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -3664,13 +4843,12 @@ class ScalingPlan(ResourceModelWithAllowedPropertySet): # pylint: disable=too-m
the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range
(section 14.27) header fields.
:vartype etag: str
- :ivar identity:
- :vartype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :ivar sku:
- :vartype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :ivar plan:
- :vartype plan: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :ivar identity: Managed service identity (system assigned and/or user assigned identities).
+ :vartype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :ivar sku: The resource model definition representing SKU.
+ :vartype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :ivar plan: Plan for the resource.
+ :vartype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:ivar object_id: ObjectId of scaling plan. (internal use).
:vartype object_id: str
:ivar description: Description of scaling plan.
@@ -3679,11 +4857,11 @@ class ScalingPlan(ResourceModelWithAllowedPropertySet): # pylint: disable=too-m
:vartype friendly_name: str
:ivar time_zone: Timezone of the scaling plan. Required.
:vartype time_zone: str
- :ivar host_pool_type: HostPool type for desktop. "Pooled"
+ :ivar host_pool_type: HostPool type for desktop. Known values are: "Pooled" and "Personal".
:vartype host_pool_type: str or ~azure.mgmt.desktopvirtualization.models.ScalingHostPoolType
:ivar exclusion_tag: Exclusion tag for scaling plan.
:vartype exclusion_tag: str
- :ivar schedules: List of ScalingPlanPooledSchedule definitions.
+ :ivar schedules: List of Pooled ScalingSchedule definitions.
:vartype schedules: list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule]
:ivar host_pool_references: List of ScalingHostPoolReference definitions.
:vartype host_pool_references:
@@ -3712,9 +4890,9 @@ class ScalingPlan(ResourceModelWithAllowedPropertySet): # pylint: disable=too-m
"managed_by": {"key": "managedBy", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"etag": {"key": "etag", "type": "str"},
- "identity": {"key": "identity", "type": "ResourceModelWithAllowedPropertySetIdentity"},
- "sku": {"key": "sku", "type": "ResourceModelWithAllowedPropertySetSku"},
- "plan": {"key": "plan", "type": "ResourceModelWithAllowedPropertySetPlan"},
+ "identity": {"key": "identity", "type": "ManagedServiceIdentity"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "plan": {"key": "plan", "type": "Plan"},
"object_id": {"key": "properties.objectId", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
@@ -3733,9 +4911,9 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
managed_by: Optional[str] = None,
kind: Optional[str] = None,
- identity: Optional["_models.ResourceModelWithAllowedPropertySetIdentity"] = None,
- sku: Optional["_models.ResourceModelWithAllowedPropertySetSku"] = None,
- plan: Optional["_models.ResourceModelWithAllowedPropertySetPlan"] = None,
+ identity: Optional["_models.ManagedServiceIdentity"] = None,
+ sku: Optional["_models.Sku"] = None,
+ plan: Optional["_models.Plan"] = None,
description: Optional[str] = None,
friendly_name: Optional[str] = None,
host_pool_type: Union[str, "_models.ScalingHostPoolType"] = "Pooled",
@@ -3758,25 +4936,23 @@ def __init__(
resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported,
the resource provider must validate and persist this value.
:paramtype kind: str
- :keyword identity:
- :paramtype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :keyword sku:
- :paramtype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :keyword plan:
- :paramtype plan:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :keyword identity: Managed service identity (system assigned and/or user assigned identities).
+ :paramtype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :keyword sku: The resource model definition representing SKU.
+ :paramtype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :keyword plan: Plan for the resource.
+ :paramtype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:keyword description: Description of scaling plan.
:paramtype description: str
:keyword friendly_name: User friendly name of scaling plan.
:paramtype friendly_name: str
:keyword time_zone: Timezone of the scaling plan. Required.
:paramtype time_zone: str
- :keyword host_pool_type: HostPool type for desktop. "Pooled"
+ :keyword host_pool_type: HostPool type for desktop. Known values are: "Pooled" and "Personal".
:paramtype host_pool_type: str or ~azure.mgmt.desktopvirtualization.models.ScalingHostPoolType
:keyword exclusion_tag: Exclusion tag for scaling plan.
:paramtype exclusion_tag: str
- :keyword schedules: List of ScalingPlanPooledSchedule definitions.
+ :keyword schedules: List of Pooled ScalingSchedule definitions.
:paramtype schedules: list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule]
:keyword host_pool_references: List of ScalingHostPoolReference definitions.
:paramtype host_pool_references:
@@ -3845,7 +5021,7 @@ class ScalingPlanPatch(_serialization.Model):
:vartype time_zone: str
:ivar exclusion_tag: Exclusion tag for scaling plan.
:vartype exclusion_tag: str
- :ivar schedules: List of ScalingSchedule definitions.
+ :ivar schedules: List Pooled ScalingSchedule definitions.
:vartype schedules: list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule]
:ivar host_pool_references: List of ScalingHostPoolReference definitions.
:vartype host_pool_references:
@@ -3885,7 +5061,7 @@ def __init__(
:paramtype time_zone: str
:keyword exclusion_tag: Exclusion tag for scaling plan.
:paramtype exclusion_tag: str
- :keyword schedules: List of ScalingSchedule definitions.
+ :keyword schedules: List Pooled ScalingSchedule definitions.
:paramtype schedules: list[~azure.mgmt.desktopvirtualization.models.ScalingSchedule]
:keyword host_pool_references: List of ScalingHostPoolReference definitions.
:paramtype host_pool_references:
@@ -3901,11 +5077,13 @@ def __init__(
self.host_pool_references = host_pool_references
-class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-instance-attributes
+class ScalingPlanPersonalSchedule(ProxyResource):
"""Represents a ScalingPlanPersonalSchedule 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 server.
+
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
@@ -3917,9 +5095,9 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
- :ivar days_of_week: Set of days of the week on which this schedule is active.
+ :ivar days_of_week: Set of days of the week on which this schedule is active. Required.
:vartype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
- :ivar ramp_up_start_time: Starting time for ramp up period.
+ :ivar ramp_up_start_time: Starting time for ramp up period. Required.
:vartype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar ramp_up_auto_start_hosts: The desired startup behavior during the ramp up period for
personal vms in the hostpool. Known values are: "None", "WithAssignedUser", and "All".
@@ -3944,7 +5122,7 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
:ivar ramp_up_minutes_to_wait_on_logoff: The time in minutes to wait before performing the
desired session handling action when a user logs off during the ramp up period.
:vartype ramp_up_minutes_to_wait_on_logoff: int
- :ivar peak_start_time: Starting time for peak period.
+ :ivar peak_start_time: Starting time for peak period. Required.
:vartype peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar peak_start_vm_on_connect: The desired configuration of Start VM On Connect for the
hostpool during the peak phase. Known values are: "Enable" and "Disable".
@@ -3964,7 +5142,7 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
:ivar peak_minutes_to_wait_on_logoff: The time in minutes to wait before performing the desired
session handling action when a user logs off during the peak period.
:vartype peak_minutes_to_wait_on_logoff: int
- :ivar ramp_down_start_time: Starting time for ramp down period.
+ :ivar ramp_down_start_time: Starting time for ramp down period. Required.
:vartype ramp_down_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar ramp_down_start_vm_on_connect: The desired configuration of Start VM On Connect for the
hostpool during the ramp down phase. Known values are: "Enable" and "Disable".
@@ -3984,7 +5162,7 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
:ivar ramp_down_minutes_to_wait_on_logoff: The time in minutes to wait before performing the
desired session handling action when a user logs off during the ramp down period.
:vartype ramp_down_minutes_to_wait_on_logoff: int
- :ivar off_peak_start_time: Starting time for off-peak period.
+ :ivar off_peak_start_time: Starting time for off-peak period. Required.
:vartype off_peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar off_peak_start_vm_on_connect: The desired configuration of Start VM On Connect for the
hostpool during the off-peak phase. Known values are: "Enable" and "Disable".
@@ -4011,12 +5189,17 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
+ "days_of_week": {"required": True},
+ "ramp_up_start_time": {"required": True},
"ramp_up_minutes_to_wait_on_disconnect": {"minimum": 0},
"ramp_up_minutes_to_wait_on_logoff": {"minimum": 0},
+ "peak_start_time": {"required": True},
"peak_minutes_to_wait_on_disconnect": {"minimum": 0},
"peak_minutes_to_wait_on_logoff": {"minimum": 0},
+ "ramp_down_start_time": {"required": True},
"ramp_down_minutes_to_wait_on_disconnect": {"minimum": 0},
"ramp_down_minutes_to_wait_on_logoff": {"minimum": 0},
+ "off_peak_start_time": {"required": True},
"off_peak_minutes_to_wait_on_disconnect": {"minimum": 0},
"off_peak_minutes_to_wait_on_logoff": {"minimum": 0},
}
@@ -4060,27 +5243,27 @@ class ScalingPlanPersonalSchedule(ProxyResource): # pylint: disable=too-many-in
def __init__( # pylint: disable=too-many-locals
self,
*,
- days_of_week: Optional[List[Union[str, "_models.DayOfWeek"]]] = None,
- ramp_up_start_time: Optional["_models.Time"] = None,
+ days_of_week: List[Union[str, "_models.DayOfWeek"]],
+ ramp_up_start_time: "_models.Time",
+ peak_start_time: "_models.Time",
+ ramp_down_start_time: "_models.Time",
+ off_peak_start_time: "_models.Time",
ramp_up_auto_start_hosts: Optional[Union[str, "_models.StartupBehavior"]] = None,
ramp_up_start_vm_on_connect: Optional[Union[str, "_models.SetStartVMOnConnect"]] = None,
ramp_up_action_on_disconnect: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
ramp_up_minutes_to_wait_on_disconnect: Optional[int] = None,
ramp_up_action_on_logoff: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
ramp_up_minutes_to_wait_on_logoff: Optional[int] = None,
- peak_start_time: Optional["_models.Time"] = None,
peak_start_vm_on_connect: Optional[Union[str, "_models.SetStartVMOnConnect"]] = None,
peak_action_on_disconnect: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
peak_minutes_to_wait_on_disconnect: Optional[int] = None,
peak_action_on_logoff: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
peak_minutes_to_wait_on_logoff: Optional[int] = None,
- ramp_down_start_time: Optional["_models.Time"] = None,
ramp_down_start_vm_on_connect: Optional[Union[str, "_models.SetStartVMOnConnect"]] = None,
ramp_down_action_on_disconnect: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
ramp_down_minutes_to_wait_on_disconnect: Optional[int] = None,
ramp_down_action_on_logoff: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
ramp_down_minutes_to_wait_on_logoff: Optional[int] = None,
- off_peak_start_time: Optional["_models.Time"] = None,
off_peak_start_vm_on_connect: Optional[Union[str, "_models.SetStartVMOnConnect"]] = None,
off_peak_action_on_disconnect: Optional[Union[str, "_models.SessionHandlingOperation"]] = None,
off_peak_minutes_to_wait_on_disconnect: Optional[int] = None,
@@ -4089,9 +5272,9 @@ def __init__( # pylint: disable=too-many-locals
**kwargs: Any
) -> None:
"""
- :keyword days_of_week: Set of days of the week on which this schedule is active.
+ :keyword days_of_week: Set of days of the week on which this schedule is active. Required.
:paramtype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
- :keyword ramp_up_start_time: Starting time for ramp up period.
+ :keyword ramp_up_start_time: Starting time for ramp up period. Required.
:paramtype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword ramp_up_auto_start_hosts: The desired startup behavior during the ramp up period for
personal vms in the hostpool. Known values are: "None", "WithAssignedUser", and "All".
@@ -4116,7 +5299,7 @@ def __init__( # pylint: disable=too-many-locals
:keyword ramp_up_minutes_to_wait_on_logoff: The time in minutes to wait before performing the
desired session handling action when a user logs off during the ramp up period.
:paramtype ramp_up_minutes_to_wait_on_logoff: int
- :keyword peak_start_time: Starting time for peak period.
+ :keyword peak_start_time: Starting time for peak period. Required.
:paramtype peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword peak_start_vm_on_connect: The desired configuration of Start VM On Connect for the
hostpool during the peak phase. Known values are: "Enable" and "Disable".
@@ -4136,7 +5319,7 @@ def __init__( # pylint: disable=too-many-locals
:keyword peak_minutes_to_wait_on_logoff: The time in minutes to wait before performing the
desired session handling action when a user logs off during the peak period.
:paramtype peak_minutes_to_wait_on_logoff: int
- :keyword ramp_down_start_time: Starting time for ramp down period.
+ :keyword ramp_down_start_time: Starting time for ramp down period. Required.
:paramtype ramp_down_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword ramp_down_start_vm_on_connect: The desired configuration of Start VM On Connect for
the hostpool during the ramp down phase. Known values are: "Enable" and "Disable".
@@ -4156,7 +5339,7 @@ def __init__( # pylint: disable=too-many-locals
:keyword ramp_down_minutes_to_wait_on_logoff: The time in minutes to wait before performing the
desired session handling action when a user logs off during the ramp down period.
:paramtype ramp_down_minutes_to_wait_on_logoff: int
- :keyword off_peak_start_time: Starting time for off-peak period.
+ :keyword off_peak_start_time: Starting time for off-peak period. Required.
:paramtype off_peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword off_peak_start_vm_on_connect: The desired configuration of Start VM On Connect for the
hostpool during the off-peak phase. Known values are: "Enable" and "Disable".
@@ -4236,7 +5419,7 @@ def __init__(self, *, value: Optional[List["_models.ScalingPlanPersonalSchedule"
self.next_link = None
-class ScalingPlanPersonalSchedulePatch(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ScalingPlanPersonalSchedulePatch(_serialization.Model):
"""ScalingPlanPersonalSchedule properties that can be patched.
:ivar days_of_week: Set of days of the week on which this schedule is active.
@@ -4520,11 +5703,13 @@ def __init__( # pylint: disable=too-many-locals
self.off_peak_minutes_to_wait_on_logoff = off_peak_minutes_to_wait_on_logoff
-class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-attributes
+class ScalingPlanPooledSchedule(Resource):
"""Represents a ScalingPlanPooledSchedule 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 server.
+
:ivar id: Fully qualified resource ID for the resource. E.g.
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
:vartype id: str
@@ -4536,9 +5721,11 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
- :ivar days_of_week: Set of days of the week on which this schedule is active.
+ :ivar name_properties_name: Name of the ScalingPlanPooledSchedule.
+ :vartype name_properties_name: str
+ :ivar days_of_week: Set of days of the week on which this schedule is active. Required.
:vartype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
- :ivar ramp_up_start_time: Starting time for ramp up period.
+ :ivar ramp_up_start_time: Starting time for ramp up period. Required.
:vartype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Known
values are: "BreadthFirst" and "DepthFirst".
@@ -4546,15 +5733,15 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
:ivar ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up period.
:vartype ramp_up_minimum_hosts_pct: int
- :ivar ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period.
+ :ivar ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period. Required.
:vartype ramp_up_capacity_threshold_pct: int
- :ivar peak_start_time: Starting time for peak period.
+ :ivar peak_start_time: Starting time for peak period. Required.
:vartype peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar peak_load_balancing_algorithm: Load balancing algorithm for peak period. Known values
are: "BreadthFirst" and "DepthFirst".
:vartype peak_load_balancing_algorithm: str or
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
- :ivar ramp_down_start_time: Starting time for ramp down period.
+ :ivar ramp_down_start_time: Starting time for ramp down period. Required.
:vartype ramp_down_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar ramp_down_load_balancing_algorithm: Load balancing algorithm for ramp down period. Known
values are: "BreadthFirst" and "DepthFirst".
@@ -4562,7 +5749,7 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
:ivar ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down period.
:vartype ramp_down_minimum_hosts_pct: int
- :ivar ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period.
+ :ivar ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period. Required.
:vartype ramp_down_capacity_threshold_pct: int
:ivar ramp_down_force_logoff_users: Should users be logged off forcefully from hosts.
:vartype ramp_down_force_logoff_users: bool
@@ -4575,7 +5762,7 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
:vartype ramp_down_wait_time_minutes: int
:ivar ramp_down_notification_message: Notification message for users during ramp down period.
:vartype ramp_down_notification_message: str
- :ivar off_peak_start_time: Starting time for off-peak period.
+ :ivar off_peak_start_time: Starting time for off-peak period. Required.
:vartype off_peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar off_peak_load_balancing_algorithm: Load balancing algorithm for off-peak period. Known
values are: "BreadthFirst" and "DepthFirst".
@@ -4588,10 +5775,16 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
+ "name_properties_name": {"readonly": True},
+ "days_of_week": {"required": True},
+ "ramp_up_start_time": {"required": True},
"ramp_up_minimum_hosts_pct": {"maximum": 100, "minimum": 0},
- "ramp_up_capacity_threshold_pct": {"maximum": 100, "minimum": 1},
+ "ramp_up_capacity_threshold_pct": {"required": True, "maximum": 100, "minimum": 1},
+ "peak_start_time": {"required": True},
+ "ramp_down_start_time": {"required": True},
"ramp_down_minimum_hosts_pct": {"maximum": 100, "minimum": 0},
- "ramp_down_capacity_threshold_pct": {"maximum": 100, "minimum": 1},
+ "ramp_down_capacity_threshold_pct": {"required": True, "maximum": 100, "minimum": 1},
+ "off_peak_start_time": {"required": True},
}
_attribute_map = {
@@ -4599,6 +5792,7 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
+ "name_properties_name": {"key": "properties.name", "type": "str"},
"days_of_week": {"key": "properties.daysOfWeek", "type": "[str]"},
"ramp_up_start_time": {"key": "properties.rampUpStartTime", "type": "Time"},
"ramp_up_load_balancing_algorithm": {"key": "properties.rampUpLoadBalancingAlgorithm", "type": "str"},
@@ -4621,29 +5815,29 @@ class ScalingPlanPooledSchedule(Resource): # pylint: disable=too-many-instance-
def __init__(
self,
*,
- days_of_week: Optional[List[Union[str, "_models.DayOfWeek"]]] = None,
- ramp_up_start_time: Optional["_models.Time"] = None,
+ days_of_week: List[Union[str, "_models.DayOfWeek"]],
+ ramp_up_start_time: "_models.Time",
+ ramp_up_capacity_threshold_pct: int,
+ peak_start_time: "_models.Time",
+ ramp_down_start_time: "_models.Time",
+ ramp_down_capacity_threshold_pct: int,
+ off_peak_start_time: "_models.Time",
ramp_up_load_balancing_algorithm: Optional[Union[str, "_models.SessionHostLoadBalancingAlgorithm"]] = None,
ramp_up_minimum_hosts_pct: Optional[int] = None,
- ramp_up_capacity_threshold_pct: Optional[int] = None,
- peak_start_time: Optional["_models.Time"] = None,
peak_load_balancing_algorithm: Optional[Union[str, "_models.SessionHostLoadBalancingAlgorithm"]] = None,
- ramp_down_start_time: Optional["_models.Time"] = None,
ramp_down_load_balancing_algorithm: Optional[Union[str, "_models.SessionHostLoadBalancingAlgorithm"]] = None,
ramp_down_minimum_hosts_pct: Optional[int] = None,
- ramp_down_capacity_threshold_pct: Optional[int] = None,
ramp_down_force_logoff_users: Optional[bool] = None,
ramp_down_stop_hosts_when: Optional[Union[str, "_models.StopHostsWhen"]] = None,
ramp_down_wait_time_minutes: Optional[int] = None,
ramp_down_notification_message: Optional[str] = None,
- off_peak_start_time: Optional["_models.Time"] = None,
off_peak_load_balancing_algorithm: Optional[Union[str, "_models.SessionHostLoadBalancingAlgorithm"]] = None,
**kwargs: Any
) -> None:
"""
- :keyword days_of_week: Set of days of the week on which this schedule is active.
+ :keyword days_of_week: Set of days of the week on which this schedule is active. Required.
:paramtype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
- :keyword ramp_up_start_time: Starting time for ramp up period.
+ :keyword ramp_up_start_time: Starting time for ramp up period. Required.
:paramtype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Known
values are: "BreadthFirst" and "DepthFirst".
@@ -4651,15 +5845,15 @@ def __init__(
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
:keyword ramp_up_minimum_hosts_pct: Minimum host percentage for ramp up period.
:paramtype ramp_up_minimum_hosts_pct: int
- :keyword ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period.
+ :keyword ramp_up_capacity_threshold_pct: Capacity threshold for ramp up period. Required.
:paramtype ramp_up_capacity_threshold_pct: int
- :keyword peak_start_time: Starting time for peak period.
+ :keyword peak_start_time: Starting time for peak period. Required.
:paramtype peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword peak_load_balancing_algorithm: Load balancing algorithm for peak period. Known values
are: "BreadthFirst" and "DepthFirst".
:paramtype peak_load_balancing_algorithm: str or
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
- :keyword ramp_down_start_time: Starting time for ramp down period.
+ :keyword ramp_down_start_time: Starting time for ramp down period. Required.
:paramtype ramp_down_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword ramp_down_load_balancing_algorithm: Load balancing algorithm for ramp down period.
Known values are: "BreadthFirst" and "DepthFirst".
@@ -4667,7 +5861,7 @@ def __init__(
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
:keyword ramp_down_minimum_hosts_pct: Minimum host percentage for ramp down period.
:paramtype ramp_down_minimum_hosts_pct: int
- :keyword ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period.
+ :keyword ramp_down_capacity_threshold_pct: Capacity threshold for ramp down period. Required.
:paramtype ramp_down_capacity_threshold_pct: int
:keyword ramp_down_force_logoff_users: Should users be logged off forcefully from hosts.
:paramtype ramp_down_force_logoff_users: bool
@@ -4681,7 +5875,7 @@ def __init__(
:keyword ramp_down_notification_message: Notification message for users during ramp down
period.
:paramtype ramp_down_notification_message: str
- :keyword off_peak_start_time: Starting time for off-peak period.
+ :keyword off_peak_start_time: Starting time for off-peak period. Required.
:paramtype off_peak_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword off_peak_load_balancing_algorithm: Load balancing algorithm for off-peak period. Known
values are: "BreadthFirst" and "DepthFirst".
@@ -4689,6 +5883,7 @@ def __init__(
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
"""
super().__init__(**kwargs)
+ self.name_properties_name = None
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
@@ -4738,7 +5933,7 @@ def __init__(self, *, value: Optional[List["_models.ScalingPlanPooledSchedule"]]
self.next_link = None
-class ScalingPlanPooledSchedulePatch(Resource): # pylint: disable=too-many-instance-attributes
+class ScalingPlanPooledSchedulePatch(Resource):
"""ScalingPlanPooledSchedule properties that can be patched.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -4754,6 +5949,8 @@ class ScalingPlanPooledSchedulePatch(Resource): # pylint: disable=too-many-inst
:ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
information.
:vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ :ivar name_properties_name: Name of the ScalingPlanPooledSchedule.
+ :vartype name_properties_name: str
:ivar days_of_week: Set of days of the week on which this schedule is active.
:vartype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
:ivar ramp_up_start_time: Starting time for ramp up period.
@@ -4806,6 +6003,7 @@ class ScalingPlanPooledSchedulePatch(Resource): # pylint: disable=too-many-inst
"name": {"readonly": True},
"type": {"readonly": True},
"system_data": {"readonly": True},
+ "name_properties_name": {"readonly": True},
"ramp_up_minimum_hosts_pct": {"maximum": 100, "minimum": 0},
"ramp_up_capacity_threshold_pct": {"maximum": 100, "minimum": 1},
"ramp_down_minimum_hosts_pct": {"maximum": 100, "minimum": 0},
@@ -4817,6 +6015,7 @@ class ScalingPlanPooledSchedulePatch(Resource): # pylint: disable=too-many-inst
"name": {"key": "name", "type": "str"},
"type": {"key": "type", "type": "str"},
"system_data": {"key": "systemData", "type": "SystemData"},
+ "name_properties_name": {"key": "properties.name", "type": "str"},
"days_of_week": {"key": "properties.daysOfWeek", "type": "[str]"},
"ramp_up_start_time": {"key": "properties.rampUpStartTime", "type": "Time"},
"ramp_up_load_balancing_algorithm": {"key": "properties.rampUpLoadBalancingAlgorithm", "type": "str"},
@@ -4907,6 +6106,7 @@ def __init__(
~azure.mgmt.desktopvirtualization.models.SessionHostLoadBalancingAlgorithm
"""
super().__init__(**kwargs)
+ self.name_properties_name = None
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
@@ -4926,14 +6126,13 @@ def __init__(
self.off_peak_load_balancing_algorithm = off_peak_load_balancing_algorithm
-class ScalingSchedule(_serialization.Model): # pylint: disable=too-many-instance-attributes
+class ScalingSchedule(_serialization.Model):
"""A ScalingPlanPooledSchedule.
:ivar name: Name of the ScalingPlanPooledSchedule.
:vartype name: str
:ivar days_of_week: Set of days of the week on which this schedule is active.
- :vartype days_of_week: list[str or
- ~azure.mgmt.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem]
+ :vartype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
:ivar ramp_up_start_time: Starting time for ramp up period.
:vartype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:ivar ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Known
@@ -5011,7 +6210,7 @@ def __init__(
self,
*,
name: Optional[str] = None,
- days_of_week: Optional[List[Union[str, "_models.ScalingScheduleDaysOfWeekItem"]]] = None,
+ days_of_week: Optional[List[Union[str, "_models.DayOfWeek"]]] = None,
ramp_up_start_time: Optional["_models.Time"] = None,
ramp_up_load_balancing_algorithm: Optional[Union[str, "_models.SessionHostLoadBalancingAlgorithm"]] = None,
ramp_up_minimum_hosts_pct: Optional[int] = None,
@@ -5034,8 +6233,7 @@ def __init__(
:keyword name: Name of the ScalingPlanPooledSchedule.
:paramtype name: str
:keyword days_of_week: Set of days of the week on which this schedule is active.
- :paramtype days_of_week: list[str or
- ~azure.mgmt.desktopvirtualization.models.ScalingScheduleDaysOfWeekItem]
+ :paramtype days_of_week: list[str or ~azure.mgmt.desktopvirtualization.models.DayOfWeek]
:keyword ramp_up_start_time: Starting time for ramp up period.
:paramtype ramp_up_start_time: ~azure.mgmt.desktopvirtualization.models.Time
:keyword ramp_up_load_balancing_algorithm: Load balancing algorithm for ramp up period. Known
@@ -5102,6 +6300,88 @@ def __init__(
self.off_peak_load_balancing_algorithm = off_peak_load_balancing_algorithm
+class SecurityInfoPatchProperties(_serialization.Model):
+ """Security information.
+
+ :ivar type: The security type used by virtual machine in hostpool session host. Known values
+ are: "Standard", "TrustedLaunch", and "ConfidentialVM".
+ :vartype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineSecurityType
+ :ivar secure_boot_enabled: Whether to use secureBoot on the virtual machine.
+ :vartype secure_boot_enabled: bool
+ :ivar v_tpm_enabled: Whether to use vTPM on the virtual machine.
+ :vartype v_tpm_enabled: bool
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "secure_boot_enabled": {"key": "secureBootEnabled", "type": "bool"},
+ "v_tpm_enabled": {"key": "vTpmEnabled", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.VirtualMachineSecurityType"]] = None,
+ secure_boot_enabled: Optional[bool] = None,
+ v_tpm_enabled: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The security type used by virtual machine in hostpool session host. Known values
+ are: "Standard", "TrustedLaunch", and "ConfidentialVM".
+ :paramtype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineSecurityType
+ :keyword secure_boot_enabled: Whether to use secureBoot on the virtual machine.
+ :paramtype secure_boot_enabled: bool
+ :keyword v_tpm_enabled: Whether to use vTPM on the virtual machine.
+ :paramtype v_tpm_enabled: bool
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.secure_boot_enabled = secure_boot_enabled
+ self.v_tpm_enabled = v_tpm_enabled
+
+
+class SecurityInfoProperties(_serialization.Model):
+ """Security information.
+
+ :ivar type: The security type used by virtual machine in hostpool session host. Default is
+ Standard. Known values are: "Standard", "TrustedLaunch", and "ConfidentialVM".
+ :vartype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineSecurityType
+ :ivar secure_boot_enabled: Whether to use secureBoot on the virtual machine.
+ :vartype secure_boot_enabled: bool
+ :ivar v_tpm_enabled: Whether to use vTPM on the virtual machine.
+ :vartype v_tpm_enabled: bool
+ """
+
+ _attribute_map = {
+ "type": {"key": "type", "type": "str"},
+ "secure_boot_enabled": {"key": "secureBootEnabled", "type": "bool"},
+ "v_tpm_enabled": {"key": "vTpmEnabled", "type": "bool"},
+ }
+
+ def __init__(
+ self,
+ *,
+ type: Optional[Union[str, "_models.VirtualMachineSecurityType"]] = None,
+ secure_boot_enabled: Optional[bool] = None,
+ v_tpm_enabled: Optional[bool] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword type: The security type used by virtual machine in hostpool session host. Default is
+ Standard. Known values are: "Standard", "TrustedLaunch", and "ConfidentialVM".
+ :paramtype type: str or ~azure.mgmt.desktopvirtualization.models.VirtualMachineSecurityType
+ :keyword secure_boot_enabled: Whether to use secureBoot on the virtual machine.
+ :paramtype secure_boot_enabled: bool
+ :keyword v_tpm_enabled: Whether to use vTPM on the virtual machine.
+ :paramtype v_tpm_enabled: bool
+ """
+ super().__init__(**kwargs)
+ self.type = type
+ self.secure_boot_enabled = secure_boot_enabled
+ self.v_tpm_enabled = v_tpm_enabled
+
+
class SendMessage(_serialization.Model):
"""Represents message sent to a UserSession.
@@ -5150,7 +6430,7 @@ def __init__(self, *, log_specifications: Optional[List["_models.LogSpecificatio
self.log_specifications = log_specifications
-class SessionHost(Resource): # pylint: disable=too-many-instance-attributes
+class SessionHost(Resource):
"""Represents a SessionHost definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -5202,6 +6482,11 @@ class SessionHost(Resource): # pylint: disable=too-many-instance-attributes
:vartype last_update_time: ~datetime.datetime
:ivar update_error_message: The error message.
:vartype update_error_message: str
+ :ivar last_session_host_update_time: The last time update was completed.
+ :vartype last_session_host_update_time: ~datetime.datetime
+ :ivar session_host_configuration: SessionHostConfiguration version reference at the time the
+ update is initiated, in the format of date time. Example: 2024-04-26T04:56:45Z.
+ :vartype session_host_configuration: str
:ivar session_host_health_check_results: List of SessionHostHealthCheckReports.
:vartype session_host_health_check_results:
list[~azure.mgmt.desktopvirtualization.models.SessionHostHealthCheckReport]
@@ -5217,6 +6502,8 @@ class SessionHost(Resource): # pylint: disable=too-many-instance-attributes
"resource_id": {"readonly": True},
"status_timestamp": {"readonly": True},
"last_update_time": {"readonly": True},
+ "last_session_host_update_time": {"readonly": True},
+ "session_host_configuration": {"readonly": True},
"session_host_health_check_results": {"readonly": True},
}
@@ -5241,6 +6528,8 @@ class SessionHost(Resource): # pylint: disable=too-many-instance-attributes
"update_state": {"key": "properties.updateState", "type": "str"},
"last_update_time": {"key": "properties.lastUpdateTime", "type": "iso-8601"},
"update_error_message": {"key": "properties.updateErrorMessage", "type": "str"},
+ "last_session_host_update_time": {"key": "properties.lastSessionHostUpdateTime", "type": "iso-8601"},
+ "session_host_configuration": {"key": "properties.sessionHostConfiguration", "type": "str"},
"session_host_health_check_results": {
"key": "properties.sessionHostHealthCheckResults",
"type": "[SessionHostHealthCheckReport]",
@@ -5308,9 +6597,369 @@ def __init__(
self.update_state = update_state
self.last_update_time = None
self.update_error_message = update_error_message
+ self.last_session_host_update_time = None
+ self.session_host_configuration = None
self.session_host_health_check_results = None
+class SessionHostConfiguration(Resource):
+ """Represents a SessionHostConfiguration 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ :ivar version: The timestamp of the last update.
+ :vartype version: ~datetime.datetime
+ :ivar friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :vartype friendly_name: str
+ :ivar provisioning_state: Provisioning state of the Session Host Configuration. Known values
+ are: "Succeeded", "Failed", "Canceled", and "Provisioning".
+ :vartype provisioning_state: str or
+ ~azure.mgmt.desktopvirtualization.models.ProvisioningStateSHC
+ :ivar vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :vartype vm_tags: dict[str, str]
+ :ivar vm_location: The Location for the session host to be created in. It will default to the
+ location of the hostpool if not provided.
+ :vartype vm_location: str
+ :ivar vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :vartype vm_resource_group: str
+ :ivar vm_name_prefix: The prefix that should be associated with session host names. Required.
+ :vartype vm_name_prefix: str
+ :ivar availability_zones: Value for availability zones to be used by the session host. Should
+ be from [1,2,3].
+ :vartype availability_zones: list[int]
+ :ivar network_info: Network information. Required.
+ :vartype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoProperties
+ :ivar vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6. Required.
+ :vartype vm_size_id: str
+ :ivar disk_info: Disk information. Required.
+ :vartype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoProperties
+ :ivar custom_configuration_script_url: The uri to the storage blob containing the arm template
+ to be run on the virtual machine after provisioning.
+ :vartype custom_configuration_script_url: str
+ :ivar image_info: Image configurations of HostPool. Required.
+ :vartype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoProperties
+ :ivar domain_info: Domain configurations of session hosts. Required.
+ :vartype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoProperties
+ :ivar security_info: Security information.
+ :vartype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoProperties
+ :ivar vm_admin_credentials: Local Admin credentials for session hosts. Required.
+ :vartype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :ivar boot_diagnostics_info: Boot Diagnostics information.
+ :vartype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "version": {"readonly": True},
+ "friendly_name": {"max_length": 260},
+ "provisioning_state": {"readonly": True},
+ "vm_name_prefix": {"required": True, "max_length": 11},
+ "network_info": {"required": True},
+ "vm_size_id": {"required": True},
+ "disk_info": {"required": True},
+ "image_info": {"required": True},
+ "domain_info": {"required": True},
+ "vm_admin_credentials": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "version": {"key": "properties.version", "type": "iso-8601"},
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "provisioning_state": {"key": "properties.provisioningState", "type": "str"},
+ "vm_tags": {"key": "properties.vmTags", "type": "{str}"},
+ "vm_location": {"key": "properties.vmLocation", "type": "str"},
+ "vm_resource_group": {"key": "properties.vmResourceGroup", "type": "str"},
+ "vm_name_prefix": {"key": "properties.vmNamePrefix", "type": "str"},
+ "availability_zones": {"key": "properties.availabilityZones", "type": "[int]"},
+ "network_info": {"key": "properties.networkInfo", "type": "NetworkInfoProperties"},
+ "vm_size_id": {"key": "properties.vmSizeId", "type": "str"},
+ "disk_info": {"key": "properties.diskInfo", "type": "DiskInfoProperties"},
+ "custom_configuration_script_url": {"key": "properties.customConfigurationScriptUrl", "type": "str"},
+ "image_info": {"key": "properties.imageInfo", "type": "ImageInfoProperties"},
+ "domain_info": {"key": "properties.domainInfo", "type": "DomainInfoProperties"},
+ "security_info": {"key": "properties.securityInfo", "type": "SecurityInfoProperties"},
+ "vm_admin_credentials": {"key": "properties.vmAdminCredentials", "type": "KeyVaultCredentialsProperties"},
+ "boot_diagnostics_info": {"key": "properties.bootDiagnosticsInfo", "type": "BootDiagnosticsInfoProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ vm_name_prefix: str,
+ network_info: "_models.NetworkInfoProperties",
+ vm_size_id: str,
+ disk_info: "_models.DiskInfoProperties",
+ image_info: "_models.ImageInfoProperties",
+ domain_info: "_models.DomainInfoProperties",
+ vm_admin_credentials: "_models.KeyVaultCredentialsProperties",
+ friendly_name: Optional[str] = None,
+ vm_tags: Optional[Dict[str, str]] = None,
+ vm_location: Optional[str] = None,
+ vm_resource_group: Optional[str] = None,
+ availability_zones: Optional[List[int]] = None,
+ custom_configuration_script_url: Optional[str] = None,
+ security_info: Optional["_models.SecurityInfoProperties"] = None,
+ boot_diagnostics_info: Optional["_models.BootDiagnosticsInfoProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :paramtype friendly_name: str
+ :keyword vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :paramtype vm_tags: dict[str, str]
+ :keyword vm_location: The Location for the session host to be created in. It will default to
+ the location of the hostpool if not provided.
+ :paramtype vm_location: str
+ :keyword vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :paramtype vm_resource_group: str
+ :keyword vm_name_prefix: The prefix that should be associated with session host names.
+ Required.
+ :paramtype vm_name_prefix: str
+ :keyword availability_zones: Value for availability zones to be used by the session host.
+ Should be from [1,2,3].
+ :paramtype availability_zones: list[int]
+ :keyword network_info: Network information. Required.
+ :paramtype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoProperties
+ :keyword vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6. Required.
+ :paramtype vm_size_id: str
+ :keyword disk_info: Disk information. Required.
+ :paramtype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoProperties
+ :keyword custom_configuration_script_url: The uri to the storage blob containing the arm
+ template to be run on the virtual machine after provisioning.
+ :paramtype custom_configuration_script_url: str
+ :keyword image_info: Image configurations of HostPool. Required.
+ :paramtype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoProperties
+ :keyword domain_info: Domain configurations of session hosts. Required.
+ :paramtype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoProperties
+ :keyword security_info: Security information.
+ :paramtype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoProperties
+ :keyword vm_admin_credentials: Local Admin credentials for session hosts. Required.
+ :paramtype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsProperties
+ :keyword boot_diagnostics_info: Boot Diagnostics information.
+ :paramtype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoProperties
+ """
+ super().__init__(**kwargs)
+ self.version = None
+ self.friendly_name = friendly_name
+ self.provisioning_state = None
+ self.vm_tags = vm_tags
+ self.vm_location = vm_location
+ self.vm_resource_group = vm_resource_group
+ self.vm_name_prefix = vm_name_prefix
+ self.availability_zones = availability_zones
+ self.network_info = network_info
+ self.vm_size_id = vm_size_id
+ self.disk_info = disk_info
+ self.custom_configuration_script_url = custom_configuration_script_url
+ self.image_info = image_info
+ self.domain_info = domain_info
+ self.security_info = security_info
+ self.vm_admin_credentials = vm_admin_credentials
+ self.boot_diagnostics_info = boot_diagnostics_info
+
+
+class SessionHostConfigurationList(_serialization.Model):
+ """List of SessionHostConfiguration definitions.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: List of SessionHostConfiguration definitions.
+ :vartype value: list[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :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": "[SessionHostConfiguration]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.SessionHostConfiguration"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: List of SessionHostConfiguration definitions.
+ :paramtype value: list[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class SessionHostConfigurationPatch(_serialization.Model):
+ """Represents a SessionHostConfigurationPatch definition.
+
+ :ivar friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :vartype friendly_name: str
+ :ivar vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :vartype vm_tags: dict[str, str]
+ :ivar vm_location: The Location for the session host to be created in.
+ :vartype vm_location: str
+ :ivar vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :vartype vm_resource_group: str
+ :ivar vm_name_prefix: The prefix that should be associated with session host names.
+ :vartype vm_name_prefix: str
+ :ivar availability_zones: Value for availability zones to be used by the session host. Should
+ be from [1,2,3].
+ :vartype availability_zones: list[int]
+ :ivar network_info: Network information.
+ :vartype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoPatchProperties
+ :ivar vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6.
+ :vartype vm_size_id: str
+ :ivar disk_info: Disk information.
+ :vartype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoPatchProperties
+ :ivar custom_configuration_script_url: The uri to the storage blob containing the arm template
+ to be run on the virtual machine after provisioning.
+ :vartype custom_configuration_script_url: str
+ :ivar image_info: Image configurations of HostPool.
+ :vartype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoPatchProperties
+ :ivar domain_info: Domain configurations of session hosts.
+ :vartype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoPatchProperties
+ :ivar security_info: Security information.
+ :vartype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoPatchProperties
+ :ivar vm_admin_credentials: Local Admin credentials for session hosts.
+ :vartype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsPatchProperties
+ :ivar boot_diagnostics_info: Boot Diagnostics information.
+ :vartype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties
+ """
+
+ _validation = {
+ "friendly_name": {"max_length": 260},
+ "vm_name_prefix": {"max_length": 11},
+ "custom_configuration_script_url": {"max_length": 260},
+ }
+
+ _attribute_map = {
+ "friendly_name": {"key": "properties.friendlyName", "type": "str"},
+ "vm_tags": {"key": "properties.vmTags", "type": "{str}"},
+ "vm_location": {"key": "properties.vmLocation", "type": "str"},
+ "vm_resource_group": {"key": "properties.vmResourceGroup", "type": "str"},
+ "vm_name_prefix": {"key": "properties.vmNamePrefix", "type": "str"},
+ "availability_zones": {"key": "properties.availabilityZones", "type": "[int]"},
+ "network_info": {"key": "properties.networkInfo", "type": "NetworkInfoPatchProperties"},
+ "vm_size_id": {"key": "properties.vmSizeId", "type": "str"},
+ "disk_info": {"key": "properties.diskInfo", "type": "DiskInfoPatchProperties"},
+ "custom_configuration_script_url": {"key": "properties.customConfigurationScriptUrl", "type": "str"},
+ "image_info": {"key": "properties.imageInfo", "type": "ImageInfoPatchProperties"},
+ "domain_info": {"key": "properties.domainInfo", "type": "DomainInfoPatchProperties"},
+ "security_info": {"key": "properties.securityInfo", "type": "SecurityInfoPatchProperties"},
+ "vm_admin_credentials": {"key": "properties.vmAdminCredentials", "type": "KeyVaultCredentialsPatchProperties"},
+ "boot_diagnostics_info": {
+ "key": "properties.bootDiagnosticsInfo",
+ "type": "BootDiagnosticsInfoPatchProperties",
+ },
+ }
+
+ def __init__(
+ self,
+ *,
+ friendly_name: Optional[str] = None,
+ vm_tags: Optional[Dict[str, str]] = None,
+ vm_location: Optional[str] = None,
+ vm_resource_group: Optional[str] = None,
+ vm_name_prefix: Optional[str] = None,
+ availability_zones: Optional[List[int]] = None,
+ network_info: Optional["_models.NetworkInfoPatchProperties"] = None,
+ vm_size_id: Optional[str] = None,
+ disk_info: Optional["_models.DiskInfoPatchProperties"] = None,
+ custom_configuration_script_url: Optional[str] = None,
+ image_info: Optional["_models.ImageInfoPatchProperties"] = None,
+ domain_info: Optional["_models.DomainInfoPatchProperties"] = None,
+ security_info: Optional["_models.SecurityInfoPatchProperties"] = None,
+ vm_admin_credentials: Optional["_models.KeyVaultCredentialsPatchProperties"] = None,
+ boot_diagnostics_info: Optional["_models.BootDiagnosticsInfoPatchProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword friendly_name: Friendly name to describe this version of the SessionHostConfiguration.
+ :paramtype friendly_name: str
+ :keyword vm_tags: Hashtable that lists key/value pair tags to apply to the VMs.
+ :paramtype vm_tags: dict[str, str]
+ :keyword vm_location: The Location for the session host to be created in.
+ :paramtype vm_location: str
+ :keyword vm_resource_group: The ResourceGroup for the session hosts to be created in. It will
+ default to the ResourceGroup of the hostpool if not provided.
+ :paramtype vm_resource_group: str
+ :keyword vm_name_prefix: The prefix that should be associated with session host names.
+ :paramtype vm_name_prefix: str
+ :keyword availability_zones: Value for availability zones to be used by the session host.
+ Should be from [1,2,3].
+ :paramtype availability_zones: list[int]
+ :keyword network_info: Network information.
+ :paramtype network_info: ~azure.mgmt.desktopvirtualization.models.NetworkInfoPatchProperties
+ :keyword vm_size_id: The id of the size of a virtual machine connected to a hostpool. Example:
+ Standard_D2as_v6.
+ :paramtype vm_size_id: str
+ :keyword disk_info: Disk information.
+ :paramtype disk_info: ~azure.mgmt.desktopvirtualization.models.DiskInfoPatchProperties
+ :keyword custom_configuration_script_url: The uri to the storage blob containing the arm
+ template to be run on the virtual machine after provisioning.
+ :paramtype custom_configuration_script_url: str
+ :keyword image_info: Image configurations of HostPool.
+ :paramtype image_info: ~azure.mgmt.desktopvirtualization.models.ImageInfoPatchProperties
+ :keyword domain_info: Domain configurations of session hosts.
+ :paramtype domain_info: ~azure.mgmt.desktopvirtualization.models.DomainInfoPatchProperties
+ :keyword security_info: Security information.
+ :paramtype security_info: ~azure.mgmt.desktopvirtualization.models.SecurityInfoPatchProperties
+ :keyword vm_admin_credentials: Local Admin credentials for session hosts.
+ :paramtype vm_admin_credentials:
+ ~azure.mgmt.desktopvirtualization.models.KeyVaultCredentialsPatchProperties
+ :keyword boot_diagnostics_info: Boot Diagnostics information.
+ :paramtype boot_diagnostics_info:
+ ~azure.mgmt.desktopvirtualization.models.BootDiagnosticsInfoPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.friendly_name = friendly_name
+ self.vm_tags = vm_tags
+ self.vm_location = vm_location
+ self.vm_resource_group = vm_resource_group
+ self.vm_name_prefix = vm_name_prefix
+ self.availability_zones = availability_zones
+ self.network_info = network_info
+ self.vm_size_id = vm_size_id
+ self.disk_info = disk_info
+ self.custom_configuration_script_url = custom_configuration_script_url
+ self.image_info = image_info
+ self.domain_info = domain_info
+ self.security_info = security_info
+ self.vm_admin_credentials = vm_admin_credentials
+ self.boot_diagnostics_info = boot_diagnostics_info
+
+
class SessionHostHealthCheckFailureDetails(_serialization.Model):
"""Contains details on the failure.
@@ -5416,6 +7065,306 @@ def __init__(self, *, value: Optional[List["_models.SessionHost"]] = None, **kwa
self.next_link = None
+class SessionHostManagement(ProxyResource):
+ """Represents a SessionHostManagement 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 server.
+
+ :ivar id: Fully qualified resource ID for the resource. E.g.
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long
+ :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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
+ information.
+ :vartype system_data: ~azure.mgmt.desktopvirtualization.models.SystemData
+ :ivar scheduled_date_time_zone: Time zone for sessionHostManagement operations as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set
+ if useLocalTime is true. Required.
+ :vartype scheduled_date_time_zone: str
+ :ivar update: Parameters for a hostpool update. Required.
+ :vartype update: ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationProperties
+ """
+
+ _validation = {
+ "id": {"readonly": True},
+ "name": {"readonly": True},
+ "type": {"readonly": True},
+ "system_data": {"readonly": True},
+ "scheduled_date_time_zone": {"required": True},
+ "update": {"required": True},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "type": {"key": "type", "type": "str"},
+ "system_data": {"key": "systemData", "type": "SystemData"},
+ "scheduled_date_time_zone": {"key": "properties.scheduledDateTimeZone", "type": "str"},
+ "update": {"key": "properties.update", "type": "HostPoolUpdateConfigurationProperties"},
+ }
+
+ def __init__(
+ self, *, scheduled_date_time_zone: str, update: "_models.HostPoolUpdateConfigurationProperties", **kwargs: Any
+ ) -> None:
+ """
+ :keyword scheduled_date_time_zone: Time zone for sessionHostManagement operations as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set
+ if useLocalTime is true. Required.
+ :paramtype scheduled_date_time_zone: str
+ :keyword update: Parameters for a hostpool update. Required.
+ :paramtype update:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationProperties
+ """
+ super().__init__(**kwargs)
+ self.scheduled_date_time_zone = scheduled_date_time_zone
+ self.update = update
+
+
+class SessionHostManagementList(_serialization.Model):
+ """List of SessionHostManagement definitions.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar value: List of SessionHostManagement definitions.
+ :vartype value: list[~azure.mgmt.desktopvirtualization.models.SessionHostManagement]
+ :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": "[SessionHostManagement]"},
+ "next_link": {"key": "nextLink", "type": "str"},
+ }
+
+ def __init__(self, *, value: Optional[List["_models.SessionHostManagement"]] = None, **kwargs: Any) -> None:
+ """
+ :keyword value: List of SessionHostManagement definitions.
+ :paramtype value: list[~azure.mgmt.desktopvirtualization.models.SessionHostManagement]
+ """
+ super().__init__(**kwargs)
+ self.value = value
+ self.next_link = None
+
+
+class SessionHostManagementOperationProgress(_serialization.Model):
+ """SessionHostManagement Operation Progress information.
+
+ :ivar execution_start_time: Time that the sessionHostManagement operation was created.
+ :vartype execution_start_time: ~datetime.datetime
+ :ivar total_session_hosts: The number of sessionHosts to be started in the
+ sessionHostManagement operation.
+ :vartype total_session_hosts: int
+ :ivar session_hosts_in_progress: The number of sessionHosts in progress in the
+ sessionHostManagement operation.
+ :vartype session_hosts_in_progress: int
+ :ivar session_hosts_completed: The number of sessionHosts completed in the
+ sessionHostManagement operation.
+ :vartype session_hosts_completed: int
+ :ivar session_hosts_rollback_failed: The number of sessionHosts rollback failed in the
+ sessionHostManagement operation.
+ :vartype session_hosts_rollback_failed: int
+ """
+
+ _attribute_map = {
+ "execution_start_time": {"key": "executionStartTime", "type": "iso-8601"},
+ "total_session_hosts": {"key": "totalSessionHosts", "type": "int"},
+ "session_hosts_in_progress": {"key": "sessionHostsInProgress", "type": "int"},
+ "session_hosts_completed": {"key": "sessionHostsCompleted", "type": "int"},
+ "session_hosts_rollback_failed": {"key": "sessionHostsRollbackFailed", "type": "int"},
+ }
+
+ def __init__(
+ self,
+ *,
+ execution_start_time: Optional[datetime.datetime] = None,
+ total_session_hosts: Optional[int] = None,
+ session_hosts_in_progress: Optional[int] = None,
+ session_hosts_completed: Optional[int] = None,
+ session_hosts_rollback_failed: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword execution_start_time: Time that the sessionHostManagement operation was created.
+ :paramtype execution_start_time: ~datetime.datetime
+ :keyword total_session_hosts: The number of sessionHosts to be started in the
+ sessionHostManagement operation.
+ :paramtype total_session_hosts: int
+ :keyword session_hosts_in_progress: The number of sessionHosts in progress in the
+ sessionHostManagement operation.
+ :paramtype session_hosts_in_progress: int
+ :keyword session_hosts_completed: The number of sessionHosts completed in the
+ sessionHostManagement operation.
+ :paramtype session_hosts_completed: int
+ :keyword session_hosts_rollback_failed: The number of sessionHosts rollback failed in the
+ sessionHostManagement operation.
+ :paramtype session_hosts_rollback_failed: int
+ """
+ super().__init__(**kwargs)
+ self.execution_start_time = execution_start_time
+ self.total_session_hosts = total_session_hosts
+ self.session_hosts_in_progress = session_hosts_in_progress
+ self.session_hosts_completed = session_hosts_completed
+ self.session_hosts_rollback_failed = session_hosts_rollback_failed
+
+
+class SessionHostManagementPatch(_serialization.Model):
+ """Represents a SessionHostManagementPatch definition.
+
+ :ivar scheduled_date_time_zone: Time zone for sessionHostManagement operations as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set
+ if useLocalTime is true.
+ :vartype scheduled_date_time_zone: str
+ :ivar update: Parameters for a hostpool update.
+ :vartype update:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties
+ """
+
+ _attribute_map = {
+ "scheduled_date_time_zone": {"key": "properties.scheduledDateTimeZone", "type": "str"},
+ "update": {"key": "properties.update", "type": "HostPoolUpdateConfigurationPatchProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ scheduled_date_time_zone: Optional[str] = None,
+ update: Optional["_models.HostPoolUpdateConfigurationPatchProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword scheduled_date_time_zone: Time zone for sessionHostManagement operations as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid. Must be set
+ if useLocalTime is true.
+ :paramtype scheduled_date_time_zone: str
+ :keyword update: Parameters for a hostpool update.
+ :paramtype update:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.scheduled_date_time_zone = scheduled_date_time_zone
+ self.update = update
+
+
+class SessionHostManagementUpdateStatus(_serialization.Model):
+ """The current status of the session host update async operation.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar id: Fully qualified ID for the async operation.
+ :vartype id: str
+ :ivar name: Name of the async operation.
+ :vartype name: str
+ :ivar status: Operation status. Current defined values are < Error | Scheduled |
+ UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > |
+ Succeeded | Failed | Canceled. Required.
+ :vartype status: str
+ :ivar percent_complete: Percent of the operation that is complete.
+ :vartype percent_complete: float
+ :ivar start_time: The start time of the operation.
+ :vartype start_time: ~datetime.datetime
+ :ivar end_time: The end time of the operation.
+ :vartype end_time: ~datetime.datetime
+ :ivar error: If present, details of the operation error.
+ :vartype error: ~azure.mgmt.desktopvirtualization.models.ErrorDetail
+ :ivar correlation_id: The Log Analytics.
+ :vartype correlation_id: str
+ :ivar progress: Progress information on the sessionHostManagement operation.
+ :vartype progress:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementOperationProgress
+ :ivar scheduled_date_time: The timestamp that the update is scheduled for.
+ :vartype scheduled_date_time: ~datetime.datetime
+ :ivar session_host_management: SessionHostManagement properties used for the operation.
+ :vartype session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ """
+
+ _validation = {
+ "status": {"required": True},
+ "percent_complete": {"maximum": 100, "minimum": 0},
+ }
+
+ _attribute_map = {
+ "id": {"key": "id", "type": "str"},
+ "name": {"key": "name", "type": "str"},
+ "status": {"key": "status", "type": "str"},
+ "percent_complete": {"key": "percentComplete", "type": "float"},
+ "start_time": {"key": "startTime", "type": "iso-8601"},
+ "end_time": {"key": "endTime", "type": "iso-8601"},
+ "error": {"key": "error", "type": "ErrorDetail"},
+ "correlation_id": {"key": "properties.correlationId", "type": "str"},
+ "progress": {"key": "properties.progress", "type": "SessionHostManagementOperationProgress"},
+ "scheduled_date_time": {"key": "properties.scheduledDateTime", "type": "iso-8601"},
+ "session_host_management": {"key": "properties.sessionHostManagement", "type": "SessionHostManagement"},
+ }
+
+ def __init__(
+ self,
+ *,
+ status: str,
+ id: Optional[str] = None, # pylint: disable=redefined-builtin
+ name: Optional[str] = None,
+ percent_complete: Optional[float] = None,
+ start_time: Optional[datetime.datetime] = None,
+ end_time: Optional[datetime.datetime] = None,
+ error: Optional["_models.ErrorDetail"] = None,
+ correlation_id: Optional[str] = None,
+ progress: Optional["_models.SessionHostManagementOperationProgress"] = None,
+ scheduled_date_time: Optional[datetime.datetime] = None,
+ session_host_management: Optional["_models.SessionHostManagement"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword id: Fully qualified ID for the async operation.
+ :paramtype id: str
+ :keyword name: Name of the async operation.
+ :paramtype name: str
+ :keyword status: Operation status. Current defined values are < Error | Scheduled |
+ UpdatingSessionHosts | ValidatingSessionHostUpdate | Paused | Pausing | Cancelling > |
+ Succeeded | Failed | Canceled. Required.
+ :paramtype status: str
+ :keyword percent_complete: Percent of the operation that is complete.
+ :paramtype percent_complete: float
+ :keyword start_time: The start time of the operation.
+ :paramtype start_time: ~datetime.datetime
+ :keyword end_time: The end time of the operation.
+ :paramtype end_time: ~datetime.datetime
+ :keyword error: If present, details of the operation error.
+ :paramtype error: ~azure.mgmt.desktopvirtualization.models.ErrorDetail
+ :keyword correlation_id: The Log Analytics.
+ :paramtype correlation_id: str
+ :keyword progress: Progress information on the sessionHostManagement operation.
+ :paramtype progress:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementOperationProgress
+ :keyword scheduled_date_time: The timestamp that the update is scheduled for.
+ :paramtype scheduled_date_time: ~datetime.datetime
+ :keyword session_host_management: SessionHostManagement properties used for the operation.
+ :paramtype session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ """
+ super().__init__(**kwargs)
+ self.id = id
+ self.name = name
+ self.status = status
+ self.percent_complete = percent_complete
+ self.start_time = start_time
+ self.end_time = end_time
+ self.error = error
+ self.correlation_id = correlation_id
+ self.progress = progress
+ self.scheduled_date_time = scheduled_date_time
+ self.session_host_management = session_host_management
+
+
class SessionHostPatch(Resource):
"""SessionHost properties that can be patched.
@@ -5479,6 +7428,75 @@ def __init__(
self.friendly_name = friendly_name
+class Sku(_serialization.Model):
+ """The resource model definition representing SKU.
+
+ All required parameters must be populated in order to send to server.
+
+ :ivar name: The name of the SKU. E.g. P3. It is typically a letter+number code. Required.
+ :vartype name: str
+ :ivar tier: This field is required to be implemented by the Resource Provider if the service
+ has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic",
+ "Standard", and "Premium".
+ :vartype tier: str or ~azure.mgmt.desktopvirtualization.models.SkuTier
+ :ivar size: The SKU size. When the name field is the combination of tier and some other value,
+ this would be the standalone code.
+ :vartype size: str
+ :ivar family: If the service has different generations of hardware, for the same SKU, then that
+ can be captured here.
+ :vartype family: str
+ :ivar capacity: If the SKU supports scale out/in then the capacity integer should be included.
+ If scale out/in is not possible for the resource this may be omitted.
+ :vartype capacity: int
+ """
+
+ _validation = {
+ "name": {"required": True},
+ }
+
+ _attribute_map = {
+ "name": {"key": "name", "type": "str"},
+ "tier": {"key": "tier", "type": "str"},
+ "size": {"key": "size", "type": "str"},
+ "family": {"key": "family", "type": "str"},
+ "capacity": {"key": "capacity", "type": "int"},
+ }
+
+ def __init__(
+ self,
+ *,
+ name: str,
+ tier: Optional[Union[str, "_models.SkuTier"]] = None,
+ size: Optional[str] = None,
+ family: Optional[str] = None,
+ capacity: Optional[int] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword name: The name of the SKU. E.g. P3. It is typically a letter+number code. Required.
+ :paramtype name: str
+ :keyword tier: This field is required to be implemented by the Resource Provider if the service
+ has more than one tier, but is not required on a PUT. Known values are: "Free", "Basic",
+ "Standard", and "Premium".
+ :paramtype tier: str or ~azure.mgmt.desktopvirtualization.models.SkuTier
+ :keyword size: The SKU size. When the name field is the combination of tier and some other
+ value, this would be the standalone code.
+ :paramtype size: str
+ :keyword family: If the service has different generations of hardware, for the same SKU, then
+ that can be captured here.
+ :paramtype family: str
+ :keyword capacity: If the SKU supports scale out/in then the capacity integer should be
+ included. If scale out/in is not possible for the resource this may be omitted.
+ :paramtype capacity: int
+ """
+ super().__init__(**kwargs)
+ self.name = name
+ self.tier = tier
+ self.size = size
+ self.family = family
+ self.capacity = capacity
+
+
class StartMenuItem(Resource):
"""Represents a StartMenuItem definition.
@@ -5683,6 +7701,81 @@ def __init__(self, *, hour: int, minute: int, **kwargs: Any) -> None:
self.minute = minute
+class UpdateSessionHostsRequestBody(_serialization.Model):
+ """Object containing the definition for properties to be used for a sessionHostUpdate operation.
+
+ :ivar scheduled_date_time: The timestamp that the update validation is scheduled for. If none
+ is provided, the update will be executed immediately.
+ :vartype scheduled_date_time: ~datetime.datetime
+ :ivar scheduled_date_time_zone: The timeZone as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid.
+ :vartype scheduled_date_time_zone: str
+ :ivar update: settings for management information for the hostpool update operation. If none is
+ provided the update will use the settings saved in the sessionHostManagement object.
+ :vartype update:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties
+ """
+
+ _attribute_map = {
+ "scheduled_date_time": {"key": "scheduledDateTime", "type": "iso-8601"},
+ "scheduled_date_time_zone": {"key": "scheduledDateTimeZone", "type": "str"},
+ "update": {"key": "update", "type": "HostPoolUpdateConfigurationPatchProperties"},
+ }
+
+ def __init__(
+ self,
+ *,
+ scheduled_date_time: Optional[datetime.datetime] = None,
+ scheduled_date_time_zone: Optional[str] = None,
+ update: Optional["_models.HostPoolUpdateConfigurationPatchProperties"] = None,
+ **kwargs: Any
+ ) -> None:
+ """
+ :keyword scheduled_date_time: The timestamp that the update validation is scheduled for. If
+ none is provided, the update will be executed immediately.
+ :paramtype scheduled_date_time: ~datetime.datetime
+ :keyword scheduled_date_time_zone: The timeZone as defined in
+ https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid.
+ :paramtype scheduled_date_time_zone: str
+ :keyword update: settings for management information for the hostpool update operation. If none
+ is provided the update will use the settings saved in the sessionHostManagement object.
+ :paramtype update:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateConfigurationPatchProperties
+ """
+ super().__init__(**kwargs)
+ self.scheduled_date_time = scheduled_date_time
+ self.scheduled_date_time_zone = scheduled_date_time_zone
+ self.update = update
+
+
+class UserAssignedIdentity(_serialization.Model):
+ """User assigned identity properties.
+
+ Variables are only populated by the server, and will be ignored when sending a request.
+
+ :ivar principal_id: The principal ID of the assigned identity.
+ :vartype principal_id: str
+ :ivar client_id: The client ID of the assigned identity.
+ :vartype client_id: str
+ """
+
+ _validation = {
+ "principal_id": {"readonly": True},
+ "client_id": {"readonly": True},
+ }
+
+ _attribute_map = {
+ "principal_id": {"key": "principalId", "type": "str"},
+ "client_id": {"key": "clientId", "type": "str"},
+ }
+
+ def __init__(self, **kwargs: Any) -> None:
+ """ """
+ super().__init__(**kwargs)
+ self.principal_id = None
+ self.client_id = None
+
+
class UserSession(Resource):
"""Represents a UserSession definition.
@@ -5799,7 +7892,7 @@ def __init__(self, *, value: Optional[List["_models.UserSession"]] = None, **kwa
self.next_link = None
-class Workspace(ResourceModelWithAllowedPropertySet): # pylint: disable=too-many-instance-attributes
+class Workspace(ResourceModelWithAllowedPropertySet):
"""Represents a Workspace definition.
Variables are only populated by the server, and will be ignored when sending a request.
@@ -5836,13 +7929,12 @@ class Workspace(ResourceModelWithAllowedPropertySet): # pylint: disable=too-man
the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range
(section 14.27) header fields.
:vartype etag: str
- :ivar identity:
- :vartype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :ivar sku:
- :vartype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :ivar plan:
- :vartype plan: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :ivar identity: Managed service identity (system assigned and/or user assigned identities).
+ :vartype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :ivar sku: The resource model definition representing SKU.
+ :vartype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :ivar plan: Plan for the resource.
+ :vartype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:ivar object_id: ObjectId of Workspace. (internal use).
:vartype object_id: str
:ivar description: Description of Workspace.
@@ -5887,9 +7979,9 @@ class Workspace(ResourceModelWithAllowedPropertySet): # pylint: disable=too-man
"managed_by": {"key": "managedBy", "type": "str"},
"kind": {"key": "kind", "type": "str"},
"etag": {"key": "etag", "type": "str"},
- "identity": {"key": "identity", "type": "ResourceModelWithAllowedPropertySetIdentity"},
- "sku": {"key": "sku", "type": "ResourceModelWithAllowedPropertySetSku"},
- "plan": {"key": "plan", "type": "ResourceModelWithAllowedPropertySetPlan"},
+ "identity": {"key": "identity", "type": "ManagedServiceIdentity"},
+ "sku": {"key": "sku", "type": "Sku"},
+ "plan": {"key": "plan", "type": "Plan"},
"object_id": {"key": "properties.objectId", "type": "str"},
"description": {"key": "properties.description", "type": "str"},
"friendly_name": {"key": "properties.friendlyName", "type": "str"},
@@ -5909,9 +8001,9 @@ def __init__(
tags: Optional[Dict[str, str]] = None,
managed_by: Optional[str] = None,
kind: Optional[str] = None,
- identity: Optional["_models.ResourceModelWithAllowedPropertySetIdentity"] = None,
- sku: Optional["_models.ResourceModelWithAllowedPropertySetSku"] = None,
- plan: Optional["_models.ResourceModelWithAllowedPropertySetPlan"] = None,
+ identity: Optional["_models.ManagedServiceIdentity"] = None,
+ sku: Optional["_models.Sku"] = None,
+ plan: Optional["_models.Plan"] = None,
description: Optional[str] = None,
friendly_name: Optional[str] = None,
application_group_references: Optional[List[str]] = None,
@@ -5932,14 +8024,12 @@ def __init__(
resources of the same type. E.g. ApiApps are a kind of Microsoft.Web/sites type. If supported,
the resource provider must validate and persist this value.
:paramtype kind: str
- :keyword identity:
- :paramtype identity:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity
- :keyword sku:
- :paramtype sku: ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku
- :keyword plan:
- :paramtype plan:
- ~azure.mgmt.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan
+ :keyword identity: Managed service identity (system assigned and/or user assigned identities).
+ :paramtype identity: ~azure.mgmt.desktopvirtualization.models.ManagedServiceIdentity
+ :keyword sku: The resource model definition representing SKU.
+ :paramtype sku: ~azure.mgmt.desktopvirtualization.models.Sku
+ :keyword plan: Plan for the resource.
+ :paramtype plan: ~azure.mgmt.desktopvirtualization.models.Plan
:keyword description: Description of Workspace.
:paramtype description: str
:keyword friendly_name: Friendly name of Workspace.
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py
index df927dd95440..37f2db6a6d53 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/__init__.py
@@ -5,28 +5,41 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
+# pylint: disable=wrong-import-position
-from ._operations import Operations
-from ._workspaces_operations import WorkspacesOperations
-from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
-from ._private_link_resources_operations import PrivateLinkResourcesOperations
-from ._scaling_plans_operations import ScalingPlansOperations
-from ._scaling_plan_pooled_schedules_operations import ScalingPlanPooledSchedulesOperations
-from ._scaling_plan_personal_schedules_operations import ScalingPlanPersonalSchedulesOperations
-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 ._app_attach_package_info_operations import AppAttachPackageInfoOperations
-from ._msix_images_operations import MsixImagesOperations
-from ._app_attach_package_operations import AppAttachPackageOperations
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+ from ._patch import * # pylint: disable=unused-wildcard-import
+
+from ._operations import Operations # type: ignore
+from ._workspaces_operations import WorkspacesOperations # type: ignore
+from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore
+from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore
+from ._scaling_plans_operations import ScalingPlansOperations # type: ignore
+from ._scaling_plan_pooled_schedules_operations import ScalingPlanPooledSchedulesOperations # type: ignore
+from ._scaling_plan_personal_schedules_operations import ScalingPlanPersonalSchedulesOperations # type: ignore
+from ._application_groups_operations import ApplicationGroupsOperations # type: ignore
+from ._start_menu_items_operations import StartMenuItemsOperations # type: ignore
+from ._applications_operations import ApplicationsOperations # type: ignore
+from ._desktops_operations import DesktopsOperations # type: ignore
+from ._host_pools_operations import HostPoolsOperations # type: ignore
+from ._session_host_managements_operations import SessionHostManagementsOperations # type: ignore
+from ._initiate_session_host_update_operations import InitiateSessionHostUpdateOperations # type: ignore
+from ._control_session_host_update_operations import ControlSessionHostUpdateOperations # type: ignore
+from ._session_host_managements_update_status_operations import SessionHostManagementsUpdateStatusOperations # type: ignore
+from ._session_host_configurations_operations import SessionHostConfigurationsOperations # type: ignore
+from ._active_session_host_configurations_operations import ActiveSessionHostConfigurationsOperations # type: ignore
+from ._user_sessions_operations import UserSessionsOperations # type: ignore
+from ._session_hosts_operations import SessionHostsOperations # type: ignore
+from ._session_host_operations import SessionHostOperations # type: ignore
+from ._msix_packages_operations import MSIXPackagesOperations # type: ignore
+from ._app_attach_package_info_operations import AppAttachPackageInfoOperations # type: ignore
+from ._msix_images_operations import MsixImagesOperations # type: ignore
+from ._app_attach_package_operations import AppAttachPackageOperations # type: ignore
from ._patch import __all__ as _patch_all
-from ._patch import * # pylint: disable=unused-wildcard-import
+from ._patch import *
from ._patch import patch_sdk as _patch_sdk
__all__ = [
@@ -42,12 +55,19 @@
"ApplicationsOperations",
"DesktopsOperations",
"HostPoolsOperations",
+ "SessionHostManagementsOperations",
+ "InitiateSessionHostUpdateOperations",
+ "ControlSessionHostUpdateOperations",
+ "SessionHostManagementsUpdateStatusOperations",
+ "SessionHostConfigurationsOperations",
+ "ActiveSessionHostConfigurationsOperations",
"UserSessionsOperations",
"SessionHostsOperations",
+ "SessionHostOperations",
"MSIXPackagesOperations",
"AppAttachPackageInfoOperations",
"MsixImagesOperations",
"AppAttachPackageOperations",
]
-__all__.extend([p for p in _patch_all if p not in __all__])
+__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_session_host_configurations_operations.py
new file mode 100644
index 000000000000..c0b630334eab
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_active_session_host_configurations_operations.py
@@ -0,0 +1,271 @@
+# 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 sys
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_get_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_list_by_host_pool_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/activeSessionHostConfigurations",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class ActiveSessionHostConfigurationsOperations: # pylint: disable=name-too-long
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`active_session_host_configurations` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def get(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> _models.ActiveSessionHostConfiguration:
+ """Get the ActiveSessionHostConfiguration for the hostPool that is currently being used for update
+ operations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: ActiveSessionHostConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ActiveSessionHostConfiguration] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("ActiveSessionHostConfiguration", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> Iterable["_models.ActiveSessionHostConfiguration"]:
+ """List activeSessionHostConfigurations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either ActiveSessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.ActiveSessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.ActiveSessionHostConfigurationList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("ActiveSessionHostConfigurationList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_info_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_info_operations.py
index 077e07be9440..263bc8da9008 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_info_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_info_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_import_method_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -61,7 +60,7 @@ def build_import_method_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -184,7 +183,7 @@ def import_method(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_operations.py
index a6b06fb591c3..2994b21629c2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_app_attach_package_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -86,7 +85,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -124,12 +123,17 @@ def build_create_or_update_request(
def build_delete_request(
- resource_group_name: str, app_attach_package_name: str, subscription_id: str, **kwargs: Any
+ resource_group_name: str,
+ app_attach_package_name: str,
+ subscription_id: str,
+ *,
+ force: Optional[bool] = None,
+ **kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -156,6 +160,8 @@ def build_delete_request(
# Construct parameters
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+ if force is not None:
+ _params["force"] = _SERIALIZER.query("force", force, "bool")
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -169,7 +175,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -212,7 +218,7 @@ def build_list_by_resource_group_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -246,7 +252,7 @@ def build_list_by_subscription_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -296,13 +302,13 @@ def get(self, resource_group_name: str, app_attach_package_name: str, **kwargs:
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:return: AppAttachPackage or the result of cls(response)
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -360,7 +366,7 @@ def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Required.
:type app_attach_package: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
@@ -387,7 +393,7 @@ def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Required.
:type app_attach_package: IO[bytes]
@@ -412,7 +418,7 @@ def create_or_update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package: Object containing App Attach Package definitions. Is either a
AppAttachPackage type or a IO[bytes] type. Required.
@@ -422,7 +428,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -479,20 +485,22 @@ def create_or_update(
@distributed_trace
def delete( # pylint: disable=inconsistent-return-statements
- self, resource_group_name: str, app_attach_package_name: str, **kwargs: Any
+ self, resource_group_name: str, app_attach_package_name: str, force: Optional[bool] = None, **kwargs: Any
) -> None:
"""Remove an App Attach Package.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
+ :param force: Force flag to delete App Attach package. Default value is None.
+ :type force: bool
:return: None or the result of cls(response)
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -510,6 +518,7 @@ def delete( # pylint: disable=inconsistent-return-statements
resource_group_name=resource_group_name,
app_attach_package_name=app_attach_package_name,
subscription_id=self._config.subscription_id,
+ force=force,
api_version=api_version,
headers=_headers,
params=_params,
@@ -546,7 +555,7 @@ def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Default value
is None.
@@ -574,7 +583,7 @@ def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Default value
is None.
@@ -600,7 +609,7 @@ def update(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param app_attach_package_name: The name of the App Attach package. Required.
+ :param app_attach_package_name: The name of the App Attach package arm object. Required.
:type app_attach_package_name: str
:param app_attach_package_patch: Object containing App Attach Package definition. Is either a
AppAttachPackagePatch type or a IO[bytes] type. Default value is None.
@@ -610,7 +619,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.AppAttachPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -677,8 +686,8 @@ def list_by_resource_group(
:param resource_group_name: The name of the resource group. The name is case insensitive.
Required.
:type resource_group_name: str
- :param filter: OData filter expression. Valid properties for filtering are package name and
- host pool. Default value is None.
+ :param filter: OData filter expression. Valid properties for filtering are package name, host
+ pool, package owner name, and custom data. Default value is None.
:type filter: str
:return: An iterator like instance of either AppAttachPackage or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.AppAttachPackage]
@@ -690,7 +699,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -757,8 +766,8 @@ def get_next(next_link=None):
def list_by_subscription(self, filter: Optional[str] = None, **kwargs: Any) -> Iterable["_models.AppAttachPackage"]:
"""List App Attach packages in subscription.
- :param filter: OData filter expression. Valid properties for filtering are package name, host
- pool, and resource group. Default value is None.
+ :param filter: OData filter expression. Valid properties for filtering are package name,
+ resource group, host pool, package owner name, and custom data. Default value is None.
:type filter: str
:return: An iterator like instance of either AppAttachPackage or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.AppAttachPackage]
@@ -770,7 +779,7 @@ def list_by_subscription(self, filter: Optional[str] = None, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.AppAttachPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py
index 870748fdddd9..33591e5fa6ba 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_application_groups_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,8 +62,8 @@ def build_get_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -86,7 +85,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -104,8 +103,8 @@ def build_create_or_update_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -129,7 +128,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -146,8 +145,8 @@ def build_delete_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -169,7 +168,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -187,8 +186,8 @@ def build_update_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -219,7 +218,7 @@ def build_list_by_resource_group_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -259,7 +258,7 @@ def build_list_by_subscription_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -315,7 +314,7 @@ def get(self, resource_group_name: str, application_group_name: str, **kwargs: A
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -433,7 +432,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -502,7 +501,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -619,7 +618,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ApplicationGroup
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -710,7 +709,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationGroupList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -792,7 +791,7 @@ def list_by_subscription(self, filter: Optional[str] = None, **kwargs: Any) -> I
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationGroupList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py
index 0d9e753eab88..38144ea737c1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_applications_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,8 +62,8 @@ def build_get_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"applicationName": _SERIALIZER.url(
@@ -89,7 +88,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -107,8 +106,8 @@ def build_create_or_update_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"applicationName": _SERIALIZER.url(
@@ -135,7 +134,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -152,8 +151,8 @@ def build_delete_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"applicationName": _SERIALIZER.url(
@@ -178,7 +177,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -196,8 +195,8 @@ def build_update_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"applicationName": _SERIALIZER.url(
@@ -231,7 +230,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -248,8 +247,8 @@ def build_list_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -308,7 +307,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -439,7 +438,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -512,7 +511,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -639,7 +638,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Application
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -730,7 +729,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ApplicationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_control_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_control_session_host_update_operations.py
new file mode 100644
index 000000000000..5566d624531c
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_control_session_host_update_operations.py
@@ -0,0 +1,295 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Iterator, Optional, TypeVar, Union, cast, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_post_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/controlSessionHostUpdate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class ControlSessionHostUpdateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`control_session_host_update` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ def _post_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: Union[_models.HostPoolUpdateControlParameter, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(host_pool_update_control_parameter, (IOBase, bytes)):
+ _content = host_pool_update_control_parameter
+ else:
+ _json = self._serialize.body(host_pool_update_control_parameter, "HostPoolUpdateControlParameter")
+
+ _request = build_post_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: _models.HostPoolUpdateControlParameter,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Required.
+ :type host_pool_update_control_parameter:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateControlParameter
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Required.
+ :type host_pool_update_control_parameter: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ host_pool_update_control_parameter: Union[_models.HostPoolUpdateControlParameter, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[None]:
+ """Control update of a hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param host_pool_update_control_parameter: Object containing control action for hostpool
+ update. Is either a HostPoolUpdateControlParameter type or a IO[bytes] type. Required.
+ :type host_pool_update_control_parameter:
+ ~azure.mgmt.desktopvirtualization.models.HostPoolUpdateControlParameter or IO[bytes]
+ :return: An instance of LROPoller that returns either None or the result of cls(response)
+ :rtype: ~azure.core.polling.LROPoller[None]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._post_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ host_pool_update_control_parameter=host_pool_update_control_parameter,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[None].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py
index 7504de7951ce..e1b4ab536225 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_desktops_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -63,8 +62,8 @@ def build_get_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"desktopName": _SERIALIZER.url(
@@ -89,7 +88,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -107,8 +106,8 @@ def build_update_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
"desktopName": _SERIALIZER.url(
@@ -142,7 +141,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -159,8 +158,8 @@ def build_list_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -218,7 +217,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.Desktop
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -346,7 +345,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Desktop
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -437,7 +436,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.DesktopList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py
index fbd4a0b1da44..e54eb4a5aa8d 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_host_pools_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +46,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +60,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -81,7 +81,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -96,7 +96,7 @@ def build_create_or_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -119,7 +119,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -133,7 +133,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -156,7 +156,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -171,7 +171,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -200,7 +200,7 @@ def build_list_by_resource_group_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -243,7 +243,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -277,7 +277,7 @@ def build_retrieve_registration_token_request( # pylint: disable=name-too-long
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -291,7 +291,7 @@ def build_retrieve_registration_token_request( # pylint: disable=name-too-long
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -312,7 +312,7 @@ def build_list_registration_tokens_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -326,7 +326,7 @@ def build_list_registration_tokens_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -373,7 +373,7 @@ def get(self, resource_group_name: str, host_pool_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -491,7 +491,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -562,7 +562,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -677,7 +677,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.HostPool
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -764,7 +764,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.HostPoolList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -854,7 +854,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.HostPoolList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -932,7 +932,7 @@ def retrieve_registration_token(
:rtype: ~azure.mgmt.desktopvirtualization.models.RegistrationInfo
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -989,7 +989,7 @@ def list_registration_tokens(
:rtype: ~azure.mgmt.desktopvirtualization.models.RegistrationTokenList
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_initiate_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_initiate_session_host_update_operations.py
new file mode 100644
index 000000000000..947d94a0814b
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_initiate_session_host_update_operations.py
@@ -0,0 +1,230 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_post_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/initiateSessionHostUpdate",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class InitiateSessionHostUpdateOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`initiate_session_host_update` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @overload
+ def post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[_models.UpdateSessionHostsRequestBody] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Default value is None.
+ :type update_session_hosts_request_body:
+ ~azure.mgmt.desktopvirtualization.models.UpdateSessionHostsRequestBody
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def post(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Default value is None.
+ :type update_session_hosts_request_body: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def post( # pylint: disable=inconsistent-return-statements
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ update_session_hosts_request_body: Optional[Union[_models.UpdateSessionHostsRequestBody, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> None:
+ """Initiates a hostpool update or schedule an update for the future.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param update_session_hosts_request_body: Object containing the definition for properties to be
+ used in the sessionHostUpdate validation. Is either a UpdateSessionHostsRequestBody type or a
+ IO[bytes] type. Default value is None.
+ :type update_session_hosts_request_body:
+ ~azure.mgmt.desktopvirtualization.models.UpdateSessionHostsRequestBody or IO[bytes]
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(update_session_hosts_request_body, (IOBase, bytes)):
+ _content = update_session_hosts_request_body
+ else:
+ if update_session_hosts_request_body is not None:
+ _json = self._serialize.body(update_session_hosts_request_body, "UpdateSessionHostsRequestBody")
+ else:
+ _json = None
+
+ _request = build_post_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [204]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py
index a602ef61d945..889c9c877ba6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_images_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_expand_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -61,7 +60,7 @@ def build_expand_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -180,7 +179,7 @@ def expand(
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
cls: ClsType[_models.ExpandMsixImageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py
index 645fa353dc5c..11be1215ab42 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_msix_packages_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +59,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"msixPackageFullName": _SERIALIZER.url(
"msix_package_full_name",
@@ -89,7 +88,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -104,7 +103,7 @@ def build_create_or_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"msixPackageFullName": _SERIALIZER.url(
"msix_package_full_name",
@@ -135,7 +134,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -149,7 +148,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"msixPackageFullName": _SERIALIZER.url(
"msix_package_full_name",
@@ -178,7 +177,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -193,7 +192,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"msixPackageFullName": _SERIALIZER.url(
"msix_package_full_name",
@@ -231,7 +230,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -245,7 +244,7 @@ def build_list_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -303,7 +302,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -434,7 +433,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -507,7 +506,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -634,7 +633,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.MSIXPackage
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -725,7 +724,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.MSIXPackageList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py
index 066c8cf26276..242f8c3709c5 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -43,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -93,7 +92,7 @@ def list(self, **kwargs: Any) -> Iterable["_models.ResourceProviderOperation"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ResourceProviderOperationList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_endpoint_connections_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_endpoint_connections_operations.py
index 723ac5e2b192..3f1e50e1d574 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_endpoint_connections_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_endpoint_connections_operations.py
@@ -1,4 +1,4 @@
-# pylint: disable=too-many-lines,too-many-statements
+# pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +32,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +46,7 @@ def build_list_by_workspace_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +60,7 @@ def build_list_by_workspace_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -85,7 +85,7 @@ def build_get_by_workspace_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -99,7 +99,7 @@ def build_get_by_workspace_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -127,7 +127,7 @@ def build_delete_by_workspace_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -141,7 +141,7 @@ def build_delete_by_workspace_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -169,7 +169,7 @@ def build_update_by_workspace_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -184,7 +184,7 @@ def build_update_by_workspace_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -217,7 +217,7 @@ def build_list_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -231,7 +231,7 @@ def build_list_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -262,7 +262,7 @@ def build_get_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -276,7 +276,7 @@ def build_get_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -304,7 +304,7 @@ def build_delete_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -318,7 +318,7 @@ def build_delete_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -346,7 +346,7 @@ def build_update_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -361,7 +361,7 @@ def build_update_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"privateEndpointConnectionName": _SERIALIZER.url(
"private_endpoint_connection_name", private_endpoint_connection_name, "str"
@@ -423,7 +423,7 @@ def list_by_workspace(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionListResultWithSystemData] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -503,7 +503,7 @@ def get_by_workspace(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -564,7 +564,7 @@ def delete_by_workspace( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -692,7 +692,7 @@ def update_by_workspace(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -782,7 +782,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateEndpointConnectionListResultWithSystemData] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -865,7 +865,7 @@ def get_by_host_pool(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -926,7 +926,7 @@ def delete_by_host_pool( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -1054,7 +1054,7 @@ def update_by_host_pool(
:rtype: ~azure.mgmt.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py
index 29d187f3a69e..c3a7d1abbad1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_private_link_resources_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +51,7 @@ def build_list_by_workspace_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -66,7 +65,7 @@ def build_list_by_workspace_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -100,7 +99,7 @@ def build_list_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -114,7 +113,7 @@ def build_list_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -188,7 +187,7 @@ def list_by_workspace(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -287,7 +286,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_personal_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_personal_schedules_operations.py
index a28ff48dc5a4..9e6be08164c4 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_personal_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_personal_schedules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -50,7 +49,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -64,7 +63,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -97,7 +96,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -112,7 +111,7 @@ def build_create_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -147,7 +146,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -161,7 +160,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -194,7 +193,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -209,7 +208,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -247,7 +246,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -261,7 +260,7 @@ def build_list_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -318,7 +317,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -450,7 +449,7 @@ def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -522,7 +521,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -650,7 +649,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPersonalSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -743,7 +742,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanPersonalScheduleList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_pooled_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_pooled_schedules_operations.py
index 272f08869c78..f43c599931e0 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_pooled_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plan_pooled_schedules_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -50,7 +49,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -64,7 +63,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -97,7 +96,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -112,7 +111,7 @@ def build_create_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -147,7 +146,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -161,7 +160,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -194,7 +193,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -209,7 +208,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"scalingPlanScheduleName": _SERIALIZER.url(
"scaling_plan_schedule_name",
@@ -247,7 +246,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -261,7 +260,7 @@ def build_list_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -318,7 +317,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -449,7 +448,7 @@ def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -521,7 +520,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -649,7 +648,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlanPooledSchedule
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -742,7 +741,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanPooledScheduleList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py
index 96cb4dae6d9d..0b199327ef33 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_scaling_plans_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +59,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -81,7 +80,7 @@ def build_create_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -96,7 +95,7 @@ def build_create_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -119,7 +118,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -133,7 +132,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -154,7 +153,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -169,7 +168,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"scalingPlanName": _SERIALIZER.url(
- "scaling_plan_name", scaling_plan_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "scaling_plan_name", scaling_plan_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -198,7 +197,7 @@ def build_list_by_resource_group_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -241,7 +240,7 @@ def build_list_by_subscription_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -282,7 +281,7 @@ def build_list_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -296,7 +295,7 @@ def build_list_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -349,7 +348,7 @@ def get(self, resource_group_name: str, scaling_plan_name: str, **kwargs: Any) -
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -467,7 +466,7 @@ def create(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -536,7 +535,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -650,7 +649,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.ScalingPlan
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -737,7 +736,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -827,7 +826,7 @@ def list_by_subscription(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -923,7 +922,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.ScalingPlanList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_configurations_operations.py
new file mode 100644
index 000000000000..85463408e574
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_configurations_operations.py
@@ -0,0 +1,786 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ StreamClosedError,
+ StreamConsumedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.polling import LROPoller, NoPolling, PollingMethod
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+from azure.mgmt.core.polling.arm_polling import ARMPolling
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_create_or_update_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_update_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_get_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_list_by_host_pool_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostConfigurations",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class SessionHostConfigurationsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_configurations` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ def _create_or_update_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Union[_models.SessionHostConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_configuration, (IOBase, bytes)):
+ _content = session_host_configuration
+ else:
+ _json = self._serialize.body(session_host_configuration, "SessionHostConfiguration")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: _models.SessionHostConfiguration,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Required.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Required.
+ :type session_host_configuration: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Union[_models.SessionHostConfiguration, IO[bytes]],
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Create or update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions. Is
+ either a SessionHostConfiguration type or a IO[bytes] type. Required.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration or IO[bytes]
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._create_or_update_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_configuration=session_host_configuration,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.SessionHostConfiguration].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.SessionHostConfiguration](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ def _update_initial(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[Union[_models.SessionHostConfigurationPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> Iterator[bytes]:
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_configuration, (IOBase, bytes)):
+ _content = session_host_configuration
+ else:
+ if session_host_configuration is not None:
+ _json = self._serialize.body(session_host_configuration, "SessionHostConfigurationPatch")
+ else:
+ _json = None
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _decompress = kwargs.pop("decompress", True)
+ _stream = True
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 202]:
+ try:
+ response.read() # Load the body in memory and close the socket
+ except (StreamConsumedError, StreamClosedError):
+ pass
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ response_headers = {}
+ if response.status_code == 200:
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ if response.status_code == 202:
+ response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+ response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
+
+ deserialized = response.stream_download(self._client._pipeline, decompress=_decompress)
+
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[_models.SessionHostConfigurationPatch] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Default value is None.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfigurationPatch
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions.
+ Default value is None.
+ :type session_host_configuration: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def begin_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_configuration: Optional[Union[_models.SessionHostConfigurationPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> LROPoller[_models.SessionHostConfiguration]:
+ """Update a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_configuration: Object containing SessionHostConfiguration definitions. Is
+ either a SessionHostConfigurationPatch type or a IO[bytes] type. Default value is None.
+ :type session_host_configuration:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostConfigurationPatch or IO[bytes]
+ :return: An instance of LROPoller that returns either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.polling.LROPoller[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+ polling: Union[bool, PollingMethod] = kwargs.pop("polling", True)
+ lro_delay = kwargs.pop("polling_interval", self._config.polling_interval)
+ cont_token: Optional[str] = kwargs.pop("continuation_token", None)
+ if cont_token is None:
+ raw_result = self._update_initial(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_configuration=session_host_configuration,
+ api_version=api_version,
+ content_type=content_type,
+ cls=lambda x, y, z: x,
+ headers=_headers,
+ params=_params,
+ **kwargs
+ )
+ raw_result.http_response.read() # type: ignore
+ kwargs.pop("error_map", None)
+
+ def get_long_running_output(pipeline_response):
+ response_headers = {}
+ response = pipeline_response.http_response
+ response_headers["Azure-AsyncOperation"] = self._deserialize(
+ "str", response.headers.get("Azure-AsyncOperation")
+ )
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+ if cls:
+ return cls(pipeline_response, deserialized, response_headers) # type: ignore
+ return deserialized
+
+ if polling is True:
+ polling_method: PollingMethod = cast(
+ PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs)
+ )
+ elif polling is False:
+ polling_method = cast(PollingMethod, NoPolling())
+ else:
+ polling_method = polling
+ if cont_token:
+ return LROPoller[_models.SessionHostConfiguration].from_continuation_token(
+ polling_method=polling_method,
+ continuation_token=cont_token,
+ client=self._client,
+ deserialization_callback=get_long_running_output,
+ )
+ return LROPoller[_models.SessionHostConfiguration](
+ self._client, raw_result, get_long_running_output, polling_method # type: ignore
+ )
+
+ @distributed_trace
+ def get(self, resource_group_name: str, host_pool_name: str, **kwargs: Any) -> _models.SessionHostConfiguration:
+ """Get a SessionHostConfiguration.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostConfiguration or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostConfiguration] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostConfiguration", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> Iterable["_models.SessionHostConfiguration"]:
+ """List sessionHostConfigurations.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either SessionHostConfiguration or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHostConfiguration]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostConfigurationList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("SessionHostConfigurationList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_operations.py
new file mode 100644
index 000000000000..a1964b38ab19
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_operations.py
@@ -0,0 +1,613 @@
+# 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 io import IOBase
+import sys
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
+import urllib.parse
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.paging import ItemPaged
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_get_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_create_or_update_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_update_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ if content_type is not None:
+ _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+def build_list_by_host_pool_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class SessionHostManagementsOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_managements` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def get(self, resource_group_name: str, host_pool_name: str, **kwargs: Any) -> _models.SessionHostManagement:
+ """Get a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: _models.SessionHostManagement,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Required.
+ :type session_host_management: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: IO[bytes],
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Required.
+ :type session_host_management: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def create_or_update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Union[_models.SessionHostManagement, IO[bytes]],
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Create or update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Is either
+ a SessionHostManagement type or a IO[bytes] type. Required.
+ :type session_host_management: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ or IO[bytes]
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_management, (IOBase, bytes)):
+ _content = session_host_management
+ else:
+ _json = self._serialize.body(session_host_management, "SessionHostManagement")
+
+ _request = build_create_or_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200, 201]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @overload
+ def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[_models.SessionHostManagementPatch] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Default
+ value is None.
+ :type session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementPatch
+ :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @overload
+ def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[IO[bytes]] = None,
+ *,
+ content_type: str = "application/json",
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Default
+ value is None.
+ :type session_host_management: IO[bytes]
+ :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
+ Default value is "application/json".
+ :paramtype content_type: str
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+
+ @distributed_trace
+ def update(
+ self,
+ resource_group_name: str,
+ host_pool_name: str,
+ session_host_management: Optional[Union[_models.SessionHostManagementPatch, IO[bytes]]] = None,
+ **kwargs: Any
+ ) -> _models.SessionHostManagement:
+ """Update a SessionHostManagement.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_management: Object containing SessionHostManagement definitions. Is either
+ a SessionHostManagementPatch type or a IO[bytes] type. Default value is None.
+ :type session_host_management:
+ ~azure.mgmt.desktopvirtualization.models.SessionHostManagementPatch or IO[bytes]
+ :return: SessionHostManagement or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagement
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
+ cls: ClsType[_models.SessionHostManagement] = kwargs.pop("cls", None)
+
+ content_type = content_type or "application/json"
+ _json = None
+ _content = None
+ if isinstance(session_host_management, (IOBase, bytes)):
+ _content = session_host_management
+ else:
+ if session_host_management is not None:
+ _json = self._serialize.body(session_host_management, "SessionHostManagementPatch")
+ else:
+ _json = None
+
+ _request = build_update_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ content_type=content_type,
+ json=_json,
+ content=_content,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagement", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
+
+ @distributed_trace
+ def list_by_host_pool(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> Iterable["_models.SessionHostManagement"]:
+ """List SessionHostManagements by hostPool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: An iterator like instance of either SessionHostManagement or the result of
+ cls(response)
+ :rtype:
+ ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHostManagement]
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagementList] = kwargs.pop("cls", None)
+
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ def prepare_request(next_link=None):
+ if not next_link:
+
+ _request = build_list_by_host_pool_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ else:
+ # make call to next link with the client's api-version
+ _parsed_next_link = urllib.parse.urlparse(next_link)
+ _next_request_params = case_insensitive_dict(
+ {
+ key: [urllib.parse.quote(v) for v in value]
+ for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
+ }
+ )
+ _next_request_params["api-version"] = self._config.api_version
+ _request = HttpRequest(
+ "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
+ )
+ _request.url = self._client.format_url(_request.url)
+ _request.method = "GET"
+ return _request
+
+ def extract_data(pipeline_response):
+ deserialized = self._deserialize("SessionHostManagementList", pipeline_response)
+ list_of_elem = deserialized.value
+ if cls:
+ list_of_elem = cls(list_of_elem) # type: ignore
+ return deserialized.next_link or None, iter(list_of_elem)
+
+ def get_next(next_link=None):
+ _request = prepare_request(next_link)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ return pipeline_response
+
+ return ItemPaged(get_next, extract_data)
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_update_status_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_update_status_operations.py
new file mode 100644
index 000000000000..f8f7c9209289
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_managements_update_status_operations.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.
+# --------------------------------------------------------------------------
+import sys
+from typing import Any, Callable, Dict, Optional, TypeVar
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_get_request(
+ resource_group_name: str, host_pool_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHostManagements/default/sessionHostUpdateStatuses/default",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class SessionHostManagementsUpdateStatusOperations: # pylint: disable=name-too-long
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host_managements_update_status` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def get(
+ self, resource_group_name: str, host_pool_name: str, **kwargs: Any
+ ) -> _models.SessionHostManagementUpdateStatus:
+ """Get the session host update status for a given hostpool.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :return: SessionHostManagementUpdateStatus or the result of cls(response)
+ :rtype: ~azure.mgmt.desktopvirtualization.models.SessionHostManagementUpdateStatus
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[_models.SessionHostManagementUpdateStatus] = kwargs.pop("cls", None)
+
+ _request = build_get_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
+ raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
+
+ deserialized = self._deserialize("SessionHostManagementUpdateStatus", pipeline_response.http_response)
+
+ if cls:
+ return cls(pipeline_response, deserialized, {}) # type: ignore
+
+ return deserialized # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_operations.py
new file mode 100644
index 000000000000..6f81ffd98221
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_host_operations.py
@@ -0,0 +1,151 @@
+# 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 sys
+from typing import Any, Callable, Dict, Optional, TypeVar
+
+from azure.core.exceptions import (
+ ClientAuthenticationError,
+ HttpResponseError,
+ ResourceExistsError,
+ ResourceNotFoundError,
+ ResourceNotModifiedError,
+ map_error,
+)
+from azure.core.pipeline import PipelineResponse
+from azure.core.rest import HttpRequest, HttpResponse
+from azure.core.tracing.decorator import distributed_trace
+from azure.core.utils import case_insensitive_dict
+from azure.mgmt.core.exceptions import ARMErrorFormat
+
+from .. import models as _models
+from .._serialization import Serializer
+
+if sys.version_info >= (3, 9):
+ from collections.abc import MutableMapping
+else:
+ from typing import MutableMapping # type: ignore
+T = TypeVar("T")
+ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
+
+_SERIALIZER = Serializer()
+_SERIALIZER.client_side_validation = False
+
+
+def build_retry_provisioning_request(
+ resource_group_name: str, host_pool_name: str, session_host_name: str, subscription_id: str, **kwargs: Any
+) -> HttpRequest:
+ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
+ accept = _headers.pop("Accept", "application/json")
+
+ # Construct URL
+ _url = kwargs.pop(
+ "template_url",
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/retryProvisioning",
+ ) # pylint: disable=line-too-long
+ path_format_arguments = {
+ "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
+ "resourceGroupName": _SERIALIZER.url(
+ "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
+ ),
+ "hostPoolName": _SERIALIZER.url(
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ "sessionHostName": _SERIALIZER.url(
+ "session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ ),
+ }
+
+ _url: str = _url.format(**path_format_arguments) # type: ignore
+
+ # Construct parameters
+ _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
+
+ # Construct headers
+ _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
+
+ return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
+
+
+class SessionHostOperations:
+ """
+ .. warning::
+ **DO NOT** instantiate this class directly.
+
+ Instead, you should access the following operations through
+ :class:`~azure.mgmt.desktopvirtualization.DesktopVirtualizationMgmtClient`'s
+ :attr:`session_host` attribute.
+ """
+
+ models = _models
+
+ def __init__(self, *args, **kwargs):
+ input_args = list(args)
+ self._client = input_args.pop(0) if input_args else kwargs.pop("client")
+ self._config = input_args.pop(0) if input_args else kwargs.pop("config")
+ self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
+ self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
+
+ @distributed_trace
+ def retry_provisioning( # pylint: disable=inconsistent-return-statements
+ self, resource_group_name: str, host_pool_name: str, session_host_name: str, **kwargs: Any
+ ) -> None:
+ """Retry provisioning on a SessionHost.
+
+ :param resource_group_name: The name of the resource group. The name is case insensitive.
+ Required.
+ :type resource_group_name: str
+ :param host_pool_name: The name of the host pool within the specified resource group. Required.
+ :type host_pool_name: str
+ :param session_host_name: The name of the session host within the specified host pool.
+ Required.
+ :type session_host_name: str
+ :return: None or the result of cls(response)
+ :rtype: None
+ :raises ~azure.core.exceptions.HttpResponseError:
+ """
+ error_map: MutableMapping = {
+ 401: ClientAuthenticationError,
+ 404: ResourceNotFoundError,
+ 409: ResourceExistsError,
+ 304: ResourceNotModifiedError,
+ }
+ error_map.update(kwargs.pop("error_map", {}) or {})
+
+ _headers = kwargs.pop("headers", {}) or {}
+ _params = case_insensitive_dict(kwargs.pop("params", {}) or {})
+
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
+ cls: ClsType[None] = kwargs.pop("cls", None)
+
+ _request = build_retry_provisioning_request(
+ resource_group_name=resource_group_name,
+ host_pool_name=host_pool_name,
+ session_host_name=session_host_name,
+ subscription_id=self._config.subscription_id,
+ api_version=api_version,
+ headers=_headers,
+ params=_params,
+ )
+ _request.url = self._client.format_url(_request.url)
+
+ _stream = False
+ pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
+ _request, stream=_stream, **kwargs
+ )
+
+ response = pipeline_response.http_response
+
+ if response.status_code not in [200]:
+ map_error(status_code=response.status_code, response=response, error_map=error_map)
+ raise HttpResponseError(response=response, error_format=ARMErrorFormat)
+
+ if cls:
+ return cls(pipeline_response, None, {}) # type: ignore
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py
index a13604cb1569..65624e9e45e0 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_session_hosts_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +59,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -90,7 +89,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -104,7 +103,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -136,7 +135,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -151,7 +150,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -181,12 +180,13 @@ def build_list_request(
page_size: Optional[int] = None,
is_descending: Optional[bool] = None,
initial_skip: Optional[int] = None,
+ vm_path: Optional[str] = None,
**kwargs: Any
) -> HttpRequest:
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -200,7 +200,7 @@ def build_list_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -214,6 +214,10 @@ def build_list_request(
_params["isDescending"] = _SERIALIZER.query("is_descending", is_descending, "bool")
if initial_skip is not None:
_params["initialSkip"] = _SERIALIZER.query("initial_skip", initial_skip, "int")
+ if vm_path is not None:
+ _params["vmPath"] = _SERIALIZER.query(
+ "vm_path", vm_path, "str", max_length=1092, min_length=3, pattern=r"^[A-Z][a-z][0-9][@./-_ ]*$"
+ )
# Construct headers
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
@@ -258,7 +262,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -327,7 +331,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -467,7 +471,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.SessionHost
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -534,6 +538,7 @@ def list(
page_size: Optional[int] = None,
is_descending: Optional[bool] = None,
initial_skip: Optional[int] = None,
+ vm_path: Optional[str] = None,
**kwargs: Any
) -> Iterable["_models.SessionHost"]:
"""List sessionHosts.
@@ -549,6 +554,8 @@ def list(
:type is_descending: bool
:param initial_skip: Initial number of items to skip. Default value is None.
:type initial_skip: int
+ :param vm_path: The path to the VM. Default value is None.
+ :type vm_path: str
:return: An iterator like instance of either SessionHost or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.desktopvirtualization.models.SessionHost]
:raises ~azure.core.exceptions.HttpResponseError:
@@ -559,7 +566,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.SessionHostList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -577,6 +584,7 @@ def prepare_request(next_link=None):
page_size=page_size,
is_descending=is_descending,
initial_skip=initial_skip,
+ vm_path=vm_path,
api_version=api_version,
headers=_headers,
params=_params,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py
index 5ff91168d267..2bfa94625b76 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_start_menu_items_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
-from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar
+from typing import Any, Callable, Dict, Iterable, Optional, TypeVar
import urllib.parse
from azure.core.exceptions import (
@@ -31,7 +30,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -52,7 +51,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -69,8 +68,8 @@ def build_list_request(
"application_group_name",
application_group_name,
"str",
- max_length=64,
- min_length=3,
+ max_length=255,
+ min_length=1,
pattern=r"^[A-Za-z0-9@.\-_ ]*$",
),
}
@@ -144,7 +143,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.StartMenuItemList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py
index a551f43645f9..1bdb3a59a751 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_user_sessions_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -54,7 +53,7 @@ def build_list_by_host_pool_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -68,7 +67,7 @@ def build_list_by_host_pool_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -102,7 +101,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -116,7 +115,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -148,7 +147,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -162,7 +161,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -197,7 +196,7 @@ def build_list_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -211,7 +210,7 @@ def build_list_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -246,7 +245,7 @@ def build_disconnect_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -260,7 +259,7 @@ def build_disconnect_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -290,7 +289,7 @@ def build_send_message_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -305,7 +304,7 @@ def build_send_message_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"hostPoolName": _SERIALIZER.url(
- "host_pool_name", host_pool_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "host_pool_name", host_pool_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
"sessionHostName": _SERIALIZER.url(
"session_host_name", session_host_name, "str", max_length=48, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
@@ -382,7 +381,7 @@ def list_by_host_pool(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UserSessionList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -469,7 +468,7 @@ def get(
:rtype: ~azure.mgmt.desktopvirtualization.models.UserSession
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -542,7 +541,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -620,7 +619,7 @@ def list(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.UserSessionList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -707,7 +706,7 @@ def disconnect( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -748,7 +747,7 @@ def disconnect( # pylint: disable=inconsistent-return-statements
return cls(pipeline_response, None, {}) # type: ignore
@overload
- def send_message( # pylint: disable=inconsistent-return-statements
+ def send_message(
self,
resource_group_name: str,
host_pool_name: str,
@@ -784,7 +783,7 @@ def send_message( # pylint: disable=inconsistent-return-statements
"""
@overload
- def send_message( # pylint: disable=inconsistent-return-statements
+ def send_message(
self,
resource_group_name: str,
host_pool_name: str,
@@ -849,7 +848,7 @@ def send_message( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py
index 94b8a7955f8e..d5937befc762 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/azure/mgmt/desktopvirtualization/operations/_workspaces_operations.py
@@ -1,4 +1,3 @@
-# pylint: disable=too-many-lines,too-many-statements
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8,7 +7,7 @@
# --------------------------------------------------------------------------
from io import IOBase
import sys
-from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload
+from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
@@ -32,7 +31,7 @@
if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
else:
- from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports
+ from typing import MutableMapping # type: ignore
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
@@ -46,7 +45,7 @@ def build_get_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -60,7 +59,7 @@ def build_get_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -81,7 +80,7 @@ def build_create_or_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -96,7 +95,7 @@ def build_create_or_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -119,7 +118,7 @@ def build_delete_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -133,7 +132,7 @@ def build_delete_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -154,7 +153,7 @@ def build_update_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
accept = _headers.pop("Accept", "application/json")
@@ -169,7 +168,7 @@ def build_update_request(
"resource_group_name", resource_group_name, "str", max_length=90, min_length=1
),
"workspaceName": _SERIALIZER.url(
- "workspace_name", workspace_name, "str", max_length=64, min_length=3, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
+ "workspace_name", workspace_name, "str", max_length=255, min_length=1, pattern=r"^[A-Za-z0-9@.\-_ ]*$"
),
}
@@ -198,7 +197,7 @@ def build_list_by_resource_group_request(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -234,7 +233,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
- api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-04-03"))
+ api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-08-08-preview"))
accept = _headers.pop("Accept", "application/json")
# Construct URL
@@ -288,7 +287,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -406,7 +405,7 @@ def create_or_update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -475,7 +474,7 @@ def delete( # pylint: disable=inconsistent-return-statements
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -589,7 +588,7 @@ def update(
:rtype: ~azure.mgmt.desktopvirtualization.models.Workspace
:raises ~azure.core.exceptions.HttpResponseError:
"""
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -676,7 +675,7 @@ def list_by_resource_group(
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
@@ -754,7 +753,7 @@ def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Workspace"]:
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
cls: ClsType[_models.WorkspaceList] = kwargs.pop("cls", None)
- error_map: MutableMapping[int, Type[HttpResponseError]] = {
+ error_map: MutableMapping = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_get.py
new file mode 100644
index 000000000000..bcb6bb76cefa
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_get.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python active_session_host_configurations_get.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.active_session_host_configurations.get(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ActiveSessionHostConfigurations_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_list_by_host_pool.py
new file mode 100644
index 000000000000..e6aeb970b31e
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/active_session_host_configurations_list_by_host_pool.py
@@ -0,0 +1,43 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python active_session_host_configurations_list_by_host_pool.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.active_session_host_configurations.list_by_host_pool(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ActiveSessionHostConfigurations_ListByHostPool.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_create.py
index 1a3d9fc1eb08..ecbc50080132 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_create.py
@@ -36,6 +36,7 @@ def main():
app_attach_package={
"location": "southcentralus",
"properties": {
+ "customData": "",
"failHealthCheckOnStagingFailure": "NeedsAssistance",
"hostPoolReferences": [],
"image": {
@@ -72,12 +73,13 @@ def main():
"version": "packageversion",
},
"keyVaultURL": "",
+ "packageOwnerName": "App Attach",
},
},
)
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_delete.py
index dbae419122ab..818145419468 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_delete.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_get.py
index d3306b7757cc..cb030ccb331d 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_info_import_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_info_import_post.py
index 2c297780686a..63f1e79e3c1a 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_info_import_post.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_info_import_post.py
@@ -39,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackageInfo_Import_Post.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackageInfo_Import_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_resource_group.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_resource_group.py
index 3bfdde166329..74937e2fd0d5 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_resource_group.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListByResourceGroup.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_ListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_subscription.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_subscription.py
index fb648e62a071..427430ace695 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_subscription.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_list_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_ListBySubscription.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_ListBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_update.py
index 0b1239001f98..473e11c8a2d0 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/app_attach_package_update.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/AppAttachPackage_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/AppAttachPackage_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_create.py
index 0e99c30581fb..7444245f60f2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_create.py
@@ -50,6 +50,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_delete.py
index 849f2aadaafb..75c9d725503e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_delete.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_get.py
index 1ea6ce092768..75bea3960277 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_create.py
index 95aff0aff571..4ac54744387f 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_create.py
@@ -48,6 +48,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_delete.py
index 22df1d08fa55..c4ac28cb30dc 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_delete.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_get.py
index 25c26db4e667..18e9019c88a1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_resource_group.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_resource_group.py
index 0f30342aa9f3..799945282f88 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_resource_group.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_ListByResourceGroup.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_ListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_subscription.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_subscription.py
index 514eaf021932..db6cb8f4316b 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_subscription.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_list_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_ListBySubscription.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_ListBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_update.py
index a618dce1d629..8343e174b56b 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_group_update.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ApplicationGroup_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ApplicationGroup_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_list.py
index 0c964e1fbb90..49c8aa6762ad 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_update.py
index 1a5f906da636..b4f95abcce32 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/application_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Application_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Application_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_get.py
index 18b47790ea7d..1ba375031356 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_list.py
index 753ecea64156..b6f819fd1e76 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_update.py
index b358a4f54be6..4d17b2dfa504 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/desktop_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Desktop_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Desktop_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_create.py
index 1da2cef16c77..3d5b118d7137 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_create.py
@@ -44,16 +44,21 @@ def main():
},
"customRdpProperty": None,
"description": "des1",
+ "directUDP": "Enabled",
"friendlyName": "friendly",
"hostPoolType": "Pooled",
"loadBalancerType": "BreadthFirst",
+ "managedPrivateUDP": "Enabled",
+ "managementType": "Automated",
"maxSessionLimit": 999999,
"personalDesktopAssignmentType": "Automatic",
"preferredAppGroupType": "Desktop",
+ "publicUDP": "Enabled",
"registrationInfo": {
"expirationTime": "2020-10-01T14:01:54.9571247Z",
"registrationTokenOperation": "Update",
},
+ "relayUDP": "Enabled",
"ssoClientId": "client",
"ssoClientSecretKeyVaultPath": "https://keyvault/secret",
"ssoSecretType": "SharedKey",
@@ -67,6 +72,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_delete.py
index c35977b4394e..d2a17359cd83 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_delete.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_get.py
index bfc0c17fe097..e43af14d1ec8 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list.py
index aa25e869679a..799d04009958 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list_by_resource_group.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list_by_resource_group.py
index 50c8e0015963..c1bbab361802 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list_by_resource_group.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_ListByResourceGroup.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_ListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_update.py
index df9f0ded78f4..8cc1ee46ae99 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pool_update.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPool_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPool_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_list_registration_token_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_list_registration_token_post.py
index b808f45751fe..2e059406a4db 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_list_registration_token_post.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_list_registration_token_post.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPools_ListRegistrationToken_Post.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPools_ListRegistrationToken_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_retrieve_registration_token_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_retrieve_registration_token_post.py
index a46f233a7b41..3eddd88adcf2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_retrieve_registration_token_post.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/host_pools_retrieve_registration_token_post.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/HostPools_RetrieveRegistrationToken_Post.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/HostPools_RetrieveRegistrationToken_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_create.py
index b3d1ee6faf49..6b92cbffd1b1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_create.py
@@ -69,6 +69,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_delete.py
index 35396a87ea47..87c3fa503ce1 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_delete.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_get.py
index 122d3ac8bc1a..4195c3ce768f 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_list.py
index bdf2b76e629d..0679a44409bb 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_update.py
index 816aede3d0d0..a4ab73af5300 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/msix_package_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/MsixPackage_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/MsixPackage_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/operation_description_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/operation_description_list.py
index 7ba9404dee7d..175355ea2e99 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/operation_description_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/operation_description_list.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/OperationDescription_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/OperationDescription_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_host_pool.py
index ee41840691d3..3db110119209 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_host_pool.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_DeleteByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_workspace.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_workspace.py
index 15a006caf960..f6b06f43c55e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_workspace.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_delete_by_workspace.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_DeleteByWorkspace.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_DeleteByWorkspace.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_host_pool.py
index f8660d4b0a81..6af3da82f428 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_host_pool.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_workspace.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_workspace.py
index f9b0589a2b64..4c609f16a91c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_workspace.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_get_by_workspace.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_GetByWorkspace.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_GetByWorkspace.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_host_pool.py
index 6d5201a27ce5..cff35c5c0004 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_host_pool.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_ListByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_ListByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_workspace.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_workspace.py
index 6c41ad8e1512..3c04fc286191 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_workspace.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_list_by_workspace.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_ListByWorkspace.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_ListByWorkspace.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_host_pool.py
index 5b17bbde82ed..5c4a1086f59c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_host_pool.py
@@ -47,6 +47,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_workspace.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_workspace.py
index 8a10de65dfa8..f252d199e81e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_workspace.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_endpoint_connection_update_by_workspace.py
@@ -47,6 +47,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateEndpointConnection_UpdateByWorkspace.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_host_pool.py
index 9374072152e6..e138a1a3f131 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_host_pool.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateLinkResources_ListByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateLinkResources_ListByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_workspace.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_workspace.py
index da8ec5caceee..8a079e1d2698 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_workspace.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/private_link_resources_list_by_workspace.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/PrivateLinkResources_ListByWorkspace.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/PrivateLinkResources_ListByWorkspace.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_create.py
index 2ccfc35fb645..b177495af163 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_create.py
@@ -75,6 +75,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_delete.py
index f627b071de76..8ab28b69c11c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_delete.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_get.py
index b40c90aa5902..13c9614dc8fc 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_host_pool.py
index c3635c78f0da..04beedbccbb6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_host_pool.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_resource_group.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_resource_group.py
index b92cc80c5a82..2713a598fc1e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_resource_group.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListByResourceGroup.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_subscription.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_subscription.py
index b08092ed37bb..707dec5f9d18 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_subscription.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_list_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_ListBySubscription.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_ListBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_create.py
index 4055e6b7e02b..af900699638e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_create.py
@@ -68,6 +68,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_delete.py
index 77b4b85fa9a1..4137a81fa178 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_delete.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_get.py
index 14d7e4d9b927..cc388c729084 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_list.py
index a1f7eb130178..97db6ff19656 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_update.py
index ce57fd0e33db..7908a4c5b99d 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_personal_schedule_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPersonalSchedule_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPersonalSchedule_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_create.py
index c02ca159aaed..574bb04db8ce 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_create.py
@@ -58,6 +58,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_delete.py
index f2d90dec35c5..a3227bba02e7 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_delete.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_get.py
index da2a627f4692..0b817fb861d6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_list.py
index 82033bd51b3a..8e6559b057cd 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_update.py
index cf4ad0c45745..25ba13b888fd 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_pooled_schedule_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlanPooledSchedule_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlanPooledSchedule_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_update.py
index ec6e2d3e7eaf..89d98a47339e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/scaling_plan_update.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/ScalingPlan_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/ScalingPlan_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_create.py
new file mode 100644
index 000000000000..b7ab26576992
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_create.py
@@ -0,0 +1,92 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_configurations_create.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_configurations.begin_create_or_update(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ session_host_configuration={
+ "properties": {
+ "availabilityZones": [1, 3],
+ "bootDiagnosticsInfo": {
+ "enabled": True,
+ "storageUri": "https://myStorageAccountName.blob.core.windows.net",
+ },
+ "customConfigurationScriptUrl": "https://storageaccountname.blob.core.windows.net/blobcontainer/file",
+ "diskInfo": {"type": "Standard_LRS"},
+ "domainInfo": {
+ "activeDirectoryInfo": {
+ "domainCredentials": {
+ "passwordKeyVaultSecretUri": "https://myvault.vault.azure.net/secrets/mysecretname",
+ "usernameKeyVaultSecretUri": "https://myvault.vault.azure.net/secrets/myusername",
+ },
+ "domainName": "wvdarmtest1.net",
+ "ouPath": "OU=testOU,DC=domain,DC=Domain,DC=com",
+ },
+ "azureActiveDirectoryInfo": {"mdmProviderGuid": "bdefabc0-95b4-48b3-b645-8a753a63c4fa"},
+ "joinType": "ActiveDirectory",
+ },
+ "friendlyName": "InitialConfiguration",
+ "imageInfo": {
+ "customInfo": {
+ "resourceId": "/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.Compute/images/imageName"
+ },
+ "marketplaceInfo": {
+ "exactVersion": "2019.0.20190115",
+ "offer": "Windows-10",
+ "publisher": "MicrosoftWindowsDesktop",
+ "sku": "19h2-ent",
+ },
+ "type": "Marketplace",
+ },
+ "networkInfo": {
+ "securityGroupId": "/subscriptions/.../resourceGroups/.../provider s/Microsoft.Network/networkSecurityGroups/nsg1",
+ "subnetId": "/subscriptions/.../resourceGroups/.../providers/Microsoft.Network/virtualNetworks/.../subnets/subnet1",
+ },
+ "securityInfo": {"secureBootEnabled": True, "type": "TrustedLaunch", "vTpmEnabled": True},
+ "vmAdminCredentials": {
+ "passwordKeyVaultSecretUri": "https://myvault.vault.azure.net/secrets/mysecretname",
+ "usernameKeyVaultSecretUri": "https://myvault.vault.azure.net/secrets/myusername",
+ },
+ "vmLocation": "eastus2",
+ "vmNamePrefix": "westus2-vm",
+ "vmResourceGroup": "myResourceGroup",
+ "vmSizeId": "Standard_D2s_v3",
+ "vmTags": {"Department": "myDepartment", "Team": "myTeam"},
+ }
+ },
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Create.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_get.py
new file mode 100644
index 000000000000..58c96e99fb29
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_get.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_configurations_get.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_configurations.get(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_list_by_host_pool.py
new file mode 100644
index 000000000000..b55bd52f3893
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_list_by_host_pool.py
@@ -0,0 +1,43 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_configurations_list_by_host_pool.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_configurations.list_by_host_pool(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_ListByHostPool.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_update.py
new file mode 100644
index 000000000000..e11f92176b55
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_configurations_update.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_configurations_update.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_configurations.begin_update(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ ).result()
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostConfigurations_Update.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_delete.py
index 37aaf96a7d31..5d947d1a7c22 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_delete.py
@@ -37,6 +37,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_get.py
index cd1a39e42ce4..9b26507bce39 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_get.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_list.py
index 59df6423ee56..1d41e1364a7e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_control_session_host_update_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_control_session_host_update_post.py
new file mode 100644
index 000000000000..c3bcf554e701
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_control_session_host_update_post.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_control_session_host_update_post.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ client.control_session_host_update.begin_post(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ host_pool_update_control_parameter={"action": "Start", "cancelMessage": "Host pool update started"},
+ ).result()
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_ControlSessionHostUpdate_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_create.py
new file mode 100644
index 000000000000..73645705bf0d
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_create.py
@@ -0,0 +1,53 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_create.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_managements.create_or_update(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ session_host_management={
+ "properties": {
+ "scheduledDateTimeZone": "Alaskan Standard Time",
+ "update": {
+ "deleteOriginalVm": True,
+ "logOffDelayMinutes": 10,
+ "logOffMessage": "logging off for hostpool update",
+ "maxVmsRemoved": 4,
+ },
+ }
+ },
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Create.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_get.py
new file mode 100644
index 000000000000..06317c270fa5
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_get.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_get.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_managements.get(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_list_by_host_pool.py
new file mode 100644
index 000000000000..3648466faf73
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_list_by_host_pool.py
@@ -0,0 +1,43 @@
+# 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 azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_list_by_host_pool.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_managements.list_by_host_pool(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ for item in response:
+ print(item)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_ListByHostPool.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update.py
new file mode 100644
index 000000000000..3cb5ffa43308
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_update.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_managements.update(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_Update.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_session_hosts_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_session_hosts_post.py
new file mode 100644
index 000000000000..e1bfaa1ef0e2
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_session_hosts_post.py
@@ -0,0 +1,41 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_update_session_hosts_post.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ client.initiate_session_host_update.post(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_UpdateSessionHosts_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_status_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_status_get.py
new file mode 100644
index 000000000000..320e32759113
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_managements_update_status_get.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_managements_update_status_get.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ response = client.session_host_managements_update_status.get(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ )
+ print(response)
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHostManagements_UpdateStatus_Get.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_retry_provisioning_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_retry_provisioning_post.py
new file mode 100644
index 000000000000..c3e54c59f03d
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_retry_provisioning_post.py
@@ -0,0 +1,42 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+
+from azure.identity import DefaultAzureCredential
+
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+"""
+# PREREQUISITES
+ pip install azure-identity
+ pip install azure-mgmt-desktopvirtualization
+# USAGE
+ python session_host_retry_provisioning_post.py
+
+ Before run the sample, please set the values of the client ID, tenant ID and client secret
+ of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
+ AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
+ https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
+"""
+
+
+def main():
+ client = DesktopVirtualizationMgmtClient(
+ credential=DefaultAzureCredential(),
+ subscription_id="daefabc0-95b4-48b3-b645-8a753a63c4fa",
+ )
+
+ client.session_host.retry_provisioning(
+ resource_group_name="resourceGroup1",
+ host_pool_name="hostPool1",
+ session_host_name="sessionHost1.microsoft.com",
+ )
+
+
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_RetryProvisioning_Post.json
+if __name__ == "__main__":
+ main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_update.py
index 66a906828b50..8721f8298ef6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/session_host_update.py
@@ -38,6 +38,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/SessionHost_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/SessionHost_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/start_menu_item_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/start_menu_item_list.py
index 3947795d4bc0..f7c1817f6a44 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/start_menu_item_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/start_menu_item_list.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/StartMenuItem_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/StartMenuItem_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_delete.py
index 9795cd6b3ea7..0d095fd43380 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_delete.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_disconnect_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_disconnect_post.py
index 56a22a9a2d33..18d7b61e7fce 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_disconnect_post.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_disconnect_post.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Disconnect_Post.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Disconnect_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_get.py
index 1c2dd0b04134..f85cf5f26cbb 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_get.py
@@ -39,6 +39,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list.py
index 37e3dff31c75..1423a79cd527 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list.py
@@ -39,6 +39,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_List.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_List.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list_by_host_pool.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list_by_host_pool.py
index 7ece20e47752..ab0607cf5cfc 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list_by_host_pool.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_list_by_host_pool.py
@@ -38,6 +38,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_ListByHostPool.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_ListByHostPool.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_send_message_post.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_send_message_post.py
index f3f3889c48e4..03617d7c3f59 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_send_message_post.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/user_session_send_message_post.py
@@ -38,6 +38,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/UserSession_SendMessage_Post.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/UserSession_SendMessage_Post.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_create.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_create.py
index 3d2e16c4b669..68a40eaff00f 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_create.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_create.py
@@ -42,6 +42,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Create.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Create.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_delete.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_delete.py
index 8c8f3f1bc584..3beeaa4c1b1e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_delete.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_delete.py
@@ -36,6 +36,6 @@ def main():
)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Delete.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Delete.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_get.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_get.py
index 32696811908c..86290f52c53d 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_get.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_get.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Get.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Get.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_resource_group.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_resource_group.py
index c9341a79edc5..2e1d08c5c4d2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_resource_group.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_resource_group.py
@@ -37,6 +37,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_ListByResourceGroup.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_ListByResourceGroup.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_subscription.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_subscription.py
index c21d95f4c0ee..a3958c06a89c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_subscription.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_list_by_subscription.py
@@ -35,6 +35,6 @@ def main():
print(item)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_ListBySubscription.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_ListBySubscription.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_update.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_update.py
index ad8e24ed16eb..d962c2d4f1fb 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_update.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_samples/workspace_update.py
@@ -37,6 +37,6 @@ def main():
print(response)
-# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2024-04-03/examples/Workspace_Update.json
+# x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2024-08-08-preview/examples/Workspace_Update.json
if __name__ == "__main__":
main()
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/conftest.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/conftest.py
index 2bacd7394e96..b919673dd65c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/conftest.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/conftest.py
@@ -18,7 +18,7 @@
load_dotenv()
-# aovid record sensitive identity information in recordings
+# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
desktopvirtualizationmgmt_subscription_id = os.environ.get(
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations.py
new file mode 100644
index 000000000000..add290361cc0
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations.py
@@ -0,0 +1,43 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtActiveSessionHostConfigurationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_active_session_host_configurations_get(self, resource_group):
+ response = self.client.active_session_host_configurations.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_active_session_host_configurations_list_by_host_pool(self, resource_group):
+ response = self.client.active_session_host_configurations.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations_async.py
new file mode 100644
index 000000000000..544c4af08793
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_active_session_host_configurations_operations_async.py
@@ -0,0 +1,44 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtActiveSessionHostConfigurationsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_active_session_host_configurations_get(self, resource_group):
+ response = await self.client.active_session_host_configurations.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_active_session_host_configurations_list_by_host_pool(self, resource_group):
+ response = self.client.active_session_host_configurations.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations.py
index c5eae9ca9116..08007082fe4e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_import_method(self, resource_group):
+ def test_app_attach_package_info_import_method(self, resource_group):
response = self.client.app_attach_package_info.import_method(
resource_group_name=resource_group.name,
host_pool_name="str",
import_package_info_request={"packageArchitecture": "str", "path": "str"},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations_async.py
index 381ce67c0991..2b031f7be47a 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_info_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_import_method(self, resource_group):
+ async def test_app_attach_package_info_import_method(self, resource_group):
response = self.client.app_attach_package_info.import_method(
resource_group_name=resource_group.name,
host_pool_name="str",
import_package_info_request={"packageArchitecture": "str", "path": "str"},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations.py
index 2714c590f452..fc31c9d4980e 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_app_attach_package_get(self, resource_group):
response = self.client.app_attach_package.get(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -32,13 +32,14 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_app_attach_package_create_or_update(self, resource_group):
response = self.client.app_attach_package.create_or_update(
resource_group_name=resource_group.name,
app_attach_package_name="str",
app_attach_package={
"location": "str",
"properties": {
+ "customData": "str",
"failHealthCheckOnStagingFailure": "str",
"hostPoolReferences": ["str"],
"image": {
@@ -70,6 +71,8 @@ def test_create_or_update(self, resource_group):
"version": "str",
},
"keyVaultURL": "str",
+ "packageLookbackUrl": "str",
+ "packageOwnerName": "str",
"provisioningState": "str",
},
"id": "str",
@@ -85,7 +88,7 @@ def test_create_or_update(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -93,11 +96,11 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_app_attach_package_delete(self, resource_group):
response = self.client.app_attach_package.delete(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -105,11 +108,11 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_app_attach_package_update(self, resource_group):
response = self.client.app_attach_package.update(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -117,10 +120,10 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_app_attach_package_list_by_resource_group(self, resource_group):
response = self.client.app_attach_package.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -128,9 +131,9 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_app_attach_package_list_by_subscription(self, resource_group):
response = self.client.app_attach_package.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations_async.py
index fd872a32f0a4..24ccaac3bf67 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_app_attach_package_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_app_attach_package_get(self, resource_group):
response = await self.client.app_attach_package.get(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,13 +33,14 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_app_attach_package_create_or_update(self, resource_group):
response = await self.client.app_attach_package.create_or_update(
resource_group_name=resource_group.name,
app_attach_package_name="str",
app_attach_package={
"location": "str",
"properties": {
+ "customData": "str",
"failHealthCheckOnStagingFailure": "str",
"hostPoolReferences": ["str"],
"image": {
@@ -71,6 +72,8 @@ async def test_create_or_update(self, resource_group):
"version": "str",
},
"keyVaultURL": "str",
+ "packageLookbackUrl": "str",
+ "packageOwnerName": "str",
"provisioningState": "str",
},
"id": "str",
@@ -86,7 +89,7 @@ async def test_create_or_update(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -94,11 +97,11 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_app_attach_package_delete(self, resource_group):
response = await self.client.app_attach_package.delete(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -106,11 +109,11 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_app_attach_package_update(self, resource_group):
response = await self.client.app_attach_package.update(
resource_group_name=resource_group.name,
app_attach_package_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -118,10 +121,10 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_app_attach_package_list_by_resource_group(self, resource_group):
response = self.client.app_attach_package.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -129,9 +132,9 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_app_attach_package_list_by_subscription(self, resource_group):
response = self.client.app_attach_package.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations.py
index d1193ef29383..15bb16bd9524 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_application_groups_get(self, resource_group):
response = self.client.application_groups.get(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_application_groups_create_or_update(self, resource_group):
response = self.client.application_groups.create_or_update(
resource_group_name=resource_group.name,
application_group_name="str",
@@ -45,7 +45,12 @@ def test_create_or_update(self, resource_group):
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -65,7 +70,7 @@ def test_create_or_update(self, resource_group):
"type": "str",
"workspaceArmPath": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -73,11 +78,11 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_application_groups_delete(self, resource_group):
response = self.client.application_groups.delete(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -85,11 +90,11 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_application_groups_update(self, resource_group):
response = self.client.application_groups.update(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -97,10 +102,10 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_application_groups_list_by_resource_group(self, resource_group):
response = self.client.application_groups.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -108,9 +113,9 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_application_groups_list_by_subscription(self, resource_group):
response = self.client.application_groups.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations_async.py
index 9f61dc9eeea4..1aefb3f39a51 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_application_groups_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_application_groups_get(self, resource_group):
response = await self.client.application_groups.get(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_application_groups_create_or_update(self, resource_group):
response = await self.client.application_groups.create_or_update(
resource_group_name=resource_group.name,
application_group_name="str",
@@ -46,7 +46,12 @@ async def test_create_or_update(self, resource_group):
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -66,7 +71,7 @@ async def test_create_or_update(self, resource_group):
"type": "str",
"workspaceArmPath": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -74,11 +79,11 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_application_groups_delete(self, resource_group):
response = await self.client.application_groups.delete(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -86,11 +91,11 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_application_groups_update(self, resource_group):
response = await self.client.application_groups.update(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -98,10 +103,10 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_application_groups_list_by_resource_group(self, resource_group):
response = self.client.application_groups.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -109,9 +114,9 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_application_groups_list_by_subscription(self, resource_group):
response = self.client.application_groups.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations.py
index c5e68ba8dec0..fdf55e879394 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_applications_get(self, resource_group):
response = self.client.applications.get(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_applications_create_or_update(self, resource_group):
response = self.client.applications.create_or_update(
resource_group_name=resource_group.name,
application_group_name="str",
@@ -65,7 +65,7 @@ def test_create_or_update(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -73,12 +73,12 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_applications_delete(self, resource_group):
response = self.client.applications.delete(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -86,12 +86,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_applications_update(self, resource_group):
response = self.client.applications.update(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -99,11 +99,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_applications_list(self, resource_group):
response = self.client.applications.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations_async.py
index 1490dbd499c1..7e4de28bf9e8 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_applications_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_applications_get(self, resource_group):
response = await self.client.applications.get(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,7 +34,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_applications_create_or_update(self, resource_group):
response = await self.client.applications.create_or_update(
resource_group_name=resource_group.name,
application_group_name="str",
@@ -66,7 +66,7 @@ async def test_create_or_update(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -74,12 +74,12 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_applications_delete(self, resource_group):
response = await self.client.applications.delete(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -87,12 +87,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_applications_update(self, resource_group):
response = await self.client.applications.update(
resource_group_name=resource_group.name,
application_group_name="str",
application_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -100,11 +100,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_applications_list(self, resource_group):
response = self.client.applications.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations.py
new file mode 100644
index 000000000000..7676ab092ace
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations.py
@@ -0,0 +1,32 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtControlSessionHostUpdateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_control_session_host_update_begin_post(self, resource_group):
+ response = self.client.control_session_host_update.begin_post(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ host_pool_update_control_parameter={"action": "str", "cancelMessage": "str"},
+ api_version="2024-08-08-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations_async.py
new file mode 100644
index 000000000000..18c26f2641e4
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_control_session_host_update_operations_async.py
@@ -0,0 +1,35 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtControlSessionHostUpdateOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_control_session_host_update_begin_post(self, resource_group):
+ response = await (
+ await self.client.control_session_host_update.begin_post(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ host_pool_update_control_parameter={"action": "str", "cancelMessage": "str"},
+ api_version="2024-08-08-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations.py
index 3f5ea7c08f41..66e7a8ef7e27 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_desktops_get(self, resource_group):
response = self.client.desktops.get(
resource_group_name=resource_group.name,
application_group_name="str",
desktop_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,12 +33,12 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_desktops_update(self, resource_group):
response = self.client.desktops.update(
resource_group_name=resource_group.name,
application_group_name="str",
desktop_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -46,11 +46,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_desktops_list(self, resource_group):
response = self.client.desktops.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations_async.py
index 76f5dff1b61a..d0dad8d574d9 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_desktops_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_desktops_get(self, resource_group):
response = await self.client.desktops.get(
resource_group_name=resource_group.name,
application_group_name="str",
desktop_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,12 +34,12 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_desktops_update(self, resource_group):
response = await self.client.desktops.update(
resource_group_name=resource_group.name,
application_group_name="str",
desktop_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -47,11 +47,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_desktops_list(self, resource_group):
response = self.client.desktops.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations.py
index 73087acdd2ba..3a6aba2c41c0 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_host_pools_get(self, resource_group):
response = self.client.host_pools.get(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_host_pools_create_or_update(self, resource_group):
response = self.client.host_pools.create_or_update(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -52,12 +52,20 @@ def test_create_or_update(self, resource_group):
"cloudPcResource": bool,
"customRdpProperty": "str",
"description": "str",
+ "directUDP": "str",
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
+ "managedPrivateUDP": "str",
+ "managementType": "str",
"maxSessionLimit": 0,
"name": "str",
"objectId": "str",
@@ -87,11 +95,13 @@ def test_create_or_update(self, resource_group):
}
],
"publicNetworkAccess": "str",
+ "publicUDP": "str",
"registrationInfo": {
"expirationTime": "2020-02-20 00:00:00",
"registrationTokenOperation": "str",
"token": "str",
},
+ "relayUDP": "str",
"ring": 0,
"sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"},
"ssoClientId": "str",
@@ -112,7 +122,7 @@ def test_create_or_update(self, resource_group):
"validationEnvironment": bool,
"vmTemplate": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -120,11 +130,11 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_host_pools_delete(self, resource_group):
response = self.client.host_pools.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -132,11 +142,11 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_host_pools_update(self, resource_group):
response = self.client.host_pools.update(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -144,10 +154,10 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_host_pools_list_by_resource_group(self, resource_group):
response = self.client.host_pools.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -155,9 +165,9 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_host_pools_list(self, resource_group):
response = self.client.host_pools.list(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -165,11 +175,11 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_retrieve_registration_token(self, resource_group):
+ def test_host_pools_retrieve_registration_token(self, resource_group):
response = self.client.host_pools.retrieve_registration_token(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -177,11 +187,11 @@ def test_retrieve_registration_token(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_registration_tokens(self, resource_group):
+ def test_host_pools_list_registration_tokens(self, resource_group):
response = self.client.host_pools.list_registration_tokens(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations_async.py
index 4433fbe943d4..f5a71e92ae1c 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_host_pools_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_host_pools_get(self, resource_group):
response = await self.client.host_pools.get(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_host_pools_create_or_update(self, resource_group):
response = await self.client.host_pools.create_or_update(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -53,12 +53,20 @@ async def test_create_or_update(self, resource_group):
"cloudPcResource": bool,
"customRdpProperty": "str",
"description": "str",
+ "directUDP": "str",
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
+ "managedPrivateUDP": "str",
+ "managementType": "str",
"maxSessionLimit": 0,
"name": "str",
"objectId": "str",
@@ -88,11 +96,13 @@ async def test_create_or_update(self, resource_group):
}
],
"publicNetworkAccess": "str",
+ "publicUDP": "str",
"registrationInfo": {
"expirationTime": "2020-02-20 00:00:00",
"registrationTokenOperation": "str",
"token": "str",
},
+ "relayUDP": "str",
"ring": 0,
"sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"},
"ssoClientId": "str",
@@ -113,7 +123,7 @@ async def test_create_or_update(self, resource_group):
"validationEnvironment": bool,
"vmTemplate": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -121,11 +131,11 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_host_pools_delete(self, resource_group):
response = await self.client.host_pools.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -133,11 +143,11 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_host_pools_update(self, resource_group):
response = await self.client.host_pools.update(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -145,10 +155,10 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_host_pools_list_by_resource_group(self, resource_group):
response = self.client.host_pools.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -156,9 +166,9 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_host_pools_list(self, resource_group):
response = self.client.host_pools.list(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -166,11 +176,11 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_retrieve_registration_token(self, resource_group):
+ async def test_host_pools_retrieve_registration_token(self, resource_group):
response = await self.client.host_pools.retrieve_registration_token(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -178,11 +188,11 @@ async def test_retrieve_registration_token(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_registration_tokens(self, resource_group):
+ async def test_host_pools_list_registration_tokens(self, resource_group):
response = await self.client.host_pools.list_registration_tokens(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations.py
new file mode 100644
index 000000000000..071c49aecfb0
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtInitiateSessionHostUpdateOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_initiate_session_host_update_post(self, resource_group):
+ response = self.client.initiate_session_host_update.post(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations_async.py
new file mode 100644
index 000000000000..41302ec0cc77
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_initiate_session_host_update_operations_async.py
@@ -0,0 +1,32 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtInitiateSessionHostUpdateOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_initiate_session_host_update_post(self, resource_group):
+ response = await self.client.initiate_session_host_update.post(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations.py
index e78b749b217e..de09185f8ff6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_expand(self, resource_group):
+ def test_msix_images_expand(self, resource_group):
response = self.client.msix_images.expand(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_image_uri={"uri": "str"},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations_async.py
index 05b1c49cf285..5d68e04420d6 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_images_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_expand(self, resource_group):
+ async def test_msix_images_expand(self, resource_group):
response = self.client.msix_images.expand(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_image_uri={"uri": "str"},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations.py
index a1f949c00531..97580a3a50b3 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_msix_packages_get(self, resource_group):
response = self.client.msix_packages.get(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_msix_packages_create_or_update(self, resource_group):
response = self.client.msix_packages.create_or_update(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -72,7 +72,7 @@ def test_create_or_update(self, resource_group):
"type": "str",
"version": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -80,12 +80,12 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_msix_packages_delete(self, resource_group):
response = self.client.msix_packages.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -93,12 +93,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_msix_packages_update(self, resource_group):
response = self.client.msix_packages.update(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -106,11 +106,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_msix_packages_list(self, resource_group):
response = self.client.msix_packages.list(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations_async.py
index 5a015587b120..7d6657893509 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_msix_packages_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_msix_packages_get(self, resource_group):
response = await self.client.msix_packages.get(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,7 +34,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_msix_packages_create_or_update(self, resource_group):
response = await self.client.msix_packages.create_or_update(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -73,7 +73,7 @@ async def test_create_or_update(self, resource_group):
"type": "str",
"version": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -81,12 +81,12 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_msix_packages_delete(self, resource_group):
response = await self.client.msix_packages.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -94,12 +94,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_msix_packages_update(self, resource_group):
response = await self.client.msix_packages.update(
resource_group_name=resource_group.name,
host_pool_name="str",
msix_package_full_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -107,11 +107,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_msix_packages_list(self, resource_group):
response = self.client.msix_packages.list(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations.py
index 19082f23bd75..cf14c2639491 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations.py
@@ -20,9 +20,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_operations_list(self, resource_group):
response = self.client.operations.list(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations_async.py
index c1370b13dc27..345288192d60 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_operations_async.py
@@ -21,9 +21,9 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_operations_list(self, resource_group):
response = self.client.operations.list(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations.py
index a8bee2db3763..31e35f78cc25 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_workspace(self, resource_group):
+ def test_private_endpoint_connections_list_by_workspace(self, resource_group):
response = self.client.private_endpoint_connections.list_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -32,12 +32,12 @@ def test_list_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_workspace(self, resource_group):
+ def test_private_endpoint_connections_get_by_workspace(self, resource_group):
response = self.client.private_endpoint_connections.get_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -45,12 +45,12 @@ def test_get_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_by_workspace(self, resource_group):
+ def test_private_endpoint_connections_delete_by_workspace(self, resource_group):
response = self.client.private_endpoint_connections.delete_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -58,7 +58,7 @@ def test_delete_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update_by_workspace(self, resource_group):
+ def test_private_endpoint_connections_update_by_workspace(self, resource_group):
response = self.client.private_endpoint_connections.update_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
@@ -80,7 +80,7 @@ def test_update_by_workspace(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -88,11 +88,11 @@ def test_update_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_host_pool(self, resource_group):
+ def test_private_endpoint_connections_list_by_host_pool(self, resource_group):
response = self.client.private_endpoint_connections.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -100,12 +100,12 @@ def test_list_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get_by_host_pool(self, resource_group):
+ def test_private_endpoint_connections_get_by_host_pool(self, resource_group):
response = self.client.private_endpoint_connections.get_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -113,12 +113,12 @@ def test_get_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete_by_host_pool(self, resource_group):
+ def test_private_endpoint_connections_delete_by_host_pool(self, resource_group):
response = self.client.private_endpoint_connections.delete_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -126,7 +126,7 @@ def test_delete_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update_by_host_pool(self, resource_group):
+ def test_private_endpoint_connections_update_by_host_pool(self, resource_group):
response = self.client.private_endpoint_connections.update_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -148,7 +148,7 @@ def test_update_by_host_pool(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations_async.py
index e871e0546acb..b0f81fb66fba 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_endpoint_connections_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_workspace(self, resource_group):
+ async def test_private_endpoint_connections_list_by_workspace(self, resource_group):
response = self.client.private_endpoint_connections.list_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -33,12 +33,12 @@ async def test_list_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_workspace(self, resource_group):
+ async def test_private_endpoint_connections_get_by_workspace(self, resource_group):
response = await self.client.private_endpoint_connections.get_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -46,12 +46,12 @@ async def test_get_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_by_workspace(self, resource_group):
+ async def test_private_endpoint_connections_delete_by_workspace(self, resource_group):
response = await self.client.private_endpoint_connections.delete_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -59,7 +59,7 @@ async def test_delete_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update_by_workspace(self, resource_group):
+ async def test_private_endpoint_connections_update_by_workspace(self, resource_group):
response = await self.client.private_endpoint_connections.update_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
@@ -81,7 +81,7 @@ async def test_update_by_workspace(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -89,11 +89,11 @@ async def test_update_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_host_pool(self, resource_group):
+ async def test_private_endpoint_connections_list_by_host_pool(self, resource_group):
response = self.client.private_endpoint_connections.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -101,12 +101,12 @@ async def test_list_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get_by_host_pool(self, resource_group):
+ async def test_private_endpoint_connections_get_by_host_pool(self, resource_group):
response = await self.client.private_endpoint_connections.get_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -114,12 +114,12 @@ async def test_get_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete_by_host_pool(self, resource_group):
+ async def test_private_endpoint_connections_delete_by_host_pool(self, resource_group):
response = await self.client.private_endpoint_connections.delete_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
private_endpoint_connection_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -127,7 +127,7 @@ async def test_delete_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update_by_host_pool(self, resource_group):
+ async def test_private_endpoint_connections_update_by_host_pool(self, resource_group):
response = await self.client.private_endpoint_connections.update_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
@@ -149,7 +149,7 @@ async def test_update_by_host_pool(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations.py
index 5048e8fd8bf0..2d3792b67eb0 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_workspace(self, resource_group):
+ def test_private_link_resources_list_by_workspace(self, resource_group):
response = self.client.private_link_resources.list_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -32,11 +32,11 @@ def test_list_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_host_pool(self, resource_group):
+ def test_private_link_resources_list_by_host_pool(self, resource_group):
response = self.client.private_link_resources.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations_async.py
index c7abaa0bb8f6..8841d7df8b54 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_private_link_resources_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_workspace(self, resource_group):
+ async def test_private_link_resources_list_by_workspace(self, resource_group):
response = self.client.private_link_resources.list_by_workspace(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -33,11 +33,11 @@ async def test_list_by_workspace(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_host_pool(self, resource_group):
+ async def test_private_link_resources_list_by_host_pool(self, resource_group):
response = self.client.private_link_resources.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations.py
index d4536d8b1c08..f7d7cd3ad19f 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_scaling_plan_personal_schedules_get(self, resource_group):
response = self.client.scaling_plan_personal_schedules.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,39 +33,39 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_scaling_plan_personal_schedules_create(self, resource_group):
response = self.client.scaling_plan_personal_schedules.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
scaling_plan_schedule={
"daysOfWeek": ["str"],
+ "offPeakStartTime": {"hour": 0, "minute": 0},
+ "peakStartTime": {"hour": 0, "minute": 0},
+ "rampDownStartTime": {"hour": 0, "minute": 0},
+ "rampUpStartTime": {"hour": 0, "minute": 0},
"id": "str",
"name": "str",
"offPeakActionOnDisconnect": "str",
"offPeakActionOnLogoff": "str",
"offPeakMinutesToWaitOnDisconnect": 0,
"offPeakMinutesToWaitOnLogoff": 0,
- "offPeakStartTime": {"hour": 0, "minute": 0},
"offPeakStartVMOnConnect": "str",
"peakActionOnDisconnect": "str",
"peakActionOnLogoff": "str",
"peakMinutesToWaitOnDisconnect": 0,
"peakMinutesToWaitOnLogoff": 0,
- "peakStartTime": {"hour": 0, "minute": 0},
"peakStartVMOnConnect": "str",
"rampDownActionOnDisconnect": "str",
"rampDownActionOnLogoff": "str",
"rampDownMinutesToWaitOnDisconnect": 0,
"rampDownMinutesToWaitOnLogoff": 0,
- "rampDownStartTime": {"hour": 0, "minute": 0},
"rampDownStartVMOnConnect": "str",
"rampUpActionOnDisconnect": "str",
"rampUpActionOnLogoff": "str",
"rampUpAutoStartHosts": "str",
"rampUpMinutesToWaitOnDisconnect": 0,
"rampUpMinutesToWaitOnLogoff": 0,
- "rampUpStartTime": {"hour": 0, "minute": 0},
"rampUpStartVMOnConnect": "str",
"systemData": {
"createdAt": "2020-02-20 00:00:00",
@@ -77,7 +77,7 @@ def test_create(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -85,12 +85,12 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_scaling_plan_personal_schedules_delete(self, resource_group):
response = self.client.scaling_plan_personal_schedules.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -98,12 +98,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_scaling_plan_personal_schedules_update(self, resource_group):
response = self.client.scaling_plan_personal_schedules.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -111,11 +111,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_scaling_plan_personal_schedules_list(self, resource_group):
response = self.client.scaling_plan_personal_schedules.list(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations_async.py
index cb66793c9144..a6c3e3f599a4 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_personal_schedules_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_scaling_plan_personal_schedules_get(self, resource_group):
response = await self.client.scaling_plan_personal_schedules.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,39 +34,39 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_scaling_plan_personal_schedules_create(self, resource_group):
response = await self.client.scaling_plan_personal_schedules.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
scaling_plan_schedule={
"daysOfWeek": ["str"],
+ "offPeakStartTime": {"hour": 0, "minute": 0},
+ "peakStartTime": {"hour": 0, "minute": 0},
+ "rampDownStartTime": {"hour": 0, "minute": 0},
+ "rampUpStartTime": {"hour": 0, "minute": 0},
"id": "str",
"name": "str",
"offPeakActionOnDisconnect": "str",
"offPeakActionOnLogoff": "str",
"offPeakMinutesToWaitOnDisconnect": 0,
"offPeakMinutesToWaitOnLogoff": 0,
- "offPeakStartTime": {"hour": 0, "minute": 0},
"offPeakStartVMOnConnect": "str",
"peakActionOnDisconnect": "str",
"peakActionOnLogoff": "str",
"peakMinutesToWaitOnDisconnect": 0,
"peakMinutesToWaitOnLogoff": 0,
- "peakStartTime": {"hour": 0, "minute": 0},
"peakStartVMOnConnect": "str",
"rampDownActionOnDisconnect": "str",
"rampDownActionOnLogoff": "str",
"rampDownMinutesToWaitOnDisconnect": 0,
"rampDownMinutesToWaitOnLogoff": 0,
- "rampDownStartTime": {"hour": 0, "minute": 0},
"rampDownStartVMOnConnect": "str",
"rampUpActionOnDisconnect": "str",
"rampUpActionOnLogoff": "str",
"rampUpAutoStartHosts": "str",
"rampUpMinutesToWaitOnDisconnect": 0,
"rampUpMinutesToWaitOnLogoff": 0,
- "rampUpStartTime": {"hour": 0, "minute": 0},
"rampUpStartVMOnConnect": "str",
"systemData": {
"createdAt": "2020-02-20 00:00:00",
@@ -78,7 +78,7 @@ async def test_create(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -86,12 +86,12 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_scaling_plan_personal_schedules_delete(self, resource_group):
response = await self.client.scaling_plan_personal_schedules.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -99,12 +99,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_scaling_plan_personal_schedules_update(self, resource_group):
response = await self.client.scaling_plan_personal_schedules.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -112,11 +112,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_scaling_plan_personal_schedules_list(self, resource_group):
response = self.client.scaling_plan_personal_schedules.list(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations.py
index 973ae0f894fa..749940ea96ea 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_scaling_plan_pooled_schedules_get(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,31 +33,31 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_scaling_plan_pooled_schedules_create(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
scaling_plan_schedule={
"daysOfWeek": ["str"],
+ "offPeakStartTime": {"hour": 0, "minute": 0},
+ "peakStartTime": {"hour": 0, "minute": 0},
+ "rampDownCapacityThresholdPct": 0,
+ "rampDownStartTime": {"hour": 0, "minute": 0},
+ "rampUpCapacityThresholdPct": 0,
+ "rampUpStartTime": {"hour": 0, "minute": 0},
"id": "str",
"name": "str",
"offPeakLoadBalancingAlgorithm": "str",
- "offPeakStartTime": {"hour": 0, "minute": 0},
"peakLoadBalancingAlgorithm": "str",
- "peakStartTime": {"hour": 0, "minute": 0},
- "rampDownCapacityThresholdPct": 0,
"rampDownForceLogoffUsers": bool,
"rampDownLoadBalancingAlgorithm": "str",
"rampDownMinimumHostsPct": 0,
"rampDownNotificationMessage": "str",
- "rampDownStartTime": {"hour": 0, "minute": 0},
"rampDownStopHostsWhen": "str",
"rampDownWaitTimeMinutes": 0,
- "rampUpCapacityThresholdPct": 0,
"rampUpLoadBalancingAlgorithm": "str",
"rampUpMinimumHostsPct": 0,
- "rampUpStartTime": {"hour": 0, "minute": 0},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
@@ -68,7 +68,7 @@ def test_create(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -76,12 +76,12 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_scaling_plan_pooled_schedules_delete(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -89,12 +89,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_scaling_plan_pooled_schedules_update(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -102,11 +102,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_scaling_plan_pooled_schedules_list(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.list(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations_async.py
index 9ff2d9868812..9a626fbb1a65 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plan_pooled_schedules_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_scaling_plan_pooled_schedules_get(self, resource_group):
response = await self.client.scaling_plan_pooled_schedules.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,31 +34,31 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_scaling_plan_pooled_schedules_create(self, resource_group):
response = await self.client.scaling_plan_pooled_schedules.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
scaling_plan_schedule={
"daysOfWeek": ["str"],
+ "offPeakStartTime": {"hour": 0, "minute": 0},
+ "peakStartTime": {"hour": 0, "minute": 0},
+ "rampDownCapacityThresholdPct": 0,
+ "rampDownStartTime": {"hour": 0, "minute": 0},
+ "rampUpCapacityThresholdPct": 0,
+ "rampUpStartTime": {"hour": 0, "minute": 0},
"id": "str",
"name": "str",
"offPeakLoadBalancingAlgorithm": "str",
- "offPeakStartTime": {"hour": 0, "minute": 0},
"peakLoadBalancingAlgorithm": "str",
- "peakStartTime": {"hour": 0, "minute": 0},
- "rampDownCapacityThresholdPct": 0,
"rampDownForceLogoffUsers": bool,
"rampDownLoadBalancingAlgorithm": "str",
"rampDownMinimumHostsPct": 0,
"rampDownNotificationMessage": "str",
- "rampDownStartTime": {"hour": 0, "minute": 0},
"rampDownStopHostsWhen": "str",
"rampDownWaitTimeMinutes": 0,
- "rampUpCapacityThresholdPct": 0,
"rampUpLoadBalancingAlgorithm": "str",
"rampUpMinimumHostsPct": 0,
- "rampUpStartTime": {"hour": 0, "minute": 0},
"systemData": {
"createdAt": "2020-02-20 00:00:00",
"createdBy": "str",
@@ -69,7 +69,7 @@ async def test_create(self, resource_group):
},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -77,12 +77,12 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_scaling_plan_pooled_schedules_delete(self, resource_group):
response = await self.client.scaling_plan_pooled_schedules.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -90,12 +90,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_scaling_plan_pooled_schedules_update(self, resource_group):
response = await self.client.scaling_plan_pooled_schedules.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
scaling_plan_schedule_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -103,11 +103,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_scaling_plan_pooled_schedules_list(self, resource_group):
response = self.client.scaling_plan_pooled_schedules.list(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations.py
index cee2eaae558d..7e9deb46bd16 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_scaling_plans_get(self, resource_group):
response = self.client.scaling_plans.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create(self, resource_group):
+ def test_scaling_plans_create(self, resource_group):
response = self.client.scaling_plans.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
@@ -46,7 +46,12 @@ def test_create(self, resource_group):
"hostPoolReferences": [{"hostPoolArmPath": "str", "scalingPlanEnabled": bool}],
"hostPoolType": "Pooled",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -86,7 +91,7 @@ def test_create(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -94,11 +99,11 @@ def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_scaling_plans_delete(self, resource_group):
response = self.client.scaling_plans.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -106,11 +111,11 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_scaling_plans_update(self, resource_group):
response = self.client.scaling_plans.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -118,10 +123,10 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_scaling_plans_list_by_resource_group(self, resource_group):
response = self.client.scaling_plans.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -129,9 +134,9 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_scaling_plans_list_by_subscription(self, resource_group):
response = self.client.scaling_plans.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -139,11 +144,11 @@ def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_host_pool(self, resource_group):
+ def test_scaling_plans_list_by_host_pool(self, resource_group):
response = self.client.scaling_plans.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations_async.py
index bb5c7899e80d..72fc97226f2b 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_scaling_plans_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_scaling_plans_get(self, resource_group):
response = await self.client.scaling_plans.get(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create(self, resource_group):
+ async def test_scaling_plans_create(self, resource_group):
response = await self.client.scaling_plans.create(
resource_group_name=resource_group.name,
scaling_plan_name="str",
@@ -47,7 +47,12 @@ async def test_create(self, resource_group):
"hostPoolReferences": [{"hostPoolArmPath": "str", "scalingPlanEnabled": bool}],
"hostPoolType": "Pooled",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -87,7 +92,7 @@ async def test_create(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -95,11 +100,11 @@ async def test_create(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_scaling_plans_delete(self, resource_group):
response = await self.client.scaling_plans.delete(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -107,11 +112,11 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_scaling_plans_update(self, resource_group):
response = await self.client.scaling_plans.update(
resource_group_name=resource_group.name,
scaling_plan_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -119,10 +124,10 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_scaling_plans_list_by_resource_group(self, resource_group):
response = self.client.scaling_plans.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -130,9 +135,9 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_scaling_plans_list_by_subscription(self, resource_group):
response = self.client.scaling_plans.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -140,11 +145,11 @@ async def test_list_by_subscription(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_host_pool(self, resource_group):
+ async def test_scaling_plans_list_by_host_pool(self, resource_group):
response = self.client.scaling_plans.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations.py
new file mode 100644
index 000000000000..c403c32f6d93
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations.py
@@ -0,0 +1,109 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostConfigurationsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_configurations_begin_create_or_update(self, resource_group):
+ response = self.client.session_host_configurations.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_configuration={
+ "diskInfo": {"type": "str"},
+ "domainInfo": {
+ "joinType": "str",
+ "activeDirectoryInfo": {
+ "domainCredentials": {"passwordKeyVaultSecretUri": "str", "usernameKeyVaultSecretUri": "str"},
+ "ouPath": "str",
+ "domainName": "str",
+ },
+ "azureActiveDirectoryInfo": {"mdmProviderGuid": "str"},
+ },
+ "imageInfo": {
+ "type": "str",
+ "customInfo": {"resourceId": "str"},
+ "marketplaceInfo": {"exactVersion": "str", "offer": "str", "publisher": "str", "sku": "str"},
+ },
+ "networkInfo": {"subnetId": "str", "securityGroupId": "str"},
+ "vmAdminCredentials": {"passwordKeyVaultSecretUri": "str", "usernameKeyVaultSecretUri": "str"},
+ "vmNamePrefix": "str",
+ "vmSizeId": "str",
+ "availabilityZones": [0],
+ "bootDiagnosticsInfo": {"enabled": bool, "storageUri": "str"},
+ "customConfigurationScriptUrl": "str",
+ "friendlyName": "str",
+ "id": "str",
+ "name": "str",
+ "provisioningState": "str",
+ "securityInfo": {"secureBootEnabled": bool, "type": "str", "vTpmEnabled": bool},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "version": "2020-02-20 00:00:00",
+ "vmLocation": "str",
+ "vmResourceGroup": "str",
+ "vmTags": {"str": "str"},
+ },
+ api_version="2024-08-08-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_configurations_begin_update(self, resource_group):
+ response = self.client.session_host_configurations.begin_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_configurations_get(self, resource_group):
+ response = self.client.session_host_configurations.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_configurations_list_by_host_pool(self, resource_group):
+ response = self.client.session_host_configurations.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations_async.py
new file mode 100644
index 000000000000..c29ddfab3138
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_configurations_operations_async.py
@@ -0,0 +1,117 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostConfigurationsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_configurations_begin_create_or_update(self, resource_group):
+ response = await (
+ await self.client.session_host_configurations.begin_create_or_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_configuration={
+ "diskInfo": {"type": "str"},
+ "domainInfo": {
+ "joinType": "str",
+ "activeDirectoryInfo": {
+ "domainCredentials": {
+ "passwordKeyVaultSecretUri": "str",
+ "usernameKeyVaultSecretUri": "str",
+ },
+ "ouPath": "str",
+ "domainName": "str",
+ },
+ "azureActiveDirectoryInfo": {"mdmProviderGuid": "str"},
+ },
+ "imageInfo": {
+ "type": "str",
+ "customInfo": {"resourceId": "str"},
+ "marketplaceInfo": {"exactVersion": "str", "offer": "str", "publisher": "str", "sku": "str"},
+ },
+ "networkInfo": {"subnetId": "str", "securityGroupId": "str"},
+ "vmAdminCredentials": {"passwordKeyVaultSecretUri": "str", "usernameKeyVaultSecretUri": "str"},
+ "vmNamePrefix": "str",
+ "vmSizeId": "str",
+ "availabilityZones": [0],
+ "bootDiagnosticsInfo": {"enabled": bool, "storageUri": "str"},
+ "customConfigurationScriptUrl": "str",
+ "friendlyName": "str",
+ "id": "str",
+ "name": "str",
+ "provisioningState": "str",
+ "securityInfo": {"secureBootEnabled": bool, "type": "str", "vTpmEnabled": bool},
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ "version": "2020-02-20 00:00:00",
+ "vmLocation": "str",
+ "vmResourceGroup": "str",
+ "vmTags": {"str": "str"},
+ },
+ api_version="2024-08-08-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_configurations_begin_update(self, resource_group):
+ response = await (
+ await self.client.session_host_configurations.begin_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ ).result() # call '.result()' to poll until service return final result
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_configurations_get(self, resource_group):
+ response = await self.client.session_host_configurations.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_configurations_list_by_host_pool(self, resource_group):
+ response = self.client.session_host_configurations.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations.py
new file mode 100644
index 000000000000..0948e2d6c418
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations.py
@@ -0,0 +1,82 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostManagementsOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_managements_get(self, resource_group):
+ response = self.client.session_host_managements.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_managements_create_or_update(self, resource_group):
+ response = self.client.session_host_managements.create_or_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_management={
+ "scheduledDateTimeZone": "str",
+ "update": {"logOffDelayMinutes": 0, "maxVmsRemoved": 0, "deleteOriginalVm": bool, "logOffMessage": ""},
+ "id": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_managements_update(self, resource_group):
+ response = self.client.session_host_managements.update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_managements_list_by_host_pool(self, resource_group):
+ response = self.client.session_host_managements.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations_async.py
new file mode 100644
index 000000000000..ed5331bb64c0
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_operations_async.py
@@ -0,0 +1,83 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostManagementsOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_managements_get(self, resource_group):
+ response = await self.client.session_host_managements.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_managements_create_or_update(self, resource_group):
+ response = await self.client.session_host_managements.create_or_update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_management={
+ "scheduledDateTimeZone": "str",
+ "update": {"logOffDelayMinutes": 0, "maxVmsRemoved": 0, "deleteOriginalVm": bool, "logOffMessage": ""},
+ "id": "str",
+ "name": "str",
+ "systemData": {
+ "createdAt": "2020-02-20 00:00:00",
+ "createdBy": "str",
+ "createdByType": "str",
+ "lastModifiedAt": "2020-02-20 00:00:00",
+ "lastModifiedBy": "str",
+ "lastModifiedByType": "str",
+ },
+ "type": "str",
+ },
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_managements_update(self, resource_group):
+ response = await self.client.session_host_managements.update(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_managements_list_by_host_pool(self, resource_group):
+ response = self.client.session_host_managements.list_by_host_pool(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+ result = [r async for r in response]
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations.py
new file mode 100644
index 000000000000..6e3c3423884d
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations.py
@@ -0,0 +1,31 @@
+# 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 pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostManagementsUpdateStatusOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_managements_update_status_get(self, resource_group):
+ response = self.client.session_host_managements_update_status.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations_async.py
new file mode 100644
index 000000000000..67c7e113b935
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_managements_update_status_operations_async.py
@@ -0,0 +1,32 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostManagementsUpdateStatusOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_managements_update_status_get(self, resource_group):
+ response = await self.client.session_host_managements_update_status.get(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations.py
new file mode 100644
index 000000000000..a1d09aa541fe
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations.py
@@ -0,0 +1,32 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostOperations(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy
+ def test_session_host_retry_provisioning(self, resource_group):
+ response = self.client.session_host.retry_provisioning(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations_async.py
new file mode 100644
index 000000000000..609196cc3063
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_host_operations_async.py
@@ -0,0 +1,33 @@
+# coding=utf-8
+# --------------------------------------------------------------------------
+# Copyright (c) Microsoft Corporation. All rights reserved.
+# Licensed under the MIT License. See License.txt in the project root for license information.
+# Code generated by Microsoft (R) AutoRest Code Generator.
+# Changes may cause incorrect behavior and will be lost if the code is regenerated.
+# --------------------------------------------------------------------------
+import pytest
+from azure.mgmt.desktopvirtualization.aio import DesktopVirtualizationMgmtClient
+
+from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer
+from devtools_testutils.aio import recorded_by_proxy_async
+
+AZURE_LOCATION = "eastus"
+
+
+@pytest.mark.skip("you may need to update the auto-generated test case before run it")
+class TestDesktopVirtualizationMgmtSessionHostOperationsAsync(AzureMgmtRecordedTestCase):
+ def setup_method(self, method):
+ self.client = self.create_mgmt_client(DesktopVirtualizationMgmtClient, is_async=True)
+
+ @RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
+ @recorded_by_proxy_async
+ async def test_session_host_retry_provisioning(self, resource_group):
+ response = await self.client.session_host.retry_provisioning(
+ resource_group_name=resource_group.name,
+ host_pool_name="str",
+ session_host_name="str",
+ api_version="2024-08-08-preview",
+ )
+
+ # please add some check logic here by yourself
+ # ...
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations.py
index f6da35d6d8da..d42a63b698d7 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations.py
@@ -20,12 +20,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_session_hosts_get(self, resource_group):
response = self.client.session_hosts.get(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,12 +33,12 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_session_hosts_delete(self, resource_group):
response = self.client.session_hosts.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -46,12 +46,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_session_hosts_update(self, resource_group):
response = self.client.session_hosts.update(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -59,11 +59,11 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_session_hosts_list(self, resource_group):
response = self.client.session_hosts.list(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations_async.py
index 3760951a7af3..e792fa6122ad 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_session_hosts_operations_async.py
@@ -21,12 +21,12 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_session_hosts_get(self, resource_group):
response = await self.client.session_hosts.get(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -34,12 +34,12 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_session_hosts_delete(self, resource_group):
response = await self.client.session_hosts.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -47,12 +47,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_session_hosts_update(self, resource_group):
response = await self.client.session_hosts.update(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -60,11 +60,11 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_session_hosts_list(self, resource_group):
response = self.client.session_hosts.list(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations.py
index 0f2cf1687abc..065c32db8173 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_start_menu_items_list(self, resource_group):
response = self.client.start_menu_items.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations_async.py
index 0cc0958c5005..d20b550871a2 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_start_menu_items_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_start_menu_items_list(self, resource_group):
response = self.client.start_menu_items.list(
resource_group_name=resource_group.name,
application_group_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations.py
index 8b9a2c864beb..92b5da0e57ca 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_host_pool(self, resource_group):
+ def test_user_sessions_list_by_host_pool(self, resource_group):
response = self.client.user_sessions.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -32,13 +32,13 @@ def test_list_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_user_sessions_get(self, resource_group):
response = self.client.user_sessions.get(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -46,13 +46,13 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_user_sessions_delete(self, resource_group):
response = self.client.user_sessions.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -60,12 +60,12 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list(self, resource_group):
+ def test_user_sessions_list(self, resource_group):
response = self.client.user_sessions.list(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -73,13 +73,13 @@ def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_disconnect(self, resource_group):
+ def test_user_sessions_disconnect(self, resource_group):
response = self.client.user_sessions.disconnect(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -87,13 +87,13 @@ def test_disconnect(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_send_message(self, resource_group):
+ def test_user_sessions_send_message(self, resource_group):
response = self.client.user_sessions.send_message(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations_async.py
index a03d5750b173..608613ed6604 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_user_sessions_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_host_pool(self, resource_group):
+ async def test_user_sessions_list_by_host_pool(self, resource_group):
response = self.client.user_sessions.list_by_host_pool(
resource_group_name=resource_group.name,
host_pool_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -33,13 +33,13 @@ async def test_list_by_host_pool(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_user_sessions_get(self, resource_group):
response = await self.client.user_sessions.get(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -47,13 +47,13 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_user_sessions_delete(self, resource_group):
response = await self.client.user_sessions.delete(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -61,12 +61,12 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list(self, resource_group):
+ async def test_user_sessions_list(self, resource_group):
response = self.client.user_sessions.list(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -74,13 +74,13 @@ async def test_list(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_disconnect(self, resource_group):
+ async def test_user_sessions_disconnect(self, resource_group):
response = await self.client.user_sessions.disconnect(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -88,13 +88,13 @@ async def test_disconnect(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_send_message(self, resource_group):
+ async def test_user_sessions_send_message(self, resource_group):
response = await self.client.user_sessions.send_message(
resource_group_name=resource_group.name,
host_pool_name="str",
session_host_name="str",
user_session_id="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations.py
index aee123acbae0..1018cf66d4db 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations.py
@@ -20,11 +20,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_get(self, resource_group):
+ def test_workspaces_get(self, resource_group):
response = self.client.workspaces.get(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -32,7 +32,7 @@ def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_create_or_update(self, resource_group):
+ def test_workspaces_create_or_update(self, resource_group):
response = self.client.workspaces.create_or_update(
resource_group_name=resource_group.name,
workspace_name="str",
@@ -44,7 +44,12 @@ def test_create_or_update(self, resource_group):
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -86,7 +91,7 @@ def test_create_or_update(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -94,11 +99,11 @@ def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_delete(self, resource_group):
+ def test_workspaces_delete(self, resource_group):
response = self.client.workspaces.delete(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -106,11 +111,11 @@ def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_update(self, resource_group):
+ def test_workspaces_update(self, resource_group):
response = self.client.workspaces.update(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -118,10 +123,10 @@ def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_resource_group(self, resource_group):
+ def test_workspaces_list_by_resource_group(self, resource_group):
response = self.client.workspaces.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
@@ -129,9 +134,9 @@ def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy
- def test_list_by_subscription(self, resource_group):
+ def test_workspaces_list_by_subscription(self, resource_group):
response = self.client.workspaces.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r for r in response]
# please add some check logic here by yourself
diff --git a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations_async.py b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations_async.py
index dd1d71f33f85..a56e51e5f819 100644
--- a/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations_async.py
+++ b/sdk/desktopvirtualization/azure-mgmt-desktopvirtualization/generated_tests/test_desktop_virtualization_mgmt_workspaces_operations_async.py
@@ -21,11 +21,11 @@ def setup_method(self, method):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_get(self, resource_group):
+ async def test_workspaces_get(self, resource_group):
response = await self.client.workspaces.get(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -33,7 +33,7 @@ async def test_get(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_create_or_update(self, resource_group):
+ async def test_workspaces_create_or_update(self, resource_group):
response = await self.client.workspaces.create_or_update(
resource_group_name=resource_group.name,
workspace_name="str",
@@ -45,7 +45,12 @@ async def test_create_or_update(self, resource_group):
"etag": "str",
"friendlyName": "str",
"id": "str",
- "identity": {"principalId": "str", "tenantId": "str", "type": "SystemAssigned"},
+ "identity": {
+ "type": "str",
+ "principalId": "str",
+ "tenantId": "str",
+ "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}},
+ },
"kind": "str",
"managedBy": "str",
"name": "str",
@@ -87,7 +92,7 @@ async def test_create_or_update(self, resource_group):
"tags": {"str": "str"},
"type": "str",
},
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -95,11 +100,11 @@ async def test_create_or_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_delete(self, resource_group):
+ async def test_workspaces_delete(self, resource_group):
response = await self.client.workspaces.delete(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -107,11 +112,11 @@ async def test_delete(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_update(self, resource_group):
+ async def test_workspaces_update(self, resource_group):
response = await self.client.workspaces.update(
resource_group_name=resource_group.name,
workspace_name="str",
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
# please add some check logic here by yourself
@@ -119,10 +124,10 @@ async def test_update(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_resource_group(self, resource_group):
+ async def test_workspaces_list_by_resource_group(self, resource_group):
response = self.client.workspaces.list_by_resource_group(
resource_group_name=resource_group.name,
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself
@@ -130,9 +135,9 @@ async def test_list_by_resource_group(self, resource_group):
@RandomNameResourceGroupPreparer(location=AZURE_LOCATION)
@recorded_by_proxy_async
- async def test_list_by_subscription(self, resource_group):
+ async def test_workspaces_list_by_subscription(self, resource_group):
response = self.client.workspaces.list_by_subscription(
- api_version="2024-04-03",
+ api_version="2024-08-08-preview",
)
result = [r async for r in response]
# please add some check logic here by yourself