Skip to content

Commit 33d24aa

Browse files
azure-sdkWzb123456789Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD)
authored
[AutoRelease] t2-media-2022-12-27-81642(can only be merged by SDK owner) (Azure#28071)
* code and test * Update CHANGELOG.md * Update _version.py * fix readme Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: zhenbiao wei <424401670@qq.com> Co-authored-by: Zhenbiao Wei (WICRESOFT NORTH AMERICA LTD) <v-zhenbwei@microsoft.com>
1 parent ff4a665 commit 33d24aa

File tree

185 files changed

+8445
-1873
lines changed

Some content is hidden

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

185 files changed

+8445
-1873
lines changed

sdk/media/azure-mgmt-media/CHANGELOG.md

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

3+
## 10.2.0b1 (2022-12-27)
4+
5+
### Other Changes
6+
7+
- Added generated samples in github repo
8+
- Drop support for python<3.7.0
9+
310
## 10.1.0 (2022-09-14)
411

512
### Features Added

sdk/media/azure-mgmt-media/README.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,52 @@ For a more complete view of Azure libraries, see the [azure sdk python release](
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/media-services)
17-
Code samples for this package can be found at [Media Services](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.7+ 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-media
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
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.media import MediaManagementClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = MediaManagementClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
49+
Code samples for this package can be found at [Media Services](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
50+
51+
52+
## Troubleshooting
53+
54+
## Next steps
55+
56+
## Provide Feedback
2257

2358
If you encounter any bugs or have suggestions, please file an issue in the
2459
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.8.4",
2+
"commit": "5a4f7662cba770d045d500894a5565c176453cb3",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"autorest": "3.9.2",
35
"use": [
4-
"@autorest/python@6.1.5",
5-
"@autorest/modelerfour@4.23.5"
6+
"@autorest/python@6.2.7",
7+
"@autorest/modelerfour@4.24.3"
68
],
7-
"commit": "bc6b52f26f09cfc7085a8d5df109b54ba00843cc",
8-
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/mediaservices/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
9+
"autorest_command": "autorest specification/mediaservices/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/mediaservices/resource-manager/readme.md"
1111
}

sdk/media/azure-mgmt-media/azure/mgmt/media/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
2020

21-
__all__ = ["AzureMediaServices"]
21+
__all__ = [
22+
"AzureMediaServices",
23+
]
2224
__all__.extend([p for p in _patch_all if p not in __all__])
2325

2426
_patch_sdk()

sdk/media/azure-mgmt-media/azure/mgmt/media/_azure_media_services.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from azure.core.rest import HttpRequest, HttpResponse
1313
from azure.mgmt.core import ARMPipelineClient
1414

15-
from . import models
15+
from . import models as _models
1616
from ._configuration import AzureMediaServicesConfiguration
1717
from ._serialization import Deserializer, Serializer
1818
from .operations import (
@@ -112,7 +112,7 @@ def __init__(
112112
self._config = AzureMediaServicesConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
113113
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
114114

115-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
115+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
116116
self._serialize = Serializer(client_models)
117117
self._deserialize = Deserializer(client_models)
118118
self._serialize.client_side_validation = False
@@ -180,15 +180,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
180180
request_copy.url = self._client.format_url(request_copy.url)
181181
return self._client.send_request(request_copy, **kwargs)
182182

183-
def close(self):
184-
# type: () -> None
183+
def close(self) -> None:
185184
self._client.close()
186185

187-
def __enter__(self):
188-
# type: () -> AzureMediaServices
186+
def __enter__(self) -> "AzureMediaServices":
189187
self._client.__enter__()
190188
return self
191189

192-
def __exit__(self, *exc_details):
193-
# type: (Any) -> None
190+
def __exit__(self, *exc_details) -> None:
194191
self._client.__exit__(*exc_details)

sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4444
kwargs.setdefault("sdk_moniker", "mgmt-media/{}".format(VERSION))
4545
self._configure(**kwargs)
4646

47-
def _configure(
48-
self, **kwargs # type: Any
49-
):
50-
# type: (...) -> None
47+
def _configure(self, **kwargs: Any) -> None:
5148
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
5249
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
5350
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)

0 commit comments

Comments
 (0)