From f2e7f3452a1c1900db4b1cf44accac20f62ba609 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 21 Jul 2021 06:17:28 +0000 Subject: [PATCH] CodeGen from PR 15281 in Azure/azure-rest-api-specs Fix descriptions for encoding types (#15281) --- sdk/media/azure-mgmt-media/_meta.json | 11 +- .../azure/mgmt/media/_azure_media_services.py | 10 +- .../azure/mgmt/media/_configuration.py | 1 + .../azure/mgmt/media/_metadata.json | 6 +- .../azure/mgmt/media/_version.py | 2 +- .../mgmt/media/aio/_azure_media_services.py | 10 +- .../azure/mgmt/media/aio/_configuration.py | 1 + .../mgmt/media/aio/operations/__init__.py | 4 +- .../operations/_account_filters_operations.py | 42 +- .../operations/_asset_filters_operations.py | 42 +- .../aio/operations/_assets_operations.py | 60 ++- .../_content_key_policies_operations.py | 60 ++- .../media/aio/operations/_jobs_operations.py | 48 +- .../aio/operations/_live_events_operations.py | 108 +++-- .../operations/_live_outputs_operations.py | 48 +- .../aio/operations/_locations_operations.py | 6 +- .../operations/_mediaservices_operations.py | 48 +- .../mgmt/media/aio/operations/_operations.py | 83 ++-- ...private_endpoint_connections_operations.py | 26 +- .../_private_link_resources_operations.py | 12 +- .../_streaming_endpoints_operations.py | 96 ++-- .../_streaming_locators_operations.py | 48 +- .../_streaming_policies_operations.py | 36 +- .../aio/operations/_transforms_operations.py | 42 +- .../azure/mgmt/media/models/__init__.py | 38 +- .../models/_azure_media_services_enums.py | 65 ++- .../azure/mgmt/media/models/_models.py | 405 +++++++++++----- .../azure/mgmt/media/models/_models_py3.py | 443 ++++++++++++------ .../azure/mgmt/media/operations/__init__.py | 4 +- .../operations/_account_filters_operations.py | 32 +- .../operations/_asset_filters_operations.py | 32 +- .../media/operations/_assets_operations.py | 44 +- .../_content_key_policies_operations.py | 48 +- .../mgmt/media/operations/_jobs_operations.py | 36 +- .../operations/_live_events_operations.py | 76 ++- .../operations/_live_outputs_operations.py | 36 +- .../media/operations/_locations_operations.py | 4 +- .../operations/_mediaservices_operations.py | 32 +- .../mgmt/media/operations/_operations.py | 79 ++-- ...private_endpoint_connections_operations.py | 18 +- .../_private_link_resources_operations.py | 8 +- .../_streaming_endpoints_operations.py | 68 ++- .../_streaming_locators_operations.py | 36 +- .../_streaming_policies_operations.py | 28 +- .../operations/_transforms_operations.py | 32 +- 45 files changed, 1366 insertions(+), 1048 deletions(-) diff --git a/sdk/media/azure-mgmt-media/_meta.json b/sdk/media/azure-mgmt-media/_meta.json index aebbc61c3197..2a89ddffeb97 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.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "c2ec03e5faa411e9a6785c15c3ddbd812e67ba7b", "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.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "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..1eea00c94747 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,12 +19,12 @@ 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 @@ -41,8 +41,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,6 +51,8 @@ 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 @@ -99,8 +99,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,6 +109,8 @@ 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( 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..a6028e57de4c 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,12 +98,12 @@ "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", 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..8f29e300555b 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,12 +17,12 @@ 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 @@ -39,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.aio.operations.AccountFiltersOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.media.aio.operations.Operations :ivar mediaservices: MediaservicesOperations operations @@ -51,6 +49,8 @@ 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 @@ -96,8 +96,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,6 +106,8 @@ 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( 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..c6099c10f9ba 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,12 +6,12 @@ # 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 @@ -24,12 +24,12 @@ from ._streaming_endpoints_operations import StreamingEndpointsOperations __all__ = [ - 'AccountFiltersOperations', 'Operations', 'MediaservicesOperations', 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 'LocationsOperations', + 'AccountFiltersOperations', 'AssetsOperations', 'AssetFiltersOperations', 'ContentKeyPoliciesOperations', 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 index 59a0bdf5d593..85a615d44aa5 100644 --- 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 @@ -48,7 +48,7 @@ def list( transform_name: str, filter: Optional[str] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.JobCollection"]: """List Jobs. @@ -74,7 +74,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): @@ -121,7 +121,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) @@ -138,8 +138,8 @@ async def get( account_name: str, transform_name: str, job_name: str, - **kwargs - ) -> Optional["_models.Job"]: + **kwargs: Any + ) -> "_models.Job": """Get Job. Gets a Job. @@ -154,15 +154,15 @@ async def get( :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 + :rtype: ~azure.mgmt.media.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] + 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" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -188,14 +188,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('Job', pipeline_response) + deserialized = self._deserialize('Job', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -210,7 +208,7 @@ async def create( transform_name: str, job_name: str, parameters: "_models.Job", - **kwargs + **kwargs: Any ) -> "_models.Job": """Create Job. @@ -236,7 +234,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" @@ -269,7 +267,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('Job', pipeline_response) @@ -286,7 +284,7 @@ async def delete( account_name: str, transform_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete Job. @@ -310,7 +308,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 @@ -338,7 +336,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: @@ -353,7 +351,7 @@ async def update( transform_name: str, job_name: str, parameters: "_models.Job", - **kwargs + **kwargs: Any ) -> "_models.Job": """Update Job. @@ -381,7 +379,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" @@ -414,7 +412,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('Job', pipeline_response) @@ -431,7 +429,7 @@ async def cancel_job( account_name: str, transform_name: str, job_name: str, - **kwargs + **kwargs: Any ) -> None: """Cancel Job. @@ -455,7 +453,7 @@ async def cancel_job( 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 @@ -483,7 +481,7 @@ async def cancel_job( 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: 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 index e429116f5d23..87747c7b59b3 100644 --- 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 @@ -47,7 +47,7 @@ def list( account_name: str, filter: Optional[str] = None, orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.TransformCollection"]: """List Transforms. @@ -71,7 +71,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): @@ -117,7 +117,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) @@ -133,8 +133,8 @@ async def get( resource_group_name: str, account_name: str, transform_name: str, - **kwargs - ) -> Optional["_models.Transform"]: + **kwargs: Any + ) -> "_models.Transform": """Get Transform. Gets a Transform. @@ -147,15 +147,15 @@ async def get( :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 + :rtype: ~azure.mgmt.media.models.Transform :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Transform"]] + 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" + 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('Transform', pipeline_response) + deserialized = self._deserialize('Transform', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -201,7 +199,7 @@ async def create_or_update( account_name: str, transform_name: str, parameters: "_models.Transform", - **kwargs + **kwargs: Any ) -> "_models.Transform": """Create or Update Transform. @@ -225,7 +223,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" @@ -257,7 +255,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: @@ -277,7 +275,7 @@ async def delete( resource_group_name: str, account_name: str, transform_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete Transform. @@ -299,7 +297,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 @@ -326,7 +324,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: @@ -340,7 +338,7 @@ async def update( account_name: str, transform_name: str, parameters: "_models.Transform", - **kwargs + **kwargs: Any ) -> "_models.Transform": """Update Transform. @@ -364,7 +362,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" @@ -396,7 +394,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('Transform', pipeline_response) 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..47407a7cff31 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 @@ -15,7 +15,6 @@ 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 @@ -72,6 +71,9 @@ from ._models_py3 import EnabledProtocols from ._models_py3 import EntityNameAvailabilityCheckOutput from ._models_py3 import EnvelopeEncryption + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse from ._models_py3 import FaceDetectorPreset from ._models_py3 import FilterTrackPropertyCondition from ._models_py3 import FilterTrackSelection @@ -129,7 +131,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 @@ -140,7 +141,6 @@ 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 @@ -151,6 +151,7 @@ from ._models_py3 import PngLayer from ._models_py3 import PresentationTimeRange from ._models_py3 import Preset + from ._models_py3 import PresetConfigurations from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionListResult @@ -158,10 +159,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 ResourceIdentity from ._models_py3 import SelectAudioTrackByAttribute from ._models_py3 import SelectAudioTrackById from ._models_py3 import SelectVideoTrackByAttribute @@ -195,6 +196,7 @@ from ._models_py3 import TransformCollection from ._models_py3 import TransformOutput from ._models_py3 import TransportStreamFormat + from ._models_py3 import UserAssignedManagedIdentity from ._models_py3 import UtcClipTime from ._models_py3 import Video from ._models_py3 import VideoAnalyzerPreset @@ -210,7 +212,6 @@ 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 @@ -267,6 +268,9 @@ from ._models import EnabledProtocols # type: ignore from ._models import EntityNameAvailabilityCheckOutput # type: ignore from ._models import EnvelopeEncryption # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore from ._models import FaceDetectorPreset # type: ignore from ._models import FilterTrackPropertyCondition # type: ignore from ._models import FilterTrackSelection # type: ignore @@ -324,7 +328,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 @@ -335,7 +338,6 @@ 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 @@ -346,6 +348,7 @@ from ._models import PngLayer # type: ignore from ._models import PresentationTimeRange # type: ignore from ._models import Preset # type: ignore + from ._models import PresetConfigurations # type: ignore from ._models import PrivateEndpoint # type: ignore from ._models import PrivateEndpointConnection # type: ignore from ._models import PrivateEndpointConnectionListResult # type: ignore @@ -353,10 +356,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 ResourceIdentity # type: ignore from ._models import SelectAudioTrackByAttribute # type: ignore from ._models import SelectAudioTrackById # type: ignore from ._models import SelectVideoTrackByAttribute # type: ignore @@ -390,6 +393,7 @@ from ._models import TransformCollection # type: ignore from ._models import TransformOutput # type: ignore from ._models import TransportStreamFormat # type: ignore + from ._models import UserAssignedManagedIdentity # type: ignore from ._models import UtcClipTime # type: ignore from ._models import Video # type: ignore from ._models import VideoAnalyzerPreset # type: ignore @@ -408,6 +412,7 @@ AudioAnalysisMode, BlurType, ChannelMapping, + Complexity, ContentKeyPolicyFairPlayRentalAndLeaseKeyType, ContentKeyPolicyPlayReadyContentType, ContentKeyPolicyPlayReadyLicenseType, @@ -428,6 +433,7 @@ H265Complexity, H265VideoProfile, InsightsType, + InterleaveOutput, JobErrorCategory, JobErrorCode, JobRetry, @@ -436,13 +442,13 @@ LiveEventInputProtocol, LiveEventResourceState, LiveOutputResourceState, - ManagedIdentityType, MetricAggregationType, MetricUnit, OnErrorType, Priority, PrivateEndpointConnectionProvisioningState, PrivateEndpointServiceConnectionStatus, + PublicNetworkAccess, Rotation, StorageAccountType, StorageAuthentication, @@ -466,7 +472,6 @@ 'AccountFilterCollection', 'AkamaiAccessControl', 'AkamaiSignatureHeaderAuthenticationKey', - 'ApiError', 'Asset', 'AssetCollection', 'AssetContainerSas', @@ -523,6 +528,9 @@ 'EnabledProtocols', 'EntityNameAvailabilityCheckOutput', 'EnvelopeEncryption', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'FaceDetectorPreset', 'FilterTrackPropertyCondition', 'FilterTrackSelection', @@ -580,7 +588,6 @@ 'LiveEventTranscription', 'LiveOutput', 'LiveOutputListResult', - 'Location', 'LogSpecification', 'MediaService', 'MediaServiceCollection', @@ -591,7 +598,6 @@ 'Mp4Format', 'MultiBitrateFormat', 'NoEncryption', - 'ODataError', 'Operation', 'OperationCollection', 'OperationDisplay', @@ -602,6 +608,7 @@ 'PngLayer', 'PresentationTimeRange', 'Preset', + 'PresetConfigurations', 'PrivateEndpoint', 'PrivateEndpointConnection', 'PrivateEndpointConnectionListResult', @@ -609,10 +616,10 @@ 'PrivateLinkResourceListResult', 'PrivateLinkServiceConnectionState', 'Properties', - 'Provider', 'ProxyResource', 'Rectangle', 'Resource', + 'ResourceIdentity', 'SelectAudioTrackByAttribute', 'SelectAudioTrackById', 'SelectVideoTrackByAttribute', @@ -646,6 +653,7 @@ 'TransformCollection', 'TransformOutput', 'TransportStreamFormat', + 'UserAssignedManagedIdentity', 'UtcClipTime', 'Video', 'VideoAnalyzerPreset', @@ -662,6 +670,7 @@ 'AudioAnalysisMode', 'BlurType', 'ChannelMapping', + 'Complexity', 'ContentKeyPolicyFairPlayRentalAndLeaseKeyType', 'ContentKeyPolicyPlayReadyContentType', 'ContentKeyPolicyPlayReadyLicenseType', @@ -682,6 +691,7 @@ 'H265Complexity', 'H265VideoProfile', 'InsightsType', + 'InterleaveOutput', 'JobErrorCategory', 'JobErrorCode', 'JobRetry', @@ -690,13 +700,13 @@ 'LiveEventInputProtocol', 'LiveEventResourceState', 'LiveOutputResourceState', - 'ManagedIdentityType', 'MetricAggregationType', 'MetricUnit', 'OnErrorType', 'Priority', 'PrivateEndpointConnectionProvisioningState', 'PrivateEndpointServiceConnectionStatus', + 'PublicNetworkAccess', 'Rotation', 'StorageAccountType', 'StorageAuthentication', 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..055d1e175ff0 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 @@ -155,6 +155,20 @@ class ChannelMapping(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The Right Stereo channel. Sometimes referred to as Down Mix Right. STEREO_RIGHT = "StereoRight" +class Complexity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Allows you to configure the encoder settings to control the balance between speed and quality. + Example: set Complexity as Speed for faster encoding but less compression efficiency. + """ + + #: Configures the encoder to use settings optimized for faster encoding. Quality is sacrificed to + #: decrease encoding time. + SPEED = "Speed" + #: Configures the encoder to use settings that achieve a balance between speed and quality. + BALANCED = "Balanced" + #: Configures the encoder to use settings optimized to produce higher quality output at the + #: expense of slower overall encode time. + QUALITY = "Quality" + class ContentKeyPolicyFairPlayRentalAndLeaseKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The rental and lease key type. """ @@ -468,6 +482,17 @@ class InsightsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: Generate both audio and video insights. Fails if either audio or video Insights fail. ALL_INSIGHTS = "AllInsights" +class InterleaveOutput(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Sets the interleave mode of the output to control how audio and video are stored in the + container format. Example: set InterleavedOutput as NonInterleavedOutput to produce audio-only + and video-only outputs in separate MP4 files. + """ + + #: The output is video-only or audio-only. + NON_INTERLEAVED_OUTPUT = "NonInterleavedOutput" + #: The output includes both audio and video. + INTERLEAVED_OUTPUT = "InterleavedOutput" + class JobErrorCategory(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Helps with categorization of errors. """ @@ -547,15 +572,15 @@ class JobState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): 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 - 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. + """Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the + service simply passes through the incoming video and audio layer(s) to the output. When + encodingType is set to 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. """ - #: A contribution live encoder sends a multiple bitrate stream. The ingested stream passes through - #: the live event without any further processing. It is also called the pass-through mode. + #: This is the same as PassthroughStandard, please see description below. This enumeration value + #: is being deprecated. NONE = "None" #: A contribution live encoder sends a single bitrate stream to the live event and Media Services #: creates multiple bitrate streams. The output cannot exceed 720p in resolution. @@ -563,6 +588,14 @@ 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" + #: The ingested stream passes through the live event from the contribution encoder without any + #: further processing. In the PassthroughBasic mode, ingestion is limited to up to 5Mbps and only + #: 1 concurrent live output is allowed. Live transcription is not available. + PASSTHROUGH_BASIC = "PassthroughBasic" + #: The ingested stream passes through the live event from the contribution encoder without any + #: further processing. Live transcription is available. Ingestion bitrate limits are much higher + #: and up to 3 concurrent live outputs are allowed. + 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 +652,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 """ @@ -694,6 +718,15 @@ class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnum APPROVED = "Approved" REJECTED = "Rejected" +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether or not public network access is allowed for resources under the Media Services account. + """ + + #: Public network access is enabled. + ENABLED = "Enabled" + #: Public network access is disabled. + DISABLED = "Disabled" + 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 """ 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..be5aa0f0ec39 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 @@ -229,6 +229,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 +238,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 +263,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 +460,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. @@ -1056,6 +1048,10 @@ class BuiltInStandardEncoderPreset(Preset): :param odata_type: Required. The discriminator for derived types.Constant filled by server. :type odata_type: str + :param configurations: PresetConfigurations are only supported for the ContentAwareEncoding and + H265ContentAwareEncoding built-in presets. These settings will not affect other built-in or + custom defined presets. + :type configurations: ~azure.mgmt.media.models.PresetConfigurations :param preset_name: Required. The built-in preset to be used for encoding videos. Possible values include: "H264SingleBitrateSD", "H264SingleBitrate720p", "H264SingleBitrate1080p", "AdaptiveStreaming", "AACGoodQualityAudio", "ContentAwareEncodingExperimental", @@ -1073,6 +1069,7 @@ class BuiltInStandardEncoderPreset(Preset): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'configurations': {'key': 'configurations', 'type': 'PresetConfigurations'}, 'preset_name': {'key': 'presetName', 'type': 'str'}, } @@ -1082,6 +1079,7 @@ def __init__( ): super(BuiltInStandardEncoderPreset, self).__init__(**kwargs) self.odata_type = '#Microsoft.Media.BuiltInStandardEncoderPreset' # type: str + self.configurations = kwargs.get('configurations', None) self.preset_name = kwargs['preset_name'] @@ -2522,6 +2520,100 @@ def __init__( self.custom_key_acquisition_url_template = kwargs.get('custom_key_acquisition_url_template', None) +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + '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(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +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 error: The error object. + :type error: ~azure.mgmt.media.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', 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. @@ -3883,7 +3975,8 @@ class JobInputClip(JobInput): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -3939,7 +4032,8 @@ class JobInputAsset(JobInputClip): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -3991,7 +4085,8 @@ class JobInputHttp(JobInputClip): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -4010,7 +4105,8 @@ class JobInputHttp(JobInputClip): :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. + uris. Maximum length of 4000 characters. The query strings will not be returned in service + responses to prevent sensitive data exposure. :type base_uri: str """ @@ -4109,6 +4205,9 @@ class JobOutput(msrest.serialization.Model): :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 + :param preset_override: A preset used to override the preset in the corresponding transform + output. + :type preset_override: ~azure.mgmt.media.models.Preset :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 @@ -4145,6 +4244,7 @@ class JobOutput(msrest.serialization.Model): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'error': {'key': 'error', 'type': 'JobError'}, + 'preset_override': {'key': 'presetOverride', 'type': 'Preset'}, 'state': {'key': 'state', 'type': 'str'}, 'progress': {'key': 'progress', 'type': 'int'}, 'label': {'key': 'label', 'type': 'str'}, @@ -4163,6 +4263,7 @@ def __init__( super(JobOutput, self).__init__(**kwargs) self.odata_type = None # type: Optional[str] self.error = None + self.preset_override = kwargs.get('preset_override', None) self.state = None self.progress = None self.label = kwargs.get('label', None) @@ -4181,6 +4282,9 @@ class JobOutputAsset(JobOutput): :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 + :param preset_override: A preset used to override the preset in the corresponding transform + output. + :type preset_override: ~azure.mgmt.media.models.Preset :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 @@ -4220,6 +4324,7 @@ class JobOutputAsset(JobOutput): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'error': {'key': 'error', 'type': 'JobError'}, + 'preset_override': {'key': 'presetOverride', 'type': 'Preset'}, 'state': {'key': 'state', 'type': 'str'}, 'progress': {'key': 'progress', 'type': 'int'}, 'label': {'key': 'label', 'type': 'str'}, @@ -4756,12 +4861,13 @@ def __init__( class LiveEventEncoding(msrest.serialization.Model): """Specifies the live event type and optional encoding settings for encoding live events. - :param encoding_type: 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 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". + :param encoding_type: Live event type. When encodingType is set to PassthroughBasic or + PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to + the output. When encodingType is set to 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", "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 +5186,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 +5220,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 +5231,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 +5249,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 +5290,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 +5358,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 +5385,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 +5400,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 +5434,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 +5454,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 +5465,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 +5487,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 +5504,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 +5519,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): @@ -5651,37 +5751,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 +5801,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 +5813,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): @@ -6007,6 +6071,66 @@ def __init__( self.force_end_timestamp = kwargs.get('force_end_timestamp', None) +class PresetConfigurations(msrest.serialization.Model): + """An object of optional configuration settings for encoder. + + :param complexity: Allows you to configure the encoder settings to control the balance between + speed and quality. Example: set Complexity as Speed for faster encoding but less compression + efficiency. Possible values include: "Speed", "Balanced", "Quality". + :type complexity: str or ~azure.mgmt.media.models.Complexity + :param interleave_output: Sets the interleave mode of the output to control how audio and video + are stored in the container format. Example: set InterleavedOutput as NonInterleavedOutput to + produce audio-only and video-only outputs in separate MP4 files. Possible values include: + "NonInterleavedOutput", "InterleavedOutput". + :type interleave_output: str or ~azure.mgmt.media.models.InterleaveOutput + :param key_frame_interval_in_seconds: The key frame interval in seconds. Example: set + KeyFrameIntervalInSeconds as 2 to reduce the playback buffering for some players. + :type key_frame_interval_in_seconds: float + :param max_bitrate_bps: The maximum bitrate in bits per second (threshold for the top video + layer). Example: set MaxBitrateBps as 6000000 to avoid producing very high bitrate outputs for + contents with high complexity. + :type max_bitrate_bps: int + :param max_height: The maximum height of output video layers. Example: set MaxHeight as 720 to + produce output layers up to 720P even if the input is 4K. + :type max_height: int + :param max_layers: The maximum number of output video layers. Example: set MaxLayers as 4 to + make sure at most 4 output layers are produced to control the overall cost of the encoding job. + :type max_layers: int + :param min_bitrate_bps: The minimum bitrate in bits per second (threshold for the bottom video + layer). Example: set MinBitrateBps as 200000 to have a bottom layer that covers users with low + network bandwidth. + :type min_bitrate_bps: int + :param min_height: The minimum height of output video layers. Example: set MinHeight as 360 to + avoid output layers of smaller resolutions like 180P. + :type min_height: int + """ + + _attribute_map = { + 'complexity': {'key': 'complexity', 'type': 'str'}, + 'interleave_output': {'key': 'interleaveOutput', 'type': 'str'}, + 'key_frame_interval_in_seconds': {'key': 'keyFrameIntervalInSeconds', 'type': 'float'}, + 'max_bitrate_bps': {'key': 'maxBitrateBps', 'type': 'int'}, + 'max_height': {'key': 'maxHeight', 'type': 'int'}, + 'max_layers': {'key': 'maxLayers', 'type': 'int'}, + 'min_bitrate_bps': {'key': 'minBitrateBps', 'type': 'int'}, + 'min_height': {'key': 'minHeight', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(PresetConfigurations, self).__init__(**kwargs) + self.complexity = kwargs.get('complexity', None) + self.interleave_output = kwargs.get('interleave_output', None) + self.key_frame_interval_in_seconds = kwargs.get('key_frame_interval_in_seconds', None) + self.max_bitrate_bps = kwargs.get('max_bitrate_bps', None) + self.max_height = kwargs.get('max_height', None) + self.max_layers = kwargs.get('max_layers', None) + self.min_bitrate_bps = kwargs.get('min_bitrate_bps', None) + self.min_height = kwargs.get('min_height', None) + + class PrivateEndpoint(msrest.serialization.Model): """The Private Endpoint resource. @@ -6223,31 +6347,6 @@ def __init__( 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. @@ -6283,6 +6382,37 @@ def __init__( self.height = kwargs.get('height', None) +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'use_system_assigned_identity': {'required': True}, + } + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'use_system_assigned_identity': {'key': 'useSystemAssignedIdentity', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + 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 SelectAudioTrackByAttribute(AudioTrackDescriptor): """Select audio tracks from the input by specifying an attribute and an attribute filter. @@ -6546,6 +6676,8 @@ def __init__( 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 +6688,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 +6713,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): @@ -7494,6 +7635,36 @@ def __init__( self.odata_type = '#Microsoft.Media.TransportStreamFormat' # type: str +class UserAssignedManagedIdentity(msrest.serialization.Model): + """UserAssignedManagedIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str + """ + + _validation = { + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None + + 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. 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..43a4eff1ca4b 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 @@ -252,6 +252,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 +261,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 +284,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 +500,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. @@ -1138,6 +1129,10 @@ class BuiltInStandardEncoderPreset(Preset): :param odata_type: Required. The discriminator for derived types.Constant filled by server. :type odata_type: str + :param configurations: PresetConfigurations are only supported for the ContentAwareEncoding and + H265ContentAwareEncoding built-in presets. These settings will not affect other built-in or + custom defined presets. + :type configurations: ~azure.mgmt.media.models.PresetConfigurations :param preset_name: Required. The built-in preset to be used for encoding videos. Possible values include: "H264SingleBitrateSD", "H264SingleBitrate720p", "H264SingleBitrate1080p", "AdaptiveStreaming", "AACGoodQualityAudio", "ContentAwareEncodingExperimental", @@ -1155,6 +1150,7 @@ class BuiltInStandardEncoderPreset(Preset): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, + 'configurations': {'key': 'configurations', 'type': 'PresetConfigurations'}, 'preset_name': {'key': 'presetName', 'type': 'str'}, } @@ -1162,10 +1158,12 @@ def __init__( self, *, preset_name: Union[str, "EncoderNamedPreset"], + configurations: Optional["PresetConfigurations"] = None, **kwargs ): super(BuiltInStandardEncoderPreset, self).__init__(**kwargs) self.odata_type = '#Microsoft.Media.BuiltInStandardEncoderPreset' # type: str + self.configurations = configurations self.preset_name = preset_name @@ -2740,6 +2738,102 @@ def __init__( self.custom_key_acquisition_url_template = custom_key_acquisition_url_template +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :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 = { + '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(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +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 error: The error object. + :type error: ~azure.mgmt.media.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + 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. @@ -4231,7 +4325,8 @@ class JobInputClip(JobInput): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -4293,7 +4388,8 @@ class JobInputAsset(JobInputClip): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -4352,7 +4448,8 @@ class JobInputHttp(JobInputClip): :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. + :param files: List of files. Required for JobInputHttp. Maximum of 4000 characters each. Query + strings will not be returned in service responses to prevent sensitive data exposure. :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. @@ -4371,7 +4468,8 @@ class JobInputHttp(JobInputClip): :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. + uris. Maximum length of 4000 characters. The query strings will not be returned in service + responses to prevent sensitive data exposure. :type base_uri: str """ @@ -4481,6 +4579,9 @@ class JobOutput(msrest.serialization.Model): :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 + :param preset_override: A preset used to override the preset in the corresponding transform + output. + :type preset_override: ~azure.mgmt.media.models.Preset :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 @@ -4517,6 +4618,7 @@ class JobOutput(msrest.serialization.Model): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'error': {'key': 'error', 'type': 'JobError'}, + 'preset_override': {'key': 'presetOverride', 'type': 'Preset'}, 'state': {'key': 'state', 'type': 'str'}, 'progress': {'key': 'progress', 'type': 'int'}, 'label': {'key': 'label', 'type': 'str'}, @@ -4531,12 +4633,14 @@ class JobOutput(msrest.serialization.Model): def __init__( self, *, + preset_override: Optional["Preset"] = None, label: Optional[str] = None, **kwargs ): super(JobOutput, self).__init__(**kwargs) self.odata_type = None # type: Optional[str] self.error = None + self.preset_override = preset_override self.state = None self.progress = None self.label = label @@ -4555,6 +4659,9 @@ class JobOutputAsset(JobOutput): :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 + :param preset_override: A preset used to override the preset in the corresponding transform + output. + :type preset_override: ~azure.mgmt.media.models.Preset :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 @@ -4594,6 +4701,7 @@ class JobOutputAsset(JobOutput): _attribute_map = { 'odata_type': {'key': '@odata\\.type', 'type': 'str'}, 'error': {'key': 'error', 'type': 'JobError'}, + 'preset_override': {'key': 'presetOverride', 'type': 'Preset'}, 'state': {'key': 'state', 'type': 'str'}, 'progress': {'key': 'progress', 'type': 'int'}, 'label': {'key': 'label', 'type': 'str'}, @@ -4606,10 +4714,11 @@ def __init__( self, *, asset_name: str, + preset_override: Optional["Preset"] = None, label: Optional[str] = None, **kwargs ): - super(JobOutputAsset, self).__init__(label=label, **kwargs) + super(JobOutputAsset, self).__init__(preset_override=preset_override, label=label, **kwargs) self.odata_type = '#Microsoft.Media.JobOutputAsset' # type: str self.asset_name = asset_name @@ -5181,12 +5290,13 @@ def __init__( class LiveEventEncoding(msrest.serialization.Model): """Specifies the live event type and optional encoding settings for encoding live events. - :param encoding_type: 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 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". + :param encoding_type: Live event type. When encodingType is set to PassthroughBasic or + PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to + the output. When encodingType is set to 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", "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 +5653,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 +5687,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 +5698,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 +5723,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 +5768,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 +5836,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 +5863,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 +5876,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 +5887,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 +5924,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 +5944,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 +5980,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 +5997,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 +6009,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 +6020,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): @@ -6157,42 +6262,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 +6319,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): @@ -6557,6 +6620,75 @@ def __init__( self.force_end_timestamp = force_end_timestamp +class PresetConfigurations(msrest.serialization.Model): + """An object of optional configuration settings for encoder. + + :param complexity: Allows you to configure the encoder settings to control the balance between + speed and quality. Example: set Complexity as Speed for faster encoding but less compression + efficiency. Possible values include: "Speed", "Balanced", "Quality". + :type complexity: str or ~azure.mgmt.media.models.Complexity + :param interleave_output: Sets the interleave mode of the output to control how audio and video + are stored in the container format. Example: set InterleavedOutput as NonInterleavedOutput to + produce audio-only and video-only outputs in separate MP4 files. Possible values include: + "NonInterleavedOutput", "InterleavedOutput". + :type interleave_output: str or ~azure.mgmt.media.models.InterleaveOutput + :param key_frame_interval_in_seconds: The key frame interval in seconds. Example: set + KeyFrameIntervalInSeconds as 2 to reduce the playback buffering for some players. + :type key_frame_interval_in_seconds: float + :param max_bitrate_bps: The maximum bitrate in bits per second (threshold for the top video + layer). Example: set MaxBitrateBps as 6000000 to avoid producing very high bitrate outputs for + contents with high complexity. + :type max_bitrate_bps: int + :param max_height: The maximum height of output video layers. Example: set MaxHeight as 720 to + produce output layers up to 720P even if the input is 4K. + :type max_height: int + :param max_layers: The maximum number of output video layers. Example: set MaxLayers as 4 to + make sure at most 4 output layers are produced to control the overall cost of the encoding job. + :type max_layers: int + :param min_bitrate_bps: The minimum bitrate in bits per second (threshold for the bottom video + layer). Example: set MinBitrateBps as 200000 to have a bottom layer that covers users with low + network bandwidth. + :type min_bitrate_bps: int + :param min_height: The minimum height of output video layers. Example: set MinHeight as 360 to + avoid output layers of smaller resolutions like 180P. + :type min_height: int + """ + + _attribute_map = { + 'complexity': {'key': 'complexity', 'type': 'str'}, + 'interleave_output': {'key': 'interleaveOutput', 'type': 'str'}, + 'key_frame_interval_in_seconds': {'key': 'keyFrameIntervalInSeconds', 'type': 'float'}, + 'max_bitrate_bps': {'key': 'maxBitrateBps', 'type': 'int'}, + 'max_height': {'key': 'maxHeight', 'type': 'int'}, + 'max_layers': {'key': 'maxLayers', 'type': 'int'}, + 'min_bitrate_bps': {'key': 'minBitrateBps', 'type': 'int'}, + 'min_height': {'key': 'minHeight', 'type': 'int'}, + } + + def __init__( + self, + *, + complexity: Optional[Union[str, "Complexity"]] = None, + interleave_output: Optional[Union[str, "InterleaveOutput"]] = None, + key_frame_interval_in_seconds: Optional[float] = None, + max_bitrate_bps: Optional[int] = None, + max_height: Optional[int] = None, + max_layers: Optional[int] = None, + min_bitrate_bps: Optional[int] = None, + min_height: Optional[int] = None, + **kwargs + ): + super(PresetConfigurations, self).__init__(**kwargs) + self.complexity = complexity + self.interleave_output = interleave_output + self.key_frame_interval_in_seconds = key_frame_interval_in_seconds + self.max_bitrate_bps = max_bitrate_bps + self.max_height = max_height + self.max_layers = max_layers + self.min_bitrate_bps = min_bitrate_bps + self.min_height = min_height + + class PrivateEndpoint(msrest.serialization.Model): """The Private Endpoint resource. @@ -6786,33 +6918,6 @@ def __init__( 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. @@ -6853,6 +6958,40 @@ def __init__( self.height = height +class ResourceIdentity(msrest.serialization.Model): + """ResourceIdentity. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'use_system_assigned_identity': {'required': True}, + } + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'use_system_assigned_identity': {'key': 'useSystemAssignedIdentity', 'type': 'bool'}, + } + + def __init__( + self, + *, + use_system_assigned_identity: bool, + user_assigned_identity: Optional[str] = None, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + self.use_system_assigned_identity = use_system_assigned_identity + + class SelectAudioTrackByAttribute(AudioTrackDescriptor): """Select audio tracks from the input by specifying an attribute and an attribute filter. @@ -7134,6 +7273,8 @@ def __init__( 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 +7285,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 +7308,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): @@ -8183,6 +8334,36 @@ def __init__( self.odata_type = '#Microsoft.Media.TransportStreamFormat' # type: str +class UserAssignedManagedIdentity(msrest.serialization.Model): + """UserAssignedManagedIdentity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str + """ + + _validation = { + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None + + 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. 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..c6099c10f9ba 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,12 +6,12 @@ # 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 @@ -24,12 +24,12 @@ from ._streaming_endpoints_operations import StreamingEndpointsOperations __all__ = [ - 'AccountFiltersOperations', 'Operations', 'MediaservicesOperations', 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 'LocationsOperations', + 'AccountFiltersOperations', 'AssetsOperations', 'AssetFiltersOperations', 'ContentKeyPoliciesOperations', 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 index 2b1d4e6c2da1..401019c6bf44 100644 --- 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 @@ -79,7 +79,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): @@ -126,7 +126,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) @@ -145,7 +145,7 @@ def get( job_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.Job"] + # type: (...) -> "_models.Job" """Get Job. Gets a Job. @@ -160,15 +160,15 @@ def get( :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 + :rtype: ~azure.mgmt.media.models.Job :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Job"]] + 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" + api_version = "2021-06-01" accept = "application/json" # Construct URL @@ -194,14 +194,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('Job', pipeline_response) + deserialized = self._deserialize('Job', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -243,7 +241,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" @@ -276,7 +274,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('Job', pipeline_response) @@ -318,7 +316,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 @@ -346,7 +344,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: @@ -390,7 +388,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" @@ -423,7 +421,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('Job', pipeline_response) @@ -465,7 +463,7 @@ def cancel_job( 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 @@ -493,7 +491,7 @@ def cancel_job( 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: 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 index 365c14892355..612fdcd385f6 100644 --- 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 @@ -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): @@ -122,7 +122,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) @@ -140,7 +140,7 @@ def get( transform_name, # type: str **kwargs # type: Any ): - # type: (...) -> Optional["_models.Transform"] + # type: (...) -> "_models.Transform" """Get Transform. Gets a Transform. @@ -153,15 +153,15 @@ def get( :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 + :rtype: ~azure.mgmt.media.models.Transform :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.Transform"]] + 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" + 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('Transform', pipeline_response) + deserialized = self._deserialize('Transform', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) @@ -232,7 +230,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" @@ -264,7 +262,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: @@ -307,7 +305,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 @@ -334,7 +332,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 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" @@ -405,7 +403,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('Transform', pipeline_response)