Skip to content

Commit c87bab1

Browse files
authored
code and test (Azure#26199)
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
1 parent 9a8a7c5 commit c87bab1

File tree

67 files changed

+18579
-11678
lines changed

Some content is hidden

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

67 files changed

+18579
-11678
lines changed

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

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

3+
## 10.1.0 (2022-09-14)
4+
5+
### Features Added
6+
7+
- Added operation LiveEventsOperations.async_operation
8+
- Added operation LiveEventsOperations.operation_location
9+
- Added operation LiveOutputsOperations.async_operation
10+
- Added operation LiveOutputsOperations.operation_location
11+
- Added operation StreamingEndpointsOperations.async_operation
12+
- Added operation StreamingEndpointsOperations.operation_location
13+
- Model AudioTrack has a new parameter bit_rate
14+
- Model AudioTrack has a new parameter dash_settings
15+
- Model AudioTrack has a new parameter display_name
16+
- Model AudioTrack has a new parameter file_name
17+
- Model AudioTrack has a new parameter hls_settings
18+
- Model AudioTrack has a new parameter language_code
19+
- Model AudioTrack has a new parameter mpeg4_track_id
20+
- Model CommonEncryptionCbcs has a new parameter clear_key_encryption_configuration
21+
- Model CommonEncryptionCenc has a new parameter clear_key_encryption_configuration
22+
- Model ContentKeyPolicyPlayReadyLicense has a new parameter security_level
23+
- Model LiveOutput has a new parameter rewind_window_length
24+
325
## 10.0.0 (2022-07-01)
426

527
**Features**

sdk/media/azure-mgmt-media/MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include _meta.json
2-
recursive-include tests *.py *.yaml
2+
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

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

77
## _Disclaimer_
@@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313

1414
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
1715

1816
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/media-services)
1917
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.

sdk/media/azure-mgmt-media/_meta.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.7.2",
2+
"autorest": "3.8.4",
33
"use": [
4-
"@autorest/python@5.16.0",
5-
"@autorest/modelerfour@4.19.3"
4+
"@autorest/python@6.1.5",
5+
"@autorest/modelerfour@4.23.5"
66
],
7-
"commit": "fda2db441da3f1fab31bb235e97da3e33c8e3903",
7+
"commit": "bc6b52f26f09cfc7085a8d5df109b54ba00843cc",
88
"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 --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
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",
1010
"readme": "specification/mediaservices/resource-manager/readme.md"
1111
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
20-
__all__ = ['AzureMediaServices']
20+
21+
__all__ = ["AzureMediaServices"]
2122
__all__.extend([p for p in _patch_all if p not in __all__])
2223

2324
_patch_sdk()

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

Lines changed: 41 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,42 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12-
from msrest import Deserializer, Serializer
13-
1412
from azure.core.rest import HttpRequest, HttpResponse
1513
from azure.mgmt.core import ARMPipelineClient
1614

1715
from . import models
1816
from ._configuration import AzureMediaServicesConfiguration
19-
from .operations import AccountFiltersOperations, AssetFiltersOperations, AssetsOperations, ContentKeyPoliciesOperations, JobsOperations, LiveEventsOperations, LiveOutputsOperations, LocationsOperations, MediaServicesOperationResultsOperations, MediaServicesOperationStatusesOperations, MediaservicesOperations, OperationResultsOperations, OperationStatusesOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, StreamingEndpointsOperations, StreamingLocatorsOperations, StreamingPoliciesOperations, TracksOperations, TransformsOperations
17+
from ._serialization import Deserializer, Serializer
18+
from .operations import (
19+
AccountFiltersOperations,
20+
AssetFiltersOperations,
21+
AssetsOperations,
22+
ContentKeyPoliciesOperations,
23+
JobsOperations,
24+
LiveEventsOperations,
25+
LiveOutputsOperations,
26+
LocationsOperations,
27+
MediaServicesOperationResultsOperations,
28+
MediaServicesOperationStatusesOperations,
29+
MediaservicesOperations,
30+
OperationResultsOperations,
31+
OperationStatusesOperations,
32+
Operations,
33+
PrivateEndpointConnectionsOperations,
34+
PrivateLinkResourcesOperations,
35+
StreamingEndpointsOperations,
36+
StreamingLocatorsOperations,
37+
StreamingPoliciesOperations,
38+
TracksOperations,
39+
TransformsOperations,
40+
)
2041

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

25-
class AzureMediaServices: # pylint: disable=too-many-instance-attributes
46+
47+
class AzureMediaServices: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2648
"""This Swagger was generated by the API Framework.
2749
2850
:ivar account_filters: AccountFiltersOperations operations
@@ -70,15 +92,12 @@ class AzureMediaServices: # pylint: disable=too-many-instance-attributes
7092
:vartype live_outputs: azure.mgmt.media.operations.LiveOutputsOperations
7193
:ivar streaming_endpoints: StreamingEndpointsOperations operations
7294
:vartype streaming_endpoints: azure.mgmt.media.operations.StreamingEndpointsOperations
73-
:param credential: Credential needed for the client to connect to Azure.
95+
:param credential: Credential needed for the client to connect to Azure. Required.
7496
:type credential: ~azure.core.credentials.TokenCredential
75-
:param subscription_id: The unique identifier for a Microsoft Azure subscription.
97+
:param subscription_id: The unique identifier for a Microsoft Azure subscription. Required.
7698
:type subscription_id: str
7799
:param base_url: Service URL. Default value is "https://management.azure.com".
78100
:type base_url: str
79-
:keyword api_version: Api Version. Default value is "2021-11-01". Note that overriding this
80-
default value may result in unsupported behavior.
81-
:paramtype api_version: str
82101
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
83102
Retry-After header is present.
84103
"""
@@ -97,39 +116,25 @@ def __init__(
97116
self._serialize = Serializer(client_models)
98117
self._deserialize = Deserializer(client_models)
99118
self._serialize.client_side_validation = False
100-
self.account_filters = AccountFiltersOperations(
101-
self._client, self._config, self._serialize, self._deserialize
102-
)
103-
self.operations = Operations(
104-
self._client, self._config, self._serialize, self._deserialize
105-
)
106-
self.mediaservices = MediaservicesOperations(
107-
self._client, self._config, self._serialize, self._deserialize
108-
)
119+
self.account_filters = AccountFiltersOperations(self._client, self._config, self._serialize, self._deserialize)
120+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
121+
self.mediaservices = MediaservicesOperations(self._client, self._config, self._serialize, self._deserialize)
109122
self.private_link_resources = PrivateLinkResourcesOperations(
110123
self._client, self._config, self._serialize, self._deserialize
111124
)
112125
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
113126
self._client, self._config, self._serialize, self._deserialize
114127
)
115-
self.locations = LocationsOperations(
116-
self._client, self._config, self._serialize, self._deserialize
117-
)
128+
self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize)
118129
self.media_services_operation_statuses = MediaServicesOperationStatusesOperations(
119130
self._client, self._config, self._serialize, self._deserialize
120131
)
121132
self.media_services_operation_results = MediaServicesOperationResultsOperations(
122133
self._client, self._config, self._serialize, self._deserialize
123134
)
124-
self.assets = AssetsOperations(
125-
self._client, self._config, self._serialize, self._deserialize
126-
)
127-
self.asset_filters = AssetFiltersOperations(
128-
self._client, self._config, self._serialize, self._deserialize
129-
)
130-
self.tracks = TracksOperations(
131-
self._client, self._config, self._serialize, self._deserialize
132-
)
135+
self.assets = AssetsOperations(self._client, self._config, self._serialize, self._deserialize)
136+
self.asset_filters = AssetFiltersOperations(self._client, self._config, self._serialize, self._deserialize)
137+
self.tracks = TracksOperations(self._client, self._config, self._serialize, self._deserialize)
133138
self.operation_statuses = OperationStatusesOperations(
134139
self._client, self._config, self._serialize, self._deserialize
135140
)
@@ -139,34 +144,21 @@ def __init__(
139144
self.content_key_policies = ContentKeyPoliciesOperations(
140145
self._client, self._config, self._serialize, self._deserialize
141146
)
142-
self.transforms = TransformsOperations(
143-
self._client, self._config, self._serialize, self._deserialize
144-
)
145-
self.jobs = JobsOperations(
146-
self._client, self._config, self._serialize, self._deserialize
147-
)
147+
self.transforms = TransformsOperations(self._client, self._config, self._serialize, self._deserialize)
148+
self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize)
148149
self.streaming_policies = StreamingPoliciesOperations(
149150
self._client, self._config, self._serialize, self._deserialize
150151
)
151152
self.streaming_locators = StreamingLocatorsOperations(
152153
self._client, self._config, self._serialize, self._deserialize
153154
)
154-
self.live_events = LiveEventsOperations(
155-
self._client, self._config, self._serialize, self._deserialize
156-
)
157-
self.live_outputs = LiveOutputsOperations(
158-
self._client, self._config, self._serialize, self._deserialize
159-
)
155+
self.live_events = LiveEventsOperations(self._client, self._config, self._serialize, self._deserialize)
156+
self.live_outputs = LiveOutputsOperations(self._client, self._config, self._serialize, self._deserialize)
160157
self.streaming_endpoints = StreamingEndpointsOperations(
161158
self._client, self._config, self._serialize, self._deserialize
162159
)
163160

164-
165-
def _send_request(
166-
self,
167-
request: HttpRequest,
168-
**kwargs: Any
169-
) -> HttpResponse:
161+
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
170162
"""Runs the network request through the client's chained policies.
171163
172164
>>> from azure.core.rest import HttpRequest
@@ -175,7 +167,7 @@ def _send_request(
175167
>>> response = client._send_request(request)
176168
<HttpResponse: 200 OK>
177169
178-
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
170+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
179171
180172
:param request: The network request you want to make. Required.
181173
:type request: ~azure.core.rest.HttpRequest

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

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,49 +25,39 @@ class AzureMediaServicesConfiguration(Configuration): # pylint: disable=too-man
2525
Note that all parameters used to create this instance are saved as instance
2626
attributes.
2727
28-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
2929
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The unique identifier for a Microsoft Azure subscription.
30+
:param subscription_id: The unique identifier for a Microsoft Azure subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2021-11-01". Note that overriding this
33-
default value may result in unsupported behavior.
34-
:paramtype api_version: str
3532
"""
3633

37-
def __init__(
38-
self,
39-
credential: "TokenCredential",
40-
subscription_id: str,
41-
**kwargs: Any
42-
) -> None:
34+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
4335
super(AzureMediaServicesConfiguration, self).__init__(**kwargs)
44-
api_version = kwargs.pop('api_version', "2021-11-01") # type: str
45-
4636
if credential is None:
4737
raise ValueError("Parameter 'credential' must not be None.")
4838
if subscription_id is None:
4939
raise ValueError("Parameter 'subscription_id' must not be None.")
5040

5141
self.credential = credential
5242
self.subscription_id = subscription_id
53-
self.api_version = api_version
54-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
55-
kwargs.setdefault('sdk_moniker', 'mgmt-media/{}'.format(VERSION))
43+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
44+
kwargs.setdefault("sdk_moniker", "mgmt-media/{}".format(VERSION))
5645
self._configure(**kwargs)
5746

5847
def _configure(
59-
self,
60-
**kwargs # type: Any
48+
self, **kwargs # type: Any
6149
):
6250
# type: (...) -> None
63-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
64-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
65-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
66-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
67-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
68-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
69-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
70-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
71-
self.authentication_policy = kwargs.get('authentication_policy')
51+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
52+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
53+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
54+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
55+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
56+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
57+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
58+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.authentication_policy = kwargs.get("authentication_policy")
7260
if self.credential and not self.authentication_policy:
73-
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
61+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
62+
self.credential, *self.credential_scopes, **kwargs
63+
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
# This file is used for handwritten extensions to the generated code. Example:
2929
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
3030
def patch_sdk():
31-
pass
31+
pass

0 commit comments

Comments
 (0)