Skip to content

Commit 2fc5cbd

Browse files
authored
Regenerate azure-mgmt-iotcentral with latest code generator tool (#46927)
1 parent 8394a41 commit 2fc5cbd

50 files changed

Lines changed: 1858 additions & 1377 deletions

Some content is hidden

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

sdk/iothub/azure-mgmt-iotcentral/CHANGELOG.md

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

3+
## 9.0.1 (2026-05-15)
4+
5+
### Other Changes
6+
7+
- Regenerated with latest code generator tool
8+
39
## 10.0.0b2 (2022-11-23)
410

511
### Other Changes
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
include _meta.json
2-
recursive-include tests *.py *.json
3-
recursive-include samples *.py *.md
41
include *.md
5-
include azure/__init__.py
6-
include azure/mgmt/__init__.py
72
include LICENSE
83
include azure/mgmt/iotcentral/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include azure/__init__.py
7+
include azure/mgmt/__init__.py
Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Iot Central Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.10+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
17-
Code samples for this package can be found at [Iot Central Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
15+
- Python 3.10+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-iotcentral
22+
pip install azure-identity
23+
```
2224

23-
If you encounter any bugs or have suggestions, please file an issue in the
24-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.iotcentral import IotCentralClient
40+
import os
2641

42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = IotCentralClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
2745

46+
## Examples
2847

48+
Code samples for this package can be found at:
49+
- [Search Iot Central Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
58+
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.

sdk/iothub/azure-mgmt-iotcentral/_meta.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"commit": "28975ababee90829893afeed9ebd8b3a41f91090",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.10.2",
5+
"use": [
6+
"@autorest/python@6.50.0",
7+
"@autorest/modelerfour@4.27.0"
8+
],
9+
"autorest_command": "autorest specification/iotcentral/resource-manager/Microsoft.IoTCentral/IoTCentral/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=C:\\dev\\azure-sdk-for-python\\sdk --tag=package-2021-06 --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
10+
"readme": "specification/iotcentral/resource-manager/Microsoft.IoTCentral/IoTCentral/readme.md"
11+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"CrossLanguagePackageId": null,
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.iotcentral.models.Resource": null,
5+
"azure.mgmt.iotcentral.models.App": null,
6+
"azure.mgmt.iotcentral.models.AppAvailabilityInfo": null,
7+
"azure.mgmt.iotcentral.models.AppListResult": null,
8+
"azure.mgmt.iotcentral.models.AppPatch": null,
9+
"azure.mgmt.iotcentral.models.AppSkuInfo": null,
10+
"azure.mgmt.iotcentral.models.AppTemplate": null,
11+
"azure.mgmt.iotcentral.models.AppTemplateLocations": null,
12+
"azure.mgmt.iotcentral.models.AppTemplatesResult": null,
13+
"azure.mgmt.iotcentral.models.CloudErrorBody": null,
14+
"azure.mgmt.iotcentral.models.Operation": null,
15+
"azure.mgmt.iotcentral.models.OperationDisplay": null,
16+
"azure.mgmt.iotcentral.models.OperationInputs": null,
17+
"azure.mgmt.iotcentral.models.OperationListResult": null,
18+
"azure.mgmt.iotcentral.models.SystemAssignedServiceIdentity": null,
19+
"azure.mgmt.iotcentral.models.AppSku": null,
20+
"azure.mgmt.iotcentral.models.SystemAssignedServiceIdentityType": null,
21+
"azure.mgmt.iotcentral.models.AppState": null,
22+
"azure.mgmt.iotcentral.operations.AppsOperations.get": null,
23+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.get": null,
24+
"azure.mgmt.iotcentral.operations.AppsOperations.begin_create_or_update": null,
25+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.begin_create_or_update": null,
26+
"azure.mgmt.iotcentral.operations.AppsOperations.begin_update": null,
27+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.begin_update": null,
28+
"azure.mgmt.iotcentral.operations.AppsOperations.begin_delete": null,
29+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.begin_delete": null,
30+
"azure.mgmt.iotcentral.operations.AppsOperations.list_by_subscription": null,
31+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.list_by_subscription": null,
32+
"azure.mgmt.iotcentral.operations.AppsOperations.list_by_resource_group": null,
33+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.list_by_resource_group": null,
34+
"azure.mgmt.iotcentral.operations.AppsOperations.check_name_availability": null,
35+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.check_name_availability": null,
36+
"azure.mgmt.iotcentral.operations.AppsOperations.check_subdomain_availability": null,
37+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.check_subdomain_availability": null,
38+
"azure.mgmt.iotcentral.operations.AppsOperations.list_templates": null,
39+
"azure.mgmt.iotcentral.aio.operations.AppsOperations.list_templates": null,
40+
"azure.mgmt.iotcentral.operations.Operations.list": null,
41+
"azure.mgmt.iotcentral.aio.operations.Operations.list": null
42+
}
43+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
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__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest 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 ._iot_central_client import IotCentralClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._iot_central_client import IotCentralClient # 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 * # 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

2127
__all__ = [
2228
"IotCentralClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/_configuration.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,19 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
import sys
10-
from typing import Any, TYPE_CHECKING
9+
from typing import Any, Optional, TYPE_CHECKING
1110

12-
from azure.core.configuration import Configuration
1311
from azure.core.pipeline import policies
1412
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1513

1614
from ._version import VERSION
1715

18-
if sys.version_info >= (3, 8):
19-
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
20-
else:
21-
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
22-
2316
if TYPE_CHECKING:
24-
# pylint: disable=unused-import,ungrouped-imports
17+
from azure.core import AzureClouds
2518
from azure.core.credentials import TokenCredential
2619

2720

28-
class IotCentralClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
21+
class IotCentralClientConfiguration: # pylint: disable=too-many-instance-attributes
2922
"""Configuration for IotCentralClient.
3023
3124
Note that all parameters used to create this instance are saved as instance
@@ -35,14 +28,22 @@ class IotCentralClientConfiguration(Configuration): # pylint: disable=too-many-
3528
:type credential: ~azure.core.credentials.TokenCredential
3629
:param subscription_id: The subscription identifier. Required.
3730
:type subscription_id: str
31+
:param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is
32+
None.
33+
:type cloud_setting: ~azure.core.AzureClouds
3834
:keyword api_version: Api Version. Default value is "2021-06-01". Note that overriding this
3935
default value may result in unsupported behavior.
4036
:paramtype api_version: str
4137
"""
4238

43-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
44-
super(IotCentralClientConfiguration, self).__init__(**kwargs)
45-
api_version: Literal["2021-06-01"] = kwargs.pop("api_version", "2021-06-01")
39+
def __init__(
40+
self,
41+
credential: "TokenCredential",
42+
subscription_id: str,
43+
cloud_setting: Optional["AzureClouds"] = None,
44+
**kwargs: Any
45+
) -> None:
46+
api_version: str = kwargs.pop("api_version", "2021-06-01")
4647

4748
if credential is None:
4849
raise ValueError("Parameter 'credential' must not be None.")
@@ -51,9 +52,11 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
5152

5253
self.credential = credential
5354
self.subscription_id = subscription_id
55+
self.cloud_setting = cloud_setting
5456
self.api_version = api_version
5557
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
5658
kwargs.setdefault("sdk_moniker", "mgmt-iotcentral/{}".format(VERSION))
59+
self.polling_interval = kwargs.get("polling_interval", 30)
5760
self._configure(**kwargs)
5861

5962
def _configure(self, **kwargs: Any) -> None:
@@ -62,9 +65,9 @@ def _configure(self, **kwargs: Any) -> None:
6265
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
6366
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
6467
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
65-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6668
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
6769
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
70+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
6871
self.authentication_policy = kwargs.get("authentication_policy")
6972
if self.credential and not self.authentication_policy:
7073
self.authentication_policy = ARMChallengeAuthenticationPolicy(

0 commit comments

Comments
 (0)