diff --git a/sdk/media/azure-mgmt-media/_meta.json b/sdk/media/azure-mgmt-media/_meta.json index aebbc61c3197..aac5350f6988 100644 --- a/sdk/media/azure-mgmt-media/_meta.json +++ b/sdk/media/azure-mgmt-media/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "d78e99bbaa8170a72c38d8a6dad8a896f9a5c636", + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.1", + "@autorest/modelerfour@4.19.2" + ], + "commit": "68c2d7c5e56c4c70e46d7158f19cdbf29dbdbfc4", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/mediaservices/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/python@5.6.6 --version=3.3.0", + "autorest_command": "autorest specification/mediaservices/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/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", "readme": "specification/mediaservices/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/_azure_media_services.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/_azure_media_services.py index 9124613973de..628a58ecbc85 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/_azure_media_services.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/_azure_media_services.py @@ -19,17 +19,15 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import AzureMediaServicesConfiguration -from .operations import AccountFiltersOperations from .operations import Operations from .operations import MediaservicesOperations from .operations import PrivateLinkResourcesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import LocationsOperations +from .operations import AccountFiltersOperations from .operations import AssetsOperations from .operations import AssetFiltersOperations from .operations import ContentKeyPoliciesOperations -from .operations import TransformsOperations -from .operations import JobsOperations from .operations import StreamingPoliciesOperations from .operations import StreamingLocatorsOperations from .operations import LiveEventsOperations @@ -41,8 +39,6 @@ class AzureMediaServices(object): """This Swagger was generated by the API Framework. - :ivar account_filters: AccountFiltersOperations operations - :vartype account_filters: azure.mgmt.media.operations.AccountFiltersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.media.operations.Operations :ivar mediaservices: MediaservicesOperations operations @@ -53,16 +49,14 @@ class AzureMediaServices(object): :vartype private_endpoint_connections: azure.mgmt.media.operations.PrivateEndpointConnectionsOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.media.operations.LocationsOperations + :ivar account_filters: AccountFiltersOperations operations + :vartype account_filters: azure.mgmt.media.operations.AccountFiltersOperations :ivar assets: AssetsOperations operations :vartype assets: azure.mgmt.media.operations.AssetsOperations :ivar asset_filters: AssetFiltersOperations operations :vartype asset_filters: azure.mgmt.media.operations.AssetFiltersOperations :ivar content_key_policies: ContentKeyPoliciesOperations operations :vartype content_key_policies: azure.mgmt.media.operations.ContentKeyPoliciesOperations - :ivar transforms: TransformsOperations operations - :vartype transforms: azure.mgmt.media.operations.TransformsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.media.operations.JobsOperations :ivar streaming_policies: StreamingPoliciesOperations operations :vartype streaming_policies: azure.mgmt.media.operations.StreamingPoliciesOperations :ivar streaming_locators: StreamingLocatorsOperations operations @@ -99,8 +93,6 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.account_filters = AccountFiltersOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.mediaservices = MediaservicesOperations( @@ -111,16 +103,14 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) + self.account_filters = AccountFiltersOperations( + self._client, self._config, self._serialize, self._deserialize) self.assets = AssetsOperations( self._client, self._config, self._serialize, self._deserialize) self.asset_filters = AssetFiltersOperations( self._client, self._config, self._serialize, self._deserialize) self.content_key_policies = ContentKeyPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transforms = TransformsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self._config, self._serialize, self._deserialize) self.streaming_policies = StreamingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.streaming_locators = StreamingLocatorsOperations( diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py index fe65c943e84a..d4710a019776 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/_configuration.py @@ -48,6 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-media/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/_metadata.json b/sdk/media/azure-mgmt-media/azure/mgmt/media/_metadata.json index c5abfd2cb715..db5605038ae3 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/_metadata.json +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "", - "total_api_version_list": ["2020-05-01", "2021-05-01"], + "chosen_version": "2021-06-01", + "total_api_version_list": ["2021-06-01"], "client": { "name": "AzureMediaServices", "filename": "_azure_media_services", @@ -98,17 +98,15 @@ "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { - "account_filters": "AccountFiltersOperations", "operations": "Operations", "mediaservices": "MediaservicesOperations", "private_link_resources": "PrivateLinkResourcesOperations", "private_endpoint_connections": "PrivateEndpointConnectionsOperations", "locations": "LocationsOperations", + "account_filters": "AccountFiltersOperations", "assets": "AssetsOperations", "asset_filters": "AssetFiltersOperations", "content_key_policies": "ContentKeyPoliciesOperations", - "transforms": "TransformsOperations", - "jobs": "JobsOperations", "streaming_policies": "StreamingPoliciesOperations", "streaming_locators": "StreamingLocatorsOperations", "live_events": "LiveEventsOperations", diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/_version.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/_version.py index 364f3c906cf9..e5754a47ce68 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/_version.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "7.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_azure_media_services.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_azure_media_services.py index ec11cb6398c1..8ca9e874e0ff 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_azure_media_services.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_azure_media_services.py @@ -17,17 +17,15 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import AzureMediaServicesConfiguration -from .operations import AccountFiltersOperations from .operations import Operations from .operations import MediaservicesOperations from .operations import PrivateLinkResourcesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import LocationsOperations +from .operations import AccountFiltersOperations from .operations import AssetsOperations from .operations import AssetFiltersOperations from .operations import ContentKeyPoliciesOperations -from .operations import TransformsOperations -from .operations import JobsOperations from .operations import StreamingPoliciesOperations from .operations import StreamingLocatorsOperations from .operations import LiveEventsOperations @@ -39,8 +37,6 @@ class AzureMediaServices(object): """This Swagger was generated by the API Framework. - :ivar account_filters: AccountFiltersOperations operations - :vartype account_filters: azure.mgmt.media.aio.operations.AccountFiltersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.media.aio.operations.Operations :ivar mediaservices: MediaservicesOperations operations @@ -51,16 +47,14 @@ class AzureMediaServices(object): :vartype private_endpoint_connections: azure.mgmt.media.aio.operations.PrivateEndpointConnectionsOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.media.aio.operations.LocationsOperations + :ivar account_filters: AccountFiltersOperations operations + :vartype account_filters: azure.mgmt.media.aio.operations.AccountFiltersOperations :ivar assets: AssetsOperations operations :vartype assets: azure.mgmt.media.aio.operations.AssetsOperations :ivar asset_filters: AssetFiltersOperations operations :vartype asset_filters: azure.mgmt.media.aio.operations.AssetFiltersOperations :ivar content_key_policies: ContentKeyPoliciesOperations operations :vartype content_key_policies: azure.mgmt.media.aio.operations.ContentKeyPoliciesOperations - :ivar transforms: TransformsOperations operations - :vartype transforms: azure.mgmt.media.aio.operations.TransformsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.media.aio.operations.JobsOperations :ivar streaming_policies: StreamingPoliciesOperations operations :vartype streaming_policies: azure.mgmt.media.aio.operations.StreamingPoliciesOperations :ivar streaming_locators: StreamingLocatorsOperations operations @@ -96,8 +90,6 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) - self.account_filters = AccountFiltersOperations( - self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.mediaservices = MediaservicesOperations( @@ -108,16 +100,14 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) + self.account_filters = AccountFiltersOperations( + self._client, self._config, self._serialize, self._deserialize) self.assets = AssetsOperations( self._client, self._config, self._serialize, self._deserialize) self.asset_filters = AssetFiltersOperations( self._client, self._config, self._serialize, self._deserialize) self.content_key_policies = ContentKeyPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transforms = TransformsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.jobs = JobsOperations( - self._client, self._config, self._serialize, self._deserialize) self.streaming_policies = StreamingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.streaming_locators = StreamingLocatorsOperations( diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_configuration.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_configuration.py index 3219fa71818e..094a409a03d3 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_configuration.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/_configuration.py @@ -45,6 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.api_version = "2021-06-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-media/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/__init__.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/__init__.py index 795a18cd9d99..a928fbab084a 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/__init__.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/__init__.py @@ -6,17 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._account_filters_operations import AccountFiltersOperations from ._operations import Operations from ._mediaservices_operations import MediaservicesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._locations_operations import LocationsOperations +from ._account_filters_operations import AccountFiltersOperations from ._assets_operations import AssetsOperations from ._asset_filters_operations import AssetFiltersOperations from ._content_key_policies_operations import ContentKeyPoliciesOperations -from ._transforms_operations import TransformsOperations -from ._jobs_operations import JobsOperations from ._streaming_policies_operations import StreamingPoliciesOperations from ._streaming_locators_operations import StreamingLocatorsOperations from ._live_events_operations import LiveEventsOperations @@ -24,17 +22,15 @@ from ._streaming_endpoints_operations import StreamingEndpointsOperations __all__ = [ - 'AccountFiltersOperations', 'Operations', 'MediaservicesOperations', 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 'LocationsOperations', + 'AccountFiltersOperations', 'AssetsOperations', 'AssetFiltersOperations', 'ContentKeyPoliciesOperations', - 'TransformsOperations', - 'JobsOperations', 'StreamingPoliciesOperations', 'StreamingLocatorsOperations', 'LiveEventsOperations', diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_account_filters_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_account_filters_operations.py index b4029572d360..9b350e80aca2 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_account_filters_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_account_filters_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AccountFilterCollection"]: """List Account Filters. @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -107,7 +107,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -123,8 +123,8 @@ async def get( resource_group_name: str, account_name: str, filter_name: str, - **kwargs - ) -> Optional["_models.AccountFilter"]: + **kwargs: Any + ) -> "_models.AccountFilter": """Get an Account Filter. Get the details of an Account Filter in the Media Services account. @@ -137,15 +137,15 @@ async def get( :type filter_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AccountFilter, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.AccountFilter or None + :rtype: ~azure.mgmt.media.models.AccountFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccountFilter"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -170,14 +170,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccountFilter', pipeline_response) + deserialized = self._deserialize('AccountFilter', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -191,7 +189,7 @@ async def create_or_update( account_name: str, filter_name: str, parameters: "_models.AccountFilter", - **kwargs + **kwargs: Any ) -> "_models.AccountFilter": """Create or update an Account Filter. @@ -215,7 +213,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -247,7 +245,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -267,7 +265,7 @@ async def delete( resource_group_name: str, account_name: str, filter_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete an Account Filter. @@ -289,7 +287,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -316,7 +314,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -330,7 +328,7 @@ async def update( account_name: str, filter_name: str, parameters: "_models.AccountFilter", - **kwargs + **kwargs: Any ) -> "_models.AccountFilter": """Update an Account Filter. @@ -354,7 +352,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -386,7 +384,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountFilter', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_asset_filters_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_asset_filters_operations.py index 4def84178adb..d8fab50a5bf4 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_asset_filters_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_asset_filters_operations.py @@ -46,7 +46,7 @@ def list( resource_group_name: str, account_name: str, asset_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AssetFilterCollection"]: """List Asset Filters. @@ -68,7 +68,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -111,7 +111,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -128,8 +128,8 @@ async def get( account_name: str, asset_name: str, filter_name: str, - **kwargs - ) -> Optional["_models.AssetFilter"]: + **kwargs: Any + ) -> "_models.AssetFilter": """Get an Asset Filter. Get the details of an Asset Filter associated with the specified Asset. @@ -144,15 +144,15 @@ async def get( :type filter_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AssetFilter, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.AssetFilter or None + :rtype: ~azure.mgmt.media.models.AssetFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AssetFilter"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AssetFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -178,14 +178,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AssetFilter', pipeline_response) + deserialized = self._deserialize('AssetFilter', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -200,7 +198,7 @@ async def create_or_update( asset_name: str, filter_name: str, parameters: "_models.AssetFilter", - **kwargs + **kwargs: Any ) -> "_models.AssetFilter": """Create or update an Asset Filter. @@ -226,7 +224,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -259,7 +257,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,7 +278,7 @@ async def delete( account_name: str, asset_name: str, filter_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete an Asset Filter. @@ -304,7 +302,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -332,7 +330,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -347,7 +345,7 @@ async def update( asset_name: str, filter_name: str, parameters: "_models.AssetFilter", - **kwargs + **kwargs: Any ) -> "_models.AssetFilter": """Update an Asset Filter. @@ -373,7 +371,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -406,7 +404,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AssetFilter', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_assets_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_assets_operations.py index b400b99451be..aa61bef1a963 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_assets_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_assets_operations.py @@ -48,7 +48,7 @@ def list( filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AssetCollection"]: """List Assets. @@ -76,7 +76,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -124,7 +124,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -140,8 +140,8 @@ async def get( resource_group_name: str, account_name: str, asset_name: str, - **kwargs - ) -> Optional["_models.Asset"]: + **kwargs: Any + ) -> "_models.Asset": """Get an Asset. Get the details of an Asset in the Media Services account. @@ -154,15 +154,15 @@ async def get( :type asset_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Asset, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Asset or None + :rtype: ~azure.mgmt.media.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Asset"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -187,14 +187,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize('Asset', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ async def create_or_update( account_name: str, asset_name: str, parameters: "_models.Asset", - **kwargs + **kwargs: Any ) -> "_models.Asset": """Create or update an Asset. @@ -232,7 +230,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -264,7 +262,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -284,7 +282,7 @@ async def delete( resource_group_name: str, account_name: str, asset_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete an Asset. @@ -306,7 +304,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -333,7 +331,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -347,7 +345,7 @@ async def update( account_name: str, asset_name: str, parameters: "_models.Asset", - **kwargs + **kwargs: Any ) -> "_models.Asset": """Update an Asset. @@ -371,7 +369,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -403,7 +401,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Asset', pipeline_response) @@ -420,7 +418,7 @@ async def list_container_sas( account_name: str, asset_name: str, parameters: "_models.ListContainerSasInput", - **kwargs + **kwargs: Any ) -> "_models.AssetContainerSas": """List the Asset URLs. @@ -445,7 +443,7 @@ async def list_container_sas( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -477,7 +475,7 @@ async def list_container_sas( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AssetContainerSas', pipeline_response) @@ -493,7 +491,7 @@ async def get_encryption_key( resource_group_name: str, account_name: str, asset_name: str, - **kwargs + **kwargs: Any ) -> "_models.StorageEncryptedAssetDecryptionData": """Gets the Asset storage key. @@ -516,7 +514,7 @@ async def get_encryption_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -543,7 +541,7 @@ async def get_encryption_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StorageEncryptedAssetDecryptionData', pipeline_response) @@ -559,7 +557,7 @@ async def list_streaming_locators( resource_group_name: str, account_name: str, asset_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListStreamingLocatorsResponse": """List Streaming Locators. @@ -581,7 +579,7 @@ async def list_streaming_locators( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -608,7 +606,7 @@ async def list_streaming_locators( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListStreamingLocatorsResponse', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_content_key_policies_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_content_key_policies_operations.py index 1b41973bf6cb..9ae0de30511a 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_content_key_policies_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_content_key_policies_operations.py @@ -48,7 +48,7 @@ def list( filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ContentKeyPolicyCollection"]: """List Content Key Policies. @@ -76,7 +76,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -124,7 +124,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -140,8 +140,8 @@ async def get( resource_group_name: str, account_name: str, content_key_policy_name: str, - **kwargs - ) -> Optional["_models.ContentKeyPolicy"]: + **kwargs: Any + ) -> "_models.ContentKeyPolicy": """Get a Content Key Policy. Get the details of a Content Key Policy in the Media Services account. @@ -154,15 +154,15 @@ async def get( :type content_key_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentKeyPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.ContentKeyPolicy or None + :rtype: ~azure.mgmt.media.models.ContentKeyPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContentKeyPolicy"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentKeyPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -187,14 +187,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) + deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ async def create_or_update( account_name: str, content_key_policy_name: str, parameters: "_models.ContentKeyPolicy", - **kwargs + **kwargs: Any ) -> "_models.ContentKeyPolicy": """Create or update an Content Key Policy. @@ -232,7 +230,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -264,7 +262,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -284,7 +282,7 @@ async def delete( resource_group_name: str, account_name: str, content_key_policy_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Content Key Policy. @@ -306,7 +304,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -333,7 +331,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -347,7 +345,7 @@ async def update( account_name: str, content_key_policy_name: str, parameters: "_models.ContentKeyPolicy", - **kwargs + **kwargs: Any ) -> "_models.ContentKeyPolicy": """Update a Content Key Policy. @@ -371,7 +369,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -403,7 +401,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) @@ -419,8 +417,8 @@ async def get_policy_properties_with_secrets( resource_group_name: str, account_name: str, content_key_policy_name: str, - **kwargs - ) -> Optional["_models.ContentKeyPolicyProperties"]: + **kwargs: Any + ) -> "_models.ContentKeyPolicyProperties": """Get a Content Key Policy with secrets. Get a Content Key Policy including secret values. @@ -433,15 +431,15 @@ async def get_policy_properties_with_secrets( :type content_key_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentKeyPolicyProperties, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.ContentKeyPolicyProperties or None + :rtype: ~azure.mgmt.media.models.ContentKeyPolicyProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContentKeyPolicyProperties"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentKeyPolicyProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -466,14 +464,12 @@ async def get_policy_properties_with_secrets( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ContentKeyPolicyProperties', pipeline_response) + deserialized = self._deserialize('ContentKeyPolicyProperties', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_jobs_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_jobs_operations.py deleted file mode 100644 index 59a0bdf5d593..000000000000 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations: - """JobsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.media.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - filter: Optional[str] = None, - orderby: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.JobCollection"]: - """List Jobs. - - Lists all of the Jobs for the Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param filter: Restricts the set of items returned. - :type filter: str - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.media.models.JobCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobCollection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('JobCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs'} # type: ignore - - async def get( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - job_name: str, - **kwargs - ) -> Optional["_models.Job"]: - """Get Job. - - Gets a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job or None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - async def create( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - job_name: str, - parameters: "_models.Job", - **kwargs - ) -> "_models.Job": - """Create Job. - - Creates a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Job - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Job') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - job_name: str, - **kwargs - ) -> None: - """Delete Job. - - Deletes a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - job_name: str, - parameters: "_models.Job", - **kwargs - ) -> "_models.Job": - """Update Job. - - Update is only supported for description and priority. Updating Priority will take effect when - the Job state is Queued or Scheduled and depending on the timing the priority update may be - ignored. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Job - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Job') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - async def cancel_job( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - job_name: str, - **kwargs - ) -> None: - """Cancel Job. - - Cancel a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.cancel_job.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob'} # type: ignore diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_events_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_events_operations.py index 60d89ad920cb..0ec8ca649164 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_events_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_events_operations.py @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.LiveEventListResult"]: """List live events. @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -125,8 +125,8 @@ async def get( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs - ) -> Optional["_models.LiveEvent"]: + **kwargs: Any + ) -> "_models.LiveEvent": """Get Live Event. Gets properties of a live event. @@ -139,15 +139,15 @@ async def get( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LiveEvent, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.LiveEvent or None + :rtype: ~azure.mgmt.media.models.LiveEvent :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LiveEvent"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveEvent"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -172,14 +172,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LiveEvent', pipeline_response) + deserialized = self._deserialize('LiveEvent', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -194,14 +192,14 @@ async def _create_initial( live_event_name: str, parameters: "_models.LiveEvent", auto_start: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> "_models.LiveEvent": cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveEvent"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +233,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -257,7 +255,7 @@ async def begin_create( live_event_name: str, parameters: "_models.LiveEvent", auto_start: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.LiveEvent"]: """Create Live Event. @@ -276,8 +274,8 @@ async def begin_create( :type auto_start: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either LiveEvent or the result of cls(response) @@ -339,14 +337,14 @@ async def _update_initial( account_name: str, live_event_name: str, parameters: "_models.LiveEvent", - **kwargs + **kwargs: Any ) -> "_models.LiveEvent": cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveEvent"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -378,7 +376,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -399,7 +397,7 @@ async def begin_update( account_name: str, live_event_name: str, parameters: "_models.LiveEvent", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.LiveEvent"]: """Updates settings on an existing live event. @@ -413,8 +411,8 @@ async def begin_update( :type parameters: ~azure.mgmt.media.models.LiveEvent :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either LiveEvent or the result of cls(response) @@ -474,14 +472,14 @@ async def _delete_initial( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -508,7 +506,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -521,7 +519,7 @@ async def begin_delete( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Live Event. @@ -535,8 +533,8 @@ async def begin_delete( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -592,14 +590,14 @@ async def _allocate_initial( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -626,7 +624,7 @@ async def _allocate_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -639,7 +637,7 @@ async def begin_allocate( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Allocate resources for a live event. @@ -653,8 +651,8 @@ async def begin_allocate( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -710,14 +708,14 @@ async def _start_initial( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -744,7 +742,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -757,7 +755,7 @@ async def begin_start( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Start Live Event. @@ -772,8 +770,8 @@ async def begin_start( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -830,14 +828,14 @@ async def _stop_initial( account_name: str, live_event_name: str, parameters: "_models.LiveEventActionInput", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -869,7 +867,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -883,7 +881,7 @@ async def begin_stop( account_name: str, live_event_name: str, parameters: "_models.LiveEventActionInput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Stop Live Event. @@ -899,8 +897,8 @@ async def begin_stop( :type parameters: ~azure.mgmt.media.models.LiveEventActionInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -957,14 +955,14 @@ async def _reset_initial( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -991,7 +989,7 @@ async def _reset_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1004,7 +1002,7 @@ async def begin_reset( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Reset Live Event. @@ -1020,8 +1018,8 @@ async def begin_reset( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_outputs_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_outputs_operations.py index 520c3e61ddda..3a1065c8f564 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_outputs_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_live_outputs_operations.py @@ -48,7 +48,7 @@ def list( resource_group_name: str, account_name: str, live_event_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.LiveOutputListResult"]: """List Live Outputs. @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -113,7 +113,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -130,8 +130,8 @@ async def get( account_name: str, live_event_name: str, live_output_name: str, - **kwargs - ) -> Optional["_models.LiveOutput"]: + **kwargs: Any + ) -> "_models.LiveOutput": """Get Live Output. Gets a live output. @@ -146,15 +146,15 @@ async def get( :type live_output_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LiveOutput, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.LiveOutput or None + :rtype: ~azure.mgmt.media.models.LiveOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LiveOutput"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -180,14 +180,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LiveOutput', pipeline_response) + deserialized = self._deserialize('LiveOutput', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -202,14 +200,14 @@ async def _create_initial( live_event_name: str, live_output_name: str, parameters: "_models.LiveOutput", - **kwargs + **kwargs: Any ) -> "_models.LiveOutput": cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -242,7 +240,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -264,7 +262,7 @@ async def begin_create( live_event_name: str, live_output_name: str, parameters: "_models.LiveOutput", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.LiveOutput"]: """Create Live Output. @@ -282,8 +280,8 @@ async def begin_create( :type parameters: ~azure.mgmt.media.models.LiveOutput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either LiveOutput or the result of cls(response) @@ -346,14 +344,14 @@ async def _delete_initial( account_name: str, live_event_name: str, live_output_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -381,7 +379,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -395,7 +393,7 @@ async def begin_delete( account_name: str, live_event_name: str, live_output_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Live Output. @@ -412,8 +410,8 @@ async def begin_delete( :type live_output_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_locations_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_locations_operations.py index 5eea4f0c7e50..4af5653619c7 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_locations_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_locations_operations.py @@ -44,7 +44,7 @@ async def check_name_availability( self, location_name: str, parameters: "_models.CheckNameAvailabilityInput", - **kwargs + **kwargs: Any ) -> "_models.EntityNameAvailabilityCheckOutput": """Check Name Availability. @@ -64,7 +64,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -94,7 +94,7 @@ async def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EntityNameAvailabilityCheckOutput', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_mediaservices_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_mediaservices_operations.py index c95090812dea..182729ed3cf6 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_mediaservices_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_mediaservices_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MediaServiceCollection"]: """List Media Services accounts. @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -103,7 +103,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -118,7 +118,7 @@ async def get( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.MediaService": """Get a Media Services account. @@ -138,7 +138,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -164,7 +164,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MediaService', pipeline_response) @@ -180,7 +180,7 @@ async def create_or_update( resource_group_name: str, account_name: str, parameters: "_models.MediaService", - **kwargs + **kwargs: Any ) -> "_models.MediaService": """Create or update a Media Services account. @@ -202,7 +202,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -233,7 +233,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -252,7 +252,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Media Services account. @@ -272,7 +272,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -298,7 +298,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -311,7 +311,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.MediaServiceUpdate", - **kwargs + **kwargs: Any ) -> "_models.MediaService": """Update a Media Services account. @@ -333,7 +333,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -364,7 +364,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MediaService', pipeline_response) @@ -380,7 +380,7 @@ async def sync_storage_keys( resource_group_name: str, account_name: str, parameters: "_models.SyncStorageKeysInput", - **kwargs + **kwargs: Any ) -> None: """Synchronizes Storage Account Keys. @@ -403,7 +403,7 @@ async def sync_storage_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -434,7 +434,7 @@ async def sync_storage_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -447,7 +447,7 @@ async def list_edge_policies( resource_group_name: str, account_name: str, parameters: "_models.ListEdgePoliciesInput", - **kwargs + **kwargs: Any ) -> "_models.EdgePolicies": """List the media edge policies associated with the Media Services account. @@ -469,7 +469,7 @@ async def list_edge_policies( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -500,7 +500,7 @@ async def list_edge_policies( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EdgePolicies', pipeline_response) @@ -513,7 +513,7 @@ async def list_edge_policies( def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MediaServiceCollection"]: """List Media Services accounts. @@ -529,7 +529,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -569,7 +569,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_operations.py index 06f414605452..329479997fbb 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_operations.py @@ -5,10 +5,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, Callable, Dict, Generic, Optional, TypeVar import warnings -from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest @@ -41,17 +40,17 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - def list( + async def list( self, - **kwargs - ) -> AsyncIterable["_models.OperationCollection"]: + **kwargs: Any + ) -> "_models.OperationCollection": """List Operations. Lists all the Media Services operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.media.models.OperationCollection] + :return: OperationCollection, or the result of cls(response) + :rtype: ~azure.mgmt.media.models.OperationCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationCollection"] @@ -59,49 +58,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('OperationCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) + # Construct URL + url = self.list.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized list.metadata = {'url': '/providers/Microsoft.Media/operations'} # type: ignore diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_endpoint_connections_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_endpoint_connections_operations.py index 52eeed308e7e..f5af6f105a9f 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_endpoint_connections_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnectionListResult": """Get all private endpoint connections. @@ -64,7 +64,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -90,7 +90,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) @@ -106,7 +106,7 @@ async def get( resource_group_name: str, account_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Get private endpoint connection. @@ -128,7 +128,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -155,7 +155,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -172,7 +172,7 @@ async def create_or_update( account_name: str, name: str, parameters: "_models.PrivateEndpointConnection", - **kwargs + **kwargs: Any ) -> "_models.PrivateEndpointConnection": """Update private endpoint connection. @@ -196,7 +196,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -228,7 +228,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -244,7 +244,7 @@ async def delete( resource_group_name: str, account_name: str, name: str, - **kwargs + **kwargs: Any ) -> None: """Delete private endpoint connection. @@ -266,7 +266,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -291,9 +291,9 @@ async def delete( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_link_resources_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_link_resources_operations.py index ea41ce6ecc53..296c88b37b88 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_link_resources_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_private_link_resources_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": """Get list of group IDs. @@ -64,7 +64,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -90,7 +90,7 @@ async def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) @@ -106,7 +106,7 @@ async def get( resource_group_name: str, account_name: str, name: str, - **kwargs + **kwargs: Any ) -> "_models.PrivateLinkResource": """Get group ID. @@ -128,7 +128,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -155,7 +155,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResource', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_endpoints_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_endpoints_operations.py index b4b6c64972b8..2241de3e99c7 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_endpoints_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_endpoints_operations.py @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StreamingEndpointListResult"]: """List StreamingEndpoints. @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -109,7 +109,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -125,8 +125,8 @@ async def get( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs - ) -> Optional["_models.StreamingEndpoint"]: + **kwargs: Any + ) -> "_models.StreamingEndpoint": """Get StreamingEndpoint. Gets a streaming endpoint. @@ -139,15 +139,15 @@ async def get( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingEndpoint or None + :rtype: ~azure.mgmt.media.models.StreamingEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingEndpoint"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -172,14 +172,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingEndpoint', pipeline_response) + deserialized = self._deserialize('StreamingEndpoint', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -194,14 +192,14 @@ async def _create_initial( streaming_endpoint_name: str, parameters: "_models.StreamingEndpoint", auto_start: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> "_models.StreamingEndpoint": cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +233,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -257,7 +255,7 @@ async def begin_create( streaming_endpoint_name: str, parameters: "_models.StreamingEndpoint", auto_start: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StreamingEndpoint"]: """Create StreamingEndpoint. @@ -276,8 +274,8 @@ async def begin_create( :type auto_start: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StreamingEndpoint or the result of cls(response) @@ -339,14 +337,14 @@ async def _update_initial( account_name: str, streaming_endpoint_name: str, parameters: "_models.StreamingEndpoint", - **kwargs + **kwargs: Any ) -> "_models.StreamingEndpoint": cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -378,7 +376,7 @@ async def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -399,7 +397,7 @@ async def begin_update( account_name: str, streaming_endpoint_name: str, parameters: "_models.StreamingEndpoint", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.StreamingEndpoint"]: """Update StreamingEndpoint. @@ -415,8 +413,8 @@ async def begin_update( :type parameters: ~azure.mgmt.media.models.StreamingEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either StreamingEndpoint or the result of cls(response) @@ -476,14 +474,14 @@ async def _delete_initial( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -510,7 +508,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -523,7 +521,7 @@ async def begin_delete( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete StreamingEndpoint. @@ -537,8 +535,8 @@ async def begin_delete( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -594,14 +592,14 @@ async def _start_initial( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -628,7 +626,7 @@ async def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -641,7 +639,7 @@ async def begin_start( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Start StreamingEndpoint. @@ -655,8 +653,8 @@ async def begin_start( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -712,14 +710,14 @@ async def _stop_initial( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -746,7 +744,7 @@ async def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -759,7 +757,7 @@ async def begin_stop( resource_group_name: str, account_name: str, streaming_endpoint_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Stop StreamingEndpoint. @@ -773,8 +771,8 @@ async def begin_stop( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -831,14 +829,14 @@ async def _scale_initial( account_name: str, streaming_endpoint_name: str, parameters: "_models.StreamingEntityScaleUnit", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -870,7 +868,7 @@ async def _scale_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -884,7 +882,7 @@ async def begin_scale( account_name: str, streaming_endpoint_name: str, parameters: "_models.StreamingEntityScaleUnit", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Scale StreamingEndpoint. @@ -900,8 +898,8 @@ async def begin_scale( :type parameters: ~azure.mgmt.media.models.StreamingEntityScaleUnit :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_locators_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_locators_operations.py index 5d1e9e4a9d89..bb041ac3659e 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_locators_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_locators_operations.py @@ -48,7 +48,7 @@ def list( filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StreamingLocatorCollection"]: """List Streaming Locators. @@ -76,7 +76,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -124,7 +124,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -140,8 +140,8 @@ async def get( resource_group_name: str, account_name: str, streaming_locator_name: str, - **kwargs - ) -> Optional["_models.StreamingLocator"]: + **kwargs: Any + ) -> "_models.StreamingLocator": """Get a Streaming Locator. Get the details of a Streaming Locator in the Media Services account. @@ -154,15 +154,15 @@ async def get( :type streaming_locator_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingLocator, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingLocator or None + :rtype: ~azure.mgmt.media.models.StreamingLocator :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingLocator"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingLocator"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -187,14 +187,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingLocator', pipeline_response) + deserialized = self._deserialize('StreamingLocator', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ async def create( account_name: str, streaming_locator_name: str, parameters: "_models.StreamingLocator", - **kwargs + **kwargs: Any ) -> "_models.StreamingLocator": """Create a Streaming Locator. @@ -232,7 +230,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -264,7 +262,7 @@ async def create( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StreamingLocator', pipeline_response) @@ -280,7 +278,7 @@ async def delete( resource_group_name: str, account_name: str, streaming_locator_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Streaming Locator. @@ -302,7 +300,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -329,7 +327,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -342,7 +340,7 @@ async def list_content_keys( resource_group_name: str, account_name: str, streaming_locator_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListContentKeysResponse": """List Content Keys. @@ -364,7 +362,7 @@ async def list_content_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -391,7 +389,7 @@ async def list_content_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListContentKeysResponse', pipeline_response) @@ -407,7 +405,7 @@ async def list_paths( resource_group_name: str, account_name: str, streaming_locator_name: str, - **kwargs + **kwargs: Any ) -> "_models.ListPathsResponse": """List Paths. @@ -429,7 +427,7 @@ async def list_paths( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -456,7 +454,7 @@ async def list_paths( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListPathsResponse', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_policies_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_policies_operations.py index d536a9c765f8..6479e30e56f3 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_policies_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_streaming_policies_operations.py @@ -48,7 +48,7 @@ def list( filter: Optional[str] = None, top: Optional[int] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.StreamingPolicyCollection"]: """List Streaming Policies. @@ -76,7 +76,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -124,7 +124,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -140,8 +140,8 @@ async def get( resource_group_name: str, account_name: str, streaming_policy_name: str, - **kwargs - ) -> Optional["_models.StreamingPolicy"]: + **kwargs: Any + ) -> "_models.StreamingPolicy": """Get a Streaming Policy. Get the details of a Streaming Policy in the Media Services account. @@ -154,15 +154,15 @@ async def get( :type streaming_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingPolicy or None + :rtype: ~azure.mgmt.media.models.StreamingPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingPolicy"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -187,14 +187,12 @@ async def get( pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingPolicy', pipeline_response) + deserialized = self._deserialize('StreamingPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ async def create( account_name: str, streaming_policy_name: str, parameters: "_models.StreamingPolicy", - **kwargs + **kwargs: Any ) -> "_models.StreamingPolicy": """Create a Streaming Policy. @@ -232,7 +230,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -264,7 +262,7 @@ async def create( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StreamingPolicy', pipeline_response) @@ -280,7 +278,7 @@ async def delete( resource_group_name: str, account_name: str, streaming_policy_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Streaming Policy. @@ -302,7 +300,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -329,7 +327,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_transforms_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_transforms_operations.py deleted file mode 100644 index e429116f5d23..000000000000 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/aio/operations/_transforms_operations.py +++ /dev/null @@ -1,408 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class TransformsOperations: - """TransformsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.media.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name: str, - account_name: str, - filter: Optional[str] = None, - orderby: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.TransformCollection"]: - """List Transforms. - - Lists the Transforms in the account. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param filter: Restricts the set of items returned. - :type filter: str - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransformCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.media.models.TransformCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransformCollection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('TransformCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms'} # type: ignore - - async def get( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - **kwargs - ) -> Optional["_models.Transform"]: - """Get Transform. - - Gets a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform or None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Transform"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - parameters: "_models.Transform", - **kwargs - ) -> "_models.Transform": - """Create or Update Transform. - - Creates or updates a new Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Transform - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Transform"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Transform') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Transform', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - **kwargs - ) -> None: - """Delete Transform. - - Deletes a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - async def update( - self, - resource_group_name: str, - account_name: str, - transform_name: str, - parameters: "_models.Transform", - **kwargs - ) -> "_models.Transform": - """Update Transform. - - Updates a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Transform - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Transform"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Transform') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/__init__.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/__init__.py index 40499b50de42..b935c9a1d735 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/__init__.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/__init__.py @@ -7,15 +7,12 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AacAudio - from ._models_py3 import AbsoluteClipTime from ._models_py3 import AccessControl from ._models_py3 import AccountEncryption from ._models_py3 import AccountFilter from ._models_py3 import AccountFilterCollection from ._models_py3 import AkamaiAccessControl from ._models_py3 import AkamaiSignatureHeaderAuthenticationKey - from ._models_py3 import ApiError from ._models_py3 import Asset from ._models_py3 import AssetCollection from ._models_py3 import AssetContainerSas @@ -23,16 +20,9 @@ from ._models_py3 import AssetFilter from ._models_py3 import AssetFilterCollection from ._models_py3 import AssetStreamingLocator - from ._models_py3 import Audio - from ._models_py3 import AudioAnalyzerPreset - from ._models_py3 import AudioOverlay - from ._models_py3 import AudioTrackDescriptor - from ._models_py3 import BuiltInStandardEncoderPreset from ._models_py3 import CbcsDrmConfiguration from ._models_py3 import CencDrmConfiguration from ._models_py3 import CheckNameAvailabilityInput - from ._models_py3 import ClipTime - from ._models_py3 import Codec from ._models_py3 import CommonEncryptionCbcs from ._models_py3 import CommonEncryptionCenc from ._models_py3 import ContentKeyPolicy @@ -61,55 +51,25 @@ from ._models_py3 import ContentKeyPolicyUnknownRestriction from ._models_py3 import ContentKeyPolicyWidevineConfiguration from ._models_py3 import ContentKeyPolicyX509CertificateTokenKey - from ._models_py3 import CopyAudio - from ._models_py3 import CopyVideo from ._models_py3 import CrossSiteAccessPolicies from ._models_py3 import DefaultKey - from ._models_py3 import Deinterlace from ._models_py3 import EdgePolicies from ._models_py3 import EdgeUsageDataCollectionPolicy from ._models_py3 import EdgeUsageDataEventHub from ._models_py3 import EnabledProtocols from ._models_py3 import EntityNameAvailabilityCheckOutput from ._models_py3 import EnvelopeEncryption - from ._models_py3 import FaceDetectorPreset + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse from ._models_py3 import FilterTrackPropertyCondition from ._models_py3 import FilterTrackSelection - from ._models_py3 import Filters from ._models_py3 import FirstQuality - from ._models_py3 import Format - from ._models_py3 import FromAllInputFile - from ._models_py3 import FromEachInputFile - from ._models_py3 import H264Layer - from ._models_py3 import H264Video - from ._models_py3 import H265Layer - from ._models_py3 import H265Video - from ._models_py3 import H265VideoLayer from ._models_py3 import Hls from ._models_py3 import IPAccessControl from ._models_py3 import IPRange - from ._models_py3 import Image - from ._models_py3 import ImageFormat - from ._models_py3 import InputDefinition - from ._models_py3 import InputFile - from ._models_py3 import Job - from ._models_py3 import JobCollection - from ._models_py3 import JobError - from ._models_py3 import JobErrorDetail - from ._models_py3 import JobInput - from ._models_py3 import JobInputAsset - from ._models_py3 import JobInputClip - from ._models_py3 import JobInputHttp - from ._models_py3 import JobInputSequence - from ._models_py3 import JobInputs - from ._models_py3 import JobOutput - from ._models_py3 import JobOutputAsset - from ._models_py3 import JpgFormat - from ._models_py3 import JpgImage - from ._models_py3 import JpgLayer from ._models_py3 import KeyDelivery from ._models_py3 import KeyVaultProperties - from ._models_py3 import Layer from ._models_py3 import ListContainerSasInput from ._models_py3 import ListContentKeysResponse from ._models_py3 import ListEdgePoliciesInput @@ -129,7 +89,6 @@ from ._models_py3 import LiveEventTranscription from ._models_py3 import LiveOutput from ._models_py3 import LiveOutputListResult - from ._models_py3 import Location from ._models_py3 import LogSpecification from ._models_py3 import MediaService from ._models_py3 import MediaServiceCollection @@ -137,20 +96,11 @@ from ._models_py3 import MediaServiceUpdate from ._models_py3 import MetricDimension from ._models_py3 import MetricSpecification - from ._models_py3 import Mp4Format - from ._models_py3 import MultiBitrateFormat from ._models_py3 import NoEncryption - from ._models_py3 import ODataError from ._models_py3 import Operation from ._models_py3 import OperationCollection from ._models_py3 import OperationDisplay - from ._models_py3 import OutputFile - from ._models_py3 import Overlay - from ._models_py3 import PngFormat - from ._models_py3 import PngImage - from ._models_py3 import PngLayer from ._models_py3 import PresentationTimeRange - from ._models_py3 import Preset from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionListResult @@ -158,16 +108,10 @@ from ._models_py3 import PrivateLinkResourceListResult from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import Properties - from ._models_py3 import Provider from ._models_py3 import ProxyResource - from ._models_py3 import Rectangle from ._models_py3 import Resource - from ._models_py3 import SelectAudioTrackByAttribute - from ._models_py3 import SelectAudioTrackById - from ._models_py3 import SelectVideoTrackByAttribute - from ._models_py3 import SelectVideoTrackById + from ._models_py3 import ResourceIdentity from ._models_py3 import ServiceSpecification - from ._models_py3 import StandardEncoderPreset from ._models_py3 import StorageAccount from ._models_py3 import StorageEncryptedAssetDecryptionData from ._models_py3 import StreamingEndpoint @@ -187,30 +131,17 @@ from ._models_py3 import StreamingPolicyWidevineConfiguration from ._models_py3 import SyncStorageKeysInput from ._models_py3 import SystemData - from ._models_py3 import TrackDescriptor from ._models_py3 import TrackPropertyCondition from ._models_py3 import TrackSelection from ._models_py3 import TrackedResource - from ._models_py3 import Transform - from ._models_py3 import TransformCollection - from ._models_py3 import TransformOutput - from ._models_py3 import TransportStreamFormat - from ._models_py3 import UtcClipTime - from ._models_py3 import Video - from ._models_py3 import VideoAnalyzerPreset - from ._models_py3 import VideoLayer - from ._models_py3 import VideoOverlay - from ._models_py3 import VideoTrackDescriptor + from ._models_py3 import UserAssignedManagedIdentity except (SyntaxError, ImportError): - from ._models import AacAudio # type: ignore - from ._models import AbsoluteClipTime # type: ignore from ._models import AccessControl # type: ignore from ._models import AccountEncryption # type: ignore from ._models import AccountFilter # type: ignore from ._models import AccountFilterCollection # type: ignore from ._models import AkamaiAccessControl # type: ignore from ._models import AkamaiSignatureHeaderAuthenticationKey # type: ignore - from ._models import ApiError # type: ignore from ._models import Asset # type: ignore from ._models import AssetCollection # type: ignore from ._models import AssetContainerSas # type: ignore @@ -218,16 +149,9 @@ from ._models import AssetFilter # type: ignore from ._models import AssetFilterCollection # type: ignore from ._models import AssetStreamingLocator # type: ignore - from ._models import Audio # type: ignore - from ._models import AudioAnalyzerPreset # type: ignore - from ._models import AudioOverlay # type: ignore - from ._models import AudioTrackDescriptor # type: ignore - from ._models import BuiltInStandardEncoderPreset # type: ignore from ._models import CbcsDrmConfiguration # type: ignore from ._models import CencDrmConfiguration # type: ignore from ._models import CheckNameAvailabilityInput # type: ignore - from ._models import ClipTime # type: ignore - from ._models import Codec # type: ignore from ._models import CommonEncryptionCbcs # type: ignore from ._models import CommonEncryptionCenc # type: ignore from ._models import ContentKeyPolicy # type: ignore @@ -256,55 +180,25 @@ from ._models import ContentKeyPolicyUnknownRestriction # type: ignore from ._models import ContentKeyPolicyWidevineConfiguration # type: ignore from ._models import ContentKeyPolicyX509CertificateTokenKey # type: ignore - from ._models import CopyAudio # type: ignore - from ._models import CopyVideo # type: ignore from ._models import CrossSiteAccessPolicies # type: ignore from ._models import DefaultKey # type: ignore - from ._models import Deinterlace # type: ignore from ._models import EdgePolicies # type: ignore from ._models import EdgeUsageDataCollectionPolicy # type: ignore from ._models import EdgeUsageDataEventHub # type: ignore from ._models import EnabledProtocols # type: ignore from ._models import EntityNameAvailabilityCheckOutput # type: ignore from ._models import EnvelopeEncryption # type: ignore - from ._models import FaceDetectorPreset # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore from ._models import FilterTrackPropertyCondition # type: ignore from ._models import FilterTrackSelection # type: ignore - from ._models import Filters # type: ignore from ._models import FirstQuality # type: ignore - from ._models import Format # type: ignore - from ._models import FromAllInputFile # type: ignore - from ._models import FromEachInputFile # type: ignore - from ._models import H264Layer # type: ignore - from ._models import H264Video # type: ignore - from ._models import H265Layer # type: ignore - from ._models import H265Video # type: ignore - from ._models import H265VideoLayer # type: ignore from ._models import Hls # type: ignore from ._models import IPAccessControl # type: ignore from ._models import IPRange # type: ignore - from ._models import Image # type: ignore - from ._models import ImageFormat # type: ignore - from ._models import InputDefinition # type: ignore - from ._models import InputFile # type: ignore - from ._models import Job # type: ignore - from ._models import JobCollection # type: ignore - from ._models import JobError # type: ignore - from ._models import JobErrorDetail # type: ignore - from ._models import JobInput # type: ignore - from ._models import JobInputAsset # type: ignore - from ._models import JobInputClip # type: ignore - from ._models import JobInputHttp # type: ignore - from ._models import JobInputSequence # type: ignore - from ._models import JobInputs # type: ignore - from ._models import JobOutput # type: ignore - from ._models import JobOutputAsset # type: ignore - from ._models import JpgFormat # type: ignore - from ._models import JpgImage # type: ignore - from ._models import JpgLayer # type: ignore from ._models import KeyDelivery # type: ignore from ._models import KeyVaultProperties # type: ignore - from ._models import Layer # type: ignore from ._models import ListContainerSasInput # type: ignore from ._models import ListContentKeysResponse # type: ignore from ._models import ListEdgePoliciesInput # type: ignore @@ -324,7 +218,6 @@ from ._models import LiveEventTranscription # type: ignore from ._models import LiveOutput # type: ignore from ._models import LiveOutputListResult # type: ignore - from ._models import Location # type: ignore from ._models import LogSpecification # type: ignore from ._models import MediaService # type: ignore from ._models import MediaServiceCollection # type: ignore @@ -332,20 +225,11 @@ from ._models import MediaServiceUpdate # type: ignore from ._models import MetricDimension # type: ignore from ._models import MetricSpecification # type: ignore - from ._models import Mp4Format # type: ignore - from ._models import MultiBitrateFormat # type: ignore from ._models import NoEncryption # type: ignore - from ._models import ODataError # type: ignore from ._models import Operation # type: ignore from ._models import OperationCollection # type: ignore from ._models import OperationDisplay # type: ignore - from ._models import OutputFile # type: ignore - from ._models import Overlay # type: ignore - from ._models import PngFormat # type: ignore - from ._models import PngImage # type: ignore - from ._models import PngLayer # type: ignore from ._models import PresentationTimeRange # type: ignore - from ._models import Preset # type: ignore from ._models import PrivateEndpoint # type: ignore from ._models import PrivateEndpointConnection # type: ignore from ._models import PrivateEndpointConnectionListResult # type: ignore @@ -353,16 +237,10 @@ from ._models import PrivateLinkResourceListResult # type: ignore from ._models import PrivateLinkServiceConnectionState # type: ignore from ._models import Properties # type: ignore - from ._models import Provider # type: ignore from ._models import ProxyResource # type: ignore - from ._models import Rectangle # type: ignore from ._models import Resource # type: ignore - from ._models import SelectAudioTrackByAttribute # type: ignore - from ._models import SelectAudioTrackById # type: ignore - from ._models import SelectVideoTrackByAttribute # type: ignore - from ._models import SelectVideoTrackById # type: ignore + from ._models import ResourceIdentity # type: ignore from ._models import ServiceSpecification # type: ignore - from ._models import StandardEncoderPreset # type: ignore from ._models import StorageAccount # type: ignore from ._models import StorageEncryptedAssetDecryptionData # type: ignore from ._models import StreamingEndpoint # type: ignore @@ -382,32 +260,16 @@ from ._models import StreamingPolicyWidevineConfiguration # type: ignore from ._models import SyncStorageKeysInput # type: ignore from ._models import SystemData # type: ignore - from ._models import TrackDescriptor # type: ignore from ._models import TrackPropertyCondition # type: ignore from ._models import TrackSelection # type: ignore from ._models import TrackedResource # type: ignore - from ._models import Transform # type: ignore - from ._models import TransformCollection # type: ignore - from ._models import TransformOutput # type: ignore - from ._models import TransportStreamFormat # type: ignore - from ._models import UtcClipTime # type: ignore - from ._models import Video # type: ignore - from ._models import VideoAnalyzerPreset # type: ignore - from ._models import VideoLayer # type: ignore - from ._models import VideoOverlay # type: ignore - from ._models import VideoTrackDescriptor # type: ignore + from ._models import UserAssignedManagedIdentity # type: ignore from ._azure_media_services_enums import ( - AacAudioProfile, AccountEncryptionKeyType, ActionType, - AnalysisResolution, AssetContainerPermission, AssetStorageEncryptionFormat, - AttributeFilter, - AudioAnalysisMode, - BlurType, - ChannelMapping, ContentKeyPolicyFairPlayRentalAndLeaseKeyType, ContentKeyPolicyPlayReadyContentType, ContentKeyPolicyPlayReadyLicenseType, @@ -415,35 +277,18 @@ ContentKeyPolicyRestrictionTokenType, CreatedByType, DefaultAction, - DeinterlaceMode, - DeinterlaceParity, - EncoderNamedPreset, EncryptionScheme, - EntropyMode, - FaceRedactorMode, FilterTrackPropertyCompareOperation, FilterTrackPropertyType, - H264Complexity, - H264VideoProfile, - H265Complexity, - H265VideoProfile, - InsightsType, - JobErrorCategory, - JobErrorCode, - JobRetry, - JobState, LiveEventEncodingType, LiveEventInputProtocol, LiveEventResourceState, LiveOutputResourceState, - ManagedIdentityType, MetricAggregationType, MetricUnit, - OnErrorType, - Priority, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, - Rotation, + PublicNetworkAccess, StorageAccountType, StorageAuthentication, StreamOptionsFlag, @@ -451,22 +296,17 @@ StreamingLocatorContentKeyType, StreamingPolicyStreamingProtocol, StretchMode, - TrackAttribute, TrackPropertyCompareOperation, TrackPropertyType, - VideoSyncMode, ) __all__ = [ - 'AacAudio', - 'AbsoluteClipTime', 'AccessControl', 'AccountEncryption', 'AccountFilter', 'AccountFilterCollection', 'AkamaiAccessControl', 'AkamaiSignatureHeaderAuthenticationKey', - 'ApiError', 'Asset', 'AssetCollection', 'AssetContainerSas', @@ -474,16 +314,9 @@ 'AssetFilter', 'AssetFilterCollection', 'AssetStreamingLocator', - 'Audio', - 'AudioAnalyzerPreset', - 'AudioOverlay', - 'AudioTrackDescriptor', - 'BuiltInStandardEncoderPreset', 'CbcsDrmConfiguration', 'CencDrmConfiguration', 'CheckNameAvailabilityInput', - 'ClipTime', - 'Codec', 'CommonEncryptionCbcs', 'CommonEncryptionCenc', 'ContentKeyPolicy', @@ -512,55 +345,25 @@ 'ContentKeyPolicyUnknownRestriction', 'ContentKeyPolicyWidevineConfiguration', 'ContentKeyPolicyX509CertificateTokenKey', - 'CopyAudio', - 'CopyVideo', 'CrossSiteAccessPolicies', 'DefaultKey', - 'Deinterlace', 'EdgePolicies', 'EdgeUsageDataCollectionPolicy', 'EdgeUsageDataEventHub', 'EnabledProtocols', 'EntityNameAvailabilityCheckOutput', 'EnvelopeEncryption', - 'FaceDetectorPreset', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'FilterTrackPropertyCondition', 'FilterTrackSelection', - 'Filters', 'FirstQuality', - 'Format', - 'FromAllInputFile', - 'FromEachInputFile', - 'H264Layer', - 'H264Video', - 'H265Layer', - 'H265Video', - 'H265VideoLayer', 'Hls', 'IPAccessControl', 'IPRange', - 'Image', - 'ImageFormat', - 'InputDefinition', - 'InputFile', - 'Job', - 'JobCollection', - 'JobError', - 'JobErrorDetail', - 'JobInput', - 'JobInputAsset', - 'JobInputClip', - 'JobInputHttp', - 'JobInputSequence', - 'JobInputs', - 'JobOutput', - 'JobOutputAsset', - 'JpgFormat', - 'JpgImage', - 'JpgLayer', 'KeyDelivery', 'KeyVaultProperties', - 'Layer', 'ListContainerSasInput', 'ListContentKeysResponse', 'ListEdgePoliciesInput', @@ -580,7 +383,6 @@ 'LiveEventTranscription', 'LiveOutput', 'LiveOutputListResult', - 'Location', 'LogSpecification', 'MediaService', 'MediaServiceCollection', @@ -588,20 +390,11 @@ 'MediaServiceUpdate', 'MetricDimension', 'MetricSpecification', - 'Mp4Format', - 'MultiBitrateFormat', 'NoEncryption', - 'ODataError', 'Operation', 'OperationCollection', 'OperationDisplay', - 'OutputFile', - 'Overlay', - 'PngFormat', - 'PngImage', - 'PngLayer', 'PresentationTimeRange', - 'Preset', 'PrivateEndpoint', 'PrivateEndpointConnection', 'PrivateEndpointConnectionListResult', @@ -609,16 +402,10 @@ 'PrivateLinkResourceListResult', 'PrivateLinkServiceConnectionState', 'Properties', - 'Provider', 'ProxyResource', - 'Rectangle', 'Resource', - 'SelectAudioTrackByAttribute', - 'SelectAudioTrackById', - 'SelectVideoTrackByAttribute', - 'SelectVideoTrackById', + 'ResourceIdentity', 'ServiceSpecification', - 'StandardEncoderPreset', 'StorageAccount', 'StorageEncryptedAssetDecryptionData', 'StreamingEndpoint', @@ -638,30 +425,14 @@ 'StreamingPolicyWidevineConfiguration', 'SyncStorageKeysInput', 'SystemData', - 'TrackDescriptor', 'TrackPropertyCondition', 'TrackSelection', 'TrackedResource', - 'Transform', - 'TransformCollection', - 'TransformOutput', - 'TransportStreamFormat', - 'UtcClipTime', - 'Video', - 'VideoAnalyzerPreset', - 'VideoLayer', - 'VideoOverlay', - 'VideoTrackDescriptor', - 'AacAudioProfile', + 'UserAssignedManagedIdentity', 'AccountEncryptionKeyType', 'ActionType', - 'AnalysisResolution', 'AssetContainerPermission', 'AssetStorageEncryptionFormat', - 'AttributeFilter', - 'AudioAnalysisMode', - 'BlurType', - 'ChannelMapping', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyType', 'ContentKeyPolicyPlayReadyContentType', 'ContentKeyPolicyPlayReadyLicenseType', @@ -669,35 +440,18 @@ 'ContentKeyPolicyRestrictionTokenType', 'CreatedByType', 'DefaultAction', - 'DeinterlaceMode', - 'DeinterlaceParity', - 'EncoderNamedPreset', 'EncryptionScheme', - 'EntropyMode', - 'FaceRedactorMode', 'FilterTrackPropertyCompareOperation', 'FilterTrackPropertyType', - 'H264Complexity', - 'H264VideoProfile', - 'H265Complexity', - 'H265VideoProfile', - 'InsightsType', - 'JobErrorCategory', - 'JobErrorCode', - 'JobRetry', - 'JobState', 'LiveEventEncodingType', 'LiveEventInputProtocol', 'LiveEventResourceState', 'LiveOutputResourceState', - 'ManagedIdentityType', 'MetricAggregationType', 'MetricUnit', - 'OnErrorType', - 'Priority', 'PrivateEndpointConnectionProvisioningState', 'PrivateEndpointServiceConnectionStatus', - 'Rotation', + 'PublicNetworkAccess', 'StorageAccountType', 'StorageAuthentication', 'StreamOptionsFlag', @@ -705,8 +459,6 @@ 'StreamingLocatorContentKeyType', 'StreamingPolicyStreamingProtocol', 'StretchMode', - 'TrackAttribute', 'TrackPropertyCompareOperation', 'TrackPropertyType', - 'VideoSyncMode', ] diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_azure_media_services_enums.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_azure_media_services_enums.py index 36f003647135..9896acb3b4b4 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_azure_media_services_enums.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_azure_media_services_enums.py @@ -26,17 +26,6 @@ def __getattr__(cls, name): raise AttributeError(name) -class AacAudioProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The encoding profile to be used when encoding audio with AAC. - """ - - #: Specifies that the output audio is to be encoded into AAC Low Complexity profile (AAC-LC). - AAC_LC = "AacLc" - #: Specifies that the output audio is to be encoded into HE-AAC v1 profile. - HE_AAC_V1 = "HeAacV1" - #: Specifies that the output audio is to be encoded into HE-AAC v2 profile. - HE_AAC_V2 = "HeAacV2" - class AccountEncryptionKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of key used to encrypt the Account Key. """ @@ -53,21 +42,6 @@ class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: An internal action. INTERNAL = "Internal" -class AnalysisResolution(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Specifies the maximum resolution at which your video is analyzed. The default behavior is - "SourceResolution," which will keep the input video at its original resolution when analyzed. - Using "StandardDefinition" will resize input videos to standard definition while preserving the - appropriate aspect ratio. It will only resize if the video is of higher resolution. For - example, a 1920x1080 input would be scaled to 640x360 before processing. Switching to - "StandardDefinition" will reduce the time it takes to process high resolution video. It may - also reduce the cost of using this component (see - https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). - However, faces that end up being too small in the resized video may not be detected. - """ - - SOURCE_RESOLUTION = "SourceResolution" - STANDARD_DEFINITION = "StandardDefinition" - class AssetContainerPermission(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The permissions to set on the SAS URL. """ @@ -89,72 +63,6 @@ class AssetStorageEncryptionFormat(with_metaclass(_CaseInsensitiveEnumMeta, str, #: The Asset is encrypted with Media Services client-side encryption. MEDIA_STORAGE_CLIENT_ENCRYPTION = "MediaStorageClientEncryption" -class AttributeFilter(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of AttributeFilter to apply to the TrackAttribute in order to select the tracks. - """ - - #: All tracks will be included. - ALL = "All" - #: The first track will be included when the attribute is sorted in descending order. Generally - #: used to select the largest bitrate. - TOP = "Top" - #: The first track will be included when the attribute is sorted in ascending order. Generally - #: used to select the smallest bitrate. - BOTTOM = "Bottom" - #: Any tracks that have an attribute equal to the value given will be included. - VALUE_EQUALS = "ValueEquals" - -class AudioAnalysisMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Determines the set of audio analysis operations to be performed. If unspecified, the Standard - AudioAnalysisMode would be chosen. - """ - - #: Performs all operations included in the Basic mode, additionally performing language detection - #: and speaker diarization. - STANDARD = "Standard" - #: This mode performs speech-to-text transcription and generation of a VTT subtitle/caption file. - #: The output of this mode includes an Insights JSON file including only the keywords, - #: transcription,and timing information. Automatic language detection and speaker diarization are - #: not included in this mode. - BASIC = "Basic" - -class BlurType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Blur type - """ - - #: Box: debug filter, bounding box only. - BOX = "Box" - #: Low: box-car blur filter. - LOW = "Low" - #: Med: Gaussian blur filter. - MED = "Med" - #: High: Confuse blur filter. - HIGH = "High" - #: Black: Black out filter. - BLACK = "Black" - -class ChannelMapping(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Optional designation for single channel audio tracks. Can be used to combine the tracks into - stereo or multi-channel audio tracks. - """ - - #: The Front Left Channel. - FRONT_LEFT = "FrontLeft" - #: The Front Right Channel. - FRONT_RIGHT = "FrontRight" - #: The Center Channel. - CENTER = "Center" - #: Low Frequency Effects Channel. Sometimes referred to as the Subwoofer. - LOW_FREQUENCY_EFFECTS = "LowFrequencyEffects" - #: The Back Left Channel. Sometimes referred to as the Left Surround Channel. - BACK_LEFT = "BackLeft" - #: The Back Right Channel. Sometimes referred to as the Right Surround Channel. - BACK_RIGHT = "BackRight" - #: The Left Stereo channel. Sometimes referred to as Down Mix Left. - STEREO_LEFT = "StereoLeft" - #: The Right Stereo channel. Sometimes referred to as Down Mix Right. - STEREO_RIGHT = "StereoRight" - class ContentKeyPolicyFairPlayRentalAndLeaseKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The rental and lease key type. """ @@ -239,95 +147,6 @@ class DefaultAction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Public IP addresses are blocked. DENY = "Deny" -class DeinterlaceMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The deinterlacing mode. Defaults to AutoPixelAdaptive. - """ - - #: Disables de-interlacing of the source video. - OFF = "Off" - #: Apply automatic pixel adaptive de-interlacing on each frame in the input video. - AUTO_PIXEL_ADAPTIVE = "AutoPixelAdaptive" - -class DeinterlaceParity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The field parity for de-interlacing, defaults to Auto. - """ - - #: Automatically detect the order of fields. - AUTO = "Auto" - #: Apply top field first processing of input video. - TOP_FIELD_FIRST = "TopFieldFirst" - #: Apply bottom field first processing of input video. - BOTTOM_FIELD_FIRST = "BottomFieldFirst" - -class EncoderNamedPreset(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The built-in preset to be used for encoding videos. - """ - - #: Produces an MP4 file where the video is encoded with H.264 codec at 2200 kbps and a picture - #: height of 480 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H264_SINGLE_BITRATE_SD = "H264SingleBitrateSD" - #: Produces an MP4 file where the video is encoded with H.264 codec at 4500 kbps and a picture - #: height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H264_SINGLE_BITRATE720_P = "H264SingleBitrate720p" - #: Produces an MP4 file where the video is encoded with H.264 codec at 6750 kbps and a picture - #: height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H264_SINGLE_BITRATE1080_P = "H264SingleBitrate1080p" - #: Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a - #: bitrate ladder based on the input resolution, bitrate and frame rate. The auto-generated preset - #: will never exceed the input resolution. For example, if the input is 720p, output will remain - #: 720p at best. - ADAPTIVE_STREAMING = "AdaptiveStreaming" - #: Produces a single MP4 file containing only stereo audio encoded at 192 kbps. - AAC_GOOD_QUALITY_AUDIO = "AACGoodQualityAudio" - #: Exposes an experimental preset for content-aware encoding. Given any input content, the service - #: attempts to automatically determine the optimal number of layers, appropriate bitrate and - #: resolution settings for delivery by adaptive streaming. The underlying algorithms will continue - #: to evolve over time. The output will contain MP4 files with video and audio interleaved. - CONTENT_AWARE_ENCODING_EXPERIMENTAL = "ContentAwareEncodingExperimental" - #: Produces a set of GOP-aligned MP4s by using content-aware encoding. Given any input content, - #: the service performs an initial lightweight analysis of the input content, and uses the results - #: to determine the optimal number of layers, appropriate bitrate and resolution settings for - #: delivery by adaptive streaming. This preset is particularly effective for low and medium - #: complexity videos, where the output files will be at lower bitrates but at a quality that still - #: delivers a good experience to viewers. The output will contain MP4 files with video and audio - #: interleaved. - CONTENT_AWARE_ENCODING = "ContentAwareEncoding" - #: Copy all video and audio streams from the input asset as non-interleaved video and audio output - #: files. This preset can be used to clip an existing asset or convert a group of key frame (GOP) - #: aligned MP4 files as an asset that can be streamed. - COPY_ALL_BITRATE_NON_INTERLEAVED = "CopyAllBitrateNonInterleaved" - #: Produces a set of 8 GOP-aligned MP4 files, ranging from 6000 kbps to 400 kbps, and stereo AAC - #: audio. Resolution starts at 1080p and goes down to 180p. - H264_MULTIPLE_BITRATE1080_P = "H264MultipleBitrate1080p" - #: Produces a set of 6 GOP-aligned MP4 files, ranging from 3400 kbps to 400 kbps, and stereo AAC - #: audio. Resolution starts at 720p and goes down to 180p. - H264_MULTIPLE_BITRATE720_P = "H264MultipleBitrate720p" - #: Produces a set of 5 GOP-aligned MP4 files, ranging from 1900kbps to 400 kbps, and stereo AAC - #: audio. Resolution starts at 480p and goes down to 240p. - H264_MULTIPLE_BITRATE_SD = "H264MultipleBitrateSD" - #: Produces a set of GOP-aligned MP4s by using content-aware encoding. Given any input content, - #: the service performs an initial lightweight analysis of the input content, and uses the results - #: to determine the optimal number of layers, appropriate bitrate and resolution settings for - #: delivery by adaptive streaming. This preset is particularly effective for low and medium - #: complexity videos, where the output files will be at lower bitrates but at a quality that still - #: delivers a good experience to viewers. The output will contain MP4 files with video and audio - #: interleaved. - H265_CONTENT_AWARE_ENCODING = "H265ContentAwareEncoding" - #: Produces a set of GOP aligned MP4 files with H.265 video and stereo AAC audio. Auto-generates a - #: bitrate ladder based on the input resolution, bitrate and frame rate. The auto-generated preset - #: will never exceed the input resolution. For example, if the input is 720p, output will remain - #: 720p at best. - H265_ADAPTIVE_STREAMING = "H265AdaptiveStreaming" - #: Produces an MP4 file where the video is encoded with H.265 codec at 1800 kbps and a picture - #: height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H265_SINGLE_BITRATE720_P = "H265SingleBitrate720p" - #: Produces an MP4 file where the video is encoded with H.265 codec at 3500 kbps and a picture - #: height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H265_SINGLE_BITRATE1080_P = "H265SingleBitrate1080p" - #: Produces an MP4 file where the video is encoded with H.265 codec at 9500 kbps and a picture - #: height of 2160 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. - H265_SINGLE_BITRATE4_K = "H265SingleBitrate4K" - class EncryptionScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Encryption scheme """ @@ -341,35 +160,6 @@ class EncryptionScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: CommonEncryptionCbcs scheme. COMMON_ENCRYPTION_CBCS = "CommonEncryptionCbcs" -class EntropyMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The entropy mode to be used for this layer. If not specified, the encoder chooses the mode that - is appropriate for the profile and level. - """ - - #: Context Adaptive Binary Arithmetic Coder (CABAC) entropy encoding. - CABAC = "Cabac" - #: Context Adaptive Variable Length Coder (CAVLC) entropy encoding. - CAVLC = "Cavlc" - -class FaceRedactorMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """This mode provides the ability to choose between the following settings: 1) Analyze - For - detection only.This mode generates a metadata JSON file marking appearances of faces throughout - the video.Where possible, appearances of the same person are assigned the same ID. 2) Combined - - Additionally redacts(blurs) detected faces. 3) Redact - This enables a 2-pass process, - allowing for selective redaction of a subset of detected faces.It takes in the metadata file - from a prior analyze pass, along with the source video, and a user-selected subset of IDs that - require redaction. - """ - - #: Analyze mode detects faces and outputs a metadata file with the results. Allows editing of the - #: metadata file before faces are blurred with Redact mode. - ANALYZE = "Analyze" - #: Redact mode consumes the metadata file from Analyze mode and redacts the faces found. - REDACT = "Redact" - #: Combined mode does the Analyze and Redact steps in one pass when editing the analyzed faces is - #: not desired. - COMBINED = "Combined" - class FilterTrackPropertyCompareOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The track property condition operation. """ @@ -396,156 +186,6 @@ class FilterTrackPropertyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum #: The bitrate. BITRATE = "Bitrate" -class H264Complexity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Tells the encoder how to choose its encoding settings. The default value is Balanced. - """ - - #: Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed - #: to decrease encoding time. - SPEED = "Speed" - #: Tells the encoder to use settings that achieve a balance between speed and quality. - BALANCED = "Balanced" - #: Tells the encoder to use settings that are optimized to produce higher quality output at the - #: expense of slower overall encode time. - QUALITY = "Quality" - -class H264VideoProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """We currently support Baseline, Main, High, High422, High444. Default is Auto. - """ - - #: Tells the encoder to automatically determine the appropriate H.264 profile. - AUTO = "Auto" - #: Baseline profile. - BASELINE = "Baseline" - #: Main profile. - MAIN = "Main" - #: High profile. - HIGH = "High" - #: High 4:2:2 profile. - HIGH422 = "High422" - #: High 4:4:4 predictive profile. - HIGH444 = "High444" - -class H265Complexity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Tells the encoder how to choose its encoding settings. Quality will provide for a higher - compression ratio but at a higher cost and longer compute time. Speed will produce a - relatively larger file but is faster and more economical. The default value is Balanced. - """ - - #: Tells the encoder to use settings that are optimized for faster encoding. Quality is sacrificed - #: to decrease encoding time. - SPEED = "Speed" - #: Tells the encoder to use settings that achieve a balance between speed and quality. - BALANCED = "Balanced" - #: Tells the encoder to use settings that are optimized to produce higher quality output at the - #: expense of slower overall encode time. - QUALITY = "Quality" - -class H265VideoProfile(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """We currently support Main. Default is Auto. - """ - - #: Tells the encoder to automatically determine the appropriate H.265 profile. - AUTO = "Auto" - #: Main profile - #: (https://x265.readthedocs.io/en/default/cli.html?highlight=profile#profile-level-tier). - MAIN = "Main" - -class InsightsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Defines the type of insights that you want the service to generate. The allowed values are - 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default is AllInsights. If you - set this to AllInsights and the input is audio only, then only audio insights are generated. - Similarly if the input is video only, then only video insights are generated. It is recommended - that you not use AudioInsightsOnly if you expect some of your inputs to be video only; or use - VideoInsightsOnly if you expect some of your inputs to be audio only. Your Jobs in such - conditions would error out. - """ - - #: Generate audio only insights. Ignore video even if present. Fails if no audio is present. - AUDIO_INSIGHTS_ONLY = "AudioInsightsOnly" - #: Generate video only insights. Ignore audio if present. Fails if no video is present. - VIDEO_INSIGHTS_ONLY = "VideoInsightsOnly" - #: Generate both audio and video insights. Fails if either audio or video Insights fail. - ALL_INSIGHTS = "AllInsights" - -class JobErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Helps with categorization of errors. - """ - - #: The error is service related. - SERVICE = "Service" - #: The error is download related. - DOWNLOAD = "Download" - #: The error is upload related. - UPLOAD = "Upload" - #: The error is configuration related. - CONFIGURATION = "Configuration" - #: The error is related to data in the input files. - CONTENT = "Content" - -class JobErrorCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Error code describing the error. - """ - - #: Fatal service error, please contact support. - SERVICE_ERROR = "ServiceError" - #: Transient error, please retry, if retry is unsuccessful, please contact support. - SERVICE_TRANSIENT_ERROR = "ServiceTransientError" - #: While trying to download the input files, the files were not accessible, please check the - #: availability of the source. - DOWNLOAD_NOT_ACCESSIBLE = "DownloadNotAccessible" - #: While trying to download the input files, there was an issue during transfer (storage service, - #: network errors), see details and check your source. - DOWNLOAD_TRANSIENT_ERROR = "DownloadTransientError" - #: While trying to upload the output files, the destination was not reachable, please check the - #: availability of the destination. - UPLOAD_NOT_ACCESSIBLE = "UploadNotAccessible" - #: While trying to upload the output files, there was an issue during transfer (storage service, - #: network errors), see details and check your destination. - UPLOAD_TRANSIENT_ERROR = "UploadTransientError" - #: There was a problem with the combination of input files and the configuration settings applied, - #: fix the configuration settings and retry with the same input, or change input to match the - #: configuration. - CONFIGURATION_UNSUPPORTED = "ConfigurationUnsupported" - #: There was a problem with the input content (for example: zero byte files, or - #: corrupt/non-decodable files), check the input files. - CONTENT_MALFORMED = "ContentMalformed" - #: There was a problem with the format of the input (not valid media file, or an unsupported - #: file/codec), check the validity of the input files. - CONTENT_UNSUPPORTED = "ContentUnsupported" - -class JobRetry(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Indicates that it may be possible to retry the Job. If retry is unsuccessful, please contact - Azure support via Azure Portal. - """ - - #: Issue needs to be investigated and then the job resubmitted with corrections or retried once - #: the underlying issue has been corrected. - DO_NOT_RETRY = "DoNotRetry" - #: Issue may be resolved after waiting for a period of time and resubmitting the same Job. - MAY_RETRY = "MayRetry" - -class JobState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Describes the state of the JobOutput. - """ - - #: The job was canceled. This is a final state for the job. - CANCELED = "Canceled" - #: The job is in the process of being canceled. This is a transient state for the job. - CANCELING = "Canceling" - #: The job has encountered an error. This is a final state for the job. - ERROR = "Error" - #: The job is finished. This is a final state for the job. - FINISHED = "Finished" - #: The job is processing. This is a transient state for the job. - PROCESSING = "Processing" - #: The job is in a queued state, waiting for resources to become available. This is a transient - #: state. - QUEUED = "Queued" - #: The job is being scheduled to run on an available resource. This is a transient state, between - #: queued and processing states. - SCHEDULED = "Scheduled" - class LiveEventEncodingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Live event type. When encodingType is set to None, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or @@ -563,6 +203,10 @@ class LiveEventEncodingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)) #: A contribution live encoder sends a single bitrate stream to the live event and Media Services #: creates multiple bitrate streams. The output cannot exceed 1080p in resolution. PREMIUM1080_P = "Premium1080p" + #: Pending update... + PASSTHROUGH_BASIC = "PassthroughBasic" + #: Pending update... + PASSTHROUGH_STANDARD = "PassthroughStandard" class LiveEventInputProtocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The input protocol for the live event. This is specified at creation time and cannot be @@ -619,15 +263,6 @@ class LiveOutputResourceState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum #: Any streaming URLs created on the live output asset continue to work. DELETING = "Deleting" -class ManagedIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The identity type. - """ - - #: A system-assigned managed identity. - SYSTEM_ASSIGNED = "SystemAssigned" - #: No managed identity. - NONE = "None" - class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The metric aggregation type """ @@ -650,33 +285,6 @@ class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The number of milliseconds. MILLISECONDS = "Milliseconds" -class OnErrorType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """A Transform can define more than one outputs. This property defines what the service should do - when one output fails - either continue to produce other outputs, or, stop the other outputs. - The overall Job state will not reflect failures of outputs that are specified with - 'ContinueJob'. The default is 'StopProcessingJob'. - """ - - #: Tells the service that if this TransformOutput fails, then any other incomplete - #: TransformOutputs can be stopped. - STOP_PROCESSING_JOB = "StopProcessingJob" - #: Tells the service that if this TransformOutput fails, then allow any other TransformOutput to - #: continue. - CONTINUE_JOB = "ContinueJob" - -class Priority(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Sets the relative priority of the TransformOutputs within a Transform. This sets the priority - that the service uses for processing TransformOutputs. The default priority is Normal. - """ - - #: Used for TransformOutputs that can be generated after Normal and High priority - #: TransformOutputs. - LOW = "Low" - #: Used for TransformOutputs that can be generated at Normal priority. - NORMAL = "Normal" - #: Used for TransformOutputs that should take precedence over others. - HIGH = "High" - class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current provisioning state. """ @@ -694,23 +302,14 @@ class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnum APPROVED = "Approved" REJECTED = "Rejected" -class Rotation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The rotation, if any, to be applied to the input video, before it is encoded. Default is Auto +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether or not public network access is allowed for resources under the Media Services account. """ - #: Automatically detect and rotate as needed. - AUTO = "Auto" - #: Do not rotate the video. If the output format supports it, any metadata about rotation is kept - #: intact. - NONE = "None" - #: Do not rotate the video but remove any metadata about the rotation. - ROTATE0 = "Rotate0" - #: Rotate 90 degrees clockwise. - ROTATE90 = "Rotate90" - #: Rotate 180 degrees clockwise. - ROTATE180 = "Rotate180" - #: Rotate 270 degrees clockwise. - ROTATE270 = "Rotate270" + #: Public network access is enabled. + ENABLED = "Enabled" + #: Public network access is disabled. + DISABLED = "Disabled" class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of the storage account. @@ -779,12 +378,12 @@ class StreamOptionsFlag(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): LOW_LATENCY = "LowLatency" class StretchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The resizing mode - how the input video will be resized to fit the desired output - resolution(s). Default is AutoSize + """Specifies how the input video will be resized to fit the desired output resolution(s). Default + is None """ - #: Strictly respect the output resolution without considering the pixel aspect ratio or display - #: aspect ratio of the input video. + #: Strictly respects the output resolution specified in the encoding preset without considering + #: the pixel aspect ratio or display aspect ratio of the input video. NONE = "None" #: Override the output resolution, and change it to match the display aspect ratio of the input, #: without padding. For example, if the input is 1920x1080 and the encoding preset asks for @@ -798,15 +397,6 @@ class StretchMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: and pillar box regions 280 pixels wide at the left and right. AUTO_FIT = "AutoFit" -class TrackAttribute(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The TrackAttribute to filter the tracks by. - """ - - #: The bitrate of the track. - BITRATE = "Bitrate" - #: The language of the track. - LANGUAGE = "Language" - class TrackPropertyCompareOperation(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Track property condition operation """ @@ -824,26 +414,3 @@ class TrackPropertyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): UNKNOWN = "Unknown" #: Track FourCC. FOUR_CC = "FourCC" - -class VideoSyncMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The Video Sync Mode - """ - - #: This is the default method. Chooses between Cfr and Vfr depending on muxer capabilities. For - #: output format MP4, the default mode is Cfr. - AUTO = "Auto" - #: The presentation timestamps on frames are passed through from the input file to the output file - #: writer. Recommended when the input source has variable frame rate, and are attempting to - #: produce multiple layers for adaptive streaming in the output which have aligned GOP boundaries. - #: Note: if two or more frames in the input have duplicate timestamps, then the output will also - #: have the same behavior. - PASSTHROUGH = "Passthrough" - #: Input frames will be repeated and/or dropped as needed to achieve exactly the requested - #: constant frame rate. Recommended when the output frame rate is explicitly set at a specified - #: value. - CFR = "Cfr" - #: Similar to the Passthrough mode, but if the input has frames that have duplicate timestamps, - #: then only one frame is passed through to the output, and others are dropped. Recommended when - #: the number of output frames is expected to be equal to the number of input frames. For example, - #: the output is used to calculate a quality metric like PSNR against the input. - VFR = "Vfr" diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models.py index b59667cdae7a..aff9845b1925 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models.py @@ -10,197 +10,6 @@ import msrest.serialization -class Codec(msrest.serialization.Model): - """Describes the basic properties of all codecs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Audio, CopyAudio, CopyVideo, Video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.Audio': 'Audio', '#Microsoft.Media.CopyAudio': 'CopyAudio', '#Microsoft.Media.CopyVideo': 'CopyVideo', '#Microsoft.Media.Video': 'Video'} - } - - def __init__( - self, - **kwargs - ): - super(Codec, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.label = kwargs.get('label', None) - - -class Audio(Codec): - """Defines the common properties for all audio codecs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AacAudio. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param channels: The number of channels in the audio. - :type channels: int - :param sampling_rate: The sampling rate to use for encoding in hertz. - :type sampling_rate: int - :param bitrate: The bitrate, in bits per second, of the output encoded audio. - :type bitrate: int - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'channels': {'key': 'channels', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AacAudio': 'AacAudio'} - } - - def __init__( - self, - **kwargs - ): - super(Audio, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.Audio' # type: str - self.channels = kwargs.get('channels', None) - self.sampling_rate = kwargs.get('sampling_rate', None) - self.bitrate = kwargs.get('bitrate', None) - - -class AacAudio(Audio): - """Describes Advanced Audio Codec (AAC) audio encoding settings. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param channels: The number of channels in the audio. - :type channels: int - :param sampling_rate: The sampling rate to use for encoding in hertz. - :type sampling_rate: int - :param bitrate: The bitrate, in bits per second, of the output encoded audio. - :type bitrate: int - :param profile: The encoding profile to be used when encoding audio with AAC. Possible values - include: "AacLc", "HeAacV1", "HeAacV2". - :type profile: str or ~azure.mgmt.media.models.AacAudioProfile - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'channels': {'key': 'channels', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'profile': {'key': 'profile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AacAudio, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AacAudio' # type: str - self.profile = kwargs.get('profile', None) - - -class ClipTime(msrest.serialization.Model): - """Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AbsoluteClipTime, UtcClipTime. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AbsoluteClipTime': 'AbsoluteClipTime', '#Microsoft.Media.UtcClipTime': 'UtcClipTime'} - } - - def __init__( - self, - **kwargs - ): - super(ClipTime, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AbsoluteClipTime(ClipTime): - """Specifies the clip time as an absolute time position in the media file. The absolute time can point to a different position depending on whether the media file starts from a timestamp of zero or not. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param time: Required. The time position on the timeline of the input media. It is usually - specified as an ISO8601 period. e.g PT30S for 30 seconds. - :type time: ~datetime.timedelta - """ - - _validation = { - 'odata_type': {'required': True}, - 'time': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'duration'}, - } - - def __init__( - self, - **kwargs - ): - super(AbsoluteClipTime, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AbsoluteClipTime' # type: str - self.time = kwargs['time'] - - class AccessControl(msrest.serialization.Model): """AccessControl. @@ -229,6 +38,8 @@ def __init__( class AccountEncryption(msrest.serialization.Model): """AccountEncryption. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. :param type: Required. The type of key used to encrypt the Account Key. Possible values @@ -236,15 +47,22 @@ class AccountEncryption(msrest.serialization.Model): :type type: str or ~azure.mgmt.media.models.AccountEncryptionKeyType :param key_vault_properties: The properties of the key used to encrypt the account. :type key_vault_properties: ~azure.mgmt.media.models.KeyVaultProperties + :param identity: The Key Vault identity. + :type identity: ~azure.mgmt.media.models.ResourceIdentity + :ivar status: The current status of the Key Vault mapping. + :vartype status: str """ _validation = { 'type': {'required': True}, + 'status': {'readonly': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -254,6 +72,8 @@ def __init__( super(AccountEncryption, self).__init__(**kwargs) self.type = kwargs['type'] self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.identity = kwargs.get('identity', None) + self.status = None class Resource(msrest.serialization.Model): @@ -449,25 +269,6 @@ def __init__( self.expiration = kwargs.get('expiration', None) -class ApiError(msrest.serialization.Model): - """The API error. - - :param error: The error properties. - :type error: ~azure.mgmt.media.models.ODataError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ODataError'}, - } - - def __init__( - self, - **kwargs - ): - super(ApiError, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - class Asset(ProxyResource): """An Asset. @@ -757,426 +558,98 @@ def __init__( self.default_content_key_policy_name = None -class Preset(msrest.serialization.Model): - """Base type for all Presets, which define the recipe or instructions on how the input media files should be processed. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioAnalyzerPreset, BuiltInStandardEncoderPreset, FaceDetectorPreset, StandardEncoderPreset. - - All required parameters must be populated in order to send to Azure. +class CbcsDrmConfiguration(msrest.serialization.Model): + """Class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str + :param fair_play: FairPlay configurations. + :type fair_play: ~azure.mgmt.media.models.StreamingPolicyFairPlayConfiguration + :param play_ready: PlayReady configurations. + :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration + :param widevine: Widevine configurations. + :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioAnalyzerPreset': 'AudioAnalyzerPreset', '#Microsoft.Media.BuiltInStandardEncoderPreset': 'BuiltInStandardEncoderPreset', '#Microsoft.Media.FaceDetectorPreset': 'FaceDetectorPreset', '#Microsoft.Media.StandardEncoderPreset': 'StandardEncoderPreset'} + 'fair_play': {'key': 'fairPlay', 'type': 'StreamingPolicyFairPlayConfiguration'}, + 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, + 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, } def __init__( self, **kwargs ): - super(Preset, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AudioAnalyzerPreset(Preset): - """The Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, including speech transcription. Currently, the preset supports processing of content with a single audio track. + super(CbcsDrmConfiguration, self).__init__(**kwargs) + self.fair_play = kwargs.get('fair_play', None) + self.play_ready = kwargs.get('play_ready', None) + self.widevine = kwargs.get('widevine', None) - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VideoAnalyzerPreset. - All required parameters must be populated in order to send to Azure. +class CencDrmConfiguration(msrest.serialization.Model): + """Class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param audio_language: The language for the audio payload in the input using the BCP-47 format - of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is - recommended that you specify it. The language must be specified explicitly for - AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If - the language isn't specified or set to null, automatic language detection will choose the first - language detected and process with the selected language for the duration of the file. It does - not currently support dynamically switching between languages after the first language is - detected. The automatic detection works best with audio recordings with clearly discernable - speech. If automatic detection fails to find the language, transcription would fallback to - 'en-US'." The list of supported languages is available here: - https://go.microsoft.com/fwlink/?linkid=2109463. - :type audio_language: str - :param mode: Determines the set of audio analysis operations to be performed. If unspecified, - the Standard AudioAnalysisMode would be chosen. Possible values include: "Standard", "Basic". - :type mode: str or ~azure.mgmt.media.models.AudioAnalysisMode - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] + :param play_ready: PlayReady configurations. + :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration + :param widevine: Widevine configurations. + :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'audio_language': {'key': 'audioLanguage', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.VideoAnalyzerPreset': 'VideoAnalyzerPreset'} + 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, + 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, } def __init__( self, **kwargs ): - super(AudioAnalyzerPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AudioAnalyzerPreset' # type: str - self.audio_language = kwargs.get('audio_language', None) - self.mode = kwargs.get('mode', None) - self.experimental_options = kwargs.get('experimental_options', None) - - -class Overlay(msrest.serialization.Model): - """Base type for all overlays - image, audio or video. + super(CencDrmConfiguration, self).__init__(**kwargs) + self.play_ready = kwargs.get('play_ready', None) + self.widevine = kwargs.get('widevine', None) - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioOverlay, VideoOverlay. - All required parameters must be populated in order to send to Azure. +class CheckNameAvailabilityInput(msrest.serialization.Model): + """The input to the check name availability request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float + :param name: The account name. + :type name: str + :param type: The account type. For a Media Services account, this should be 'MediaServices'. + :type type: str """ - _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioOverlay': 'AudioOverlay', '#Microsoft.Media.VideoOverlay': 'VideoOverlay'} + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Overlay, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.input_label = kwargs['input_label'] - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) - self.fade_in_duration = kwargs.get('fade_in_duration', None) - self.fade_out_duration = kwargs.get('fade_out_duration', None) - self.audio_gain_level = kwargs.get('audio_gain_level', None) - + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) -class AudioOverlay(Overlay): - """Describes the properties of an audio overlay. - All required parameters must be populated in order to send to Azure. +class CommonEncryptionCbcs(msrest.serialization.Model): + """Class for CommonEncryptionCbcs encryption scheme. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float + :param enabled_protocols: Representing supported protocols. + :type enabled_protocols: ~azure.mgmt.media.models.EnabledProtocols + :param clear_tracks: Representing which tracks should not be encrypted. + :type clear_tracks: list[~azure.mgmt.media.models.TrackSelection] + :param content_keys: Representing default content key for each encryption scheme and separate + content keys for specific tracks. + :type content_keys: ~azure.mgmt.media.models.StreamingPolicyContentKeys + :param drm: Configuration of DRMs for current encryption scheme. + :type drm: ~azure.mgmt.media.models.CbcsDrmConfiguration """ - _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(AudioOverlay, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AudioOverlay' # type: str - - -class TrackDescriptor(msrest.serialization.Model): - """Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioTrackDescriptor, VideoTrackDescriptor. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioTrackDescriptor': 'AudioTrackDescriptor', '#Microsoft.Media.VideoTrackDescriptor': 'VideoTrackDescriptor'} - } - - def __init__( - self, - **kwargs - ): - super(TrackDescriptor, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AudioTrackDescriptor(TrackDescriptor): - """A TrackSelection to select audio tracks. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SelectAudioTrackByAttribute, SelectAudioTrackById. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.SelectAudioTrackByAttribute': 'SelectAudioTrackByAttribute', '#Microsoft.Media.SelectAudioTrackById': 'SelectAudioTrackById'} - } - - def __init__( - self, - **kwargs - ): - super(AudioTrackDescriptor, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AudioTrackDescriptor' # type: str - self.channel_mapping = kwargs.get('channel_mapping', None) - - -class BuiltInStandardEncoderPreset(Preset): - """Describes a built-in preset for encoding the input video with the Standard Encoder. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param preset_name: Required. The built-in preset to be used for encoding videos. Possible - values include: "H264SingleBitrateSD", "H264SingleBitrate720p", "H264SingleBitrate1080p", - "AdaptiveStreaming", "AACGoodQualityAudio", "ContentAwareEncodingExperimental", - "ContentAwareEncoding", "CopyAllBitrateNonInterleaved", "H264MultipleBitrate1080p", - "H264MultipleBitrate720p", "H264MultipleBitrateSD", "H265ContentAwareEncoding", - "H265AdaptiveStreaming", "H265SingleBitrate720p", "H265SingleBitrate1080p", - "H265SingleBitrate4K". - :type preset_name: str or ~azure.mgmt.media.models.EncoderNamedPreset - """ - - _validation = { - 'odata_type': {'required': True}, - 'preset_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'preset_name': {'key': 'presetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(BuiltInStandardEncoderPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.BuiltInStandardEncoderPreset' # type: str - self.preset_name = kwargs['preset_name'] - - -class CbcsDrmConfiguration(msrest.serialization.Model): - """Class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy. - - :param fair_play: FairPlay configurations. - :type fair_play: ~azure.mgmt.media.models.StreamingPolicyFairPlayConfiguration - :param play_ready: PlayReady configurations. - :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration - :param widevine: Widevine configurations. - :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration - """ - - _attribute_map = { - 'fair_play': {'key': 'fairPlay', 'type': 'StreamingPolicyFairPlayConfiguration'}, - 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, - 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(CbcsDrmConfiguration, self).__init__(**kwargs) - self.fair_play = kwargs.get('fair_play', None) - self.play_ready = kwargs.get('play_ready', None) - self.widevine = kwargs.get('widevine', None) - - -class CencDrmConfiguration(msrest.serialization.Model): - """Class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy. - - :param play_ready: PlayReady configurations. - :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration - :param widevine: Widevine configurations. - :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration - """ - - _attribute_map = { - 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, - 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, - } - - def __init__( - self, - **kwargs - ): - super(CencDrmConfiguration, self).__init__(**kwargs) - self.play_ready = kwargs.get('play_ready', None) - self.widevine = kwargs.get('widevine', None) - - -class CheckNameAvailabilityInput(msrest.serialization.Model): - """The input to the check name availability request. - - :param name: The account name. - :type name: str - :param type: The account type. For a Media Services account, this should be 'MediaServices'. - :type type: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CheckNameAvailabilityInput, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - - -class CommonEncryptionCbcs(msrest.serialization.Model): - """Class for CommonEncryptionCbcs encryption scheme. - - :param enabled_protocols: Representing supported protocols. - :type enabled_protocols: ~azure.mgmt.media.models.EnabledProtocols - :param clear_tracks: Representing which tracks should not be encrypted. - :type clear_tracks: list[~azure.mgmt.media.models.TrackSelection] - :param content_keys: Representing default content key for each encryption scheme and separate - content keys for specific tracks. - :type content_keys: ~azure.mgmt.media.models.StreamingPolicyContentKeys - :param drm: Configuration of DRMs for current encryption scheme. - :type drm: ~azure.mgmt.media.models.CbcsDrmConfiguration - """ - - _attribute_map = { - 'enabled_protocols': {'key': 'enabledProtocols', 'type': 'EnabledProtocols'}, - 'clear_tracks': {'key': 'clearTracks', 'type': '[TrackSelection]'}, - 'content_keys': {'key': 'contentKeys', 'type': 'StreamingPolicyContentKeys'}, - 'drm': {'key': 'drm', 'type': 'CbcsDrmConfiguration'}, + 'enabled_protocols': {'key': 'enabledProtocols', 'type': 'EnabledProtocols'}, + 'clear_tracks': {'key': 'clearTracks', 'type': '[TrackSelection]'}, + 'content_keys': {'key': 'contentKeys', 'type': 'StreamingPolicyContentKeys'}, + 'drm': {'key': 'drm', 'type': 'CbcsDrmConfiguration'}, } def __init__( @@ -2202,64 +1675,6 @@ def __init__( self.raw_body = kwargs['raw_body'] -class CopyAudio(Codec): - """A codec flag, which tells the encoder to copy the input audio bitstream. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyAudio, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.CopyAudio' # type: str - - -class CopyVideo(Codec): - """A codec flag, which tells the encoder to copy the input video bitstream without re-encoding. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(CopyVideo, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.CopyVideo' # type: str - - class CrossSiteAccessPolicies(msrest.serialization.Model): """The client access policy. @@ -2306,31 +1721,6 @@ def __init__( self.policy_name = kwargs.get('policy_name', None) -class Deinterlace(msrest.serialization.Model): - """Describes the de-interlacing settings. - - :param parity: The field parity for de-interlacing, defaults to Auto. Possible values include: - "Auto", "TopFieldFirst", "BottomFieldFirst". - :type parity: str or ~azure.mgmt.media.models.DeinterlaceParity - :param mode: The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: - "Off", "AutoPixelAdaptive". - :type mode: str or ~azure.mgmt.media.models.DeinterlaceMode - """ - - _attribute_map = { - 'parity': {'key': 'parity', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Deinterlace, self).__init__(**kwargs) - self.parity = kwargs.get('parity', None) - self.mode = kwargs.get('mode', None) - - class EdgePolicies(msrest.serialization.Model): """EdgePolicies. @@ -2522,1889 +1912,252 @@ def __init__( self.custom_key_acquisition_url_template = kwargs.get('custom_key_acquisition_url_template', None) -class FaceDetectorPreset(Preset): - """Describes all the settings to be used when analyzing a video in order to detect (and optionally redact) all the faces present. +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param resolution: Specifies the maximum resolution at which your video is analyzed. The - default behavior is "SourceResolution," which will keep the input video at its original - resolution when analyzed. Using "StandardDefinition" will resize input videos to standard - definition while preserving the appropriate aspect ratio. It will only resize if the video is - of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before - processing. Switching to "StandardDefinition" will reduce the time it takes to process high - resolution video. It may also reduce the cost of using this component (see - https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). - However, faces that end up being too small in the resized video may not be detected. Possible - values include: "SourceResolution", "StandardDefinition". - :type resolution: str or ~azure.mgmt.media.models.AnalysisResolution - :param mode: This mode provides the ability to choose between the following settings: 1) - Analyze - For detection only.This mode generates a metadata JSON file marking appearances of - faces throughout the video.Where possible, appearances of the same person are assigned the same - ID. 2) Combined - Additionally redacts(blurs) detected faces. 3) Redact - This enables a 2-pass - process, allowing for selective redaction of a subset of detected faces.It takes in the - metadata file from a prior analyze pass, along with the source video, and a user-selected - subset of IDs that require redaction. Possible values include: "Analyze", "Redact", "Combined". - :type mode: str or ~azure.mgmt.media.models.FaceRedactorMode - :param blur_type: Blur type. Possible values include: "Box", "Low", "Med", "High", "Black". - :type blur_type: str or ~azure.mgmt.media.models.BlurType - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any """ _validation = { - 'odata_type': {'required': True}, + 'type': {'readonly': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'resolution': {'key': 'resolution', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'blur_type': {'key': 'blurType', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, **kwargs ): - super(FaceDetectorPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.FaceDetectorPreset' # type: str - self.resolution = kwargs.get('resolution', None) - self.mode = kwargs.get('mode', None) - self.blur_type = kwargs.get('blur_type', None) - self.experimental_options = kwargs.get('experimental_options', None) + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class Filters(msrest.serialization.Model): - """Describes all the filtering operations, such as de-interlacing, rotation etc. that are to be applied to the input media before encoding. +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. - :param deinterlace: The de-interlacing settings. - :type deinterlace: ~azure.mgmt.media.models.Deinterlace - :param rotation: The rotation, if any, to be applied to the input video, before it is encoded. - Default is Auto. Possible values include: "Auto", "None", "Rotate0", "Rotate90", "Rotate180", - "Rotate270". - :type rotation: str or ~azure.mgmt.media.models.Rotation - :param crop: The parameters for the rectangular window with which to crop the input video. - :type crop: ~azure.mgmt.media.models.Rectangle - :param overlays: The properties of overlays to be applied to the input video. These could be - audio, image or video overlays. - :type overlays: list[~azure.mgmt.media.models.Overlay] + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.media.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.media.models.ErrorAdditionalInfo] """ + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + _attribute_map = { - 'deinterlace': {'key': 'deinterlace', 'type': 'Deinterlace'}, - 'rotation': {'key': 'rotation', 'type': 'str'}, - 'crop': {'key': 'crop', 'type': 'Rectangle'}, - 'overlays': {'key': 'overlays', 'type': '[Overlay]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( self, **kwargs ): - super(Filters, self).__init__(**kwargs) - self.deinterlace = kwargs.get('deinterlace', None) - self.rotation = kwargs.get('rotation', None) - self.crop = kwargs.get('crop', None) - self.overlays = kwargs.get('overlays', None) - - -class FilterTrackPropertyCondition(msrest.serialization.Model): - """The class to specify one track property condition. - - All required parameters must be populated in order to send to Azure. - - :param property: Required. The track property type. Possible values include: "Unknown", "Type", - "Name", "Language", "FourCC", "Bitrate". - :type property: str or ~azure.mgmt.media.models.FilterTrackPropertyType - :param value: Required. The track property value. - :type value: str - :param operation: Required. The track property condition operation. Possible values include: - "Equal", "NotEqual". - :type operation: str or ~azure.mgmt.media.models.FilterTrackPropertyCompareOperation - """ - - _validation = { - 'property': {'required': True}, - 'value': {'required': True}, - 'operation': {'required': True}, - } - - _attribute_map = { - 'property': {'key': 'property', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterTrackPropertyCondition, self).__init__(**kwargs) - self.property = kwargs['property'] - self.value = kwargs['value'] - self.operation = kwargs['operation'] - - -class FilterTrackSelection(msrest.serialization.Model): - """Representing a list of FilterTrackPropertyConditions to select a track. The filters are combined using a logical AND operation. - - All required parameters must be populated in order to send to Azure. - - :param track_selections: Required. The track selections. - :type track_selections: list[~azure.mgmt.media.models.FilterTrackPropertyCondition] - """ - - _validation = { - 'track_selections': {'required': True}, - } - - _attribute_map = { - 'track_selections': {'key': 'trackSelections', 'type': '[FilterTrackPropertyCondition]'}, - } - - def __init__( - self, - **kwargs - ): - super(FilterTrackSelection, self).__init__(**kwargs) - self.track_selections = kwargs['track_selections'] - - -class FirstQuality(msrest.serialization.Model): - """Filter First Quality. - - All required parameters must be populated in order to send to Azure. - - :param bitrate: Required. The first quality bitrate. - :type bitrate: int - """ - - _validation = { - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(FirstQuality, self).__init__(**kwargs) - self.bitrate = kwargs['bitrate'] - - -class Format(msrest.serialization.Model): - """Base class for output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ImageFormat, MultiBitrateFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.ImageFormat': 'ImageFormat', '#Microsoft.Media.MultiBitrateFormat': 'MultiBitrateFormat'} - } - - def __init__( - self, - **kwargs - ): - super(Format, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.filename_pattern = kwargs['filename_pattern'] - - -class InputDefinition(msrest.serialization.Model): - """Base class for defining an input. Use sub classes of this class to specify tracks selections and related metadata. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FromAllInputFile, FromEachInputFile, InputFile. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.FromAllInputFile': 'FromAllInputFile', '#Microsoft.Media.FromEachInputFile': 'FromEachInputFile', '#Microsoft.Media.InputFile': 'InputFile'} - } - - def __init__( - self, - **kwargs - ): - super(InputDefinition, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.included_tracks = kwargs.get('included_tracks', None) - - -class FromAllInputFile(InputDefinition): - """An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - def __init__( - self, - **kwargs - ): - super(FromAllInputFile, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.FromAllInputFile' # type: str - - -class FromEachInputFile(InputDefinition): - """An InputDefinition that looks at each input file provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to select tracks from each file given. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - def __init__( - self, - **kwargs - ): - super(FromEachInputFile, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.FromEachInputFile' # type: str - - -class Layer(msrest.serialization.Model): - """The encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by specifying a layer for each desired resolution. A layer represents the properties for the video or image at a resolution. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H265VideoLayer, JpgLayer, PngLayer, VideoLayer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H265VideoLayer': 'H265VideoLayer', '#Microsoft.Media.JpgLayer': 'JpgLayer', '#Microsoft.Media.PngLayer': 'PngLayer', '#Microsoft.Media.VideoLayer': 'VideoLayer'} - } - - def __init__( - self, - **kwargs - ): - super(Layer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) - self.label = kwargs.get('label', None) - - -class VideoLayer(Layer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H264Layer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Whether or not adaptive B-frames are to be used when encoding this - layer. If not specified, the encoder will turn it on whenever the video profile permits its - use. - :type adaptive_b_frame: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H264Layer': 'H264Layer'} - } - - def __init__( - self, - **kwargs - ): - super(VideoLayer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.VideoLayer' # type: str - self.bitrate = kwargs['bitrate'] - self.max_bitrate = kwargs.get('max_bitrate', None) - self.b_frames = kwargs.get('b_frames', None) - self.frame_rate = kwargs.get('frame_rate', None) - self.slices = kwargs.get('slices', None) - self.adaptive_b_frame = kwargs.get('adaptive_b_frame', None) - - -class H264Layer(VideoLayer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer with the H.264 video codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Whether or not adaptive B-frames are to be used when encoding this - layer. If not specified, the encoder will turn it on whenever the video profile permits its - use. - :type adaptive_b_frame: bool - :param profile: We currently support Baseline, Main, High, High422, High444. Default is Auto. - Possible values include: "Auto", "Baseline", "Main", "High", "High422", "High444". - :type profile: str or ~azure.mgmt.media.models.H264VideoProfile - :param level: We currently support Level up to 6.2. The value can be Auto, or a number that - matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose - the Level that is appropriate for this layer. - :type level: str - :param buffer_window: The VBV buffer window length. The value should be in ISO 8601 format. The - value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - :type buffer_window: ~datetime.timedelta - :param reference_frames: The number of reference frames to be used when encoding this layer. If - not specified, the encoder determines an appropriate number based on the encoder complexity - setting. - :type reference_frames: int - :param entropy_mode: The entropy mode to be used for this layer. If not specified, the encoder - chooses the mode that is appropriate for the profile and level. Possible values include: - "Cabac", "Cavlc". - :type entropy_mode: str or ~azure.mgmt.media.models.EntropyMode - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - 'profile': {'key': 'profile', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'buffer_window': {'key': 'bufferWindow', 'type': 'duration'}, - 'reference_frames': {'key': 'referenceFrames', 'type': 'int'}, - 'entropy_mode': {'key': 'entropyMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(H264Layer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.H264Layer' # type: str - self.profile = kwargs.get('profile', None) - self.level = kwargs.get('level', None) - self.buffer_window = kwargs.get('buffer_window', None) - self.reference_frames = kwargs.get('reference_frames', None) - self.entropy_mode = kwargs.get('entropy_mode', None) - - -class Video(Codec): - """Describes the basic properties for encoding the input video. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H264Video, H265Video, Image. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H264Video': 'H264Video', '#Microsoft.Media.H265Video': 'H265Video', '#Microsoft.Media.Image': 'Image'} - } - - def __init__( - self, - **kwargs - ): - super(Video, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.Video' # type: str - self.key_frame_interval = kwargs.get('key_frame_interval', None) - self.stretch_mode = kwargs.get('stretch_mode', None) - self.sync_mode = kwargs.get('sync_mode', None) - - -class H264Video(Video): - """Describes all the properties for encoding a video with the H.264 codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param scene_change_detection: Whether or not the encoder should insert key frames at scene - changes. If not specified, the default is false. This flag should be set to true only when the - encoder is being configured to produce a single output video. - :type scene_change_detection: bool - :param complexity: Tells the encoder how to choose its encoding settings. The default value is - Balanced. Possible values include: "Speed", "Balanced", "Quality". - :type complexity: str or ~azure.mgmt.media.models.H264Complexity - :param layers: The collection of output H.264 layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.H264Layer] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'scene_change_detection': {'key': 'sceneChangeDetection', 'type': 'bool'}, - 'complexity': {'key': 'complexity', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[H264Layer]'}, - } - - def __init__( - self, - **kwargs - ): - super(H264Video, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.H264Video' # type: str - self.scene_change_detection = kwargs.get('scene_change_detection', None) - self.complexity = kwargs.get('complexity', None) - self.layers = kwargs.get('layers', None) - - -class H265VideoLayer(Layer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H265Layer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this - value should be 3000000 This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Specifies whether or not adaptive B-frames are to be used when - encoding this layer. If not specified, the encoder will turn it on whenever the video profile - permits its use. - :type adaptive_b_frame: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H265Layer': 'H265Layer'} - } - - def __init__( - self, - **kwargs - ): - super(H265VideoLayer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.H265VideoLayer' # type: str - self.bitrate = kwargs['bitrate'] - self.max_bitrate = kwargs.get('max_bitrate', None) - self.b_frames = kwargs.get('b_frames', None) - self.frame_rate = kwargs.get('frame_rate', None) - self.slices = kwargs.get('slices', None) - self.adaptive_b_frame = kwargs.get('adaptive_b_frame', None) - - -class H265Layer(H265VideoLayer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer with the H.265 video codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this - value should be 3000000 This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Specifies whether or not adaptive B-frames are to be used when - encoding this layer. If not specified, the encoder will turn it on whenever the video profile - permits its use. - :type adaptive_b_frame: bool - :param profile: We currently support Main. Default is Auto. Possible values include: "Auto", - "Main". - :type profile: str or ~azure.mgmt.media.models.H265VideoProfile - :param level: We currently support Level up to 6.2. The value can be Auto, or a number that - matches the H.265 profile. If not specified, the default is Auto, which lets the encoder choose - the Level that is appropriate for this layer. - :type level: str - :param buffer_window: The VBV buffer window length. The value should be in ISO 8601 format. The - value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - :type buffer_window: ~datetime.timedelta - :param reference_frames: The number of reference frames to be used when encoding this layer. If - not specified, the encoder determines an appropriate number based on the encoder complexity - setting. - :type reference_frames: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - 'profile': {'key': 'profile', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'buffer_window': {'key': 'bufferWindow', 'type': 'duration'}, - 'reference_frames': {'key': 'referenceFrames', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(H265Layer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.H265Layer' # type: str - self.profile = kwargs.get('profile', None) - self.level = kwargs.get('level', None) - self.buffer_window = kwargs.get('buffer_window', None) - self.reference_frames = kwargs.get('reference_frames', None) - - -class H265Video(Video): - """Describes all the properties for encoding a video with the H.265 codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param scene_change_detection: Specifies whether or not the encoder should insert key frames at - scene changes. If not specified, the default is false. This flag should be set to true only - when the encoder is being configured to produce a single output video. - :type scene_change_detection: bool - :param complexity: Tells the encoder how to choose its encoding settings. Quality will provide - for a higher compression ratio but at a higher cost and longer compute time. Speed will - produce a relatively larger file but is faster and more economical. The default value is - Balanced. Possible values include: "Speed", "Balanced", "Quality". - :type complexity: str or ~azure.mgmt.media.models.H265Complexity - :param layers: The collection of output H.265 layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.H265Layer] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'scene_change_detection': {'key': 'sceneChangeDetection', 'type': 'bool'}, - 'complexity': {'key': 'complexity', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[H265Layer]'}, - } - - def __init__( - self, - **kwargs - ): - super(H265Video, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.H265Video' # type: str - self.scene_change_detection = kwargs.get('scene_change_detection', None) - self.complexity = kwargs.get('complexity', None) - self.layers = kwargs.get('layers', None) - - -class Hls(msrest.serialization.Model): - """HTTP Live Streaming (HLS) packing setting for the live output. - - :param fragments_per_ts_segment: The number of fragments in an HTTP Live Streaming (HLS) TS - segment in the output of the live event. This value does not affect the packing ratio for HLS - CMAF output. - :type fragments_per_ts_segment: int - """ - - _attribute_map = { - 'fragments_per_ts_segment': {'key': 'fragmentsPerTsSegment', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(Hls, self).__init__(**kwargs) - self.fragments_per_ts_segment = kwargs.get('fragments_per_ts_segment', None) - - -class Image(Video): - """Describes the basic properties for generating thumbnails from the input video. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JpgImage, PngImage. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JpgImage': 'JpgImage', '#Microsoft.Media.PngImage': 'PngImage'} - } - - def __init__( - self, - **kwargs - ): - super(Image, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.Image' # type: str - self.start = kwargs['start'] - self.step = kwargs.get('step', None) - self.range = kwargs.get('range', None) - - -class ImageFormat(Format): - """Describes the properties for an output image file. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JpgFormat, PngFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JpgFormat': 'JpgFormat', '#Microsoft.Media.PngFormat': 'PngFormat'} - } - - def __init__( - self, - **kwargs - ): - super(ImageFormat, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.ImageFormat' # type: str - - -class InputFile(InputDefinition): - """An InputDefinition for a single file. TrackSelections are scoped to the file specified. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - :param filename: Name of the file that this input definition applies to. - :type filename: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - 'filename': {'key': 'filename', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(InputFile, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.InputFile' # type: str - self.filename = kwargs.get('filename', None) - - -class IPAccessControl(msrest.serialization.Model): - """The IP access control. - - :param allow: The IP allow list. - :type allow: list[~azure.mgmt.media.models.IPRange] - """ - - _attribute_map = { - 'allow': {'key': 'allow', 'type': '[IPRange]'}, - } - - def __init__( - self, - **kwargs - ): - super(IPAccessControl, self).__init__(**kwargs) - self.allow = kwargs.get('allow', None) - - -class IPRange(msrest.serialization.Model): - """The IP address range in the CIDR scheme. - - :param name: The friendly name for the IP address range. - :type name: str - :param address: The IP address. - :type address: str - :param subnet_prefix_length: The subnet mask prefix length (see CIDR notation). - :type subnet_prefix_length: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'subnet_prefix_length': {'key': 'subnetPrefixLength', 'type': 'int'}, - } - - def __init__( - self, - **kwargs - ): - super(IPRange, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.address = kwargs.get('address', None) - self.subnet_prefix_length = kwargs.get('subnet_prefix_length', None) - - -class Job(ProxyResource): - """A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using EventGrid. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.media.models.SystemData - :ivar created: The UTC date and time when the customer has created the Job, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype created: ~datetime.datetime - :ivar state: The current state of the job. Possible values include: "Canceled", "Canceling", - "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :param description: Optional customer supplied description of the Job. - :type description: str - :param input: The inputs for the Job. - :type input: ~azure.mgmt.media.models.JobInput - :ivar last_modified: The UTC date and time when the customer has last updated the Job, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype last_modified: ~datetime.datetime - :param outputs: The outputs for the Job. - :type outputs: list[~azure.mgmt.media.models.JobOutput] - :param priority: Priority with which the job should be processed. Higher priority jobs are - processed before lower priority jobs. If not set, the default is normal. Possible values - include: "Low", "Normal", "High". - :type priority: str or ~azure.mgmt.media.models.Priority - :param correlation_data: Customer provided key, value pairs that will be returned in Job and - JobOutput state events. - :type correlation_data: dict[str, str] - :ivar start_time: The UTC date and time at which this Job began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job finished processing. - :vartype end_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'created': {'readonly': True}, - 'state': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'input': {'key': 'properties.input', 'type': 'JobInput'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'outputs': {'key': 'properties.outputs', 'type': '[JobOutput]'}, - 'priority': {'key': 'properties.priority', 'type': 'str'}, - 'correlation_data': {'key': 'properties.correlationData', 'type': '{str}'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(Job, self).__init__(**kwargs) - self.system_data = None - self.created = None - self.state = None - self.description = kwargs.get('description', None) - self.input = kwargs.get('input', None) - self.last_modified = None - self.outputs = kwargs.get('outputs', None) - self.priority = kwargs.get('priority', None) - self.correlation_data = kwargs.get('correlation_data', None) - self.start_time = None - self.end_time = None - - -class JobCollection(msrest.serialization.Model): - """A collection of Job items. - - :param value: A collection of Job items. - :type value: list[~azure.mgmt.media.models.Job] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Job]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.odata_next_link = kwargs.get('odata_next_link', None) - - -class JobError(msrest.serialization.Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code describing the error. Possible values include: "ServiceError", - "ServiceTransientError", "DownloadNotAccessible", "DownloadTransientError", - "UploadNotAccessible", "UploadTransientError", "ConfigurationUnsupported", "ContentMalformed", - "ContentUnsupported". - :vartype code: str or ~azure.mgmt.media.models.JobErrorCode - :ivar message: A human-readable language-dependent representation of the error. - :vartype message: str - :ivar category: Helps with categorization of errors. Possible values include: "Service", - "Download", "Upload", "Configuration", "Content". - :vartype category: str or ~azure.mgmt.media.models.JobErrorCategory - :ivar retry: Indicates that it may be possible to retry the Job. If retry is unsuccessful, - please contact Azure support via Azure Portal. Possible values include: "DoNotRetry", - "MayRetry". - :vartype retry: str or ~azure.mgmt.media.models.JobRetry - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.mgmt.media.models.JobErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'category': {'readonly': True}, - 'retry': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'retry': {'key': 'retry', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[JobErrorDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobError, self).__init__(**kwargs) - self.code = None - self.message = None - self.category = None - self.retry = None - self.details = None - - -class JobErrorDetail(msrest.serialization.Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code describing the error detail. - :vartype code: str - :ivar message: A human-readable representation of the error. - :vartype message: str - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - - -class JobInput(msrest.serialization.Model): - """Base class for inputs to a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputClip, JobInputSequence, JobInputs. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobInputClip': 'JobInputClip', '#Microsoft.Media.JobInputSequence': 'JobInputSequence', '#Microsoft.Media.JobInputs': 'JobInputs'} - } - - def __init__( - self, - **kwargs - ): - super(JobInput, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class JobInputClip(JobInput): - """Represents input files for a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputAsset, JobInputHttp. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobInputAsset': 'JobInputAsset', '#Microsoft.Media.JobInputHttp': 'JobInputHttp'} - } - - def __init__( - self, - **kwargs - ): - super(JobInputClip, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputClip' # type: str - self.files = kwargs.get('files', None) - self.start = kwargs.get('start', None) - self.end = kwargs.get('end', None) - self.label = kwargs.get('label', None) - self.input_definitions = kwargs.get('input_definitions', None) - - -class JobInputAsset(JobInputClip): - """Represents an Asset for input into a Job. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - :param asset_name: Required. The name of the input Asset. - :type asset_name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'asset_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobInputAsset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputAsset' # type: str - self.asset_name = kwargs['asset_name'] - - -class JobInputHttp(JobInputClip): - """Represents HTTPS job input. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - :param base_uri: Base URI for HTTPS job input. It will be concatenated with provided file - names. If no base uri is given, then the provided file list is assumed to be fully qualified - uris. Maximum length of 4000 characters. - :type base_uri: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - 'base_uri': {'key': 'baseUri', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(JobInputHttp, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputHttp' # type: str - self.base_uri = kwargs.get('base_uri', None) - + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class JobInputs(JobInput): - """Describes a list of inputs to a Job. - All required parameters must be populated in order to send to Azure. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param inputs: List of inputs to a Job. - :type inputs: list[~azure.mgmt.media.models.JobInput] + :param error: The error object. + :type error: ~azure.mgmt.media.models.ErrorDetail """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[JobInput]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, **kwargs ): - super(JobInputs, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputs' # type: str - self.inputs = kwargs.get('inputs', None) + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) -class JobInputSequence(JobInput): - """A Sequence contains an ordered list of Clips where each clip is a JobInput. The Sequence will be treated as a single input. +class FilterTrackPropertyCondition(msrest.serialization.Model): + """The class to specify one track property condition. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param inputs: JobInputs that make up the timeline. - :type inputs: list[~azure.mgmt.media.models.JobInputClip] + :param property: Required. The track property type. Possible values include: "Unknown", "Type", + "Name", "Language", "FourCC", "Bitrate". + :type property: str or ~azure.mgmt.media.models.FilterTrackPropertyType + :param value: Required. The track property value. + :type value: str + :param operation: Required. The track property condition operation. Possible values include: + "Equal", "NotEqual". + :type operation: str or ~azure.mgmt.media.models.FilterTrackPropertyCompareOperation """ _validation = { - 'odata_type': {'required': True}, + 'property': {'required': True}, + 'value': {'required': True}, + 'operation': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[JobInputClip]'}, + 'property': {'key': 'property', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, } def __init__( self, **kwargs ): - super(JobInputSequence, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputSequence' # type: str - self.inputs = kwargs.get('inputs', None) - - -class JobOutput(msrest.serialization.Model): - """Describes all the properties of a JobOutput. + super(FilterTrackPropertyCondition, self).__init__(**kwargs) + self.property = kwargs['property'] + self.value = kwargs['value'] + self.operation = kwargs['operation'] - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobOutputAsset. - Variables are only populated by the server, and will be ignored when sending a request. +class FilterTrackSelection(msrest.serialization.Model): + """Representing a list of FilterTrackPropertyConditions to select a track. The filters are combined using a logical AND operation. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :ivar error: If the JobOutput is in the Error state, it contains the details of the error. - :vartype error: ~azure.mgmt.media.models.JobError - :ivar state: Describes the state of the JobOutput. Possible values include: "Canceled", - "Canceling", "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :ivar progress: If the JobOutput is in a Processing state, this contains the Job completion - percentage. The value is an estimate and not intended to be used to predict Job completion - times. To determine if the JobOutput is complete, use the State property. - :vartype progress: int - :param label: A label that is assigned to a JobOutput in order to help uniquely identify it. - This is useful when your Transform has more than one TransformOutput, whereby your Job has more - than one JobOutput. In such cases, when you submit the Job, you will add two or more - JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you - retrieve the Job, either through events or on a GET request, you can use the label to easily - identify the JobOutput. If a label is not provided, a default value of - '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in - the corresponding TransformOutput and the output index is the relative index of the this - JobOutput within the Job. Note that this index is the same as the relative index of the - corresponding TransformOutput within its Transform. - :type label: str - :ivar start_time: The UTC date and time at which this Job Output began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job Output finished processing. - :vartype end_time: ~datetime.datetime + :param track_selections: Required. The track selections. + :type track_selections: list[~azure.mgmt.media.models.FilterTrackPropertyCondition] """ _validation = { - 'odata_type': {'required': True}, - 'error': {'readonly': True}, - 'state': {'readonly': True}, - 'progress': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, + 'track_selections': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'JobError'}, - 'state': {'key': 'state', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'int'}, - 'label': {'key': 'label', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobOutputAsset': 'JobOutputAsset'} + 'track_selections': {'key': 'trackSelections', 'type': '[FilterTrackPropertyCondition]'}, } def __init__( self, **kwargs ): - super(JobOutput, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.error = None - self.state = None - self.progress = None - self.label = kwargs.get('label', None) - self.start_time = None - self.end_time = None - + super(FilterTrackSelection, self).__init__(**kwargs) + self.track_selections = kwargs['track_selections'] -class JobOutputAsset(JobOutput): - """Represents an Asset used as a JobOutput. - Variables are only populated by the server, and will be ignored when sending a request. +class FirstQuality(msrest.serialization.Model): + """Filter First Quality. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :ivar error: If the JobOutput is in the Error state, it contains the details of the error. - :vartype error: ~azure.mgmt.media.models.JobError - :ivar state: Describes the state of the JobOutput. Possible values include: "Canceled", - "Canceling", "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :ivar progress: If the JobOutput is in a Processing state, this contains the Job completion - percentage. The value is an estimate and not intended to be used to predict Job completion - times. To determine if the JobOutput is complete, use the State property. - :vartype progress: int - :param label: A label that is assigned to a JobOutput in order to help uniquely identify it. - This is useful when your Transform has more than one TransformOutput, whereby your Job has more - than one JobOutput. In such cases, when you submit the Job, you will add two or more - JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you - retrieve the Job, either through events or on a GET request, you can use the label to easily - identify the JobOutput. If a label is not provided, a default value of - '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in - the corresponding TransformOutput and the output index is the relative index of the this - JobOutput within the Job. Note that this index is the same as the relative index of the - corresponding TransformOutput within its Transform. - :type label: str - :ivar start_time: The UTC date and time at which this Job Output began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job Output finished processing. - :vartype end_time: ~datetime.datetime - :param asset_name: Required. The name of the output Asset. - :type asset_name: str + :param bitrate: Required. The first quality bitrate. + :type bitrate: int """ _validation = { - 'odata_type': {'required': True}, - 'error': {'readonly': True}, - 'state': {'readonly': True}, - 'progress': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'asset_name': {'required': True}, + 'bitrate': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'JobError'}, - 'state': {'key': 'state', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'int'}, - 'label': {'key': 'label', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, + 'bitrate': {'key': 'bitrate', 'type': 'int'}, } def __init__( self, **kwargs ): - super(JobOutputAsset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobOutputAsset' # type: str - self.asset_name = kwargs['asset_name'] - + super(FirstQuality, self).__init__(**kwargs) + self.bitrate = kwargs['bitrate'] -class JpgFormat(ImageFormat): - """Describes the settings for producing JPEG thumbnails. - All required parameters must be populated in order to send to Azure. +class Hls(msrest.serialization.Model): + """HTTP Live Streaming (HLS) packing setting for the live output. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str + :param fragments_per_ts_segment: The number of fragments in an HTTP Live Streaming (HLS) TS + segment in the output of the live event. This value does not affect the packing ratio for HLS + CMAF output. + :type fragments_per_ts_segment: int """ - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, + 'fragments_per_ts_segment': {'key': 'fragmentsPerTsSegment', 'type': 'int'}, } def __init__( self, **kwargs ): - super(JpgFormat, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JpgFormat' # type: str - + super(Hls, self).__init__(**kwargs) + self.fragments_per_ts_segment = kwargs.get('fragments_per_ts_segment', None) -class JpgImage(Image): - """Describes the properties for producing a series of JPEG images from the input video. - All required parameters must be populated in order to send to Azure. +class IPAccessControl(msrest.serialization.Model): + """The IP access control. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - :param layers: A collection of output JPEG image layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.JpgLayer] - :param sprite_column: Sets the number of columns used in thumbnail sprite image. The number of - rows are automatically calculated and a VTT file is generated with the coordinate mappings for - each thumbnail in the sprite. Note: this value should be a positive integer and a proper value - is recommended so that the output image resolution will not go beyond JPEG maximum pixel - resolution limit 65535x65535. - :type sprite_column: int + :param allow: The IP allow list. + :type allow: list[~azure.mgmt.media.models.IPRange] """ - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[JpgLayer]'}, - 'sprite_column': {'key': 'spriteColumn', 'type': 'int'}, + 'allow': {'key': 'allow', 'type': '[IPRange]'}, } def __init__( self, **kwargs ): - super(JpgImage, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JpgImage' # type: str - self.layers = kwargs.get('layers', None) - self.sprite_column = kwargs.get('sprite_column', None) - + super(IPAccessControl, self).__init__(**kwargs) + self.allow = kwargs.get('allow', None) -class JpgLayer(Layer): - """Describes the settings to produce a JPEG image from the input video. - All required parameters must be populated in order to send to Azure. +class IPRange(msrest.serialization.Model): + """The IP address range in the CIDR scheme. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param quality: The compression quality of the JPEG output. Range is from 0-100 and the default - is 70. - :type quality: int + :param name: The friendly name for the IP address range. + :type name: str + :param address: The IP address. + :type address: str + :param subnet_prefix_length: The subnet mask prefix length (see CIDR notation). + :type subnet_prefix_length: int """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'quality': {'key': 'quality', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'subnet_prefix_length': {'key': 'subnetPrefixLength', 'type': 'int'}, } def __init__( self, **kwargs ): - super(JpgLayer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JpgLayer' # type: str - self.quality = kwargs.get('quality', None) + super(IPRange, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.address = kwargs.get('address', None) + self.subnet_prefix_length = kwargs.get('subnet_prefix_length', None) class KeyDelivery(msrest.serialization.Model): @@ -4761,7 +2514,7 @@ class LiveEventEncoding(msrest.serialization.Model): Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the live event is created. Possible values include: "None", - "Standard", "Premium1080p". + "Standard", "Premium1080p", "PassthroughBasic", "PassthroughStandard". :type encoding_type: str or ~azure.mgmt.media.models.LiveEventEncodingType :param preset_name: The optional encoding preset name, used when encodingType is not None. This value is specified at creation time and cannot be updated. If the encodingType is set to @@ -5080,6 +2833,8 @@ class LiveOutput(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.media.models.SystemData :param description: The description of the live output. :type description: str :param asset_name: The asset that the live output will write to. @@ -5112,6 +2867,7 @@ class LiveOutput(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'created': {'readonly': True}, 'last_modified': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -5122,6 +2878,7 @@ class LiveOutput(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'asset_name': {'key': 'properties.assetName', 'type': 'str'}, 'archive_window_length': {'key': 'properties.archiveWindowLength', 'type': 'duration'}, @@ -5139,6 +2896,7 @@ def __init__( **kwargs ): super(LiveOutput, self).__init__(**kwargs) + self.system_data = None self.description = kwargs.get('description', None) self.asset_name = kwargs.get('asset_name', None) self.archive_window_length = kwargs.get('archive_window_length', None) @@ -5179,31 +2937,6 @@ def __init__( self.odata_next_link = kwargs.get('odata_next_link', None) -class Location(msrest.serialization.Model): - """Location. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Location, self).__init__(**kwargs) - self.name = kwargs['name'] - - class LogSpecification(msrest.serialization.Model): """A diagnostic log emitted by service. @@ -5272,6 +3005,9 @@ class MediaService(TrackedResource): :type encryption: ~azure.mgmt.media.models.AccountEncryption :param key_delivery: The Key Delivery properties for Media Services account. :type key_delivery: ~azure.mgmt.media.models.KeyDelivery + :param public_network_access: Whether or not public network access is allowed for resources + under the Media Services account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.media.models.PublicNetworkAccess """ _validation = { @@ -5296,6 +3032,7 @@ class MediaService(TrackedResource): 'storage_authentication': {'key': 'properties.storageAuthentication', 'type': 'str'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, 'key_delivery': {'key': 'properties.keyDelivery', 'type': 'KeyDelivery'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, } def __init__( @@ -5310,6 +3047,7 @@ def __init__( self.storage_authentication = kwargs.get('storage_authentication', None) self.encryption = kwargs.get('encryption', None) self.key_delivery = kwargs.get('key_delivery', None) + self.public_network_access = kwargs.get('public_network_access', None) class MediaServiceCollection(msrest.serialization.Model): @@ -5343,12 +3081,14 @@ class MediaServiceIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. The identity type. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.media.models.ManagedIdentityType + :param type: Required. The identity type. + :type type: str :ivar principal_id: The Principal ID of the identity. :vartype principal_id: str :ivar tenant_id: The Tenant ID of the identity. :vartype tenant_id: str + :param user_assigned_identities: The user assigned managed identities. + :type user_assigned_identities: dict[str, ~azure.mgmt.media.models.UserAssignedManagedIdentity] """ _validation = { @@ -5361,6 +3101,7 @@ class MediaServiceIdentity(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, } def __init__( @@ -5371,6 +3112,7 @@ def __init__( self.type = kwargs['type'] self.principal_id = None self.tenant_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) class MediaServiceUpdate(msrest.serialization.Model): @@ -5392,6 +3134,9 @@ class MediaServiceUpdate(msrest.serialization.Model): :type encryption: ~azure.mgmt.media.models.AccountEncryption :param key_delivery: The Key Delivery properties for Media Services account. :type key_delivery: ~azure.mgmt.media.models.KeyDelivery + :param public_network_access: Whether or not public network access is allowed for resources + under the Media Services account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.media.models.PublicNetworkAccess """ _validation = { @@ -5406,6 +3151,7 @@ class MediaServiceUpdate(msrest.serialization.Model): 'storage_authentication': {'key': 'properties.storageAuthentication', 'type': 'str'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, 'key_delivery': {'key': 'properties.keyDelivery', 'type': 'KeyDelivery'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, } def __init__( @@ -5420,6 +3166,7 @@ def __init__( self.storage_authentication = kwargs.get('storage_authentication', None) self.encryption = kwargs.get('encryption', None) self.key_delivery = kwargs.get('key_delivery', None) + self.public_network_access = kwargs.get('public_network_access', None) class MetricDimension(msrest.serialization.Model): @@ -5523,113 +3270,19 @@ def __init__( self, **kwargs ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.display_description = None - self.unit = None - self.aggregation_type = None - self.lock_aggregation_type = None - self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) - self.dimensions = None - self.enable_regional_mdm_account = None - self.source_mdm_account = None - self.source_mdm_namespace = None - self.supported_time_grain_types = None - - -class MultiBitrateFormat(Format): - """Describes the properties for producing a collection of GOP aligned multi-bitrate files. The default behavior is to produce one output file for each video layer which is muxed together with all the audios. The exact output files produced can be controlled by specifying the outputFiles collection. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mp4Format, TransportStreamFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.Mp4Format': 'Mp4Format', '#Microsoft.Media.TransportStreamFormat': 'TransportStreamFormat'} - } - - def __init__( - self, - **kwargs - ): - super(MultiBitrateFormat, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.MultiBitrateFormat' # type: str - self.output_files = kwargs.get('output_files', None) - - -class Mp4Format(MultiBitrateFormat): - """Describes the properties for an output ISO MP4 file. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - def __init__( - self, - **kwargs - ): - super(Mp4Format, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.Mp4Format' # type: str + super(MetricSpecification, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.display_description = None + self.unit = None + self.aggregation_type = None + self.lock_aggregation_type = None + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.dimensions = None + self.enable_regional_mdm_account = None + self.source_mdm_account = None + self.source_mdm_namespace = None + self.supported_time_grain_types = None class NoEncryption(msrest.serialization.Model): @@ -5651,37 +3304,6 @@ def __init__( self.enabled_protocols = kwargs.get('enabled_protocols', None) -class ODataError(msrest.serialization.Model): - """Information about an error. - - :param code: A language-independent error name. - :type code: str - :param message: The error message. - :type message: str - :param target: The target of the error (for example, the name of the property in error). - :type target: str - :param details: The error details. - :type details: list[~azure.mgmt.media.models.ODataError] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ODataError]'}, - } - - def __init__( - self, - **kwargs - ): - super(ODataError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - class Operation(msrest.serialization.Model): """An operation. @@ -5732,14 +3354,10 @@ class OperationCollection(msrest.serialization.Model): :param value: A collection of Operation items. :type value: list[~azure.mgmt.media.models.Operation] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[Operation]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, } def __init__( @@ -5748,7 +3366,6 @@ def __init__( ): super(OperationCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) - self.odata_next_link = kwargs.get('odata_next_link', None) class OperationDisplay(msrest.serialization.Model): @@ -5782,192 +3399,6 @@ def __init__( self.description = kwargs.get('description', None) -class OutputFile(msrest.serialization.Model): - """Represents an output file produced. - - All required parameters must be populated in order to send to Azure. - - :param labels: Required. The list of labels that describe how the encoder should multiplex - video and audio into an output file. For example, if the encoder is producing two video layers - with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells - the encoder to produce an output file with the video track represented by v1 and the audio - track represented by a1. - :type labels: list[str] - """ - - _validation = { - 'labels': {'required': True}, - } - - _attribute_map = { - 'labels': {'key': 'labels', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(OutputFile, self).__init__(**kwargs) - self.labels = kwargs['labels'] - - -class PngFormat(ImageFormat): - """Describes the settings for producing PNG thumbnails. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PngFormat, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.PngFormat' # type: str - - -class PngImage(Image): - """Describes the properties for producing a series of PNG images from the input video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - :param layers: A collection of output PNG image layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.PngLayer] - """ - - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[PngLayer]'}, - } - - def __init__( - self, - **kwargs - ): - super(PngImage, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.PngImage' # type: str - self.layers = kwargs.get('layers', None) - - -class PngLayer(Layer): - """Describes the settings to produce a PNG image from the input video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PngLayer, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.PngLayer' # type: str - - class PresentationTimeRange(msrest.serialization.Model): """The presentation time range, this is asset related and not recommended for Account Filter. @@ -6128,349 +3559,130 @@ class PrivateLinkResource(Resource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'group_id': {'readonly': True}, - 'required_members': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'group_id': {'key': 'properties.groupId', 'type': 'str'}, - 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, - 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResource, self).__init__(**kwargs) - self.group_id = None - self.required_members = None - self.required_zone_names = kwargs.get('required_zone_names', None) - - -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: Array of private link resources. - :type value: list[~azure.mgmt.media.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected". - :type status: str or ~azure.mgmt.media.models.PrivateEndpointServiceConnectionStatus - :param description: The reason for approval/rejection of the connection. - :type description: str - :param actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :type actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = kwargs.get('actions_required', None) - - -class Properties(msrest.serialization.Model): - """The service specification property. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar service_specification: The service specifications. - :vartype service_specification: ~azure.mgmt.media.models.ServiceSpecification - """ - - _validation = { - 'service_specification': {'readonly': True}, - } - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(Properties, self).__init__(**kwargs) - self.service_specification = None - - -class Provider(msrest.serialization.Model): - """A resource provider. - - All required parameters must be populated in order to send to Azure. - - :param provider_name: Required. The provider name. - :type provider_name: str - """ - - _validation = { - 'provider_name': {'required': True}, - } - - _attribute_map = { - 'provider_name': {'key': 'providerName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Provider, self).__init__(**kwargs) - self.provider_name = kwargs['provider_name'] - - -class Rectangle(msrest.serialization.Model): - """Describes the properties of a rectangular window applied to the input media before processing it. - - :param left: The number of pixels from the left-margin. This can be absolute pixel value (e.g - 100), or relative to the size of the video (For example, 50%). - :type left: str - :param top: The number of pixels from the top-margin. This can be absolute pixel value (e.g - 100), or relative to the size of the video (For example, 50%). - :type top: str - :param width: The width of the rectangular region in pixels. This can be absolute pixel value - (e.g 100), or relative to the size of the video (For example, 50%). - :type width: str - :param height: The height of the rectangular region in pixels. This can be absolute pixel value - (e.g 100), or relative to the size of the video (For example, 50%). - :type height: str - """ - - _attribute_map = { - 'left': {'key': 'left', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Rectangle, self).__init__(**kwargs) - self.left = kwargs.get('left', None) - self.top = kwargs.get('top', None) - self.width = kwargs.get('width', None) - self.height = kwargs.get('height', None) - - -class SelectAudioTrackByAttribute(AudioTrackDescriptor): - """Select audio tracks from the input by specifying an attribute and an attribute filter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - :param attribute: Required. The TrackAttribute to filter the tracks by. Possible values - include: "Bitrate", "Language". - :type attribute: str or ~azure.mgmt.media.models.TrackAttribute - :param filter: Required. The type of AttributeFilter to apply to the TrackAttribute in order to - select the tracks. Possible values include: "All", "Top", "Bottom", "ValueEquals". - :type filter: str or ~azure.mgmt.media.models.AttributeFilter - :param filter_value: The value to filter the tracks by. Only used when - AttributeFilter.ValueEquals is specified for the Filter property. - :type filter_value: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'attribute': {'required': True}, - 'filter': {'required': True}, + 'required_members': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - 'attribute': {'key': 'attribute', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'filter_value': {'key': 'filterValue', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(SelectAudioTrackByAttribute, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectAudioTrackByAttribute' # type: str - self.attribute = kwargs['attribute'] - self.filter = kwargs['filter'] - self.filter_value = kwargs.get('filter_value', None) - + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) -class SelectAudioTrackById(AudioTrackDescriptor): - """Select audio tracks from the input by specifying a track identifier. - All required parameters must be populated in order to send to Azure. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - :param track_id: Required. Track identifier to select. - :type track_id: long + :param value: Array of private link resources. + :type value: list[~azure.mgmt.media.models.PrivateLinkResource] """ - _validation = { - 'odata_type': {'required': True}, - 'track_id': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - 'track_id': {'key': 'trackId', 'type': 'long'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, } def __init__( self, **kwargs ): - super(SelectAudioTrackById, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectAudioTrackById' # type: str - self.track_id = kwargs['track_id'] - - -class VideoTrackDescriptor(TrackDescriptor): - """A TrackSelection to select video tracks. + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SelectVideoTrackByAttribute, SelectVideoTrackById. - All required parameters must be populated in order to send to Azure. +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.media.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.SelectVideoTrackByAttribute': 'SelectVideoTrackByAttribute', '#Microsoft.Media.SelectVideoTrackById': 'SelectVideoTrackById'} + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VideoTrackDescriptor, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.VideoTrackDescriptor' # type: str + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) -class SelectVideoTrackByAttribute(VideoTrackDescriptor): - """Select video tracks from the input by specifying an attribute and an attribute filter. +class Properties(msrest.serialization.Model): + """The service specification property. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param attribute: Required. The TrackAttribute to filter the tracks by. Possible values - include: "Bitrate", "Language". - :type attribute: str or ~azure.mgmt.media.models.TrackAttribute - :param filter: Required. The type of AttributeFilter to apply to the TrackAttribute in order to - select the tracks. Possible values include: "All", "Top", "Bottom", "ValueEquals". - :type filter: str or ~azure.mgmt.media.models.AttributeFilter - :param filter_value: The value to filter the tracks by. Only used when - AttributeFilter.ValueEquals is specified for the Filter property. For TrackAttribute.Bitrate, - this should be an integer value in bits per second (e.g: '1500000'). The - TrackAttribute.Language is not supported for video tracks. - :type filter_value: str + :ivar service_specification: The service specifications. + :vartype service_specification: ~azure.mgmt.media.models.ServiceSpecification """ _validation = { - 'odata_type': {'required': True}, - 'attribute': {'required': True}, - 'filter': {'required': True}, + 'service_specification': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'attribute': {'key': 'attribute', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'filter_value': {'key': 'filterValue', 'type': 'str'}, + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, **kwargs ): - super(SelectVideoTrackByAttribute, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectVideoTrackByAttribute' # type: str - self.attribute = kwargs['attribute'] - self.filter = kwargs['filter'] - self.filter_value = kwargs.get('filter_value', None) + super(Properties, self).__init__(**kwargs) + self.service_specification = None -class SelectVideoTrackById(VideoTrackDescriptor): - """Select video tracks from the input by specifying a track identifier. +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param track_id: Required. Track identifier to select. - :type track_id: long + :param user_assigned_identity: The user assigned managed identity's ARM ID to use when + accessing a resource. + :type user_assigned_identity: str + :param use_system_assigned_identity: Required. Indicates whether to use System Assigned Managed + Identity. Mutual exclusive with User Assigned Managed Identity. + :type use_system_assigned_identity: bool """ _validation = { - 'odata_type': {'required': True}, - 'track_id': {'required': True}, + 'use_system_assigned_identity': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'track_id': {'key': 'trackId', 'type': 'long'}, + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'use_system_assigned_identity': {'key': 'useSystemAssignedIdentity', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(SelectVideoTrackById, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectVideoTrackById' # type: str - self.track_id = kwargs['track_id'] + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = kwargs.get('user_assigned_identity', None) + self.use_system_assigned_identity = kwargs['use_system_assigned_identity'] class ServiceSpecification(msrest.serialization.Model): @@ -6503,49 +3715,11 @@ def __init__( self.metric_specifications = None -class StandardEncoderPreset(Preset): - """Describes all the settings to be used when encoding the input video with the Standard Encoder. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filters: One or more filtering operations that are applied to the input media before - encoding. - :type filters: ~azure.mgmt.media.models.Filters - :param codecs: Required. The list of codecs to be used when encoding the input video. - :type codecs: list[~azure.mgmt.media.models.Codec] - :param formats: Required. The list of outputs to be produced by the encoder. - :type formats: list[~azure.mgmt.media.models.Format] - """ - - _validation = { - 'odata_type': {'required': True}, - 'codecs': {'required': True}, - 'formats': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': 'Filters'}, - 'codecs': {'key': 'codecs', 'type': '[Codec]'}, - 'formats': {'key': 'formats', 'type': '[Format]'}, - } - - def __init__( - self, - **kwargs - ): - super(StandardEncoderPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.StandardEncoderPreset' # type: str - self.filters = kwargs.get('filters', None) - self.codecs = kwargs['codecs'] - self.formats = kwargs['formats'] - - class StorageAccount(msrest.serialization.Model): """The storage account details. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. :param id: The ID of the storage account resource. Media Services relies on tables and queues @@ -6556,15 +3730,22 @@ class StorageAccount(msrest.serialization.Model): :param type: Required. The type of the storage account. Possible values include: "Primary", "Secondary". :type type: str or ~azure.mgmt.media.models.StorageAccountType + :param identity: The storage account identity. + :type identity: ~azure.mgmt.media.models.ResourceIdentity + :ivar status: The current status of the storage account mapping. + :vartype status: str """ _validation = { 'type': {'required': True}, + 'status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -6574,6 +3755,8 @@ def __init__( super(StorageAccount, self).__init__(**kwargs) self.id = kwargs.get('id', None) self.type = kwargs['type'] + self.identity = kwargs.get('identity', None) + self.status = None class StorageEncryptedAssetDecryptionData(msrest.serialization.Model): @@ -7328,327 +4511,31 @@ def __init__( self.track_selections = kwargs.get('track_selections', None) -class Transform(ProxyResource): - """A Transform encapsulates the rules or instructions for generating desired outputs from input media, such as by transcoding or by extracting insights. After the Transform is created, it can be applied to input media by creating Jobs. +class UserAssignedManagedIdentity(msrest.serialization.Model): + """UserAssignedManagedIdentity. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.media.models.SystemData - :ivar created: The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' - format. - :vartype created: ~datetime.datetime - :param description: An optional verbose description of the Transform. - :type description: str - :ivar last_modified: The UTC date and time when the Transform was last updated, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype last_modified: ~datetime.datetime - :param outputs: An array of one or more TransformOutputs that the Transform should generate. - :type outputs: list[~azure.mgmt.media.models.TransformOutput] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'outputs': {'key': 'properties.outputs', 'type': '[TransformOutput]'}, - } - - def __init__( - self, - **kwargs - ): - super(Transform, self).__init__(**kwargs) - self.system_data = None - self.created = None - self.description = kwargs.get('description', None) - self.last_modified = None - self.outputs = kwargs.get('outputs', None) - - -class TransformCollection(msrest.serialization.Model): - """A collection of Transform items. - - :param value: A collection of Transform items. - :type value: list[~azure.mgmt.media.models.Transform] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Transform]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransformCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.odata_next_link = kwargs.get('odata_next_link', None) - - -class TransformOutput(msrest.serialization.Model): - """Describes the properties of a TransformOutput, which are the rules to be applied while generating the desired output. - - All required parameters must be populated in order to send to Azure. - - :param on_error: A Transform can define more than one outputs. This property defines what the - service should do when one output fails - either continue to produce other outputs, or, stop - the other outputs. The overall Job state will not reflect failures of outputs that are - specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: - "StopProcessingJob", "ContinueJob". - :type on_error: str or ~azure.mgmt.media.models.OnErrorType - :param relative_priority: Sets the relative priority of the TransformOutputs within a - Transform. This sets the priority that the service uses for processing TransformOutputs. The - default priority is Normal. Possible values include: "Low", "Normal", "High". - :type relative_priority: str or ~azure.mgmt.media.models.Priority - :param preset: Required. Preset that describes the operations that will be used to modify, - transcode, or extract insights from the source file to generate the output. - :type preset: ~azure.mgmt.media.models.Preset - """ - - _validation = { - 'preset': {'required': True}, - } - - _attribute_map = { - 'on_error': {'key': 'onError', 'type': 'str'}, - 'relative_priority': {'key': 'relativePriority', 'type': 'str'}, - 'preset': {'key': 'preset', 'type': 'Preset'}, - } - - def __init__( - self, - **kwargs - ): - super(TransformOutput, self).__init__(**kwargs) - self.on_error = kwargs.get('on_error', None) - self.relative_priority = kwargs.get('relative_priority', None) - self.preset = kwargs['preset'] - - -class TransportStreamFormat(MultiBitrateFormat): - """Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC 13818-1) output video file(s). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransportStreamFormat, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.TransportStreamFormat' # type: str - - -class UtcClipTime(ClipTime): - """Specifies the clip time as a Utc time position in the media file. The Utc time can point to a different position depending on whether the media file starts from a timestamp of zero or not. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param time: Required. The time position on the timeline of the input media based on Utc time. - :type time: ~datetime.datetime - """ - - _validation = { - 'odata_type': {'required': True}, - 'time': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(UtcClipTime, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.UtcClipTime' # type: str - self.time = kwargs['time'] - - -class VideoAnalyzerPreset(AudioAnalyzerPreset): - """A video analyzer preset that extracts insights (rich metadata) from both audio and video, and outputs a JSON format file. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param audio_language: The language for the audio payload in the input using the BCP-47 format - of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is - recommended that you specify it. The language must be specified explicitly for - AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If - the language isn't specified or set to null, automatic language detection will choose the first - language detected and process with the selected language for the duration of the file. It does - not currently support dynamically switching between languages after the first language is - detected. The automatic detection works best with audio recordings with clearly discernable - speech. If automatic detection fails to find the language, transcription would fallback to - 'en-US'." The list of supported languages is available here: - https://go.microsoft.com/fwlink/?linkid=2109463. - :type audio_language: str - :param mode: Determines the set of audio analysis operations to be performed. If unspecified, - the Standard AudioAnalysisMode would be chosen. Possible values include: "Standard", "Basic". - :type mode: str or ~azure.mgmt.media.models.AudioAnalysisMode - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] - :param insights_to_extract: Defines the type of insights that you want the service to generate. - The allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default - is AllInsights. If you set this to AllInsights and the input is audio only, then only audio - insights are generated. Similarly if the input is video only, then only video insights are - generated. It is recommended that you not use AudioInsightsOnly if you expect some of your - inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to be audio - only. Your Jobs in such conditions would error out. Possible values include: - "AudioInsightsOnly", "VideoInsightsOnly", "AllInsights". - :type insights_to_extract: str or ~azure.mgmt.media.models.InsightsType - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'audio_language': {'key': 'audioLanguage', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, - 'insights_to_extract': {'key': 'insightsToExtract', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(VideoAnalyzerPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.VideoAnalyzerPreset' # type: str - self.insights_to_extract = kwargs.get('insights_to_extract', None) - - -class VideoOverlay(Overlay): - """Describes the properties of a video overlay. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float - :param position: The location in the input video where the overlay is applied. - :type position: ~azure.mgmt.media.models.Rectangle - :param opacity: The opacity of the overlay. This is a value in the range [0 - 1.0]. Default is - 1.0 which mean the overlay is opaque. - :type opacity: float - :param crop_rectangle: An optional rectangular window used to crop the overlay image or video. - :type crop_rectangle: ~azure.mgmt.media.models.Rectangle + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str """ _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - 'position': {'key': 'position', 'type': 'Rectangle'}, - 'opacity': {'key': 'opacity', 'type': 'float'}, - 'crop_rectangle': {'key': 'cropRectangle', 'type': 'Rectangle'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VideoOverlay, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.VideoOverlay' # type: str - self.position = kwargs.get('position', None) - self.opacity = kwargs.get('opacity', None) - self.crop_rectangle = kwargs.get('crop_rectangle', None) + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models_py3.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models_py3.py index 90f65b7358a3..21ed20504a36 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models_py3.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/models/_models_py3.py @@ -15,212 +15,6 @@ from ._azure_media_services_enums import * -class Codec(msrest.serialization.Model): - """Describes the basic properties of all codecs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Audio, CopyAudio, CopyVideo, Video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.Audio': 'Audio', '#Microsoft.Media.CopyAudio': 'CopyAudio', '#Microsoft.Media.CopyVideo': 'CopyVideo', '#Microsoft.Media.Video': 'Video'} - } - - def __init__( - self, - *, - label: Optional[str] = None, - **kwargs - ): - super(Codec, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.label = label - - -class Audio(Codec): - """Defines the common properties for all audio codecs. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AacAudio. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param channels: The number of channels in the audio. - :type channels: int - :param sampling_rate: The sampling rate to use for encoding in hertz. - :type sampling_rate: int - :param bitrate: The bitrate, in bits per second, of the output encoded audio. - :type bitrate: int - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'channels': {'key': 'channels', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AacAudio': 'AacAudio'} - } - - def __init__( - self, - *, - label: Optional[str] = None, - channels: Optional[int] = None, - sampling_rate: Optional[int] = None, - bitrate: Optional[int] = None, - **kwargs - ): - super(Audio, self).__init__(label=label, **kwargs) - self.odata_type = '#Microsoft.Media.Audio' # type: str - self.channels = channels - self.sampling_rate = sampling_rate - self.bitrate = bitrate - - -class AacAudio(Audio): - """Describes Advanced Audio Codec (AAC) audio encoding settings. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param channels: The number of channels in the audio. - :type channels: int - :param sampling_rate: The sampling rate to use for encoding in hertz. - :type sampling_rate: int - :param bitrate: The bitrate, in bits per second, of the output encoded audio. - :type bitrate: int - :param profile: The encoding profile to be used when encoding audio with AAC. Possible values - include: "AacLc", "HeAacV1", "HeAacV2". - :type profile: str or ~azure.mgmt.media.models.AacAudioProfile - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'channels': {'key': 'channels', 'type': 'int'}, - 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'profile': {'key': 'profile', 'type': 'str'}, - } - - def __init__( - self, - *, - label: Optional[str] = None, - channels: Optional[int] = None, - sampling_rate: Optional[int] = None, - bitrate: Optional[int] = None, - profile: Optional[Union[str, "AacAudioProfile"]] = None, - **kwargs - ): - super(AacAudio, self).__init__(label=label, channels=channels, sampling_rate=sampling_rate, bitrate=bitrate, **kwargs) - self.odata_type = '#Microsoft.Media.AacAudio' # type: str - self.profile = profile - - -class ClipTime(msrest.serialization.Model): - """Base class for specifying a clip time. Use sub classes of this class to specify the time position in the media. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AbsoluteClipTime, UtcClipTime. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AbsoluteClipTime': 'AbsoluteClipTime', '#Microsoft.Media.UtcClipTime': 'UtcClipTime'} - } - - def __init__( - self, - **kwargs - ): - super(ClipTime, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AbsoluteClipTime(ClipTime): - """Specifies the clip time as an absolute time position in the media file. The absolute time can point to a different position depending on whether the media file starts from a timestamp of zero or not. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param time: Required. The time position on the timeline of the input media. It is usually - specified as an ISO8601 period. e.g PT30S for 30 seconds. - :type time: ~datetime.timedelta - """ - - _validation = { - 'odata_type': {'required': True}, - 'time': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'duration'}, - } - - def __init__( - self, - *, - time: datetime.timedelta, - **kwargs - ): - super(AbsoluteClipTime, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AbsoluteClipTime' # type: str - self.time = time - - class AccessControl(msrest.serialization.Model): """AccessControl. @@ -252,6 +46,8 @@ def __init__( class AccountEncryption(msrest.serialization.Model): """AccountEncryption. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. :param type: Required. The type of key used to encrypt the Account Key. Possible values @@ -259,15 +55,22 @@ class AccountEncryption(msrest.serialization.Model): :type type: str or ~azure.mgmt.media.models.AccountEncryptionKeyType :param key_vault_properties: The properties of the key used to encrypt the account. :type key_vault_properties: ~azure.mgmt.media.models.KeyVaultProperties + :param identity: The Key Vault identity. + :type identity: ~azure.mgmt.media.models.ResourceIdentity + :ivar status: The current status of the Key Vault mapping. + :vartype status: str """ _validation = { 'type': {'required': True}, + 'status': {'readonly': True}, } _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -275,11 +78,14 @@ def __init__( *, type: Union[str, "AccountEncryptionKeyType"], key_vault_properties: Optional["KeyVaultProperties"] = None, + identity: Optional["ResourceIdentity"] = None, **kwargs ): super(AccountEncryption, self).__init__(**kwargs) self.type = type self.key_vault_properties = key_vault_properties + self.identity = identity + self.status = None class Resource(msrest.serialization.Model): @@ -488,27 +294,6 @@ def __init__( self.expiration = expiration -class ApiError(msrest.serialization.Model): - """The API error. - - :param error: The error properties. - :type error: ~azure.mgmt.media.models.ODataError - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ODataError'}, - } - - def __init__( - self, - *, - error: Optional["ODataError"] = None, - **kwargs - ): - super(ApiError, self).__init__(**kwargs) - self.error = error - - class Asset(ProxyResource): """An Asset. @@ -819,441 +604,91 @@ def __init__( self.default_content_key_policy_name = None -class Preset(msrest.serialization.Model): - """Base type for all Presets, which define the recipe or instructions on how the input media files should be processed. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioAnalyzerPreset, BuiltInStandardEncoderPreset, FaceDetectorPreset, StandardEncoderPreset. - - All required parameters must be populated in order to send to Azure. +class CbcsDrmConfiguration(msrest.serialization.Model): + """Class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str + :param fair_play: FairPlay configurations. + :type fair_play: ~azure.mgmt.media.models.StreamingPolicyFairPlayConfiguration + :param play_ready: PlayReady configurations. + :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration + :param widevine: Widevine configurations. + :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioAnalyzerPreset': 'AudioAnalyzerPreset', '#Microsoft.Media.BuiltInStandardEncoderPreset': 'BuiltInStandardEncoderPreset', '#Microsoft.Media.FaceDetectorPreset': 'FaceDetectorPreset', '#Microsoft.Media.StandardEncoderPreset': 'StandardEncoderPreset'} + 'fair_play': {'key': 'fairPlay', 'type': 'StreamingPolicyFairPlayConfiguration'}, + 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, + 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, } def __init__( self, + *, + fair_play: Optional["StreamingPolicyFairPlayConfiguration"] = None, + play_ready: Optional["StreamingPolicyPlayReadyConfiguration"] = None, + widevine: Optional["StreamingPolicyWidevineConfiguration"] = None, **kwargs ): - super(Preset, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AudioAnalyzerPreset(Preset): - """The Audio Analyzer preset applies a pre-defined set of AI-based analysis operations, including speech transcription. Currently, the preset supports processing of content with a single audio track. + super(CbcsDrmConfiguration, self).__init__(**kwargs) + self.fair_play = fair_play + self.play_ready = play_ready + self.widevine = widevine - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: VideoAnalyzerPreset. - All required parameters must be populated in order to send to Azure. +class CencDrmConfiguration(msrest.serialization.Model): + """Class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param audio_language: The language for the audio payload in the input using the BCP-47 format - of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is - recommended that you specify it. The language must be specified explicitly for - AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If - the language isn't specified or set to null, automatic language detection will choose the first - language detected and process with the selected language for the duration of the file. It does - not currently support dynamically switching between languages after the first language is - detected. The automatic detection works best with audio recordings with clearly discernable - speech. If automatic detection fails to find the language, transcription would fallback to - 'en-US'." The list of supported languages is available here: - https://go.microsoft.com/fwlink/?linkid=2109463. - :type audio_language: str - :param mode: Determines the set of audio analysis operations to be performed. If unspecified, - the Standard AudioAnalysisMode would be chosen. Possible values include: "Standard", "Basic". - :type mode: str or ~azure.mgmt.media.models.AudioAnalysisMode - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] + :param play_ready: PlayReady configurations. + :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration + :param widevine: Widevine configurations. + :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'audio_language': {'key': 'audioLanguage', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.VideoAnalyzerPreset': 'VideoAnalyzerPreset'} + 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, + 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, } def __init__( self, *, - audio_language: Optional[str] = None, - mode: Optional[Union[str, "AudioAnalysisMode"]] = None, - experimental_options: Optional[Dict[str, str]] = None, + play_ready: Optional["StreamingPolicyPlayReadyConfiguration"] = None, + widevine: Optional["StreamingPolicyWidevineConfiguration"] = None, **kwargs ): - super(AudioAnalyzerPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AudioAnalyzerPreset' # type: str - self.audio_language = audio_language - self.mode = mode - self.experimental_options = experimental_options - - -class Overlay(msrest.serialization.Model): - """Base type for all overlays - image, audio or video. + super(CencDrmConfiguration, self).__init__(**kwargs) + self.play_ready = play_ready + self.widevine = widevine - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioOverlay, VideoOverlay. - All required parameters must be populated in order to send to Azure. +class CheckNameAvailabilityInput(msrest.serialization.Model): + """The input to the check name availability request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float + :param name: The account name. + :type name: str + :param type: The account type. For a Media Services account, this should be 'MediaServices'. + :type type: str """ - _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioOverlay': 'AudioOverlay', '#Microsoft.Media.VideoOverlay': 'VideoOverlay'} + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, *, - input_label: str, - start: Optional[datetime.timedelta] = None, - end: Optional[datetime.timedelta] = None, - fade_in_duration: Optional[datetime.timedelta] = None, - fade_out_duration: Optional[datetime.timedelta] = None, - audio_gain_level: Optional[float] = None, + name: Optional[str] = None, + type: Optional[str] = None, **kwargs ): - super(Overlay, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.input_label = input_label - self.start = start - self.end = end - self.fade_in_duration = fade_in_duration - self.fade_out_duration = fade_out_duration - self.audio_gain_level = audio_gain_level - - -class AudioOverlay(Overlay): - """Describes the properties of an audio overlay. + super(CheckNameAvailabilityInput, self).__init__(**kwargs) + self.name = name + self.type = type - All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float - """ - - _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - } - - def __init__( - self, - *, - input_label: str, - start: Optional[datetime.timedelta] = None, - end: Optional[datetime.timedelta] = None, - fade_in_duration: Optional[datetime.timedelta] = None, - fade_out_duration: Optional[datetime.timedelta] = None, - audio_gain_level: Optional[float] = None, - **kwargs - ): - super(AudioOverlay, self).__init__(input_label=input_label, start=start, end=end, fade_in_duration=fade_in_duration, fade_out_duration=fade_out_duration, audio_gain_level=audio_gain_level, **kwargs) - self.odata_type = '#Microsoft.Media.AudioOverlay' # type: str - - -class TrackDescriptor(msrest.serialization.Model): - """Base type for all TrackDescriptor types, which define the metadata and selection for tracks that should be processed by a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AudioTrackDescriptor, VideoTrackDescriptor. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.AudioTrackDescriptor': 'AudioTrackDescriptor', '#Microsoft.Media.VideoTrackDescriptor': 'VideoTrackDescriptor'} - } - - def __init__( - self, - **kwargs - ): - super(TrackDescriptor, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class AudioTrackDescriptor(TrackDescriptor): - """A TrackSelection to select audio tracks. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SelectAudioTrackByAttribute, SelectAudioTrackById. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.SelectAudioTrackByAttribute': 'SelectAudioTrackByAttribute', '#Microsoft.Media.SelectAudioTrackById': 'SelectAudioTrackById'} - } - - def __init__( - self, - *, - channel_mapping: Optional[Union[str, "ChannelMapping"]] = None, - **kwargs - ): - super(AudioTrackDescriptor, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.AudioTrackDescriptor' # type: str - self.channel_mapping = channel_mapping - - -class BuiltInStandardEncoderPreset(Preset): - """Describes a built-in preset for encoding the input video with the Standard Encoder. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param preset_name: Required. The built-in preset to be used for encoding videos. Possible - values include: "H264SingleBitrateSD", "H264SingleBitrate720p", "H264SingleBitrate1080p", - "AdaptiveStreaming", "AACGoodQualityAudio", "ContentAwareEncodingExperimental", - "ContentAwareEncoding", "CopyAllBitrateNonInterleaved", "H264MultipleBitrate1080p", - "H264MultipleBitrate720p", "H264MultipleBitrateSD", "H265ContentAwareEncoding", - "H265AdaptiveStreaming", "H265SingleBitrate720p", "H265SingleBitrate1080p", - "H265SingleBitrate4K". - :type preset_name: str or ~azure.mgmt.media.models.EncoderNamedPreset - """ - - _validation = { - 'odata_type': {'required': True}, - 'preset_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'preset_name': {'key': 'presetName', 'type': 'str'}, - } - - def __init__( - self, - *, - preset_name: Union[str, "EncoderNamedPreset"], - **kwargs - ): - super(BuiltInStandardEncoderPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.BuiltInStandardEncoderPreset' # type: str - self.preset_name = preset_name - - -class CbcsDrmConfiguration(msrest.serialization.Model): - """Class to specify DRM configurations of CommonEncryptionCbcs scheme in Streaming Policy. - - :param fair_play: FairPlay configurations. - :type fair_play: ~azure.mgmt.media.models.StreamingPolicyFairPlayConfiguration - :param play_ready: PlayReady configurations. - :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration - :param widevine: Widevine configurations. - :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration - """ - - _attribute_map = { - 'fair_play': {'key': 'fairPlay', 'type': 'StreamingPolicyFairPlayConfiguration'}, - 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, - 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, - } - - def __init__( - self, - *, - fair_play: Optional["StreamingPolicyFairPlayConfiguration"] = None, - play_ready: Optional["StreamingPolicyPlayReadyConfiguration"] = None, - widevine: Optional["StreamingPolicyWidevineConfiguration"] = None, - **kwargs - ): - super(CbcsDrmConfiguration, self).__init__(**kwargs) - self.fair_play = fair_play - self.play_ready = play_ready - self.widevine = widevine - - -class CencDrmConfiguration(msrest.serialization.Model): - """Class to specify DRM configurations of CommonEncryptionCenc scheme in Streaming Policy. - - :param play_ready: PlayReady configurations. - :type play_ready: ~azure.mgmt.media.models.StreamingPolicyPlayReadyConfiguration - :param widevine: Widevine configurations. - :type widevine: ~azure.mgmt.media.models.StreamingPolicyWidevineConfiguration - """ - - _attribute_map = { - 'play_ready': {'key': 'playReady', 'type': 'StreamingPolicyPlayReadyConfiguration'}, - 'widevine': {'key': 'widevine', 'type': 'StreamingPolicyWidevineConfiguration'}, - } - - def __init__( - self, - *, - play_ready: Optional["StreamingPolicyPlayReadyConfiguration"] = None, - widevine: Optional["StreamingPolicyWidevineConfiguration"] = None, - **kwargs - ): - super(CencDrmConfiguration, self).__init__(**kwargs) - self.play_ready = play_ready - self.widevine = widevine - - -class CheckNameAvailabilityInput(msrest.serialization.Model): - """The input to the check name availability request. - - :param name: The account name. - :type name: str - :param type: The account type. For a Media Services account, this should be 'MediaServices'. - :type type: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - **kwargs - ): - super(CheckNameAvailabilityInput, self).__init__(**kwargs) - self.name = name - self.type = type - - -class CommonEncryptionCbcs(msrest.serialization.Model): - """Class for CommonEncryptionCbcs encryption scheme. +class CommonEncryptionCbcs(msrest.serialization.Model): + """Class for CommonEncryptionCbcs encryption scheme. :param enabled_protocols: Representing supported protocols. :type enabled_protocols: ~azure.mgmt.media.models.EnabledProtocols @@ -2382,68 +1817,6 @@ def __init__( self.raw_body = raw_body -class CopyAudio(Codec): - """A codec flag, which tells the encoder to copy the input audio bitstream. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - *, - label: Optional[str] = None, - **kwargs - ): - super(CopyAudio, self).__init__(label=label, **kwargs) - self.odata_type = '#Microsoft.Media.CopyAudio' # type: str - - -class CopyVideo(Codec): - """A codec flag, which tells the encoder to copy the input video bitstream without re-encoding. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - *, - label: Optional[str] = None, - **kwargs - ): - super(CopyVideo, self).__init__(label=label, **kwargs) - self.odata_type = '#Microsoft.Media.CopyVideo' # type: str - - class CrossSiteAccessPolicies(msrest.serialization.Model): """The client access policy. @@ -2496,34 +1869,6 @@ def __init__( self.policy_name = policy_name -class Deinterlace(msrest.serialization.Model): - """Describes the de-interlacing settings. - - :param parity: The field parity for de-interlacing, defaults to Auto. Possible values include: - "Auto", "TopFieldFirst", "BottomFieldFirst". - :type parity: str or ~azure.mgmt.media.models.DeinterlaceParity - :param mode: The deinterlacing mode. Defaults to AutoPixelAdaptive. Possible values include: - "Off", "AutoPixelAdaptive". - :type mode: str or ~azure.mgmt.media.models.DeinterlaceMode - """ - - _attribute_map = { - 'parity': {'key': 'parity', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - } - - def __init__( - self, - *, - parity: Optional[Union[str, "DeinterlaceParity"]] = None, - mode: Optional[Union[str, "DeinterlaceMode"]] = None, - **kwargs - ): - super(Deinterlace, self).__init__(**kwargs) - self.parity = parity - self.mode = mode - - class EdgePolicies(msrest.serialization.Model): """EdgePolicies. @@ -2740,2065 +2085,270 @@ def __init__( self.custom_key_acquisition_url_template = custom_key_acquisition_url_template -class FaceDetectorPreset(Preset): - """Describes all the settings to be used when analyzing a video in order to detect (and optionally redact) all the faces present. +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param resolution: Specifies the maximum resolution at which your video is analyzed. The - default behavior is "SourceResolution," which will keep the input video at its original - resolution when analyzed. Using "StandardDefinition" will resize input videos to standard - definition while preserving the appropriate aspect ratio. It will only resize if the video is - of higher resolution. For example, a 1920x1080 input would be scaled to 640x360 before - processing. Switching to "StandardDefinition" will reduce the time it takes to process high - resolution video. It may also reduce the cost of using this component (see - https://azure.microsoft.com/en-us/pricing/details/media-services/#analytics for details). - However, faces that end up being too small in the resized video may not be detected. Possible - values include: "SourceResolution", "StandardDefinition". - :type resolution: str or ~azure.mgmt.media.models.AnalysisResolution - :param mode: This mode provides the ability to choose between the following settings: 1) - Analyze - For detection only.This mode generates a metadata JSON file marking appearances of - faces throughout the video.Where possible, appearances of the same person are assigned the same - ID. 2) Combined - Additionally redacts(blurs) detected faces. 3) Redact - This enables a 2-pass - process, allowing for selective redaction of a subset of detected faces.It takes in the - metadata file from a prior analyze pass, along with the source video, and a user-selected - subset of IDs that require redaction. Possible values include: "Analyze", "Redact", "Combined". - :type mode: str or ~azure.mgmt.media.models.FaceRedactorMode - :param blur_type: Blur type. Possible values include: "Box", "Low", "Med", "High", "Black". - :type blur_type: str or ~azure.mgmt.media.models.BlurType - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any """ _validation = { - 'odata_type': {'required': True}, + 'type': {'readonly': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'resolution': {'key': 'resolution', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'blur_type': {'key': 'blurType', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, - *, - resolution: Optional[Union[str, "AnalysisResolution"]] = None, - mode: Optional[Union[str, "FaceRedactorMode"]] = None, - blur_type: Optional[Union[str, "BlurType"]] = None, - experimental_options: Optional[Dict[str, str]] = None, **kwargs ): - super(FaceDetectorPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.FaceDetectorPreset' # type: str - self.resolution = resolution - self.mode = mode - self.blur_type = blur_type - self.experimental_options = experimental_options + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class Filters(msrest.serialization.Model): - """Describes all the filtering operations, such as de-interlacing, rotation etc. that are to be applied to the input media before encoding. +class ErrorDetail(msrest.serialization.Model): + """The error detail. - :param deinterlace: The de-interlacing settings. - :type deinterlace: ~azure.mgmt.media.models.Deinterlace - :param rotation: The rotation, if any, to be applied to the input video, before it is encoded. - Default is Auto. Possible values include: "Auto", "None", "Rotate0", "Rotate90", "Rotate180", - "Rotate270". - :type rotation: str or ~azure.mgmt.media.models.Rotation - :param crop: The parameters for the rectangular window with which to crop the input video. - :type crop: ~azure.mgmt.media.models.Rectangle - :param overlays: The properties of overlays to be applied to the input video. These could be - audio, image or video overlays. - :type overlays: list[~azure.mgmt.media.models.Overlay] - """ + Variables are only populated by the server, and will be ignored when sending a request. - _attribute_map = { - 'deinterlace': {'key': 'deinterlace', 'type': 'Deinterlace'}, - 'rotation': {'key': 'rotation', 'type': 'str'}, - 'crop': {'key': 'crop', 'type': 'Rectangle'}, - 'overlays': {'key': 'overlays', 'type': '[Overlay]'}, - } - - def __init__( - self, - *, - deinterlace: Optional["Deinterlace"] = None, - rotation: Optional[Union[str, "Rotation"]] = None, - crop: Optional["Rectangle"] = None, - overlays: Optional[List["Overlay"]] = None, - **kwargs - ): - super(Filters, self).__init__(**kwargs) - self.deinterlace = deinterlace - self.rotation = rotation - self.crop = crop - self.overlays = overlays - - -class FilterTrackPropertyCondition(msrest.serialization.Model): - """The class to specify one track property condition. - - All required parameters must be populated in order to send to Azure. - - :param property: Required. The track property type. Possible values include: "Unknown", "Type", - "Name", "Language", "FourCC", "Bitrate". - :type property: str or ~azure.mgmt.media.models.FilterTrackPropertyType - :param value: Required. The track property value. - :type value: str - :param operation: Required. The track property condition operation. Possible values include: - "Equal", "NotEqual". - :type operation: str or ~azure.mgmt.media.models.FilterTrackPropertyCompareOperation - """ - - _validation = { - 'property': {'required': True}, - 'value': {'required': True}, - 'operation': {'required': True}, - } - - _attribute_map = { - 'property': {'key': 'property', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - } - - def __init__( - self, - *, - property: Union[str, "FilterTrackPropertyType"], - value: str, - operation: Union[str, "FilterTrackPropertyCompareOperation"], - **kwargs - ): - super(FilterTrackPropertyCondition, self).__init__(**kwargs) - self.property = property - self.value = value - self.operation = operation - - -class FilterTrackSelection(msrest.serialization.Model): - """Representing a list of FilterTrackPropertyConditions to select a track. The filters are combined using a logical AND operation. - - All required parameters must be populated in order to send to Azure. - - :param track_selections: Required. The track selections. - :type track_selections: list[~azure.mgmt.media.models.FilterTrackPropertyCondition] - """ - - _validation = { - 'track_selections': {'required': True}, - } - - _attribute_map = { - 'track_selections': {'key': 'trackSelections', 'type': '[FilterTrackPropertyCondition]'}, - } - - def __init__( - self, - *, - track_selections: List["FilterTrackPropertyCondition"], - **kwargs - ): - super(FilterTrackSelection, self).__init__(**kwargs) - self.track_selections = track_selections - - -class FirstQuality(msrest.serialization.Model): - """Filter First Quality. - - All required parameters must be populated in order to send to Azure. - - :param bitrate: Required. The first quality bitrate. - :type bitrate: int - """ - - _validation = { - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - } - - def __init__( - self, - *, - bitrate: int, - **kwargs - ): - super(FirstQuality, self).__init__(**kwargs) - self.bitrate = bitrate - - -class Format(msrest.serialization.Model): - """Base class for output. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ImageFormat, MultiBitrateFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.ImageFormat': 'ImageFormat', '#Microsoft.Media.MultiBitrateFormat': 'MultiBitrateFormat'} - } - - def __init__( - self, - *, - filename_pattern: str, - **kwargs - ): - super(Format, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.filename_pattern = filename_pattern - - -class InputDefinition(msrest.serialization.Model): - """Base class for defining an input. Use sub classes of this class to specify tracks selections and related metadata. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FromAllInputFile, FromEachInputFile, InputFile. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.FromAllInputFile': 'FromAllInputFile', '#Microsoft.Media.FromEachInputFile': 'FromEachInputFile', '#Microsoft.Media.InputFile': 'InputFile'} - } - - def __init__( - self, - *, - included_tracks: Optional[List["TrackDescriptor"]] = None, - **kwargs - ): - super(InputDefinition, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.included_tracks = included_tracks - - -class FromAllInputFile(InputDefinition): - """An InputDefinition that looks across all of the files provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to allow selection of a single track across a set of input files. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - def __init__( - self, - *, - included_tracks: Optional[List["TrackDescriptor"]] = None, - **kwargs - ): - super(FromAllInputFile, self).__init__(included_tracks=included_tracks, **kwargs) - self.odata_type = '#Microsoft.Media.FromAllInputFile' # type: str - - -class FromEachInputFile(InputDefinition): - """An InputDefinition that looks at each input file provided to select tracks specified by the IncludedTracks property. Generally used with the AudioTrackByAttribute and VideoTrackByAttribute to select tracks from each file given. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - } - - def __init__( - self, - *, - included_tracks: Optional[List["TrackDescriptor"]] = None, - **kwargs - ): - super(FromEachInputFile, self).__init__(included_tracks=included_tracks, **kwargs) - self.odata_type = '#Microsoft.Media.FromEachInputFile' # type: str - - -class Layer(msrest.serialization.Model): - """The encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by specifying a layer for each desired resolution. A layer represents the properties for the video or image at a resolution. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H265VideoLayer, JpgLayer, PngLayer, VideoLayer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H265VideoLayer': 'H265VideoLayer', '#Microsoft.Media.JpgLayer': 'JpgLayer', '#Microsoft.Media.PngLayer': 'PngLayer', '#Microsoft.Media.VideoLayer': 'VideoLayer'} - } - - def __init__( - self, - *, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - **kwargs - ): - super(Layer, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.width = width - self.height = height - self.label = label - - -class VideoLayer(Layer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H264Layer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Whether or not adaptive B-frames are to be used when encoding this - layer. If not specified, the encoder will turn it on whenever the video profile permits its - use. - :type adaptive_b_frame: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H264Layer': 'H264Layer'} - } - - def __init__( - self, - *, - bitrate: int, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - max_bitrate: Optional[int] = None, - b_frames: Optional[int] = None, - frame_rate: Optional[str] = None, - slices: Optional[int] = None, - adaptive_b_frame: Optional[bool] = None, - **kwargs - ): - super(VideoLayer, self).__init__(width=width, height=height, label=label, **kwargs) - self.odata_type = '#Microsoft.Media.VideoLayer' # type: str - self.bitrate = bitrate - self.max_bitrate = max_bitrate - self.b_frames = b_frames - self.frame_rate = frame_rate - self.slices = slices - self.adaptive_b_frame = adaptive_b_frame - - -class H264Layer(VideoLayer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer with the H.264 video codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Whether or not adaptive B-frames are to be used when encoding this - layer. If not specified, the encoder will turn it on whenever the video profile permits its - use. - :type adaptive_b_frame: bool - :param profile: We currently support Baseline, Main, High, High422, High444. Default is Auto. - Possible values include: "Auto", "Baseline", "Main", "High", "High422", "High444". - :type profile: str or ~azure.mgmt.media.models.H264VideoProfile - :param level: We currently support Level up to 6.2. The value can be Auto, or a number that - matches the H.264 profile. If not specified, the default is Auto, which lets the encoder choose - the Level that is appropriate for this layer. - :type level: str - :param buffer_window: The VBV buffer window length. The value should be in ISO 8601 format. The - value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - :type buffer_window: ~datetime.timedelta - :param reference_frames: The number of reference frames to be used when encoding this layer. If - not specified, the encoder determines an appropriate number based on the encoder complexity - setting. - :type reference_frames: int - :param entropy_mode: The entropy mode to be used for this layer. If not specified, the encoder - chooses the mode that is appropriate for the profile and level. Possible values include: - "Cabac", "Cavlc". - :type entropy_mode: str or ~azure.mgmt.media.models.EntropyMode - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - 'profile': {'key': 'profile', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'buffer_window': {'key': 'bufferWindow', 'type': 'duration'}, - 'reference_frames': {'key': 'referenceFrames', 'type': 'int'}, - 'entropy_mode': {'key': 'entropyMode', 'type': 'str'}, - } - - def __init__( - self, - *, - bitrate: int, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - max_bitrate: Optional[int] = None, - b_frames: Optional[int] = None, - frame_rate: Optional[str] = None, - slices: Optional[int] = None, - adaptive_b_frame: Optional[bool] = None, - profile: Optional[Union[str, "H264VideoProfile"]] = None, - level: Optional[str] = None, - buffer_window: Optional[datetime.timedelta] = None, - reference_frames: Optional[int] = None, - entropy_mode: Optional[Union[str, "EntropyMode"]] = None, - **kwargs - ): - super(H264Layer, self).__init__(width=width, height=height, label=label, bitrate=bitrate, max_bitrate=max_bitrate, b_frames=b_frames, frame_rate=frame_rate, slices=slices, adaptive_b_frame=adaptive_b_frame, **kwargs) - self.odata_type = '#Microsoft.Media.H264Layer' # type: str - self.profile = profile - self.level = level - self.buffer_window = buffer_window - self.reference_frames = reference_frames - self.entropy_mode = entropy_mode - - -class Video(Codec): - """Describes the basic properties for encoding the input video. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H264Video, H265Video, Image. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H264Video': 'H264Video', '#Microsoft.Media.H265Video': 'H265Video', '#Microsoft.Media.Image': 'Image'} - } - - def __init__( - self, - *, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - **kwargs - ): - super(Video, self).__init__(label=label, **kwargs) - self.odata_type = '#Microsoft.Media.Video' # type: str - self.key_frame_interval = key_frame_interval - self.stretch_mode = stretch_mode - self.sync_mode = sync_mode - - -class H264Video(Video): - """Describes all the properties for encoding a video with the H.264 codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param scene_change_detection: Whether or not the encoder should insert key frames at scene - changes. If not specified, the default is false. This flag should be set to true only when the - encoder is being configured to produce a single output video. - :type scene_change_detection: bool - :param complexity: Tells the encoder how to choose its encoding settings. The default value is - Balanced. Possible values include: "Speed", "Balanced", "Quality". - :type complexity: str or ~azure.mgmt.media.models.H264Complexity - :param layers: The collection of output H.264 layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.H264Layer] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'scene_change_detection': {'key': 'sceneChangeDetection', 'type': 'bool'}, - 'complexity': {'key': 'complexity', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[H264Layer]'}, - } - - def __init__( - self, - *, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - scene_change_detection: Optional[bool] = None, - complexity: Optional[Union[str, "H264Complexity"]] = None, - layers: Optional[List["H264Layer"]] = None, - **kwargs - ): - super(H264Video, self).__init__(label=label, key_frame_interval=key_frame_interval, stretch_mode=stretch_mode, sync_mode=sync_mode, **kwargs) - self.odata_type = '#Microsoft.Media.H264Video' # type: str - self.scene_change_detection = scene_change_detection - self.complexity = complexity - self.layers = layers - - -class H265VideoLayer(Layer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: H265Layer. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this - value should be 3000000 This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Specifies whether or not adaptive B-frames are to be used when - encoding this layer. If not specified, the encoder will turn it on whenever the video profile - permits its use. - :type adaptive_b_frame: bool - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.H265Layer': 'H265Layer'} - } - - def __init__( - self, - *, - bitrate: int, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - max_bitrate: Optional[int] = None, - b_frames: Optional[int] = None, - frame_rate: Optional[str] = None, - slices: Optional[int] = None, - adaptive_b_frame: Optional[bool] = None, - **kwargs - ): - super(H265VideoLayer, self).__init__(width=width, height=height, label=label, **kwargs) - self.odata_type = '#Microsoft.Media.H265VideoLayer' # type: str - self.bitrate = bitrate - self.max_bitrate = max_bitrate - self.b_frames = b_frames - self.frame_rate = frame_rate - self.slices = slices - self.adaptive_b_frame = adaptive_b_frame - - -class H265Layer(H265VideoLayer): - """Describes the settings to be used when encoding the input video into a desired output bitrate layer with the H.265 video codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param bitrate: Required. The average bitrate in bits per second at which to encode the input - video when generating this layer. For example: a target bitrate of 3000Kbps or 3Mbps means this - value should be 3000000 This is a required field. - :type bitrate: int - :param max_bitrate: The maximum bitrate (in bits per second), at which the VBV buffer should be - assumed to refill. If not specified, defaults to the same value as bitrate. - :type max_bitrate: int - :param b_frames: The number of B-frames to be used when encoding this layer. If not specified, - the encoder chooses an appropriate number based on the video profile and level. - :type b_frames: int - :param frame_rate: The frame rate (in frames per second) at which to encode this layer. The - value can be in the form of M/N where M and N are integers (For example, 30000/1001), or in the - form of a number (For example, 30, or 29.97). The encoder enforces constraints on allowed frame - rates based on the profile and level. If it is not specified, the encoder will use the same - frame rate as the input video. - :type frame_rate: str - :param slices: The number of slices to be used when encoding this layer. If not specified, - default is zero, which means that encoder will use a single slice for each frame. - :type slices: int - :param adaptive_b_frame: Specifies whether or not adaptive B-frames are to be used when - encoding this layer. If not specified, the encoder will turn it on whenever the video profile - permits its use. - :type adaptive_b_frame: bool - :param profile: We currently support Main. Default is Auto. Possible values include: "Auto", - "Main". - :type profile: str or ~azure.mgmt.media.models.H265VideoProfile - :param level: We currently support Level up to 6.2. The value can be Auto, or a number that - matches the H.265 profile. If not specified, the default is Auto, which lets the encoder choose - the Level that is appropriate for this layer. - :type level: str - :param buffer_window: The VBV buffer window length. The value should be in ISO 8601 format. The - value should be in the range [0.1-100] seconds. The default is 5 seconds (for example, PT5S). - :type buffer_window: ~datetime.timedelta - :param reference_frames: The number of reference frames to be used when encoding this layer. If - not specified, the encoder determines an appropriate number based on the encoder complexity - setting. - :type reference_frames: int - """ - - _validation = { - 'odata_type': {'required': True}, - 'bitrate': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'bitrate': {'key': 'bitrate', 'type': 'int'}, - 'max_bitrate': {'key': 'maxBitrate', 'type': 'int'}, - 'b_frames': {'key': 'bFrames', 'type': 'int'}, - 'frame_rate': {'key': 'frameRate', 'type': 'str'}, - 'slices': {'key': 'slices', 'type': 'int'}, - 'adaptive_b_frame': {'key': 'adaptiveBFrame', 'type': 'bool'}, - 'profile': {'key': 'profile', 'type': 'str'}, - 'level': {'key': 'level', 'type': 'str'}, - 'buffer_window': {'key': 'bufferWindow', 'type': 'duration'}, - 'reference_frames': {'key': 'referenceFrames', 'type': 'int'}, - } - - def __init__( - self, - *, - bitrate: int, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - max_bitrate: Optional[int] = None, - b_frames: Optional[int] = None, - frame_rate: Optional[str] = None, - slices: Optional[int] = None, - adaptive_b_frame: Optional[bool] = None, - profile: Optional[Union[str, "H265VideoProfile"]] = None, - level: Optional[str] = None, - buffer_window: Optional[datetime.timedelta] = None, - reference_frames: Optional[int] = None, - **kwargs - ): - super(H265Layer, self).__init__(width=width, height=height, label=label, bitrate=bitrate, max_bitrate=max_bitrate, b_frames=b_frames, frame_rate=frame_rate, slices=slices, adaptive_b_frame=adaptive_b_frame, **kwargs) - self.odata_type = '#Microsoft.Media.H265Layer' # type: str - self.profile = profile - self.level = level - self.buffer_window = buffer_window - self.reference_frames = reference_frames - - -class H265Video(Video): - """Describes all the properties for encoding a video with the H.265 codec. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param scene_change_detection: Specifies whether or not the encoder should insert key frames at - scene changes. If not specified, the default is false. This flag should be set to true only - when the encoder is being configured to produce a single output video. - :type scene_change_detection: bool - :param complexity: Tells the encoder how to choose its encoding settings. Quality will provide - for a higher compression ratio but at a higher cost and longer compute time. Speed will - produce a relatively larger file but is faster and more economical. The default value is - Balanced. Possible values include: "Speed", "Balanced", "Quality". - :type complexity: str or ~azure.mgmt.media.models.H265Complexity - :param layers: The collection of output H.265 layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.H265Layer] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'scene_change_detection': {'key': 'sceneChangeDetection', 'type': 'bool'}, - 'complexity': {'key': 'complexity', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[H265Layer]'}, - } - - def __init__( - self, - *, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - scene_change_detection: Optional[bool] = None, - complexity: Optional[Union[str, "H265Complexity"]] = None, - layers: Optional[List["H265Layer"]] = None, - **kwargs - ): - super(H265Video, self).__init__(label=label, key_frame_interval=key_frame_interval, stretch_mode=stretch_mode, sync_mode=sync_mode, **kwargs) - self.odata_type = '#Microsoft.Media.H265Video' # type: str - self.scene_change_detection = scene_change_detection - self.complexity = complexity - self.layers = layers - - -class Hls(msrest.serialization.Model): - """HTTP Live Streaming (HLS) packing setting for the live output. - - :param fragments_per_ts_segment: The number of fragments in an HTTP Live Streaming (HLS) TS - segment in the output of the live event. This value does not affect the packing ratio for HLS - CMAF output. - :type fragments_per_ts_segment: int - """ - - _attribute_map = { - 'fragments_per_ts_segment': {'key': 'fragmentsPerTsSegment', 'type': 'int'}, - } - - def __init__( - self, - *, - fragments_per_ts_segment: Optional[int] = None, - **kwargs - ): - super(Hls, self).__init__(**kwargs) - self.fragments_per_ts_segment = fragments_per_ts_segment - - -class Image(Video): - """Describes the basic properties for generating thumbnails from the input video. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JpgImage, PngImage. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JpgImage': 'JpgImage', '#Microsoft.Media.PngImage': 'PngImage'} - } - - def __init__( - self, - *, - start: str, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - step: Optional[str] = None, - range: Optional[str] = None, - **kwargs - ): - super(Image, self).__init__(label=label, key_frame_interval=key_frame_interval, stretch_mode=stretch_mode, sync_mode=sync_mode, **kwargs) - self.odata_type = '#Microsoft.Media.Image' # type: str - self.start = start - self.step = step - self.range = range - - -class ImageFormat(Format): - """Describes the properties for an output image file. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JpgFormat, PngFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JpgFormat': 'JpgFormat', '#Microsoft.Media.PngFormat': 'PngFormat'} - } - - def __init__( - self, - *, - filename_pattern: str, - **kwargs - ): - super(ImageFormat, self).__init__(filename_pattern=filename_pattern, **kwargs) - self.odata_type = '#Microsoft.Media.ImageFormat' # type: str - - -class InputFile(InputDefinition): - """An InputDefinition for a single file. TrackSelections are scoped to the file specified. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param included_tracks: The list of TrackDescriptors which define the metadata and selection of - tracks in the input. - :type included_tracks: list[~azure.mgmt.media.models.TrackDescriptor] - :param filename: Name of the file that this input definition applies to. - :type filename: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'included_tracks': {'key': 'includedTracks', 'type': '[TrackDescriptor]'}, - 'filename': {'key': 'filename', 'type': 'str'}, - } - - def __init__( - self, - *, - included_tracks: Optional[List["TrackDescriptor"]] = None, - filename: Optional[str] = None, - **kwargs - ): - super(InputFile, self).__init__(included_tracks=included_tracks, **kwargs) - self.odata_type = '#Microsoft.Media.InputFile' # type: str - self.filename = filename - - -class IPAccessControl(msrest.serialization.Model): - """The IP access control. - - :param allow: The IP allow list. - :type allow: list[~azure.mgmt.media.models.IPRange] - """ - - _attribute_map = { - 'allow': {'key': 'allow', 'type': '[IPRange]'}, - } - - def __init__( - self, - *, - allow: Optional[List["IPRange"]] = None, - **kwargs - ): - super(IPAccessControl, self).__init__(**kwargs) - self.allow = allow - - -class IPRange(msrest.serialization.Model): - """The IP address range in the CIDR scheme. - - :param name: The friendly name for the IP address range. - :type name: str - :param address: The IP address. - :type address: str - :param subnet_prefix_length: The subnet mask prefix length (see CIDR notation). - :type subnet_prefix_length: int - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'address': {'key': 'address', 'type': 'str'}, - 'subnet_prefix_length': {'key': 'subnetPrefixLength', 'type': 'int'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - address: Optional[str] = None, - subnet_prefix_length: Optional[int] = None, - **kwargs - ): - super(IPRange, self).__init__(**kwargs) - self.name = name - self.address = address - self.subnet_prefix_length = subnet_prefix_length - - -class Job(ProxyResource): - """A Job resource type. The progress and state can be obtained by polling a Job or subscribing to events using EventGrid. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.media.models.SystemData - :ivar created: The UTC date and time when the customer has created the Job, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype created: ~datetime.datetime - :ivar state: The current state of the job. Possible values include: "Canceled", "Canceling", - "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :param description: Optional customer supplied description of the Job. - :type description: str - :param input: The inputs for the Job. - :type input: ~azure.mgmt.media.models.JobInput - :ivar last_modified: The UTC date and time when the customer has last updated the Job, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype last_modified: ~datetime.datetime - :param outputs: The outputs for the Job. - :type outputs: list[~azure.mgmt.media.models.JobOutput] - :param priority: Priority with which the job should be processed. Higher priority jobs are - processed before lower priority jobs. If not set, the default is normal. Possible values - include: "Low", "Normal", "High". - :type priority: str or ~azure.mgmt.media.models.Priority - :param correlation_data: Customer provided key, value pairs that will be returned in Job and - JobOutput state events. - :type correlation_data: dict[str, str] - :ivar start_time: The UTC date and time at which this Job began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job finished processing. - :vartype end_time: ~datetime.datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'created': {'readonly': True}, - 'state': {'readonly': True}, - 'last_modified': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'input': {'key': 'properties.input', 'type': 'JobInput'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'outputs': {'key': 'properties.outputs', 'type': '[JobOutput]'}, - 'priority': {'key': 'properties.priority', 'type': 'str'}, - 'correlation_data': {'key': 'properties.correlationData', 'type': '{str}'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - input: Optional["JobInput"] = None, - outputs: Optional[List["JobOutput"]] = None, - priority: Optional[Union[str, "Priority"]] = None, - correlation_data: Optional[Dict[str, str]] = None, - **kwargs - ): - super(Job, self).__init__(**kwargs) - self.system_data = None - self.created = None - self.state = None - self.description = description - self.input = input - self.last_modified = None - self.outputs = outputs - self.priority = priority - self.correlation_data = correlation_data - self.start_time = None - self.end_time = None - - -class JobCollection(msrest.serialization.Model): - """A collection of Job items. - - :param value: A collection of Job items. - :type value: list[~azure.mgmt.media.models.Job] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Job]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Job"]] = None, - odata_next_link: Optional[str] = None, - **kwargs - ): - super(JobCollection, self).__init__(**kwargs) - self.value = value - self.odata_next_link = odata_next_link - - -class JobError(msrest.serialization.Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Error code describing the error. Possible values include: "ServiceError", - "ServiceTransientError", "DownloadNotAccessible", "DownloadTransientError", - "UploadNotAccessible", "UploadTransientError", "ConfigurationUnsupported", "ContentMalformed", - "ContentUnsupported". - :vartype code: str or ~azure.mgmt.media.models.JobErrorCode - :ivar message: A human-readable language-dependent representation of the error. - :vartype message: str - :ivar category: Helps with categorization of errors. Possible values include: "Service", - "Download", "Upload", "Configuration", "Content". - :vartype category: str or ~azure.mgmt.media.models.JobErrorCategory - :ivar retry: Indicates that it may be possible to retry the Job. If retry is unsuccessful, - please contact Azure support via Azure Portal. Possible values include: "DoNotRetry", - "MayRetry". - :vartype retry: str or ~azure.mgmt.media.models.JobRetry - :ivar details: An array of details about specific errors that led to this reported error. - :vartype details: list[~azure.mgmt.media.models.JobErrorDetail] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'category': {'readonly': True}, - 'retry': {'readonly': True}, - 'details': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - 'retry': {'key': 'retry', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[JobErrorDetail]'}, - } - - def __init__( - self, - **kwargs - ): - super(JobError, self).__init__(**kwargs) - self.code = None - self.message = None - self.category = None - self.retry = None - self.details = None - - -class JobErrorDetail(msrest.serialization.Model): - """Details of JobOutput errors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: Code describing the error detail. + :ivar code: The error code. :vartype code: str - :ivar message: A human-readable representation of the error. + :ivar message: The error message. :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.media.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.media.models.ErrorAdditionalInfo] """ _validation = { 'code': {'readonly': True}, 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, } def __init__( self, **kwargs ): - super(JobErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - - -class JobInput(msrest.serialization.Model): - """Base class for inputs to a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputClip, JobInputSequence, JobInputs. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobInputClip': 'JobInputClip', '#Microsoft.Media.JobInputSequence': 'JobInputSequence', '#Microsoft.Media.JobInputs': 'JobInputs'} - } - - def __init__( - self, - **kwargs - ): - super(JobInput, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - - -class JobInputClip(JobInput): - """Represents input files for a Job. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobInputAsset, JobInputHttp. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobInputAsset': 'JobInputAsset', '#Microsoft.Media.JobInputHttp': 'JobInputHttp'} - } - - def __init__( - self, - *, - files: Optional[List[str]] = None, - start: Optional["ClipTime"] = None, - end: Optional["ClipTime"] = None, - label: Optional[str] = None, - input_definitions: Optional[List["InputDefinition"]] = None, - **kwargs - ): - super(JobInputClip, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputClip' # type: str - self.files = files - self.start = start - self.end = end - self.label = label - self.input_definitions = input_definitions - - -class JobInputAsset(JobInputClip): - """Represents an Asset for input into a Job. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - :param asset_name: Required. The name of the input Asset. - :type asset_name: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'asset_name': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, - } - - def __init__( - self, - *, - asset_name: str, - files: Optional[List[str]] = None, - start: Optional["ClipTime"] = None, - end: Optional["ClipTime"] = None, - label: Optional[str] = None, - input_definitions: Optional[List["InputDefinition"]] = None, - **kwargs - ): - super(JobInputAsset, self).__init__(files=files, start=start, end=end, label=label, input_definitions=input_definitions, **kwargs) - self.odata_type = '#Microsoft.Media.JobInputAsset' # type: str - self.asset_name = asset_name - - -class JobInputHttp(JobInputClip): - """Represents HTTPS job input. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. - :type files: list[str] - :param start: Defines a point on the timeline of the input media at which processing will - start. Defaults to the beginning of the input media. - :type start: ~azure.mgmt.media.models.ClipTime - :param end: Defines a point on the timeline of the input media at which processing will end. - Defaults to the end of the input media. - :type end: ~azure.mgmt.media.models.ClipTime - :param label: A label that is assigned to a JobInputClip, that is used to satisfy a reference - used in the Transform. For example, a Transform can be authored so as to take an image file - with the label 'xyz' and apply it as an overlay onto the input video before it is encoded. When - submitting a Job, exactly one of the JobInputs should be the image file, and it should have the - label 'xyz'. - :type label: str - :param input_definitions: Defines a list of InputDefinitions. For each InputDefinition, it - defines a list of track selections and related metadata. - :type input_definitions: list[~azure.mgmt.media.models.InputDefinition] - :param base_uri: Base URI for HTTPS job input. It will be concatenated with provided file - names. If no base uri is given, then the provided file list is assumed to be fully qualified - uris. Maximum length of 4000 characters. - :type base_uri: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'files': {'key': 'files', 'type': '[str]'}, - 'start': {'key': 'start', 'type': 'ClipTime'}, - 'end': {'key': 'end', 'type': 'ClipTime'}, - 'label': {'key': 'label', 'type': 'str'}, - 'input_definitions': {'key': 'inputDefinitions', 'type': '[InputDefinition]'}, - 'base_uri': {'key': 'baseUri', 'type': 'str'}, - } - - def __init__( - self, - *, - files: Optional[List[str]] = None, - start: Optional["ClipTime"] = None, - end: Optional["ClipTime"] = None, - label: Optional[str] = None, - input_definitions: Optional[List["InputDefinition"]] = None, - base_uri: Optional[str] = None, - **kwargs - ): - super(JobInputHttp, self).__init__(files=files, start=start, end=end, label=label, input_definitions=input_definitions, **kwargs) - self.odata_type = '#Microsoft.Media.JobInputHttp' # type: str - self.base_uri = base_uri - + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class JobInputs(JobInput): - """Describes a list of inputs to a Job. - All required parameters must be populated in order to send to Azure. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param inputs: List of inputs to a Job. - :type inputs: list[~azure.mgmt.media.models.JobInput] + :param error: The error object. + :type error: ~azure.mgmt.media.models.ErrorDetail """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[JobInput]'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, *, - inputs: Optional[List["JobInput"]] = None, + error: Optional["ErrorDetail"] = None, **kwargs ): - super(JobInputs, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputs' # type: str - self.inputs = inputs + super(ErrorResponse, self).__init__(**kwargs) + self.error = error -class JobInputSequence(JobInput): - """A Sequence contains an ordered list of Clips where each clip is a JobInput. The Sequence will be treated as a single input. +class FilterTrackPropertyCondition(msrest.serialization.Model): + """The class to specify one track property condition. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param inputs: JobInputs that make up the timeline. - :type inputs: list[~azure.mgmt.media.models.JobInputClip] + :param property: Required. The track property type. Possible values include: "Unknown", "Type", + "Name", "Language", "FourCC", "Bitrate". + :type property: str or ~azure.mgmt.media.models.FilterTrackPropertyType + :param value: Required. The track property value. + :type value: str + :param operation: Required. The track property condition operation. Possible values include: + "Equal", "NotEqual". + :type operation: str or ~azure.mgmt.media.models.FilterTrackPropertyCompareOperation """ _validation = { - 'odata_type': {'required': True}, + 'property': {'required': True}, + 'value': {'required': True}, + 'operation': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'inputs': {'key': 'inputs', 'type': '[JobInputClip]'}, + 'property': {'key': 'property', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, } def __init__( self, *, - inputs: Optional[List["JobInputClip"]] = None, + property: Union[str, "FilterTrackPropertyType"], + value: str, + operation: Union[str, "FilterTrackPropertyCompareOperation"], **kwargs ): - super(JobInputSequence, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.JobInputSequence' # type: str - self.inputs = inputs - - -class JobOutput(msrest.serialization.Model): - """Describes all the properties of a JobOutput. + super(FilterTrackPropertyCondition, self).__init__(**kwargs) + self.property = property + self.value = value + self.operation = operation - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: JobOutputAsset. - Variables are only populated by the server, and will be ignored when sending a request. +class FilterTrackSelection(msrest.serialization.Model): + """Representing a list of FilterTrackPropertyConditions to select a track. The filters are combined using a logical AND operation. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :ivar error: If the JobOutput is in the Error state, it contains the details of the error. - :vartype error: ~azure.mgmt.media.models.JobError - :ivar state: Describes the state of the JobOutput. Possible values include: "Canceled", - "Canceling", "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :ivar progress: If the JobOutput is in a Processing state, this contains the Job completion - percentage. The value is an estimate and not intended to be used to predict Job completion - times. To determine if the JobOutput is complete, use the State property. - :vartype progress: int - :param label: A label that is assigned to a JobOutput in order to help uniquely identify it. - This is useful when your Transform has more than one TransformOutput, whereby your Job has more - than one JobOutput. In such cases, when you submit the Job, you will add two or more - JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you - retrieve the Job, either through events or on a GET request, you can use the label to easily - identify the JobOutput. If a label is not provided, a default value of - '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in - the corresponding TransformOutput and the output index is the relative index of the this - JobOutput within the Job. Note that this index is the same as the relative index of the - corresponding TransformOutput within its Transform. - :type label: str - :ivar start_time: The UTC date and time at which this Job Output began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job Output finished processing. - :vartype end_time: ~datetime.datetime + :param track_selections: Required. The track selections. + :type track_selections: list[~azure.mgmt.media.models.FilterTrackPropertyCondition] """ _validation = { - 'odata_type': {'required': True}, - 'error': {'readonly': True}, - 'state': {'readonly': True}, - 'progress': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, + 'track_selections': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'JobError'}, - 'state': {'key': 'state', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'int'}, - 'label': {'key': 'label', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.JobOutputAsset': 'JobOutputAsset'} + 'track_selections': {'key': 'trackSelections', 'type': '[FilterTrackPropertyCondition]'}, } def __init__( self, *, - label: Optional[str] = None, + track_selections: List["FilterTrackPropertyCondition"], **kwargs ): - super(JobOutput, self).__init__(**kwargs) - self.odata_type = None # type: Optional[str] - self.error = None - self.state = None - self.progress = None - self.label = label - self.start_time = None - self.end_time = None - + super(FilterTrackSelection, self).__init__(**kwargs) + self.track_selections = track_selections -class JobOutputAsset(JobOutput): - """Represents an Asset used as a JobOutput. - Variables are only populated by the server, and will be ignored when sending a request. +class FirstQuality(msrest.serialization.Model): + """Filter First Quality. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :ivar error: If the JobOutput is in the Error state, it contains the details of the error. - :vartype error: ~azure.mgmt.media.models.JobError - :ivar state: Describes the state of the JobOutput. Possible values include: "Canceled", - "Canceling", "Error", "Finished", "Processing", "Queued", "Scheduled". - :vartype state: str or ~azure.mgmt.media.models.JobState - :ivar progress: If the JobOutput is in a Processing state, this contains the Job completion - percentage. The value is an estimate and not intended to be used to predict Job completion - times. To determine if the JobOutput is complete, use the State property. - :vartype progress: int - :param label: A label that is assigned to a JobOutput in order to help uniquely identify it. - This is useful when your Transform has more than one TransformOutput, whereby your Job has more - than one JobOutput. In such cases, when you submit the Job, you will add two or more - JobOutputs, in the same order as TransformOutputs in the Transform. Subsequently, when you - retrieve the Job, either through events or on a GET request, you can use the label to easily - identify the JobOutput. If a label is not provided, a default value of - '{presetName}_{outputIndex}' will be used, where the preset name is the name of the preset in - the corresponding TransformOutput and the output index is the relative index of the this - JobOutput within the Job. Note that this index is the same as the relative index of the - corresponding TransformOutput within its Transform. - :type label: str - :ivar start_time: The UTC date and time at which this Job Output began processing. - :vartype start_time: ~datetime.datetime - :ivar end_time: The UTC date and time at which this Job Output finished processing. - :vartype end_time: ~datetime.datetime - :param asset_name: Required. The name of the output Asset. - :type asset_name: str + :param bitrate: Required. The first quality bitrate. + :type bitrate: int """ _validation = { - 'odata_type': {'required': True}, - 'error': {'readonly': True}, - 'state': {'readonly': True}, - 'progress': {'readonly': True}, - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'asset_name': {'required': True}, + 'bitrate': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'error': {'key': 'error', 'type': 'JobError'}, - 'state': {'key': 'state', 'type': 'str'}, - 'progress': {'key': 'progress', 'type': 'int'}, - 'label': {'key': 'label', 'type': 'str'}, - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'asset_name': {'key': 'assetName', 'type': 'str'}, + 'bitrate': {'key': 'bitrate', 'type': 'int'}, } def __init__( self, *, - asset_name: str, - label: Optional[str] = None, + bitrate: int, **kwargs ): - super(JobOutputAsset, self).__init__(label=label, **kwargs) - self.odata_type = '#Microsoft.Media.JobOutputAsset' # type: str - self.asset_name = asset_name - + super(FirstQuality, self).__init__(**kwargs) + self.bitrate = bitrate -class JpgFormat(ImageFormat): - """Describes the settings for producing JPEG thumbnails. - All required parameters must be populated in order to send to Azure. +class Hls(msrest.serialization.Model): + """HTTP Live Streaming (HLS) packing setting for the live output. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str + :param fragments_per_ts_segment: The number of fragments in an HTTP Live Streaming (HLS) TS + segment in the output of the live event. This value does not affect the packing ratio for HLS + CMAF output. + :type fragments_per_ts_segment: int """ - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, + 'fragments_per_ts_segment': {'key': 'fragmentsPerTsSegment', 'type': 'int'}, } def __init__( self, *, - filename_pattern: str, + fragments_per_ts_segment: Optional[int] = None, **kwargs ): - super(JpgFormat, self).__init__(filename_pattern=filename_pattern, **kwargs) - self.odata_type = '#Microsoft.Media.JpgFormat' # type: str - + super(Hls, self).__init__(**kwargs) + self.fragments_per_ts_segment = fragments_per_ts_segment -class JpgImage(Image): - """Describes the properties for producing a series of JPEG images from the input video. - All required parameters must be populated in order to send to Azure. +class IPAccessControl(msrest.serialization.Model): + """The IP access control. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - :param layers: A collection of output JPEG image layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.JpgLayer] - :param sprite_column: Sets the number of columns used in thumbnail sprite image. The number of - rows are automatically calculated and a VTT file is generated with the coordinate mappings for - each thumbnail in the sprite. Note: this value should be a positive integer and a proper value - is recommended so that the output image resolution will not go beyond JPEG maximum pixel - resolution limit 65535x65535. - :type sprite_column: int + :param allow: The IP allow list. + :type allow: list[~azure.mgmt.media.models.IPRange] """ - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[JpgLayer]'}, - 'sprite_column': {'key': 'spriteColumn', 'type': 'int'}, + 'allow': {'key': 'allow', 'type': '[IPRange]'}, } def __init__( self, *, - start: str, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - step: Optional[str] = None, - range: Optional[str] = None, - layers: Optional[List["JpgLayer"]] = None, - sprite_column: Optional[int] = None, + allow: Optional[List["IPRange"]] = None, **kwargs ): - super(JpgImage, self).__init__(label=label, key_frame_interval=key_frame_interval, stretch_mode=stretch_mode, sync_mode=sync_mode, start=start, step=step, range=range, **kwargs) - self.odata_type = '#Microsoft.Media.JpgImage' # type: str - self.layers = layers - self.sprite_column = sprite_column - + super(IPAccessControl, self).__init__(**kwargs) + self.allow = allow -class JpgLayer(Layer): - """Describes the settings to produce a JPEG image from the input video. - All required parameters must be populated in order to send to Azure. +class IPRange(msrest.serialization.Model): + """The IP address range in the CIDR scheme. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - :param quality: The compression quality of the JPEG output. Range is from 0-100 and the default - is 70. - :type quality: int + :param name: The friendly name for the IP address range. + :type name: str + :param address: The IP address. + :type address: str + :param subnet_prefix_length: The subnet mask prefix length (see CIDR notation). + :type subnet_prefix_length: int """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'quality': {'key': 'quality', 'type': 'int'}, + 'name': {'key': 'name', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'subnet_prefix_length': {'key': 'subnetPrefixLength', 'type': 'int'}, } def __init__( self, *, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - quality: Optional[int] = None, + name: Optional[str] = None, + address: Optional[str] = None, + subnet_prefix_length: Optional[int] = None, **kwargs ): - super(JpgLayer, self).__init__(width=width, height=height, label=label, **kwargs) - self.odata_type = '#Microsoft.Media.JpgLayer' # type: str - self.quality = quality + super(IPRange, self).__init__(**kwargs) + self.name = name + self.address = address + self.subnet_prefix_length = subnet_prefix_length class KeyDelivery(msrest.serialization.Model): @@ -5186,7 +2736,7 @@ class LiveEventEncoding(msrest.serialization.Model): Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers. See https://go.microsoft.com/fwlink/?linkid=2095101 for more information. This property cannot be modified after the live event is created. Possible values include: "None", - "Standard", "Premium1080p". + "Standard", "Premium1080p", "PassthroughBasic", "PassthroughStandard". :type encoding_type: str or ~azure.mgmt.media.models.LiveEventEncodingType :param preset_name: The optional encoding preset name, used when encodingType is not None. This value is specified at creation time and cannot be updated. If the encodingType is set to @@ -5543,6 +3093,8 @@ class LiveOutput(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure.mgmt.media.models.SystemData :param description: The description of the live output. :type description: str :param asset_name: The asset that the live output will write to. @@ -5575,6 +3127,7 @@ class LiveOutput(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'created': {'readonly': True}, 'last_modified': {'readonly': True}, 'provisioning_state': {'readonly': True}, @@ -5585,6 +3138,7 @@ class LiveOutput(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'asset_name': {'key': 'properties.assetName', 'type': 'str'}, 'archive_window_length': {'key': 'properties.archiveWindowLength', 'type': 'duration'}, @@ -5609,6 +3163,7 @@ def __init__( **kwargs ): super(LiveOutput, self).__init__(**kwargs) + self.system_data = None self.description = description self.asset_name = asset_name self.archive_window_length = archive_window_length @@ -5653,33 +3208,6 @@ def __init__( self.odata_next_link = odata_next_link -class Location(msrest.serialization.Model): - """Location. - - All required parameters must be populated in order to send to Azure. - - :param name: Required. - :type name: str - """ - - _validation = { - 'name': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - } - - def __init__( - self, - *, - name: str, - **kwargs - ): - super(Location, self).__init__(**kwargs) - self.name = name - - class LogSpecification(msrest.serialization.Model): """A diagnostic log emitted by service. @@ -5748,6 +3276,9 @@ class MediaService(TrackedResource): :type encryption: ~azure.mgmt.media.models.AccountEncryption :param key_delivery: The Key Delivery properties for Media Services account. :type key_delivery: ~azure.mgmt.media.models.KeyDelivery + :param public_network_access: Whether or not public network access is allowed for resources + under the Media Services account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.media.models.PublicNetworkAccess """ _validation = { @@ -5772,6 +3303,7 @@ class MediaService(TrackedResource): 'storage_authentication': {'key': 'properties.storageAuthentication', 'type': 'str'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, 'key_delivery': {'key': 'properties.keyDelivery', 'type': 'KeyDelivery'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, } def __init__( @@ -5784,6 +3316,7 @@ def __init__( storage_authentication: Optional[Union[str, "StorageAuthentication"]] = None, encryption: Optional["AccountEncryption"] = None, key_delivery: Optional["KeyDelivery"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): super(MediaService, self).__init__(tags=tags, location=location, **kwargs) @@ -5794,6 +3327,7 @@ def __init__( self.storage_authentication = storage_authentication self.encryption = encryption self.key_delivery = key_delivery + self.public_network_access = public_network_access class MediaServiceCollection(msrest.serialization.Model): @@ -5830,12 +3364,14 @@ class MediaServiceIdentity(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param type: Required. The identity type. Possible values include: "SystemAssigned", "None". - :type type: str or ~azure.mgmt.media.models.ManagedIdentityType + :param type: Required. The identity type. + :type type: str :ivar principal_id: The Principal ID of the identity. :vartype principal_id: str :ivar tenant_id: The Tenant ID of the identity. :vartype tenant_id: str + :param user_assigned_identities: The user assigned managed identities. + :type user_assigned_identities: dict[str, ~azure.mgmt.media.models.UserAssignedManagedIdentity] """ _validation = { @@ -5848,18 +3384,21 @@ class MediaServiceIdentity(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, } def __init__( self, *, - type: Union[str, "ManagedIdentityType"], + type: str, + user_assigned_identities: Optional[Dict[str, "UserAssignedManagedIdentity"]] = None, **kwargs ): super(MediaServiceIdentity, self).__init__(**kwargs) self.type = type self.principal_id = None self.tenant_id = None + self.user_assigned_identities = user_assigned_identities class MediaServiceUpdate(msrest.serialization.Model): @@ -5881,6 +3420,9 @@ class MediaServiceUpdate(msrest.serialization.Model): :type encryption: ~azure.mgmt.media.models.AccountEncryption :param key_delivery: The Key Delivery properties for Media Services account. :type key_delivery: ~azure.mgmt.media.models.KeyDelivery + :param public_network_access: Whether or not public network access is allowed for resources + under the Media Services account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.media.models.PublicNetworkAccess """ _validation = { @@ -5895,6 +3437,7 @@ class MediaServiceUpdate(msrest.serialization.Model): 'storage_authentication': {'key': 'properties.storageAuthentication', 'type': 'str'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, 'key_delivery': {'key': 'properties.keyDelivery', 'type': 'KeyDelivery'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, } def __init__( @@ -5906,6 +3449,7 @@ def __init__( storage_authentication: Optional[Union[str, "StorageAuthentication"]] = None, encryption: Optional["AccountEncryption"] = None, key_delivery: Optional["KeyDelivery"] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): super(MediaServiceUpdate, self).__init__(**kwargs) @@ -5916,6 +3460,7 @@ def __init__( self.storage_authentication = storage_authentication self.encryption = encryption self.key_delivery = key_delivery + self.public_network_access = public_network_access class MetricDimension(msrest.serialization.Model): @@ -6033,107 +3578,7 @@ def __init__( self.enable_regional_mdm_account = None self.source_mdm_account = None self.source_mdm_namespace = None - self.supported_time_grain_types = None - - -class MultiBitrateFormat(Format): - """Describes the properties for producing a collection of GOP aligned multi-bitrate files. The default behavior is to produce one output file for each video layer which is muxed together with all the audios. The exact output files produced can be controlled by specifying the outputFiles collection. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: Mp4Format, TransportStreamFormat. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.Mp4Format': 'Mp4Format', '#Microsoft.Media.TransportStreamFormat': 'TransportStreamFormat'} - } - - def __init__( - self, - *, - filename_pattern: str, - output_files: Optional[List["OutputFile"]] = None, - **kwargs - ): - super(MultiBitrateFormat, self).__init__(filename_pattern=filename_pattern, **kwargs) - self.odata_type = '#Microsoft.Media.MultiBitrateFormat' # type: str - self.output_files = output_files - - -class Mp4Format(MultiBitrateFormat): - """Describes the properties for an output ISO MP4 file. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - def __init__( - self, - *, - filename_pattern: str, - output_files: Optional[List["OutputFile"]] = None, - **kwargs - ): - super(Mp4Format, self).__init__(filename_pattern=filename_pattern, output_files=output_files, **kwargs) - self.odata_type = '#Microsoft.Media.Mp4Format' # type: str + self.supported_time_grain_types = None class NoEncryption(msrest.serialization.Model): @@ -6157,42 +3602,6 @@ def __init__( self.enabled_protocols = enabled_protocols -class ODataError(msrest.serialization.Model): - """Information about an error. - - :param code: A language-independent error name. - :type code: str - :param message: The error message. - :type message: str - :param target: The target of the error (for example, the name of the property in error). - :type target: str - :param details: The error details. - :type details: list[~azure.mgmt.media.models.ODataError] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ODataError]'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, - target: Optional[str] = None, - details: Optional[List["ODataError"]] = None, - **kwargs - ): - super(ODataError, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.details = details - - class Operation(msrest.serialization.Model): """An operation. @@ -6250,26 +3659,20 @@ class OperationCollection(msrest.serialization.Model): :param value: A collection of Operation items. :type value: list[~azure.mgmt.media.models.Operation] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[Operation]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, } def __init__( self, *, value: Optional[List["Operation"]] = None, - odata_next_link: Optional[str] = None, **kwargs ): super(OperationCollection, self).__init__(**kwargs) self.value = value - self.odata_next_link = odata_next_link class OperationDisplay(msrest.serialization.Model): @@ -6308,209 +3711,6 @@ def __init__( self.description = description -class OutputFile(msrest.serialization.Model): - """Represents an output file produced. - - All required parameters must be populated in order to send to Azure. - - :param labels: Required. The list of labels that describe how the encoder should multiplex - video and audio into an output file. For example, if the encoder is producing two video layers - with labels v1 and v2, and one audio layer with label a1, then an array like '[v1, a1]' tells - the encoder to produce an output file with the video track represented by v1 and the audio - track represented by a1. - :type labels: list[str] - """ - - _validation = { - 'labels': {'required': True}, - } - - _attribute_map = { - 'labels': {'key': 'labels', 'type': '[str]'}, - } - - def __init__( - self, - *, - labels: List[str], - **kwargs - ): - super(OutputFile, self).__init__(**kwargs) - self.labels = labels - - -class PngFormat(ImageFormat): - """Describes the settings for producing PNG thumbnails. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - } - - def __init__( - self, - *, - filename_pattern: str, - **kwargs - ): - super(PngFormat, self).__init__(filename_pattern=filename_pattern, **kwargs) - self.odata_type = '#Microsoft.Media.PngFormat' # type: str - - -class PngImage(Image): - """Describes the properties for producing a series of PNG images from the input video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param label: An optional label for the codec. The label can be used to control muxing - behavior. - :type label: str - :param key_frame_interval: The distance between two key frames. The value should be non-zero in - the range [0.5, 20] seconds, specified in ISO 8601 format. The default is 2 seconds(PT2S). Note - that this setting is ignored if VideoSyncMode.Passthrough is set, where the KeyFrameInterval - value will follow the input source setting. - :type key_frame_interval: ~datetime.timedelta - :param stretch_mode: The resizing mode - how the input video will be resized to fit the desired - output resolution(s). Default is AutoSize. Possible values include: "None", "AutoSize", - "AutoFit". - :type stretch_mode: str or ~azure.mgmt.media.models.StretchMode - :param sync_mode: The Video Sync Mode. Possible values include: "Auto", "Passthrough", "Cfr", - "Vfr". - :type sync_mode: str or ~azure.mgmt.media.models.VideoSyncMode - :param start: Required. The position in the input video from where to start generating - thumbnails. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or - a frame count (For example, 10 to start at the 10th frame), or a relative value to stream - duration (For example, 10% to start at 10% of stream duration). Also supports a macro {Best}, - which tells the encoder to select the best thumbnail from the first few seconds of the video - and will only produce one thumbnail, no matter what other settings are for Step and Range. The - default value is macro {Best}. - :type start: str - :param step: The intervals at which thumbnails are generated. The value can be in ISO 8601 - format (For example, PT05S for one image every 5 seconds), or a frame count (For example, 30 - for one image every 30 frames), or a relative value to stream duration (For example, 10% for - one image every 10% of stream duration). Note: Step value will affect the first generated - thumbnail, which may not be exactly the one specified at transform preset start time. This is - due to the encoder, which tries to select the best thumbnail between start time and Step - position from start time as the first output. As the default value is 10%, it means if stream - has long duration, the first generated thumbnail might be far away from the one specified at - start time. Try to select reasonable value for Step if the first thumbnail is expected close to - start time, or set Range value at 1 if only one thumbnail is needed at start time. - :type step: str - :param range: The position relative to transform preset start time in the input video at which - to stop generating thumbnails. The value can be in ISO 8601 format (For example, PT5M30S to - stop at 5 minutes and 30 seconds from start time), or a frame count (For example, 300 to stop - at the 300th frame from the frame at start time. If this value is 1, it means only producing - one thumbnail at start time), or a relative value to the stream duration (For example, 50% to - stop at half of stream duration from start time). The default value is 100%, which means to - stop at the end of the stream. - :type range: str - :param layers: A collection of output PNG image layers to be produced by the encoder. - :type layers: list[~azure.mgmt.media.models.PngLayer] - """ - - _validation = { - 'odata_type': {'required': True}, - 'start': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - 'key_frame_interval': {'key': 'keyFrameInterval', 'type': 'duration'}, - 'stretch_mode': {'key': 'stretchMode', 'type': 'str'}, - 'sync_mode': {'key': 'syncMode', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'str'}, - 'step': {'key': 'step', 'type': 'str'}, - 'range': {'key': 'range', 'type': 'str'}, - 'layers': {'key': 'layers', 'type': '[PngLayer]'}, - } - - def __init__( - self, - *, - start: str, - label: Optional[str] = None, - key_frame_interval: Optional[datetime.timedelta] = None, - stretch_mode: Optional[Union[str, "StretchMode"]] = None, - sync_mode: Optional[Union[str, "VideoSyncMode"]] = None, - step: Optional[str] = None, - range: Optional[str] = None, - layers: Optional[List["PngLayer"]] = None, - **kwargs - ): - super(PngImage, self).__init__(label=label, key_frame_interval=key_frame_interval, stretch_mode=stretch_mode, sync_mode=sync_mode, start=start, step=step, range=range, **kwargs) - self.odata_type = '#Microsoft.Media.PngImage' # type: str - self.layers = layers - - -class PngLayer(Layer): - """Describes the settings to produce a PNG image from the input video. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param width: The width of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in width as the input. - :type width: str - :param height: The height of the output video for this layer. The value can be absolute (in - pixels) or relative (in percentage). For example 50% means the output video has half as many - pixels in height as the input. - :type height: str - :param label: The alphanumeric label for this layer, which can be used in multiplexing - different video and audio layers, or in naming the output file. - :type label: str - """ - - _validation = { - 'odata_type': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - 'label': {'key': 'label', 'type': 'str'}, - } - - def __init__( - self, - *, - width: Optional[str] = None, - height: Optional[str] = None, - label: Optional[str] = None, - **kwargs - ): - super(PngLayer, self).__init__(width=width, height=height, label=label, **kwargs) - self.odata_type = '#Microsoft.Media.PngLayer' # type: str - - class PresentationTimeRange(msrest.serialization.Model): """The presentation time range, this is asset related and not recommended for Account Filter. @@ -6707,354 +3907,117 @@ def __init__( self.required_zone_names = required_zone_names -class PrivateLinkResourceListResult(msrest.serialization.Model): - """A list of private link resources. - - :param value: Array of private link resources. - :type value: list[~azure.mgmt.media.models.PrivateLinkResource] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, - } - - def __init__( - self, - *, - value: Optional[List["PrivateLinkResource"]] = None, - **kwargs - ): - super(PrivateLinkResourceListResult, self).__init__(**kwargs) - self.value = value - - -class PrivateLinkServiceConnectionState(msrest.serialization.Model): - """A collection of information about the state of the connection between service consumer and provider. - - :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner - of the service. Possible values include: "Pending", "Approved", "Rejected". - :type status: str or ~azure.mgmt.media.models.PrivateEndpointServiceConnectionStatus - :param description: The reason for approval/rejection of the connection. - :type description: str - :param actions_required: A message indicating if changes on the service provider require any - updates on the consumer. - :type actions_required: str - """ - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, - description: Optional[str] = None, - actions_required: Optional[str] = None, - **kwargs - ): - super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = actions_required - - -class Properties(msrest.serialization.Model): - """The service specification property. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar service_specification: The service specifications. - :vartype service_specification: ~azure.mgmt.media.models.ServiceSpecification - """ - - _validation = { - 'service_specification': {'readonly': True}, - } - - _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, - } - - def __init__( - self, - **kwargs - ): - super(Properties, self).__init__(**kwargs) - self.service_specification = None - - -class Provider(msrest.serialization.Model): - """A resource provider. - - All required parameters must be populated in order to send to Azure. - - :param provider_name: Required. The provider name. - :type provider_name: str - """ - - _validation = { - 'provider_name': {'required': True}, - } - - _attribute_map = { - 'provider_name': {'key': 'providerName', 'type': 'str'}, - } - - def __init__( - self, - *, - provider_name: str, - **kwargs - ): - super(Provider, self).__init__(**kwargs) - self.provider_name = provider_name - - -class Rectangle(msrest.serialization.Model): - """Describes the properties of a rectangular window applied to the input media before processing it. - - :param left: The number of pixels from the left-margin. This can be absolute pixel value (e.g - 100), or relative to the size of the video (For example, 50%). - :type left: str - :param top: The number of pixels from the top-margin. This can be absolute pixel value (e.g - 100), or relative to the size of the video (For example, 50%). - :type top: str - :param width: The width of the rectangular region in pixels. This can be absolute pixel value - (e.g 100), or relative to the size of the video (For example, 50%). - :type width: str - :param height: The height of the rectangular region in pixels. This can be absolute pixel value - (e.g 100), or relative to the size of the video (For example, 50%). - :type height: str - """ - - _attribute_map = { - 'left': {'key': 'left', 'type': 'str'}, - 'top': {'key': 'top', 'type': 'str'}, - 'width': {'key': 'width', 'type': 'str'}, - 'height': {'key': 'height', 'type': 'str'}, - } - - def __init__( - self, - *, - left: Optional[str] = None, - top: Optional[str] = None, - width: Optional[str] = None, - height: Optional[str] = None, - **kwargs - ): - super(Rectangle, self).__init__(**kwargs) - self.left = left - self.top = top - self.width = width - self.height = height - - -class SelectAudioTrackByAttribute(AudioTrackDescriptor): - """Select audio tracks from the input by specifying an attribute and an attribute filter. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - :param attribute: Required. The TrackAttribute to filter the tracks by. Possible values - include: "Bitrate", "Language". - :type attribute: str or ~azure.mgmt.media.models.TrackAttribute - :param filter: Required. The type of AttributeFilter to apply to the TrackAttribute in order to - select the tracks. Possible values include: "All", "Top", "Bottom", "ValueEquals". - :type filter: str or ~azure.mgmt.media.models.AttributeFilter - :param filter_value: The value to filter the tracks by. Only used when - AttributeFilter.ValueEquals is specified for the Filter property. - :type filter_value: str - """ - - _validation = { - 'odata_type': {'required': True}, - 'attribute': {'required': True}, - 'filter': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - 'attribute': {'key': 'attribute', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'filter_value': {'key': 'filterValue', 'type': 'str'}, - } - - def __init__( - self, - *, - attribute: Union[str, "TrackAttribute"], - filter: Union[str, "AttributeFilter"], - channel_mapping: Optional[Union[str, "ChannelMapping"]] = None, - filter_value: Optional[str] = None, - **kwargs - ): - super(SelectAudioTrackByAttribute, self).__init__(channel_mapping=channel_mapping, **kwargs) - self.odata_type = '#Microsoft.Media.SelectAudioTrackByAttribute' # type: str - self.attribute = attribute - self.filter = filter - self.filter_value = filter_value - - -class SelectAudioTrackById(AudioTrackDescriptor): - """Select audio tracks from the input by specifying a track identifier. - - All required parameters must be populated in order to send to Azure. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param channel_mapping: Optional designation for single channel audio tracks. Can be used to - combine the tracks into stereo or multi-channel audio tracks. Possible values include: - "FrontLeft", "FrontRight", "Center", "LowFrequencyEffects", "BackLeft", "BackRight", - "StereoLeft", "StereoRight". - :type channel_mapping: str or ~azure.mgmt.media.models.ChannelMapping - :param track_id: Required. Track identifier to select. - :type track_id: long + :param value: Array of private link resources. + :type value: list[~azure.mgmt.media.models.PrivateLinkResource] """ - _validation = { - 'odata_type': {'required': True}, - 'track_id': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'channel_mapping': {'key': 'channelMapping', 'type': 'str'}, - 'track_id': {'key': 'trackId', 'type': 'long'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, } def __init__( self, *, - track_id: int, - channel_mapping: Optional[Union[str, "ChannelMapping"]] = None, + value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): - super(SelectAudioTrackById, self).__init__(channel_mapping=channel_mapping, **kwargs) - self.odata_type = '#Microsoft.Media.SelectAudioTrackById' # type: str - self.track_id = track_id - - -class VideoTrackDescriptor(TrackDescriptor): - """A TrackSelection to select video tracks. + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: SelectVideoTrackByAttribute, SelectVideoTrackById. - All required parameters must be populated in order to send to Azure. +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.media.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str """ - _validation = { - 'odata_type': {'required': True}, - } - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - } - - _subtype_map = { - 'odata_type': {'#Microsoft.Media.SelectVideoTrackByAttribute': 'SelectVideoTrackByAttribute', '#Microsoft.Media.SelectVideoTrackById': 'SelectVideoTrackById'} + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, **kwargs ): - super(VideoTrackDescriptor, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.VideoTrackDescriptor' # type: str + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required -class SelectVideoTrackByAttribute(VideoTrackDescriptor): - """Select video tracks from the input by specifying an attribute and an attribute filter. +class Properties(msrest.serialization.Model): + """The service specification property. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param attribute: Required. The TrackAttribute to filter the tracks by. Possible values - include: "Bitrate", "Language". - :type attribute: str or ~azure.mgmt.media.models.TrackAttribute - :param filter: Required. The type of AttributeFilter to apply to the TrackAttribute in order to - select the tracks. Possible values include: "All", "Top", "Bottom", "ValueEquals". - :type filter: str or ~azure.mgmt.media.models.AttributeFilter - :param filter_value: The value to filter the tracks by. Only used when - AttributeFilter.ValueEquals is specified for the Filter property. For TrackAttribute.Bitrate, - this should be an integer value in bits per second (e.g: '1500000'). The - TrackAttribute.Language is not supported for video tracks. - :type filter_value: str + :ivar service_specification: The service specifications. + :vartype service_specification: ~azure.mgmt.media.models.ServiceSpecification """ _validation = { - 'odata_type': {'required': True}, - 'attribute': {'required': True}, - 'filter': {'required': True}, + 'service_specification': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'attribute': {'key': 'attribute', 'type': 'str'}, - 'filter': {'key': 'filter', 'type': 'str'}, - 'filter_value': {'key': 'filterValue', 'type': 'str'}, + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, - *, - attribute: Union[str, "TrackAttribute"], - filter: Union[str, "AttributeFilter"], - filter_value: Optional[str] = None, **kwargs ): - super(SelectVideoTrackByAttribute, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectVideoTrackByAttribute' # type: str - self.attribute = attribute - self.filter = filter - self.filter_value = filter_value + super(Properties, self).__init__(**kwargs) + self.service_specification = None -class SelectVideoTrackById(VideoTrackDescriptor): - """Select video tracks from the input by specifying a track identifier. +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. All required parameters must be populated in order to send to Azure. - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param track_id: Required. Track identifier to select. - :type track_id: long + :param user_assigned_identity: The user assigned managed identity's ARM ID to use when + accessing a resource. + :type user_assigned_identity: str + :param use_system_assigned_identity: Required. Indicates whether to use System Assigned Managed + Identity. Mutual exclusive with User Assigned Managed Identity. + :type use_system_assigned_identity: bool """ _validation = { - 'odata_type': {'required': True}, - 'track_id': {'required': True}, + 'use_system_assigned_identity': {'required': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'track_id': {'key': 'trackId', 'type': 'long'}, + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'use_system_assigned_identity': {'key': 'useSystemAssignedIdentity', 'type': 'bool'}, } def __init__( self, *, - track_id: int, + use_system_assigned_identity: bool, + user_assigned_identity: Optional[str] = None, **kwargs ): - super(SelectVideoTrackById, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.SelectVideoTrackById' # type: str - self.track_id = track_id + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + self.use_system_assigned_identity = use_system_assigned_identity class ServiceSpecification(msrest.serialization.Model): @@ -7087,53 +4050,11 @@ def __init__( self.metric_specifications = None -class StandardEncoderPreset(Preset): - """Describes all the settings to be used when encoding the input video with the Standard Encoder. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filters: One or more filtering operations that are applied to the input media before - encoding. - :type filters: ~azure.mgmt.media.models.Filters - :param codecs: Required. The list of codecs to be used when encoding the input video. - :type codecs: list[~azure.mgmt.media.models.Codec] - :param formats: Required. The list of outputs to be produced by the encoder. - :type formats: list[~azure.mgmt.media.models.Format] - """ - - _validation = { - 'odata_type': {'required': True}, - 'codecs': {'required': True}, - 'formats': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': 'Filters'}, - 'codecs': {'key': 'codecs', 'type': '[Codec]'}, - 'formats': {'key': 'formats', 'type': '[Format]'}, - } - - def __init__( - self, - *, - codecs: List["Codec"], - formats: List["Format"], - filters: Optional["Filters"] = None, - **kwargs - ): - super(StandardEncoderPreset, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.StandardEncoderPreset' # type: str - self.filters = filters - self.codecs = codecs - self.formats = formats - - class StorageAccount(msrest.serialization.Model): """The storage account details. + Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. :param id: The ID of the storage account resource. Media Services relies on tables and queues @@ -7144,15 +4065,22 @@ class StorageAccount(msrest.serialization.Model): :param type: Required. The type of the storage account. Possible values include: "Primary", "Secondary". :type type: str or ~azure.mgmt.media.models.StorageAccountType + :param identity: The storage account identity. + :type identity: ~azure.mgmt.media.models.ResourceIdentity + :ivar status: The current status of the storage account mapping. + :vartype status: str """ _validation = { 'type': {'required': True}, + 'status': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, } def __init__( @@ -7160,11 +4088,14 @@ def __init__( *, type: Union[str, "StorageAccountType"], id: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, **kwargs ): super(StorageAccount, self).__init__(**kwargs) self.id = id self.type = type + self.identity = identity + self.status = None class StorageEncryptedAssetDecryptionData(msrest.serialization.Model): @@ -8004,357 +4935,31 @@ def __init__( self.track_selections = track_selections -class Transform(ProxyResource): - """A Transform encapsulates the rules or instructions for generating desired outputs from input media, such as by transcoding or by extracting insights. After the Transform is created, it can be applied to input media by creating Jobs. +class UserAssignedManagedIdentity(msrest.serialization.Model): + """UserAssignedManagedIdentity. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: The system metadata relating to this resource. - :vartype system_data: ~azure.mgmt.media.models.SystemData - :ivar created: The UTC date and time when the Transform was created, in 'YYYY-MM-DDThh:mm:ssZ' - format. - :vartype created: ~datetime.datetime - :param description: An optional verbose description of the Transform. - :type description: str - :ivar last_modified: The UTC date and time when the Transform was last updated, in - 'YYYY-MM-DDThh:mm:ssZ' format. - :vartype last_modified: ~datetime.datetime - :param outputs: An array of one or more TransformOutputs that the Transform should generate. - :type outputs: list[~azure.mgmt.media.models.TransformOutput] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'created': {'readonly': True}, - 'last_modified': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'outputs': {'key': 'properties.outputs', 'type': '[TransformOutput]'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - outputs: Optional[List["TransformOutput"]] = None, - **kwargs - ): - super(Transform, self).__init__(**kwargs) - self.system_data = None - self.created = None - self.description = description - self.last_modified = None - self.outputs = outputs - - -class TransformCollection(msrest.serialization.Model): - """A collection of Transform items. - - :param value: A collection of Transform items. - :type value: list[~azure.mgmt.media.models.Transform] - :param odata_next_link: A link to the next page of the collection (when the collection contains - too many results to return in one response). - :type odata_next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Transform]'}, - 'odata_next_link': {'key': '@odata\\.nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Transform"]] = None, - odata_next_link: Optional[str] = None, - **kwargs - ): - super(TransformCollection, self).__init__(**kwargs) - self.value = value - self.odata_next_link = odata_next_link - - -class TransformOutput(msrest.serialization.Model): - """Describes the properties of a TransformOutput, which are the rules to be applied while generating the desired output. - - All required parameters must be populated in order to send to Azure. - - :param on_error: A Transform can define more than one outputs. This property defines what the - service should do when one output fails - either continue to produce other outputs, or, stop - the other outputs. The overall Job state will not reflect failures of outputs that are - specified with 'ContinueJob'. The default is 'StopProcessingJob'. Possible values include: - "StopProcessingJob", "ContinueJob". - :type on_error: str or ~azure.mgmt.media.models.OnErrorType - :param relative_priority: Sets the relative priority of the TransformOutputs within a - Transform. This sets the priority that the service uses for processing TransformOutputs. The - default priority is Normal. Possible values include: "Low", "Normal", "High". - :type relative_priority: str or ~azure.mgmt.media.models.Priority - :param preset: Required. Preset that describes the operations that will be used to modify, - transcode, or extract insights from the source file to generate the output. - :type preset: ~azure.mgmt.media.models.Preset - """ - - _validation = { - 'preset': {'required': True}, - } - - _attribute_map = { - 'on_error': {'key': 'onError', 'type': 'str'}, - 'relative_priority': {'key': 'relativePriority', 'type': 'str'}, - 'preset': {'key': 'preset', 'type': 'Preset'}, - } - - def __init__( - self, - *, - preset: "Preset", - on_error: Optional[Union[str, "OnErrorType"]] = None, - relative_priority: Optional[Union[str, "Priority"]] = None, - **kwargs - ): - super(TransformOutput, self).__init__(**kwargs) - self.on_error = on_error - self.relative_priority = relative_priority - self.preset = preset - - -class TransportStreamFormat(MultiBitrateFormat): - """Describes the properties for generating an MPEG-2 Transport Stream (ISO/IEC 13818-1) output video file(s). - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param filename_pattern: Required. The pattern of the file names for the generated output - files. The following macros are supported in the file name: {Basename} - An expansion macro - that will use the name of the input video file. If the base name(the file suffix is not - included) of the input video file is less than 32 characters long, the base name of input video - files will be used. If the length of base name of the input video file exceeds 32 characters, - the base name is truncated to the first 32 characters in total length. {Extension} - The - appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video - bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. - {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed - from the filename. - :type filename_pattern: str - :param output_files: The list of output files to produce. Each entry in the list is a set of - audio and video layer labels to be muxed together . - :type output_files: list[~azure.mgmt.media.models.OutputFile] - """ - - _validation = { - 'odata_type': {'required': True}, - 'filename_pattern': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'filename_pattern': {'key': 'filenamePattern', 'type': 'str'}, - 'output_files': {'key': 'outputFiles', 'type': '[OutputFile]'}, - } - - def __init__( - self, - *, - filename_pattern: str, - output_files: Optional[List["OutputFile"]] = None, - **kwargs - ): - super(TransportStreamFormat, self).__init__(filename_pattern=filename_pattern, output_files=output_files, **kwargs) - self.odata_type = '#Microsoft.Media.TransportStreamFormat' # type: str - - -class UtcClipTime(ClipTime): - """Specifies the clip time as a Utc time position in the media file. The Utc time can point to a different position depending on whether the media file starts from a timestamp of zero or not. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param time: Required. The time position on the timeline of the input media based on Utc time. - :type time: ~datetime.datetime - """ - - _validation = { - 'odata_type': {'required': True}, - 'time': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - time: datetime.datetime, - **kwargs - ): - super(UtcClipTime, self).__init__(**kwargs) - self.odata_type = '#Microsoft.Media.UtcClipTime' # type: str - self.time = time - - -class VideoAnalyzerPreset(AudioAnalyzerPreset): - """A video analyzer preset that extracts insights (rich metadata) from both audio and video, and outputs a JSON format file. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param audio_language: The language for the audio payload in the input using the BCP-47 format - of 'language tag-region' (e.g: 'en-US'). If you know the language of your content, it is - recommended that you specify it. The language must be specified explicitly for - AudioAnalysisMode::Basic, since automatic language detection is not included in basic mode. If - the language isn't specified or set to null, automatic language detection will choose the first - language detected and process with the selected language for the duration of the file. It does - not currently support dynamically switching between languages after the first language is - detected. The automatic detection works best with audio recordings with clearly discernable - speech. If automatic detection fails to find the language, transcription would fallback to - 'en-US'." The list of supported languages is available here: - https://go.microsoft.com/fwlink/?linkid=2109463. - :type audio_language: str - :param mode: Determines the set of audio analysis operations to be performed. If unspecified, - the Standard AudioAnalysisMode would be chosen. Possible values include: "Standard", "Basic". - :type mode: str or ~azure.mgmt.media.models.AudioAnalysisMode - :param experimental_options: Dictionary containing key value pairs for parameters not exposed - in the preset itself. - :type experimental_options: dict[str, str] - :param insights_to_extract: Defines the type of insights that you want the service to generate. - The allowed values are 'AudioInsightsOnly', 'VideoInsightsOnly', and 'AllInsights'. The default - is AllInsights. If you set this to AllInsights and the input is audio only, then only audio - insights are generated. Similarly if the input is video only, then only video insights are - generated. It is recommended that you not use AudioInsightsOnly if you expect some of your - inputs to be video only; or use VideoInsightsOnly if you expect some of your inputs to be audio - only. Your Jobs in such conditions would error out. Possible values include: - "AudioInsightsOnly", "VideoInsightsOnly", "AllInsights". - :type insights_to_extract: str or ~azure.mgmt.media.models.InsightsType + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str """ _validation = { - 'odata_type': {'required': True}, + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, } _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'audio_language': {'key': 'audioLanguage', 'type': 'str'}, - 'mode': {'key': 'mode', 'type': 'str'}, - 'experimental_options': {'key': 'experimentalOptions', 'type': '{str}'}, - 'insights_to_extract': {'key': 'insightsToExtract', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, } def __init__( self, - *, - audio_language: Optional[str] = None, - mode: Optional[Union[str, "AudioAnalysisMode"]] = None, - experimental_options: Optional[Dict[str, str]] = None, - insights_to_extract: Optional[Union[str, "InsightsType"]] = None, **kwargs ): - super(VideoAnalyzerPreset, self).__init__(audio_language=audio_language, mode=mode, experimental_options=experimental_options, **kwargs) - self.odata_type = '#Microsoft.Media.VideoAnalyzerPreset' # type: str - self.insights_to_extract = insights_to_extract - - -class VideoOverlay(Overlay): - """Describes the properties of a video overlay. - - All required parameters must be populated in order to send to Azure. - - :param odata_type: Required. The discriminator for derived types.Constant filled by server. - :type odata_type: str - :param input_label: Required. The label of the job input which is to be used as an overlay. The - Input must specify exactly one file. You can specify an image file in JPG, PNG, GIF or BMP - format, or an audio file (such as a WAV, MP3, WMA or M4A file), or a video file. See - https://aka.ms/mesformats for the complete list of supported audio and video file formats. - :type input_label: str - :param start: The start position, with reference to the input video, at which the overlay - starts. The value should be in ISO 8601 format. For example, PT05S to start the overlay at 5 - seconds into the input video. If not specified the overlay starts from the beginning of the - input video. - :type start: ~datetime.timedelta - :param end: The end position, with reference to the input video, at which the overlay ends. The - value should be in ISO 8601 format. For example, PT30S to end the overlay at 30 seconds into - the input video. If not specified or the value is greater than the input video duration, the - overlay will be applied until the end of the input video if the overlay media duration is - greater than the input video duration, else the overlay will last as long as the overlay media - duration. - :type end: ~datetime.timedelta - :param fade_in_duration: The duration over which the overlay fades in onto the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade in (same as PT0S). - :type fade_in_duration: ~datetime.timedelta - :param fade_out_duration: The duration over which the overlay fades out of the input video. The - value should be in ISO 8601 duration format. If not specified the default behavior is to have - no fade out (same as PT0S). - :type fade_out_duration: ~datetime.timedelta - :param audio_gain_level: The gain level of audio in the overlay. The value should be in the - range [0, 1.0]. The default is 1.0. - :type audio_gain_level: float - :param position: The location in the input video where the overlay is applied. - :type position: ~azure.mgmt.media.models.Rectangle - :param opacity: The opacity of the overlay. This is a value in the range [0 - 1.0]. Default is - 1.0 which mean the overlay is opaque. - :type opacity: float - :param crop_rectangle: An optional rectangular window used to crop the overlay image or video. - :type crop_rectangle: ~azure.mgmt.media.models.Rectangle - """ - - _validation = { - 'odata_type': {'required': True}, - 'input_label': {'required': True}, - } - - _attribute_map = { - 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, - 'input_label': {'key': 'inputLabel', 'type': 'str'}, - 'start': {'key': 'start', 'type': 'duration'}, - 'end': {'key': 'end', 'type': 'duration'}, - 'fade_in_duration': {'key': 'fadeInDuration', 'type': 'duration'}, - 'fade_out_duration': {'key': 'fadeOutDuration', 'type': 'duration'}, - 'audio_gain_level': {'key': 'audioGainLevel', 'type': 'float'}, - 'position': {'key': 'position', 'type': 'Rectangle'}, - 'opacity': {'key': 'opacity', 'type': 'float'}, - 'crop_rectangle': {'key': 'cropRectangle', 'type': 'Rectangle'}, - } - - def __init__( - self, - *, - input_label: str, - start: Optional[datetime.timedelta] = None, - end: Optional[datetime.timedelta] = None, - fade_in_duration: Optional[datetime.timedelta] = None, - fade_out_duration: Optional[datetime.timedelta] = None, - audio_gain_level: Optional[float] = None, - position: Optional["Rectangle"] = None, - opacity: Optional[float] = None, - crop_rectangle: Optional["Rectangle"] = None, - **kwargs - ): - super(VideoOverlay, self).__init__(input_label=input_label, start=start, end=end, fade_in_duration=fade_in_duration, fade_out_duration=fade_out_duration, audio_gain_level=audio_gain_level, **kwargs) - self.odata_type = '#Microsoft.Media.VideoOverlay' # type: str - self.position = position - self.opacity = opacity - self.crop_rectangle = crop_rectangle + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/__init__.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/__init__.py index 795a18cd9d99..a928fbab084a 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/__init__.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/__init__.py @@ -6,17 +6,15 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._account_filters_operations import AccountFiltersOperations from ._operations import Operations from ._mediaservices_operations import MediaservicesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._locations_operations import LocationsOperations +from ._account_filters_operations import AccountFiltersOperations from ._assets_operations import AssetsOperations from ._asset_filters_operations import AssetFiltersOperations from ._content_key_policies_operations import ContentKeyPoliciesOperations -from ._transforms_operations import TransformsOperations -from ._jobs_operations import JobsOperations from ._streaming_policies_operations import StreamingPoliciesOperations from ._streaming_locators_operations import StreamingLocatorsOperations from ._live_events_operations import LiveEventsOperations @@ -24,17 +22,15 @@ from ._streaming_endpoints_operations import StreamingEndpointsOperations __all__ = [ - 'AccountFiltersOperations', 'Operations', 'MediaservicesOperations', 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 'LocationsOperations', + 'AccountFiltersOperations', 'AssetsOperations', 'AssetFiltersOperations', 'ContentKeyPoliciesOperations', - 'TransformsOperations', - 'JobsOperations', 'StreamingPoliciesOperations', 'StreamingLocatorsOperations', 'LiveEventsOperations', diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_account_filters_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_account_filters_operations.py index 3dd75bc20ead..83a6b637d2ae 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_account_filters_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_account_filters_operations.py @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -112,7 +112,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -130,7 +130,7 @@ def get( filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.AccountFilter"] + # type: (...) -> "_models.AccountFilter" """Get an Account Filter. Get the details of an Account Filter in the Media Services account. @@ -143,15 +143,15 @@ def get( :type filter_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AccountFilter, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.AccountFilter or None + :rtype: ~azure.mgmt.media.models.AccountFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AccountFilter"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccountFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -176,14 +176,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccountFilter', pipeline_response) + deserialized = self._deserialize('AccountFilter', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -222,7 +220,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -254,7 +252,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -297,7 +295,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -324,7 +322,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -363,7 +361,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -395,7 +393,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AccountFilter', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_asset_filters_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_asset_filters_operations.py index be11b037d0f3..4d8ba875adc5 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_asset_filters_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_asset_filters_operations.py @@ -73,7 +73,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -116,7 +116,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ def get( filter_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.AssetFilter"] + # type: (...) -> "_models.AssetFilter" """Get an Asset Filter. Get the details of an Asset Filter associated with the specified Asset. @@ -150,15 +150,15 @@ def get( :type filter_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AssetFilter, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.AssetFilter or None + :rtype: ~azure.mgmt.media.models.AssetFilter :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.AssetFilter"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AssetFilter"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -184,14 +184,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AssetFilter', pipeline_response) + deserialized = self._deserialize('AssetFilter', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -233,7 +231,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -266,7 +264,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -312,7 +310,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -340,7 +338,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -382,7 +380,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -415,7 +413,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AssetFilter', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_assets_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_assets_operations.py index cfc302f54b4c..b381f096fcf2 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_assets_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_assets_operations.py @@ -81,7 +81,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ def get( asset_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.Asset"] + # type: (...) -> "_models.Asset" """Get an Asset. Get the details of an Asset in the Media Services account. @@ -160,15 +160,15 @@ def get( :type asset_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: Asset, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Asset or None + :rtype: ~azure.mgmt.media.models.Asset :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Asset"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Asset"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -193,14 +193,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Asset', pipeline_response) + deserialized = self._deserialize('Asset', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -239,7 +237,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -271,7 +269,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -314,7 +312,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -341,7 +339,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -380,7 +378,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -412,7 +410,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Asset', pipeline_response) @@ -455,7 +453,7 @@ def list_container_sas( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -487,7 +485,7 @@ def list_container_sas( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AssetContainerSas', pipeline_response) @@ -527,7 +525,7 @@ def get_encryption_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -554,7 +552,7 @@ def get_encryption_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StorageEncryptedAssetDecryptionData', pipeline_response) @@ -593,7 +591,7 @@ def list_streaming_locators( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -620,7 +618,7 @@ def list_streaming_locators( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListStreamingLocatorsResponse', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_content_key_policies_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_content_key_policies_operations.py index 56c283947af5..0dc0b0589734 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_content_key_policies_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_content_key_policies_operations.py @@ -81,7 +81,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ def get( content_key_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.ContentKeyPolicy"] + # type: (...) -> "_models.ContentKeyPolicy" """Get a Content Key Policy. Get the details of a Content Key Policy in the Media Services account. @@ -160,15 +160,15 @@ def get( :type content_key_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentKeyPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.ContentKeyPolicy or None + :rtype: ~azure.mgmt.media.models.ContentKeyPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContentKeyPolicy"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentKeyPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -193,14 +193,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) + deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -239,7 +237,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -271,7 +269,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -314,7 +312,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -341,7 +339,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -380,7 +378,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -412,7 +410,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ContentKeyPolicy', pipeline_response) @@ -430,7 +428,7 @@ def get_policy_properties_with_secrets( content_key_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.ContentKeyPolicyProperties"] + # type: (...) -> "_models.ContentKeyPolicyProperties" """Get a Content Key Policy with secrets. Get a Content Key Policy including secret values. @@ -443,15 +441,15 @@ def get_policy_properties_with_secrets( :type content_key_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentKeyPolicyProperties, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.ContentKeyPolicyProperties or None + :rtype: ~azure.mgmt.media.models.ContentKeyPolicyProperties :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ContentKeyPolicyProperties"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentKeyPolicyProperties"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -476,14 +474,12 @@ def get_policy_properties_with_secrets( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ContentKeyPolicyProperties', pipeline_response) + deserialized = self._deserialize('ContentKeyPolicyProperties', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_jobs_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_jobs_operations.py deleted file mode 100644 index 2b1d4e6c2da1..000000000000 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_jobs_operations.py +++ /dev/null @@ -1,502 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class JobsOperations(object): - """JobsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.media.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - filter=None, # type: Optional[str] - orderby=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.JobCollection"] - """List Jobs. - - Lists all of the Jobs for the Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param filter: Restricts the set of items returned. - :type filter: str - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either JobCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.media.models.JobCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.JobCollection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('JobCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs'} # type: ignore - - def get( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Job"] - """Get Job. - - Gets a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job or None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - def create( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - job_name, # type: str - parameters, # type: "_models.Job" - **kwargs # type: Any - ): - # type: (...) -> "_models.Job" - """Create Job. - - Creates a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Job - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Job') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete Job. - - Deletes a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - job_name, # type: str - parameters, # type: "_models.Job" - **kwargs # type: Any - ): - # type: (...) -> "_models.Job" - """Update Job. - - Update is only supported for description and priority. Updating Priority will take effect when - the Job state is Queued or Scheduled and depending on the timing the priority update may be - ignored. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Job - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Job, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Job - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Job"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Job') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Job', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}'} # type: ignore - - def cancel_job( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - job_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Cancel Job. - - Cancel a Job. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param job_name: The Job name. - :type job_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.cancel_job.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - 'jobName': self._serialize.url("job_name", job_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - cancel_job.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}/jobs/{jobName}/cancelJob'} # type: ignore diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_events_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_events_operations.py index 4be8b2e64b96..d8405a2d24ad 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_events_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_events_operations.py @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -132,7 +132,7 @@ def get( live_event_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.LiveEvent"] + # type: (...) -> "_models.LiveEvent" """Get Live Event. Gets properties of a live event. @@ -145,15 +145,15 @@ def get( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LiveEvent, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.LiveEvent or None + :rtype: ~azure.mgmt.media.models.LiveEvent :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LiveEvent"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveEvent"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -178,14 +178,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LiveEvent', pipeline_response) + deserialized = self._deserialize('LiveEvent', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -242,7 +240,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -284,8 +282,8 @@ def begin_create( :type auto_start: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either LiveEvent or the result of cls(response) @@ -355,7 +353,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -387,7 +385,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -423,8 +421,8 @@ def begin_update( :type parameters: ~azure.mgmt.media.models.LiveEvent :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either LiveEvent or the result of cls(response) @@ -492,7 +490,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -519,7 +517,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -547,8 +545,8 @@ def begin_delete( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -612,7 +610,7 @@ def _allocate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -639,7 +637,7 @@ def _allocate_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -667,8 +665,8 @@ def begin_allocate( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -732,7 +730,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -759,7 +757,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -788,8 +786,8 @@ def begin_start( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -854,7 +852,7 @@ def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -886,7 +884,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -917,8 +915,8 @@ def begin_stop( :type parameters: ~azure.mgmt.media.models.LiveEventActionInput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -983,7 +981,7 @@ def _reset_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -1010,7 +1008,7 @@ def _reset_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -1040,8 +1038,8 @@ def begin_reset( :type live_event_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_outputs_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_outputs_operations.py index 821b06a0fac9..cbfc02ec8b7f 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_outputs_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_live_outputs_operations.py @@ -75,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -118,7 +118,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -137,7 +137,7 @@ def get( live_output_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.LiveOutput"] + # type: (...) -> "_models.LiveOutput" """Get Live Output. Gets a live output. @@ -152,15 +152,15 @@ def get( :type live_output_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LiveOutput, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.LiveOutput or None + :rtype: ~azure.mgmt.media.models.LiveOutput :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LiveOutput"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveOutput"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -186,14 +186,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('LiveOutput', pipeline_response) + deserialized = self._deserialize('LiveOutput', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -216,7 +214,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -249,7 +247,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -290,8 +288,8 @@ def begin_create( :type parameters: ~azure.mgmt.media.models.LiveOutput :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either LiveOutput or the result of cls(response) @@ -362,7 +360,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -390,7 +388,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -422,8 +420,8 @@ def begin_delete( :type live_output_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_locations_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_locations_operations.py index 6d887d5f4281..73e7530fe78e 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_locations_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_locations_operations.py @@ -69,7 +69,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -99,7 +99,7 @@ def check_name_availability( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EntityNameAvailabilityCheckOutput', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py index 8282848c691b..cb39387ec353 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_mediaservices_operations.py @@ -67,7 +67,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -108,7 +108,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -144,7 +144,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -170,7 +170,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MediaService', pipeline_response) @@ -209,7 +209,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -240,7 +240,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -280,7 +280,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -306,7 +306,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -342,7 +342,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -373,7 +373,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MediaService', pipeline_response) @@ -413,7 +413,7 @@ def sync_storage_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -444,7 +444,7 @@ def sync_storage_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -480,7 +480,7 @@ def list_edge_policies( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -511,7 +511,7 @@ def list_edge_policies( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('EdgePolicies', pipeline_response) @@ -541,7 +541,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -581,7 +581,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_operations.py index 8ec9da80fcc3..60140de26a25 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_operations.py @@ -9,7 +9,6 @@ import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -18,7 +17,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,14 +48,14 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["_models.OperationCollection"] + # type: (...) -> "_models.OperationCollection" """List Operations. Lists all the Media Services operations. :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.media.models.OperationCollection] + :return: OperationCollection, or the result of cls(response) + :rtype: ~azure.mgmt.media.models.OperationCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationCollection"] @@ -64,49 +63,33 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) + # Construct URL + url = self.list.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized list.metadata = {'url': '/providers/Microsoft.Media/operations'} # type: ignore diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_endpoint_connections_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_endpoint_connections_operations.py index ec9330ad1028..dd6637558e63 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_endpoint_connections_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_endpoint_connections_operations.py @@ -69,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -95,7 +95,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) @@ -134,7 +134,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -161,7 +161,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -203,7 +203,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +235,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) @@ -274,7 +274,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -299,9 +299,9 @@ def delete( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_link_resources_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_link_resources_operations.py index 8669e2971e98..4eb842f31b6f 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_link_resources_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_private_link_resources_operations.py @@ -69,7 +69,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -95,7 +95,7 @@ def list( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResourceListResult', pipeline_response) @@ -134,7 +134,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -161,7 +161,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('PrivateLinkResource', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_endpoints_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_endpoints_operations.py index 609086c507b9..2d4b4f8bb7d5 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_endpoints_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_endpoints_operations.py @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -114,7 +114,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -132,7 +132,7 @@ def get( streaming_endpoint_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.StreamingEndpoint"] + # type: (...) -> "_models.StreamingEndpoint" """Get StreamingEndpoint. Gets a streaming endpoint. @@ -145,15 +145,15 @@ def get( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingEndpoint, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingEndpoint or None + :rtype: ~azure.mgmt.media.models.StreamingEndpoint :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingEndpoint"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingEndpoint"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -178,14 +178,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingEndpoint', pipeline_response) + deserialized = self._deserialize('StreamingEndpoint', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -208,7 +206,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -242,7 +240,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -284,8 +282,8 @@ def begin_create( :type auto_start: bool :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StreamingEndpoint or the result of cls(response) @@ -355,7 +353,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -387,7 +385,7 @@ def _update_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -425,8 +423,8 @@ def begin_update( :type parameters: ~azure.mgmt.media.models.StreamingEndpoint :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either StreamingEndpoint or the result of cls(response) @@ -494,7 +492,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -521,7 +519,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -549,8 +547,8 @@ def begin_delete( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -614,7 +612,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -641,7 +639,7 @@ def _start_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -669,8 +667,8 @@ def begin_start( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -734,7 +732,7 @@ def _stop_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -761,7 +759,7 @@ def _stop_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -789,8 +787,8 @@ def begin_stop( :type streaming_endpoint_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -855,7 +853,7 @@ def _scale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -887,7 +885,7 @@ def _scale_initial( if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -918,8 +916,8 @@ def begin_scale( :type parameters: ~azure.mgmt.media.models.StreamingEntityScaleUnit :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_locators_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_locators_operations.py index bad3f104c951..9b4bcc238e2e 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_locators_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_locators_operations.py @@ -81,7 +81,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ def get( streaming_locator_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.StreamingLocator"] + # type: (...) -> "_models.StreamingLocator" """Get a Streaming Locator. Get the details of a Streaming Locator in the Media Services account. @@ -160,15 +160,15 @@ def get( :type streaming_locator_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingLocator, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingLocator or None + :rtype: ~azure.mgmt.media.models.StreamingLocator :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingLocator"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingLocator"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -193,14 +193,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingLocator', pipeline_response) + deserialized = self._deserialize('StreamingLocator', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -239,7 +237,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -271,7 +269,7 @@ def create( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StreamingLocator', pipeline_response) @@ -310,7 +308,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -337,7 +335,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -373,7 +371,7 @@ def list_content_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -400,7 +398,7 @@ def list_content_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListContentKeysResponse', pipeline_response) @@ -439,7 +437,7 @@ def list_paths( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -466,7 +464,7 @@ def list_paths( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ListPathsResponse', pipeline_response) diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_policies_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_policies_operations.py index 10553bbe29d3..af9fee745a8e 100644 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_policies_operations.py +++ b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_streaming_policies_operations.py @@ -81,7 +81,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" def prepare_request(next_link=None): @@ -129,7 +129,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ def get( streaming_policy_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.StreamingPolicy"] + # type: (...) -> "_models.StreamingPolicy" """Get a Streaming Policy. Get the details of a Streaming Policy in the Media Services account. @@ -160,15 +160,15 @@ def get( :type streaming_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: StreamingPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.StreamingPolicy or None + :rtype: ~azure.mgmt.media.models.StreamingPolicy :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.StreamingPolicy"]] + cls = kwargs.pop('cls', None) # type: ClsType["_models.StreamingPolicy"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -193,14 +193,12 @@ def get( pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('StreamingPolicy', pipeline_response) + deserialized = self._deserialize('StreamingPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -239,7 +237,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -271,7 +269,7 @@ def create( if response.status_code not in [201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('StreamingPolicy', pipeline_response) @@ -310,7 +308,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -337,7 +335,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_transforms_operations.py b/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_transforms_operations.py deleted file mode 100644 index 365c14892355..000000000000 --- a/sdk/media/azure-mgmt-media/azure/mgmt/media/operations/_transforms_operations.py +++ /dev/null @@ -1,417 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class TransformsOperations(object): - """TransformsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.media.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - account_name, # type: str - filter=None, # type: Optional[str] - orderby=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TransformCollection"] - """List Transforms. - - Lists the Transforms in the account. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param filter: Restricts the set of items returned. - :type filter: str - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransformCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.media.models.TransformCollection] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransformCollection"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('TransformCollection', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.odata_next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms'} # type: ignore - - def get( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.Transform"] - """Get Transform. - - Gets a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform or None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Transform"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 404]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - parameters, # type: "_models.Transform" - **kwargs # type: Any - ): - # type: (...) -> "_models.Transform" - """Create or Update Transform. - - Creates or updates a new Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Transform - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Transform"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Transform') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Transform', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Delete Transform. - - Deletes a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - account_name, # type: str - transform_name, # type: str - parameters, # type: "_models.Transform" - **kwargs # type: Any - ): - # type: (...) -> "_models.Transform" - """Update Transform. - - Updates a Transform. - - :param resource_group_name: The name of the resource group within the Azure subscription. - :type resource_group_name: str - :param account_name: The Media Services account name. - :type account_name: str - :param transform_name: The Transform name. - :type transform_name: str - :param parameters: The request parameters. - :type parameters: ~azure.mgmt.media.models.Transform - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Transform, or the result of cls(response) - :rtype: ~azure.mgmt.media.models.Transform - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Transform"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - 'transformName': self._serialize.url("transform_name", transform_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'Transform') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ApiError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Transform', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/mediaServices/{accountName}/transforms/{transformName}'} # type: ignore