Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sdk/iothub/azure-mgmt-iothub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release History

## 5.0.0b2 (2025-10-20)

### Features Added

- Model `IotHubClient` added parameter `cloud_setting` in method `__init__`
- Model `CertificateProperties` added property `policy_resource_id`
- Model `CertificatePropertiesWithNonce` added property `policy_resource_id`
- Model `IotHubProperties` added property `device_registry`
- Enum `IotHubSku` added member `GEN2`
- Enum `IotHubSkuTier` added member `GENERATION2`
- Added model `DeviceRegistry`

## 5.0.0b1 (2025-08-14)

### Breaking Changes
Expand Down
8 changes: 4 additions & 4 deletions sdk/iothub/azure-mgmt-iothub/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
recursive-include tests *.py *.json
recursive-include samples *.py *.md
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
include LICENSE
include azure/mgmt/iothub/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/mgmt/__init__.py
8 changes: 4 additions & 4 deletions sdk/iothub/azure-mgmt-iothub/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1bdafdbace5d4cc7eb461433adac4a45af87c186",
"commit": "131b265e5626c867683ddb4770610348fc98d740",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.38.2",
"@autorest/python@6.40.0",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/iothub/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --keep-setup-py=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-preview-2023-06 --use=@autorest/python@6.38.2 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/iothub/resource-manager/readme.md"
"autorest_command": "autorest specification/iothub/resource-manager/Microsoft.Devices/IoTHub/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.40.0 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
"readme": "specification/iothub/resource-manager/Microsoft.Devices/IoTHub/readme.md"
}
1 change: 1 addition & 0 deletions sdk/iothub/azure-mgmt-iothub/apiview-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"azure.mgmt.iothub.models.CertificateVerificationDescription": null,
"azure.mgmt.iothub.models.CertificateWithNonceDescription": null,
"azure.mgmt.iothub.models.CloudToDeviceProperties": null,
"azure.mgmt.iothub.models.DeviceRegistry": null,
"azure.mgmt.iothub.models.EncryptionPropertiesDescription": null,
"azure.mgmt.iothub.models.EndpointHealthData": null,
"azure.mgmt.iothub.models.EndpointHealthDataListResult": null,
Expand Down
2 changes: 1 addition & 1 deletion sdk/iothub/azure-mgmt-iothub/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
2 changes: 1 addition & 1 deletion sdk/iothub/azure-mgmt-iothub/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


Expand All @@ -27,13 +28,22 @@ class IotHubClientConfiguration: # pylint: disable=too-many-instance-attributes
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The subscription identifier. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-06-30-preview". Note that overriding
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:type cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2025-08-01-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", "2023-06-30-preview")
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2025-08-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -42,6 +52,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs

self.credential = credential
self.subscription_id = subscription_id
self.cloud_setting = cloud_setting
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-iothub/{}".format(VERSION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials import TokenCredential


Expand Down Expand Up @@ -59,23 +60,36 @@ class IotHubClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is None.
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-06-30-preview". Note that overriding
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:paramtype cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2025-08-01-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__(
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
self,
credential: "TokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
*,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
_endpoints = get_arm_endpoints(_cloud)
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = IotHubClientConfiguration(
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
credential=credential,
subscription_id=subscription_id,
cloud_setting=cloud_setting,
credential_scopes=credential_scopes,
**kwargs
)

_policies = kwargs.pop("policies", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import sys
import codecs
from typing import (
Dict,
Any,
cast,
Optional,
Expand All @@ -31,7 +30,6 @@
Mapping,
Callable,
MutableMapping,
List,
)

try:
Expand Down Expand Up @@ -229,12 +227,12 @@ class Model:
serialization and deserialization.
"""

_subtype_map: Dict[str, Dict[str, Any]] = {}
_attribute_map: Dict[str, Dict[str, Any]] = {}
_validation: Dict[str, Dict[str, Any]] = {}
_subtype_map: dict[str, dict[str, Any]] = {}
_attribute_map: dict[str, dict[str, Any]] = {}
_validation: dict[str, dict[str, Any]] = {}

def __init__(self, **kwargs: Any) -> None:
self.additional_properties: Optional[Dict[str, Any]] = {}
self.additional_properties: Optional[dict[str, Any]] = {}
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__)
Expand Down Expand Up @@ -311,7 +309,7 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON:
def as_dict(
self,
keep_readonly: bool = True,
key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer,
key_transformer: Callable[[str, dict[str, Any], Any], Any] = attribute_transformer,
**kwargs: Any
) -> JSON:
"""Return a dict that can be serialized using json.dump.
Expand Down Expand Up @@ -380,7 +378,7 @@ def deserialize(cls, data: Any, content_type: Optional[str] = None) -> Self:
def from_dict(
cls,
data: Any,
key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None,
key_extractors: Optional[Callable[[str, dict[str, Any], Any], Any]] = None,
content_type: Optional[str] = None,
) -> Self:
"""Parse a dict using given key extractor return a model.
Expand Down Expand Up @@ -414,7 +412,7 @@ 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)) # pylint: disable=protected-access
result |= objects[valuetype]._flatten_subtype(key, objects) # pylint: disable=protected-access
return result

@classmethod
Expand Down Expand Up @@ -528,7 +526,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
"[]": self.serialize_iter,
"{}": self.serialize_dict,
}
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
self.dependencies: dict[str, type] = dict(classes) if classes else {}
self.key_transformer = full_restapi_key_transformer
self.client_side_validation = True

Expand Down Expand Up @@ -579,7 +577,7 @@ def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, to

if attr_name == "additional_properties" and attr_desc["key"] == "":
if target_obj.additional_properties is not None:
serialized.update(target_obj.additional_properties)
serialized |= target_obj.additional_properties
continue
try:

Expand Down Expand Up @@ -1184,7 +1182,7 @@ def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argumen

while "." in key:
# Need the cast, as for some reasons "split" is typed as list[str | Any]
dict_keys = cast(List[str], _FLATTEN.split(key))
dict_keys = cast(list[str], _FLATTEN.split(key))
if len(dict_keys) == 1:
key = _decode_attribute_map_key(dict_keys[0])
break
Expand Down Expand Up @@ -1386,7 +1384,7 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None:
"duration": (isodate.Duration, datetime.timedelta),
"iso-8601": (datetime.datetime),
}
self.dependencies: Dict[str, type] = dict(classes) if classes else {}
self.dependencies: dict[str, type] = dict(classes) if classes else {}
self.key_extractors = [rest_key_extractor, xml_key_extractor]
# Additional properties only works if the "rest_key_extractor" is used to
# extract the keys. Making it to work whatever the key extractor is too much
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "5.0.0b1"
VERSION = "5.0.0b2"
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy

from .._version import VERSION

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials_async import AsyncTokenCredential


Expand All @@ -27,13 +28,22 @@ class IotHubClientConfiguration: # pylint: disable=too-many-instance-attributes
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The subscription identifier. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-06-30-preview". Note that overriding
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:type cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2025-08-01-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", "2023-06-30-preview")
def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2025-08-01-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -42,6 +52,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k

self.credential = credential
self.subscription_id = subscription_id
self.cloud_setting = cloud_setting
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-iothub/{}".format(VERSION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
)

if TYPE_CHECKING:
from azure.core import AzureClouds
from azure.core.credentials_async import AsyncTokenCredential


Expand Down Expand Up @@ -60,23 +61,36 @@ class IotHubClient: # pylint: disable=too-many-instance-attributes
:type subscription_id: str
:param base_url: Service URL. Default value is None.
:type base_url: str
:keyword api_version: Api Version. Default value is "2023-06-30-preview". Note that overriding
:keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
None.
:paramtype cloud_setting: ~azure.core.AzureClouds
:keyword api_version: Api Version. Default value is "2025-08-01-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__(
self, credential: "AsyncTokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
self,
credential: "AsyncTokenCredential",
subscription_id: str,
base_url: Optional[str] = None,
*,
cloud_setting: Optional["AzureClouds"] = None,
**kwargs: Any
) -> None:
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
_cloud = cloud_setting or settings.current.azure_cloud # type: ignore
_endpoints = get_arm_endpoints(_cloud)
if not base_url:
base_url = _endpoints["resource_manager"]
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
self._config = IotHubClientConfiguration(
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
credential=credential,
subscription_id=subscription_id,
cloud_setting=cloud_setting,
credential_scopes=credential_scopes,
**kwargs
)

_policies = kwargs.pop("policies", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --------------------------------------------------------------------------
from collections.abc import MutableMapping
from io import IOBase
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload
from typing import Any, Callable, IO, Optional, TypeVar, Union, overload

from azure.core import AsyncPipelineClient
from azure.core.exceptions import (
Expand Down Expand Up @@ -37,7 +37,8 @@
from .._configuration import IotHubClientConfiguration

T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]]
List = list


class CertificatesOperations:
Expand Down
Loading
Loading