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
4 changes: 4 additions & 0 deletions sdk/deviceupdate/azure-iot-deviceupdate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.1.0 (2026-06-15)

skip changelog generation for data-plane package and please add changelog manually.

## 1.0.1 (Unreleased)

Comment on lines +3 to 8
### Features Added
Expand Down
6 changes: 3 additions & 3 deletions sdk/deviceupdate/azure-iot-deviceupdate/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include *.md
include LICENSE
include azure/iot/deviceupdate/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include LICENSE
include *.md
include azure/__init__.py
include azure/iot/__init__.py
include azure/iot/deviceupdate/py.typed
11 changes: 11 additions & 0 deletions sdk/deviceupdate/azure-iot-deviceupdate/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"apiVersion": "2026-06-01",
"apiVersions": {
"DeviceUpdateClient": "2026-06-01"
},
"commit": "292231b1131ff9fd070377372a0647c6ac7a6ce2",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/deviceupdate/data-plane/duiothub",
"emitterVersion": "0.63.1",
"httpClientPythonVersion": "^0.31.1"
}
156 changes: 156 additions & 0 deletions sdk/deviceupdate/azure-iot-deviceupdate/apiview-properties.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/deviceupdate/azure-iot-deviceupdate/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # type: ignore
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
# --------------------------------------------------------------------------
# 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.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from ._client import DeviceUpdateClient
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import DeviceUpdateClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["DeviceUpdateClient"]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__ = [
"DeviceUpdateClient",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,32 @@
# --------------------------------------------------------------------------
# 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.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from copy import deepcopy
import sys
from typing import Any, TYPE_CHECKING

from azure.core import PipelineClient
from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse

from ._configuration import DeviceUpdateClientConfiguration
from ._serialization import Deserializer, Serializer
from ._utils.serialization import Deserializer, Serializer
from .operations import DeviceManagementOperations, DeviceUpdateOperations

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Dict
if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self # type: ignore

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential


class DeviceUpdateClient: # pylint: disable=client-accepts-api-version-keyword
class DeviceUpdateClient:
"""Device Update for IoT Hub is an Azure service that enables customers to publish updates for
their IoT devices to the cloud, and then deploy that update to their devices (approve updates
to groups of devices managed and provisioned in IoT Hub). It leverages the proven security and
Expand All @@ -38,23 +42,42 @@ class DeviceUpdateClient: # pylint: disable=client-accepts-api-version-keyword
:param endpoint: The Device Update for IoT Hub account endpoint (hostname only, no protocol).
Required.
:type endpoint: str
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param instance_id: The Device Update for IoT Hub account instance identifier. Required.
:type instance_id: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Default value is "2022-10-01". Note that overriding this
default value may result in unsupported behavior.
:keyword api_version: The API version to use for this operation. Known values are "2026-06-01"
and None. Default value is None. If not set, the operation's default API version will be used.
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, endpoint: str, instance_id: str, credential: "TokenCredential", **kwargs: Any) -> None:
def __init__(self, endpoint: str, credential: "TokenCredential", instance_id: str, **kwargs: Any) -> None:
_endpoint = "https://{endpoint}"
self._config = DeviceUpdateClientConfiguration(
endpoint=endpoint, instance_id=instance_id, credential=credential, **kwargs
endpoint=endpoint, credential=credential, instance_id=instance_id, **kwargs
)
self._client = PipelineClient(base_url=_endpoint, config=self._config, **kwargs)

_policies = kwargs.pop("policies", None)
if _policies is None:
_policies = [
policies.RequestIdPolicy(**kwargs),
self._config.headers_policy,
self._config.user_agent_policy,
self._config.proxy_policy,
policies.ContentDecodePolicy(**kwargs),
self._config.redirect_policy,
self._config.retry_policy,
self._config.authentication_policy,
self._config.custom_hook_policy,
self._config.logging_policy,
policies.DistributedTracingPolicy(**kwargs),
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs)

self._serialize = Serializer()
self._deserialize = Deserializer()
Expand All @@ -64,7 +87,7 @@ def __init__(self, endpoint: str, instance_id: str, credential: "TokenCredential
self._client, self._config, self._serialize, self._deserialize
)

def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
Expand All @@ -84,21 +107,18 @@ def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:

request_copy = deepcopy(request)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
Comment on lines 108 to 113
return self._client.send_request(request_copy, **kwargs)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> DeviceUpdateClient
def __enter__(self) -> Self:
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details: Any) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@
# --------------------------------------------------------------------------
# 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.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies

from ._version import VERSION

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


class DeviceUpdateClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class DeviceUpdateClientConfiguration: # pylint: disable=too-many-instance-attributes
"""Configuration for DeviceUpdateClient.

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

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

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if instance_id is None:
raise ValueError("Parameter 'instance_id' must not be None.")
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if instance_id is None:
raise ValueError("Parameter 'instance_id' must not be None.")

self.endpoint = endpoint
self.instance_id = instance_id
self.credential = credential
self.instance_id = instance_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://api.adu.microsoft.com/.default"])
kwargs.setdefault("sdk_moniker", "iot-deviceupdate/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(
self, **kwargs # type: Any
):
# type: (...) -> None
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------
"""Customize generated code here.

Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
"""


__all__: list[str] = [] # Add all objects you want publicly available to users at this package level


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
"""Do not remove from this file.

`patch_sdk` is a last resort escape hatch that allows you to do customizations
you can't accomplish using the techniques described in
https://aka.ms/azsdk/python/dpcodegen/python/customize
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# --------------------------------------------------------------------------
# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
Loading
Loading