Skip to content

Commit dee127e

Browse files
committed
Configurations: 'specification/deviceupdate/data-plane/duiothub/tspconfig.yaml', SDK Release Type: stable, and CommitSHA: '292231b1131ff9fd070377372a0647c6ac7a6ce2' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6437603 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
1 parent 30b7dfe commit dee127e

43 files changed

Lines changed: 9939 additions & 7569 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 1.1.0 (2026-06-15)
4+
5+
skip changelog generation for data-plane package and please add changelog manually.
6+
37
## 1.0.1 (Unreleased)
48

59
### Features Added
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
include *.md
2+
include LICENSE
3+
include azure/iot/deviceupdate/py.typed
14
recursive-include tests *.py
25
recursive-include samples *.py *.md
3-
include LICENSE
4-
include *.md
56
include azure/__init__.py
67
include azure/iot/__init__.py
7-
include azure/iot/deviceupdate/py.typed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"apiVersion": "2026-06-01",
3+
"apiVersions": {
4+
"DeviceUpdateClient": "2026-06-01"
5+
},
6+
"commit": "292231b1131ff9fd070377372a0647c6ac7a6ce2",
7+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
8+
"typespec_src": "specification/deviceupdate/data-plane/duiothub",
9+
"emitterVersion": "0.63.1",
10+
"httpClientPythonVersion": "^0.31.1"
11+
}

sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json

Lines changed: 156 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/__init__.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._client import DeviceUpdateClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import DeviceUpdateClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

21-
__all__ = ["DeviceUpdateClient"]
22-
__all__.extend([p for p in _patch_all if p not in __all__])
27+
__all__ = [
28+
"DeviceUpdateClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2331

2432
_patch_sdk()

sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_client.py

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,32 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10+
import sys
1011
from typing import Any, TYPE_CHECKING
1112

1213
from azure.core import PipelineClient
14+
from azure.core.pipeline import policies
1315
from azure.core.rest import HttpRequest, HttpResponse
1416

1517
from ._configuration import DeviceUpdateClientConfiguration
16-
from ._serialization import Deserializer, Serializer
18+
from ._utils.serialization import Deserializer, Serializer
1719
from .operations import DeviceManagementOperations, DeviceUpdateOperations
1820

19-
if TYPE_CHECKING:
20-
# pylint: disable=unused-import,ungrouped-imports
21-
from typing import Dict
21+
if sys.version_info >= (3, 11):
22+
from typing import Self
23+
else:
24+
from typing_extensions import Self # type: ignore
2225

26+
if TYPE_CHECKING:
2327
from azure.core.credentials import TokenCredential
2428

2529

26-
class DeviceUpdateClient: # pylint: disable=client-accepts-api-version-keyword
30+
class DeviceUpdateClient:
2731
"""Device Update for IoT Hub is an Azure service that enables customers to publish updates for
2832
their IoT devices to the cloud, and then deploy that update to their devices (approve updates
2933
to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and
@@ -38,23 +42,42 @@ class DeviceUpdateClient: # pylint: disable=client-accepts-api-version-keyword
3842
:param endpoint: The Device Update for IoT Hub account endpoint (hostname only, no protocol).
3943
Required.
4044
:type endpoint: str
45+
:param credential: Credential used to authenticate requests to the service. Required.
46+
:type credential: ~azure.core.credentials.TokenCredential
4147
:param instance_id: The Device Update for IoT Hub account instance identifier. Required.
4248
:type instance_id: str
43-
:param credential: Credential needed for the client to connect to Azure. Required.
44-
:type credential: ~azure.core.credentials.TokenCredential
45-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
46-
default value may result in unsupported behavior.
49+
:keyword api_version: The API version to use for this operation. Known values are "2026-06-01"
50+
and None. Default value is None. If not set, the operation's default API version will be used.
51+
Note that overriding this default value may result in unsupported behavior.
4752
:paramtype api_version: str
4853
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4954
Retry-After header is present.
5055
"""
5156

52-
def __init__(self, endpoint: str, instance_id: str, credential: "TokenCredential", **kwargs: Any) -> None:
57+
def __init__(self, endpoint: str, credential: "TokenCredential", instance_id: str, **kwargs: Any) -> None:
5358
_endpoint = "https://{endpoint}"
5459
self._config = DeviceUpdateClientConfiguration(
55-
endpoint=endpoint, instance_id=instance_id, credential=credential, **kwargs
60+
endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs
5661
)
57-
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)
62+
63+
_policies = kwargs.pop("policies", None)
64+
if _policies is None:
65+
_policies = [
66+
policies.RequestIdPolicy(**kwargs),
67+
self._config.headers_policy,
68+
self._config.user_agent_policy,
69+
self._config.proxy_policy,
70+
policies.ContentDecodePolicy(**kwargs),
71+
self._config.redirect_policy,
72+
self._config.retry_policy,
73+
self._config.authentication_policy,
74+
self._config.custom_hook_policy,
75+
self._config.logging_policy,
76+
policies.DistributedTracingPolicy(**kwargs),
77+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
78+
self._config.http_logging_policy,
79+
]
80+
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)
5881

5982
self._serialize = Serializer()
6083
self._deserialize = Deserializer()
@@ -64,7 +87,7 @@ def __init__(self, endpoint: str, instance_id: str, credential: "TokenCredential
6487
self._client, self._config, self._serialize, self._deserialize
6588
)
6689

67-
def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
90+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
6891
"""Runs the network request through the client's chained policies.
6992
7093
>>> from azure.core.rest import HttpRequest
@@ -84,21 +107,18 @@ def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
84107

85108
request_copy = deepcopy(request)
86109
path_format_arguments = {
87-
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
110+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
88111
}
89112

90113
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
91-
return self._client.send_request(request_copy, **kwargs)
114+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
92115

93-
def close(self):
94-
# type: () -> None
116+
def close(self) -> None:
95117
self._client.close()
96118

97-
def __enter__(self):
98-
# type: () -> DeviceUpdateClient
119+
def __enter__(self) -> Self:
99120
self._client.__enter__()
100121
return self
101122

102-
def __exit__(self, *exc_details):
103-
# type: (Any) -> None
123+
def __exit__(self, *exc_details: Any) -> None:
104124
self._client.__exit__(*exc_details)

sdk/deviceupdate/azure-iot-deviceupdate/azure/iot/deviceupdate/_configuration.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

99
from typing import Any, TYPE_CHECKING
1010

11-
from azure.core.configuration import Configuration
1211
from azure.core.pipeline import policies
1312

1413
from ._version import VERSION
1514

1615
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1816
from azure.core.credentials import TokenCredential
1917

2018

21-
class DeviceUpdateClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
19+
class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attributes
2220
"""Configuration for DeviceUpdateClient.
2321
2422
Note that all parameters used to create this instance are saved as instance
@@ -27,46 +25,44 @@ class DeviceUpdateClientConfiguration(Configuration): # pylint: disable=too-man
2725
:param endpoint: The Device Update for IoT Hub account endpoint (hostname only, no protocol).
2826
Required.
2927
:type endpoint: str
28+
:param credential: Credential used to authenticate requests to the service. Required.
29+
:type credential: ~azure.core.credentials.TokenCredential
3030
:param instance_id: The Device Update for IoT Hub account instance identifier. Required.
3131
:type instance_id: str
32-
:param credential: Credential needed for the client to connect to Azure. Required.
33-
:type credential: ~azure.core.credentials.TokenCredential
34-
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
35-
default value may result in unsupported behavior.
32+
:keyword api_version: The API version to use for this operation. Known values are "2026-06-01"
33+
and None. Default value is None. If not set, the operation's default API version will be used.
34+
Note that overriding this default value may result in unsupported behavior.
3635
:paramtype api_version: str
3736
"""
3837

39-
def __init__(self, endpoint: str, instance_id: str, credential: "TokenCredential", **kwargs: Any) -> None:
40-
super(DeviceUpdateClientConfiguration, self).__init__(**kwargs)
41-
api_version = kwargs.pop("api_version", "2022-10-01") # type: str
38+
def __init__(self, endpoint: str, credential: "TokenCredential", instance_id: str, **kwargs: Any) -> None:
39+
api_version: str = kwargs.pop("api_version", "2026-06-01")
4240

4341
if endpoint is None:
4442
raise ValueError("Parameter 'endpoint' must not be None.")
45-
if instance_id is None:
46-
raise ValueError("Parameter 'instance_id' must not be None.")
4743
if credential is None:
4844
raise ValueError("Parameter 'credential' must not be None.")
45+
if instance_id is None:
46+
raise ValueError("Parameter 'instance_id' must not be None.")
4947

5048
self.endpoint = endpoint
51-
self.instance_id = instance_id
5249
self.credential = credential
50+
self.instance_id = instance_id
5351
self.api_version = api_version
5452
self.credential_scopes = kwargs.pop("credential_scopes", ["https://api.adu.microsoft.com/.default"])
5553
kwargs.setdefault("sdk_moniker", "iot-deviceupdate/{}".format(VERSION))
54+
self.polling_interval = kwargs.get("polling_interval", 30)
5655
self._configure(**kwargs)
5756

58-
def _configure(
59-
self, **kwargs # type: Any
60-
):
61-
# type: (...) -> None
57+
def _configure(self, **kwargs: Any) -> None:
6258
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
6359
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
6460
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
6561
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
6662
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
67-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6863
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6964
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
65+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
7066
self.authentication_policy = kwargs.get("authentication_policy")
7167
if self.credential and not self.authentication_policy:
7268
self.authentication_policy = policies.BearerTokenCredentialPolicy(
Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
# coding=utf-8
22
# --------------------------------------------------------------------------
3-
#
43
# Copyright (c) Microsoft Corporation. All rights reserved.
5-
#
6-
# The MIT License (MIT)
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the ""Software""), to
10-
# deal in the Software without restriction, including without limitation the
11-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12-
# sell copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24-
# IN THE SOFTWARE.
25-
#
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
265
# --------------------------------------------------------------------------
6+
"""Customize generated code here.
7+
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
11+
12+
__all__: list[str] = [] # Add all objects you want publicly available to users at this package level
13+
2714

28-
# This file is used for handwritten extensions to the generated code. Example:
29-
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3015
def patch_sdk():
31-
pass
16+
"""Do not remove from this file.
17+
18+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
19+
you can't accomplish using the techniques described in
20+
https://aka.ms/azsdk/python/dpcodegen/python/customize
21+
"""

0 commit comments

Comments
 (0)