Skip to content

Commit 2c0a7c4

Browse files
Azure CLI BotSDKAutoRAY-316
authored
[AutoRelease] t2-iotcentral-2021-05-13-09546(wave4) (Azure#18698)
* CodeGen from PR 14394 in Azure/azure-rest-api-specs Zed iotcentral t2 (Azure#14394) * sql t2 readme config * readme config * readme t2 config * conflient resolve * package version add * version,CHANGELOG * changelog config * changelog config Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Zed Lei <[email protected]> Co-authored-by: Zed <[email protected]>
1 parent fcbd908 commit 2c0a7c4

29 files changed

+3791
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Release History
2+
3+
## 9.0.0b1 (2021-05-13)
4+
5+
This is beta preview version.
6+
7+
This version uses a next-generation code generator that introduces important breaking changes, but also important new features (like unified authentication and async programming).
8+
9+
**General breaking changes**
10+
11+
- Credential system has been completly revamped:
12+
13+
- `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported, use the `azure-identity` classes instead: https://pypi.org/project/azure-identity/
14+
- `credentials` parameter has been renamed `credential`
15+
16+
- The `config` attribute no longer exists on a client, configuration should be passed as kwarg. Example: `MyClient(credential, subscription_id, enable_logging=True)`. For a complete set of
17+
supported options, see the [parameters accept in init documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
18+
- You can't import a `version` module anymore, use `__version__` instead
19+
- Operations that used to return a `msrest.polling.LROPoller` now returns a `azure.core.polling.LROPoller` and are prefixed with `begin_`.
20+
- Exceptions tree have been simplified and most exceptions are now `azure.core.exceptions.HttpResponseError` (`CloudError` has been removed).
21+
- Most of the operation kwarg have changed. Some of the most noticeable:
22+
23+
- `raw` has been removed. Equivalent feature can be found using `cls`, a callback that will give access to internal HTTP response for advanced user
24+
- For a complete set of
25+
supported options, see the [parameters accept in Request documentation of azure-core](https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#available-policies)
26+
27+
**General new features**
28+
29+
- Type annotations support using `typing`. SDKs are mypy ready.
30+
- This client has now stable and official support for async. Check the `aio` namespace of your package to find the async client.
31+
- This client now support natively tracing library like OpenCensus or OpenTelemetry. See this [tracing quickstart](https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/core/azure-core-tracing-opentelemetry) for an overview.
32+
33+
## 4.1.0 (2021-02-19)
34+
35+
**Features**
36+
37+
- Model AppTemplate has a new parameter industry
38+
- Model AppTemplate has a new parameter locations
39+
- Model Operation has a new parameter properties
40+
- Model Operation has a new parameter origin
41+
42+
## 4.0.0 (2021-01-05)
43+
44+
**Features**
45+
46+
- Model AppTemplate has a new parameter name
47+
48+
**Breaking changes**
49+
50+
- Model AppTemplate no longer has parameter app_template_name
51+
52+
## 3.1.0 (2020-06-30)
53+
54+
**Features**
55+
56+
- Model AppPatch has a new parameter sku
57+
58+
## 3.0.0 (2020-03-09)
59+
60+
**Breaking changes**
61+
62+
- Removed operation AppsOperations.list_templates
63+
64+
## 2.0.0 (2019-12-25)
65+
66+
**Features**
67+
68+
- Added operation AppsOperations.list_templates
69+
70+
**General Breaking Changes**
71+
72+
This version uses a next-generation code generator that might introduce
73+
breaking changes if from some import. In summary, some modules were
74+
incorrectly visible/importable and have been renamed. This fixed several
75+
issues caused by usage of classes that were not supposed to be used in
76+
the first place. IoTCentralClient cannot be imported from
77+
azure.mgmt.iotcentreal.iot_central_client anymore (import from
78+
azure.mgmt.iotcentreal works like before) IoTCentralClientConfiguration
79+
import has been moved from azure.mgmt.iotcentreal.iot_central_client
80+
to azure.mgmt.iotcentreal A model MyClass from a "models" sub-module
81+
cannot be imported anymore using azure.mgmt.iotcentreal.models.my_class
82+
(import from azure.mgmt.iotcentreal.models works like before) An
83+
operation class MyClassOperations from an operations sub-module cannot
84+
be imported anymore using
85+
azure.mgmt.iotcentreal.operations.my_class_operations (import from
86+
azure.mgmt.iotcentreal.operations works like before) Last but not least,
87+
HTTP connection pooling is now enabled by default. You should always use
88+
a client as a context manager, or call close(), or use no more than one
89+
client per process.
90+
91+
## 1.0.0 (2018-10-26)
92+
93+
**Features**
94+
95+
- Model OperationInputs has a new parameter type
96+
- Model ErrorDetails has a new parameter details
97+
- Added operation AppsOperations.check_subdomain_availability
98+
99+
**Breaking changes**
100+
101+
- Operation AppsOperations.check_name_availability has a new
102+
signature
103+
104+
**Note**
105+
106+
- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based
107+
namespace package)
108+
109+
## 0.2.0 (2018-08-07)
110+
111+
- Replace API version by 2018-09-01
112+
113+
## 0.1.0 (2018-07-16)
114+
115+
- Initial Release with support for 2017-07-01-privatepreview
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include _meta.json
2+
recursive-include tests *.py *.yaml
3+
include *.md
4+
include azure/__init__.py
5+
include azure/mgmt/__init__.py
6+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Microsoft Azure SDK for Python
2+
3+
This is the Microsoft Azure Iotcentral Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
6+
7+
8+
# Usage
9+
10+
11+
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
12+
13+
14+
15+
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
16+
Code samples for this package can be found at [Iotcentral Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
17+
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
18+
19+
20+
# Provide Feedback
21+
22+
If you encounter any bugs or have suggestions, please file an issue in the
23+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
24+
section of the project.
25+
26+
27+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iotcentral%2FREADME.png)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "3.4.2",
3+
"use": "@autorest/[email protected]",
4+
"commit": "15d7abacf7b4f7317ef96f7e8300a7b51e315e7b",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/iotcentral/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/[email protected] --version=3.4.2",
7+
"readme": "specification/iotcentral/resource-manager/readme.md"
8+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from ._iot_central_client import IotCentralClient
10+
from ._version import VERSION
11+
12+
__version__ = VERSION
13+
__all__ = ['IotCentralClient']
14+
15+
try:
16+
from ._patch import patch_sdk # type: ignore
17+
patch_sdk()
18+
except ImportError:
19+
pass
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.core.configuration import Configuration
12+
from azure.core.pipeline import policies
13+
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
14+
15+
from ._version import VERSION
16+
17+
if TYPE_CHECKING:
18+
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
21+
from azure.core.credentials import TokenCredential
22+
23+
24+
class IotCentralClientConfiguration(Configuration):
25+
"""Configuration for IotCentralClient.
26+
27+
Note that all parameters used to create this instance are saved as instance
28+
attributes.
29+
30+
:param credential: Credential needed for the client to connect to Azure.
31+
:type credential: ~azure.core.credentials.TokenCredential
32+
:param subscription_id: The subscription identifier.
33+
:type subscription_id: str
34+
"""
35+
36+
def __init__(
37+
self,
38+
credential, # type: "TokenCredential"
39+
subscription_id, # type: str
40+
**kwargs # type: Any
41+
):
42+
# type: (...) -> None
43+
if credential is None:
44+
raise ValueError("Parameter 'credential' must not be None.")
45+
if subscription_id is None:
46+
raise ValueError("Parameter 'subscription_id' must not be None.")
47+
super(IotCentralClientConfiguration, self).__init__(**kwargs)
48+
49+
self.credential = credential
50+
self.subscription_id = subscription_id
51+
self.api_version = "2018-09-01"
52+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
53+
kwargs.setdefault('sdk_moniker', 'mgmt-iotcentral/{}'.format(VERSION))
54+
self._configure(**kwargs)
55+
56+
def _configure(
57+
self,
58+
**kwargs # type: Any
59+
):
60+
# type: (...) -> None
61+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
62+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
63+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
64+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
65+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
66+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
67+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
68+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
69+
self.authentication_policy = kwargs.get('authentication_policy')
70+
if self.credential and not self.authentication_policy:
71+
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import TYPE_CHECKING
10+
11+
from azure.mgmt.core import ARMPipelineClient
12+
from msrest import Deserializer, Serializer
13+
14+
if TYPE_CHECKING:
15+
# pylint: disable=unused-import,ungrouped-imports
16+
from typing import Any, Optional
17+
18+
from azure.core.credentials import TokenCredential
19+
from azure.core.pipeline.transport import HttpRequest, HttpResponse
20+
21+
from ._configuration import IotCentralClientConfiguration
22+
from .operations import AppsOperations
23+
from .operations import Operations
24+
from . import models
25+
26+
27+
class IotCentralClient(object):
28+
"""Use this API to manage IoT Central Applications in your Azure subscription.
29+
30+
:ivar apps: AppsOperations operations
31+
:vartype apps: azure.mgmt.iotcentral.operations.AppsOperations
32+
:ivar operations: Operations operations
33+
:vartype operations: azure.mgmt.iotcentral.operations.Operations
34+
:param credential: Credential needed for the client to connect to Azure.
35+
:type credential: ~azure.core.credentials.TokenCredential
36+
:param subscription_id: The subscription identifier.
37+
:type subscription_id: str
38+
:param str base_url: Service URL
39+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
40+
"""
41+
42+
def __init__(
43+
self,
44+
credential, # type: "TokenCredential"
45+
subscription_id, # type: str
46+
base_url=None, # type: Optional[str]
47+
**kwargs # type: Any
48+
):
49+
# type: (...) -> None
50+
if not base_url:
51+
base_url = 'https://management.azure.com'
52+
self._config = IotCentralClientConfiguration(credential, subscription_id, **kwargs)
53+
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
54+
55+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
56+
self._serialize = Serializer(client_models)
57+
self._serialize.client_side_validation = False
58+
self._deserialize = Deserializer(client_models)
59+
60+
self.apps = AppsOperations(
61+
self._client, self._config, self._serialize, self._deserialize)
62+
self.operations = Operations(
63+
self._client, self._config, self._serialize, self._deserialize)
64+
65+
def _send_request(self, http_request, **kwargs):
66+
# type: (HttpRequest, Any) -> HttpResponse
67+
"""Runs the network request through the client's chained policies.
68+
69+
:param http_request: The network request you want to make. Required.
70+
:type http_request: ~azure.core.pipeline.transport.HttpRequest
71+
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
72+
:return: The response of your network call. Does not do error handling on your response.
73+
:rtype: ~azure.core.pipeline.transport.HttpResponse
74+
"""
75+
path_format_arguments = {
76+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
77+
}
78+
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
79+
stream = kwargs.pop("stream", True)
80+
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
81+
return pipeline_response.http_response
82+
83+
def close(self):
84+
# type: () -> None
85+
self._client.close()
86+
87+
def __enter__(self):
88+
# type: () -> IotCentralClient
89+
self._client.__enter__()
90+
return self
91+
92+
def __exit__(self, *exc_details):
93+
# type: (Any) -> None
94+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)