From 48a22754e3a2cfc7f9fa035144888e09b117e977 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 21 Sep 2021 05:37:57 +0000 Subject: [PATCH] CodeGen from PR 16089 in Azure/azure-rest-api-specs Merge cf2673bac6a051f1bbd4d78acc8c60d13c7e82b4 into afd16a96232b181f8723fad99bfa658e51590631 --- .../azure-mgmt-videoanalyzer/_meta.json | 11 +- .../mgmt/videoanalyzer/_configuration.py | 2 +- .../azure/mgmt/videoanalyzer/_metadata.json | 19 +- .../azure/mgmt/videoanalyzer/_version.py | 2 +- .../mgmt/videoanalyzer/_video_analyzer.py | 58 +- .../mgmt/videoanalyzer/aio/_configuration.py | 2 +- .../mgmt/videoanalyzer/aio/_video_analyzer.py | 58 +- .../videoanalyzer/aio/operations/__init__.py | 22 +- .../operations/_access_policies_operations.py | 52 +- .../operations/_edge_modules_operations.py | 54 +- ..._pipeline_operation_statuses_operations.py | 110 + .../operations/_live_pipelines_operations.py | 647 ++++ .../aio/operations/_locations_operations.py | 4 +- .../aio/operations/_operations.py | 4 +- ...eline_job_operation_statuses_operations.py | 110 + .../operations/_pipeline_jobs_operations.py | 529 +++ .../_pipeline_topologies_operations.py | 411 +++ ...private_endpoint_connections_operations.py | 306 ++ .../_private_link_resources_operations.py | 167 + ...o_analyzer_operation_results_operations.py | 104 + ..._analyzer_operation_statuses_operations.py | 102 + .../operations/_video_analyzers_operations.py | 115 +- .../aio/operations/_videos_operations.py | 80 +- .../mgmt/videoanalyzer/models/__init__.py | 209 +- .../mgmt/videoanalyzer/models/_models.py | 2970 +++++++++++++--- .../mgmt/videoanalyzer/models/_models_py3.py | 3168 ++++++++++++++--- .../models/_video_analyzer_enums.py | 161 +- .../mgmt/videoanalyzer/operations/__init__.py | 22 +- .../operations/_access_policies_operations.py | 42 +- .../operations/_edge_modules_operations.py | 44 +- ..._pipeline_operation_statuses_operations.py | 115 + .../operations/_live_pipelines_operations.py | 660 ++++ .../operations/_locations_operations.py | 2 +- .../videoanalyzer/operations/_operations.py | 2 +- ...eline_job_operation_statuses_operations.py | 115 + .../operations/_pipeline_jobs_operations.py | 540 +++ .../_pipeline_topologies_operations.py | 420 +++ ...private_endpoint_connections_operations.py | 314 ++ .../_private_link_resources_operations.py | 173 + ...o_analyzer_operation_results_operations.py | 109 + ..._analyzer_operation_statuses_operations.py | 107 + .../operations/_video_analyzers_operations.py | 104 +- .../operations/_videos_operations.py | 68 +- 43 files changed, 11058 insertions(+), 1256 deletions(-) create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipeline_operation_statuses_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipelines_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_job_operation_statuses_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_jobs_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_topologies_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_link_resources_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_results_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_statuses_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipeline_operation_statuses_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipelines_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_job_operation_statuses_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_jobs_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_topologies_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_endpoint_connections_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_link_resources_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_results_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_statuses_operations.py diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/_meta.json b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/_meta.json index 99fe2b92ff5c3..2d47647123532 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/_meta.json +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/_meta.json @@ -1,8 +1,11 @@ { - "autorest": "3.3.0", - "use": "@autorest/python@5.6.6", - "commit": "eb9ccccdb6561516fdd75082309877565a303bb7", + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "36414d8fe4d0b32973cec08689b931984f0b7b6a", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/videoanalyzer/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/videoanalyzer/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/videoanalyzer/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_configuration.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_configuration.py index 5189da18bb31d..2bab80227252d 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_configuration.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-05-01-preview" + self.api_version = "2021-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-videoanalyzer/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_metadata.json b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_metadata.json index 5210ce1facf27..0351e045cc0d7 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_metadata.json +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_metadata.json @@ -1,14 +1,14 @@ { - "chosen_version": "2021-05-01-preview", - "total_api_version_list": ["2021-05-01-preview"], + "chosen_version": "2021-11-01-preview", + "total_api_version_list": ["2021-11-01-preview"], "client": { "name": "VideoAnalyzer", "filename": "_video_analyzer", - "description": "Azure Video Analyzer ARM Client.", + "description": "Azure Video Analyzer provides a platform for you to build intelligent video applications that span the edge and the cloud.", "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false, + "has_lro_operations": true, "client_side_validation": false, "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"VideoAnalyzerConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"VideoAnalyzerConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" @@ -98,10 +98,19 @@ "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": { + "edge_modules": "EdgeModulesOperations", + "pipeline_topologies": "PipelineTopologiesOperations", + "live_pipelines": "LivePipelinesOperations", + "pipeline_jobs": "PipelineJobsOperations", + "live_pipeline_operation_statuses": "LivePipelineOperationStatusesOperations", + "pipeline_job_operation_statuses": "PipelineJobOperationStatusesOperations", "operations": "Operations", "video_analyzers": "VideoAnalyzersOperations", + "private_link_resources": "PrivateLinkResourcesOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "video_analyzer_operation_statuses": "VideoAnalyzerOperationStatusesOperations", + "video_analyzer_operation_results": "VideoAnalyzerOperationResultsOperations", "locations": "LocationsOperations", - "edge_modules": "EdgeModulesOperations", "videos": "VideosOperations", "access_policies": "AccessPoliciesOperations" } diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_version.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_version.py index dfa6ee022f154..e5754a47ce68f 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_version.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b2" +VERSION = "1.0.0b1" diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_video_analyzer.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_video_analyzer.py index 2a4ed30dd70e1..b08196714d801 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_video_analyzer.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/_video_analyzer.py @@ -19,26 +19,53 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import VideoAnalyzerConfiguration +from .operations import EdgeModulesOperations +from .operations import PipelineTopologiesOperations +from .operations import LivePipelinesOperations +from .operations import PipelineJobsOperations +from .operations import LivePipelineOperationStatusesOperations +from .operations import PipelineJobOperationStatusesOperations from .operations import Operations from .operations import VideoAnalyzersOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import VideoAnalyzerOperationStatusesOperations +from .operations import VideoAnalyzerOperationResultsOperations from .operations import LocationsOperations -from .operations import EdgeModulesOperations from .operations import VideosOperations from .operations import AccessPoliciesOperations from . import models class VideoAnalyzer(object): - """Azure Video Analyzer ARM Client. + """Azure Video Analyzer provides a platform for you to build intelligent video applications that span the edge and the cloud. + :ivar edge_modules: EdgeModulesOperations operations + :vartype edge_modules: video_analyzer.operations.EdgeModulesOperations + :ivar pipeline_topologies: PipelineTopologiesOperations operations + :vartype pipeline_topologies: video_analyzer.operations.PipelineTopologiesOperations + :ivar live_pipelines: LivePipelinesOperations operations + :vartype live_pipelines: video_analyzer.operations.LivePipelinesOperations + :ivar pipeline_jobs: PipelineJobsOperations operations + :vartype pipeline_jobs: video_analyzer.operations.PipelineJobsOperations + :ivar live_pipeline_operation_statuses: LivePipelineOperationStatusesOperations operations + :vartype live_pipeline_operation_statuses: video_analyzer.operations.LivePipelineOperationStatusesOperations + :ivar pipeline_job_operation_statuses: PipelineJobOperationStatusesOperations operations + :vartype pipeline_job_operation_statuses: video_analyzer.operations.PipelineJobOperationStatusesOperations :ivar operations: Operations operations :vartype operations: video_analyzer.operations.Operations :ivar video_analyzers: VideoAnalyzersOperations operations :vartype video_analyzers: video_analyzer.operations.VideoAnalyzersOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: video_analyzer.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: video_analyzer.operations.PrivateEndpointConnectionsOperations + :ivar video_analyzer_operation_statuses: VideoAnalyzerOperationStatusesOperations operations + :vartype video_analyzer_operation_statuses: video_analyzer.operations.VideoAnalyzerOperationStatusesOperations + :ivar video_analyzer_operation_results: VideoAnalyzerOperationResultsOperations operations + :vartype video_analyzer_operation_results: video_analyzer.operations.VideoAnalyzerOperationResultsOperations :ivar locations: LocationsOperations operations :vartype locations: video_analyzer.operations.LocationsOperations - :ivar edge_modules: EdgeModulesOperations operations - :vartype edge_modules: video_analyzer.operations.EdgeModulesOperations :ivar videos: VideosOperations operations :vartype videos: video_analyzer.operations.VideosOperations :ivar access_policies: AccessPoliciesOperations operations @@ -48,6 +75,7 @@ class VideoAnalyzer(object): :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -68,13 +96,31 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.edge_modules = EdgeModulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_topologies = PipelineTopologiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.live_pipelines = LivePipelinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_jobs = PipelineJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.live_pipeline_operation_statuses = LivePipelineOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_job_operation_statuses = PipelineJobOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.video_analyzers = VideoAnalyzersOperations( self._client, self._config, self._serialize, self._deserialize) - self.locations = LocationsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) - self.edge_modules = EdgeModulesOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.video_analyzer_operation_statuses = VideoAnalyzerOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.video_analyzer_operation_results = VideoAnalyzerOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) self.videos = VideosOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_configuration.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_configuration.py index 463b9ec5754dc..38c602c95f7f2 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_configuration.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-05-01-preview" + self.api_version = "2021-11-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-videoanalyzer/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_video_analyzer.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_video_analyzer.py index 879877551fef7..644ae5a099fa8 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_video_analyzer.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/_video_analyzer.py @@ -17,26 +17,53 @@ from azure.core.credentials_async import AsyncTokenCredential from ._configuration import VideoAnalyzerConfiguration +from .operations import EdgeModulesOperations +from .operations import PipelineTopologiesOperations +from .operations import LivePipelinesOperations +from .operations import PipelineJobsOperations +from .operations import LivePipelineOperationStatusesOperations +from .operations import PipelineJobOperationStatusesOperations from .operations import Operations from .operations import VideoAnalyzersOperations +from .operations import PrivateLinkResourcesOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import VideoAnalyzerOperationStatusesOperations +from .operations import VideoAnalyzerOperationResultsOperations from .operations import LocationsOperations -from .operations import EdgeModulesOperations from .operations import VideosOperations from .operations import AccessPoliciesOperations from .. import models class VideoAnalyzer(object): - """Azure Video Analyzer ARM Client. + """Azure Video Analyzer provides a platform for you to build intelligent video applications that span the edge and the cloud. + :ivar edge_modules: EdgeModulesOperations operations + :vartype edge_modules: video_analyzer.aio.operations.EdgeModulesOperations + :ivar pipeline_topologies: PipelineTopologiesOperations operations + :vartype pipeline_topologies: video_analyzer.aio.operations.PipelineTopologiesOperations + :ivar live_pipelines: LivePipelinesOperations operations + :vartype live_pipelines: video_analyzer.aio.operations.LivePipelinesOperations + :ivar pipeline_jobs: PipelineJobsOperations operations + :vartype pipeline_jobs: video_analyzer.aio.operations.PipelineJobsOperations + :ivar live_pipeline_operation_statuses: LivePipelineOperationStatusesOperations operations + :vartype live_pipeline_operation_statuses: video_analyzer.aio.operations.LivePipelineOperationStatusesOperations + :ivar pipeline_job_operation_statuses: PipelineJobOperationStatusesOperations operations + :vartype pipeline_job_operation_statuses: video_analyzer.aio.operations.PipelineJobOperationStatusesOperations :ivar operations: Operations operations :vartype operations: video_analyzer.aio.operations.Operations :ivar video_analyzers: VideoAnalyzersOperations operations :vartype video_analyzers: video_analyzer.aio.operations.VideoAnalyzersOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: video_analyzer.aio.operations.PrivateLinkResourcesOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: video_analyzer.aio.operations.PrivateEndpointConnectionsOperations + :ivar video_analyzer_operation_statuses: VideoAnalyzerOperationStatusesOperations operations + :vartype video_analyzer_operation_statuses: video_analyzer.aio.operations.VideoAnalyzerOperationStatusesOperations + :ivar video_analyzer_operation_results: VideoAnalyzerOperationResultsOperations operations + :vartype video_analyzer_operation_results: video_analyzer.aio.operations.VideoAnalyzerOperationResultsOperations :ivar locations: LocationsOperations operations :vartype locations: video_analyzer.aio.operations.LocationsOperations - :ivar edge_modules: EdgeModulesOperations operations - :vartype edge_modules: video_analyzer.aio.operations.EdgeModulesOperations :ivar videos: VideosOperations operations :vartype videos: video_analyzer.aio.operations.VideosOperations :ivar access_policies: AccessPoliciesOperations operations @@ -46,6 +73,7 @@ class VideoAnalyzer(object): :param subscription_id: The ID of the target subscription. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -65,13 +93,31 @@ def __init__( self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) + self.edge_modules = EdgeModulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_topologies = PipelineTopologiesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.live_pipelines = LivePipelinesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_jobs = PipelineJobsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.live_pipeline_operation_statuses = LivePipelineOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.pipeline_job_operation_statuses = PipelineJobOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) self.video_analyzers = VideoAnalyzersOperations( self._client, self._config, self._serialize, self._deserialize) - self.locations = LocationsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) - self.edge_modules = EdgeModulesOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.video_analyzer_operation_statuses = VideoAnalyzerOperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.video_analyzer_operation_results = VideoAnalyzerOperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.locations = LocationsOperations( self._client, self._config, self._serialize, self._deserialize) self.videos = VideosOperations( self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/__init__.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/__init__.py index 1ee2a23110a08..eed3976cadd80 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/__init__.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/__init__.py @@ -6,18 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._edge_modules_operations import EdgeModulesOperations +from ._pipeline_topologies_operations import PipelineTopologiesOperations +from ._live_pipelines_operations import LivePipelinesOperations +from ._pipeline_jobs_operations import PipelineJobsOperations +from ._live_pipeline_operation_statuses_operations import LivePipelineOperationStatusesOperations +from ._pipeline_job_operation_statuses_operations import PipelineJobOperationStatusesOperations from ._operations import Operations from ._video_analyzers_operations import VideoAnalyzersOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._video_analyzer_operation_statuses_operations import VideoAnalyzerOperationStatusesOperations +from ._video_analyzer_operation_results_operations import VideoAnalyzerOperationResultsOperations from ._locations_operations import LocationsOperations -from ._edge_modules_operations import EdgeModulesOperations from ._videos_operations import VideosOperations from ._access_policies_operations import AccessPoliciesOperations __all__ = [ + 'EdgeModulesOperations', + 'PipelineTopologiesOperations', + 'LivePipelinesOperations', + 'PipelineJobsOperations', + 'LivePipelineOperationStatusesOperations', + 'PipelineJobOperationStatusesOperations', 'Operations', 'VideoAnalyzersOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', + 'VideoAnalyzerOperationStatusesOperations', + 'VideoAnalyzerOperationResultsOperations', 'LocationsOperations', - 'EdgeModulesOperations', 'VideosOperations', 'AccessPoliciesOperations', ] diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_access_policies_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_access_policies_operations.py index 41824113eb94e..9ec581a27dcf2 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_access_policies_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_access_policies_operations.py @@ -46,11 +46,11 @@ def list( resource_group_name: str, account_name: str, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AccessPolicyEntityCollection"]: - """List access policy resources. + """List all existing access policy resources. - List all existing access policy resources for the specified account. + List all existing access policy resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -130,17 +130,17 @@ async def get( resource_group_name: str, account_name: str, access_policy_name: str, - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyEntity": - """Retrieves an access policy resource. + """Retrieves an existing access policy resource. - Retrieves an existing access policy resource from an account by name. + Retrieves an existing access policy resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to retrieve. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessPolicyEntity, or the result of cls(response) @@ -152,14 +152,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -196,9 +196,9 @@ async def create_or_update( account_name: str, access_policy_name: str, parameters: "_models.AccessPolicyEntity", - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyEntity": - """Creates or updates an access policy. + """Creates a new access policy resource or updates an existing one. Creates a new access policy resource or updates an existing one. @@ -206,7 +206,7 @@ async def create_or_update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to create or update. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.AccessPolicyEntity @@ -220,7 +220,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -228,7 +228,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -272,9 +272,9 @@ async def delete( resource_group_name: str, account_name: str, access_policy_name: str, - **kwargs + **kwargs: Any ) -> None: - """Deletes an access policy. + """Deletes an existing access policy resource. Deletes an existing access policy resource. @@ -282,7 +282,7 @@ async def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to delete. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -294,14 +294,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -335,9 +335,9 @@ async def update( account_name: str, access_policy_name: str, parameters: "_models.AccessPolicyEntity", - **kwargs + **kwargs: Any ) -> "_models.AccessPolicyEntity": - """Updates an existing access policy. + """Updates individual properties of an existing access policy resource. Updates individual properties of an existing access policy resource. @@ -345,7 +345,7 @@ async def update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to update. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.AccessPolicyEntity @@ -359,7 +359,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -367,7 +367,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_edge_modules_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_edge_modules_operations.py index 640fedb98d67a..8a774139d469f 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_edge_modules_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_edge_modules_operations.py @@ -45,27 +45,21 @@ def list( self, resource_group_name: str, account_name: str, - filter: Optional[str] = None, top: Optional[int] = None, - orderby: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.EdgeModuleEntityCollection"]: - """List edge module resources. + """List all existing edge module resources. - List all of the existing edge module resources for a given Video Analyzer account. + List all existing edge module resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param filter: Restricts the set of items returned. - :type filter: str :param top: Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. :type top: int - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EdgeModuleEntityCollection or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~video_analyzer.models.EdgeModuleEntityCollection] @@ -76,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -89,19 +83,15 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') request = self._client.get(url, query_parameters, header_parameters) else: @@ -140,17 +130,17 @@ async def get( resource_group_name: str, account_name: str, edge_module_name: str, - **kwargs + **kwargs: Any ) -> "_models.EdgeModuleEntity": """Retrieves an existing edge module resource. - Retrieves a specific existing edge module resource in the given Video Analyzer account. + Retrieves an existing edge module resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to retrieve. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EdgeModuleEntity, or the result of cls(response) @@ -162,14 +152,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -206,7 +196,7 @@ async def create_or_update( account_name: str, edge_module_name: str, parameters: "_models.EdgeModuleEntity", - **kwargs + **kwargs: Any ) -> "_models.EdgeModuleEntity": """Creates a new edge module or updates an existing one. @@ -222,7 +212,7 @@ async def create_or_update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to create or update. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.EdgeModuleEntity @@ -236,7 +226,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -244,7 +234,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -288,7 +278,7 @@ async def delete( resource_group_name: str, account_name: str, edge_module_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes an existing edge module resource. @@ -300,7 +290,7 @@ async def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to be deleted. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -312,14 +302,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -353,7 +343,7 @@ async def list_provisioning_token( account_name: str, edge_module_name: str, parameters: "_models.ListProvisioningTokenInput", - **kwargs + **kwargs: Any ) -> "_models.EdgeModuleProvisioningToken": """Creates a new provisioning token. @@ -369,7 +359,7 @@ async def list_provisioning_token( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module used to create a new provisioning token. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.ListProvisioningTokenInput @@ -383,7 +373,7 @@ async def list_provisioning_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +381,7 @@ async def list_provisioning_token( url = self.list_provisioning_token.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipeline_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipeline_operation_statuses_operations.py new file mode 100644 index 0000000000000..0bc9c78b712dc --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipeline_operation_statuses_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LivePipelineOperationStatusesOperations: + """LivePipelineOperationStatusesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.LivePipelineOperationStatus": + """Get the operation status. + + Get the operation status of a live pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param operation_id: The operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipelineOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipelineOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipelineOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('LivePipelineOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/operationStatuses/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipelines_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipelines_operations.py new file mode 100644 index 0000000000000..03da7823b9745 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipelines_operations.py @@ -0,0 +1,647 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LivePipelinesOperations: + """LivePipelinesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + filter: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.LivePipelineCollection"]: + """Retrieves a list of live pipeline. + + Retrieves a list of live pipeline that have been created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LivePipelineCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~video_analyzer.models.LivePipelineCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipelineCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('LivePipelineCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **kwargs: Any + ) -> "_models.LivePipeline": + """Gets a Live Pipeline by name. + + Retrieves a Live Pipeline by name. If a live pipeline with that name has been previously + created, the call will return the JSON representation of that instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + parameters: "_models.LivePipeline", + **kwargs: Any + ) -> "_models.LivePipeline": + """Creates or updates a live pipeline. + + Creates a new live pipeline or updates an existing one, with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.LivePipeline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LivePipeline') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **kwargs: Any + ) -> None: + """Deletes a live pipeline. + + Deletes a live pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + parameters: "_models.LivePipeline", + **kwargs: Any + ) -> "_models.LivePipeline": + """Update live pipeline entity. + + Updates the live pipeline entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.LivePipeline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LivePipeline') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + async def _activate_initial( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._activate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _activate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/activate'} # type: ignore + + async def begin_activate( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Activates a live pipeline. + + Activates a live pipeline with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_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: 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) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._activate_initial( + resource_group_name=resource_group_name, + account_name=account_name, + live_pipeline_name=live_pipeline_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/activate'} # type: ignore + + async def _deactivate_initial( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._deactivate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _deactivate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/deactivate'} # type: ignore + + async def begin_deactivate( + self, + resource_group_name: str, + account_name: str, + live_pipeline_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deactivates a live pipeline. + + Deactivates a live pipeline with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_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: 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) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._deactivate_initial( + resource_group_name=resource_group_name, + account_name=account_name, + live_pipeline_name=live_pipeline_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_deactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/deactivate'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_locations_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_locations_operations.py index 725f6840db0b1..f7dad8b93a326 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_locations_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_locations_operations.py @@ -44,7 +44,7 @@ async def check_name_availability( self, location_name: str, parameters: "_models.CheckNameAvailabilityRequest", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResponse": """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-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operations.py index 1e62411a0a0d6..a832bb39898d8 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, - **kwargs + **kwargs: Any ) -> "_models.OperationCollection": """List Operations. @@ -58,7 +58,7 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_job_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_job_operation_statuses_operations.py new file mode 100644 index 0000000000000..495a828f3e59a --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_job_operation_statuses_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PipelineJobOperationStatusesOperations: + """PipelineJobOperationStatusesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.PipelineJobOperationStatus": + """Get the operation statuses. + + Get the operation status of a pipeline job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param operation_id: The operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJobOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJobOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJobOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineJobOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/operationStatuses/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_jobs_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_jobs_operations.py new file mode 100644 index 0000000000000..bfd8cbbf7c531 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_jobs_operations.py @@ -0,0 +1,529 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PipelineJobsOperations: + """PipelineJobsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + filter: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PipelineJobCollection"]: + """Retrieves a list of pipeline jobs. + + Retrieves a list of pipeline jobs that have been created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PipelineJobCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~video_analyzer.models.PipelineJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('PipelineJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + **kwargs: Any + ) -> "_models.PipelineJob": + """Gets a pipeline job by name. + + Retrieves a pipeline job by name. If a pipeline job with that name has been previously created, + the call will return the JSON representation of that instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + parameters: "_models.PipelineJob", + **kwargs: Any + ) -> "_models.PipelineJob": + """Creates or updates a pipeline job. + + Creates a new pipeline job or updates an existing one, with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineJob + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineJob') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + **kwargs: Any + ) -> None: + """Deletes a pipeline job. + + Deletes a pipeline job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + parameters: "_models.PipelineJob", + **kwargs: Any + ) -> "_models.PipelineJob": + """Update pipeline job entity. + + Updates the pipeline job entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineJob + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineJob') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + async def _cancel_initial( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + **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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._cancel_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/cancel'} # type: ignore + + async def begin_cancel( + self, + resource_group_name: str, + account_name: str, + pipeline_job_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Cancels a pipeline job. + + Cancels a pipeline job with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_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: 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) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._cancel_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pipeline_job_name=pipeline_job_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/cancel'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_topologies_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_topologies_operations.py new file mode 100644 index 0000000000000..e1e5e9be0c197 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_topologies_operations.py @@ -0,0 +1,411 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PipelineTopologiesOperations: + """PipelineTopologiesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name: str, + account_name: str, + filter: Optional[str] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PipelineTopologyCollection"]: + """Retrieves a list of pipeline topologies. + + Retrieves a list of pipeline topologies that have been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PipelineTopologyCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~video_analyzer.models.PipelineTopologyCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopologyCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('PipelineTopologyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + pipeline_topology_name: str, + **kwargs: Any + ) -> "_models.PipelineTopology": + """Gets a pipeline topology by name. + + Retrieves a pipeline topology by name. If a topology with that name has been previously + created, the call will return the JSON representation of that topology. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + pipeline_topology_name: str, + parameters: "_models.PipelineTopology", + **kwargs: Any + ) -> "_models.PipelineTopology": + """Creates or updates a pipeline topology. + + Creates a new pipeline topology or updates an existing one, with the given name. A pipeline + topology is a blueprint defining what nodes are in a pipeline, and how they are interconnected. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineTopology + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineTopology') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + pipeline_topology_name: str, + **kwargs: Any + ) -> None: + """Deletes a pipeline topology. + + Deletes a pipeline topology with the given name. This method should be called after all + instances of the topology have been stopped and deleted. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + pipeline_topology_name: str, + parameters: "_models.PipelineTopology", + **kwargs: Any + ) -> "_models.PipelineTopology": + """Update pipeline topology entity. + + Updates the pipeline topology entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineTopology + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineTopology') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_endpoint_connections_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..eec4a5a9b1799 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,306 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnectionListResult": + """Get all private endpoint connections. + + Get all private endpoint connections. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # 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('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Get private endpoint connection. + + Get private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + name: str, + parameters: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Update private endpoint connection. + + Update private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + response_headers = {} + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + name: str, + **kwargs: Any + ) -> None: + """Delete private endpoint connection. + + Delete private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_link_resources_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..12273fd605a03 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,167 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def list( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourceListResult": + """Get list of group IDs. + + Get list of group IDs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # 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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateLinkResources'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResource": + """Get group ID. + + Get group ID. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateLinkResources/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_results_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_results_operations.py new file mode 100644 index 0000000000000..13273a046bfe1 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_results_operations.py @@ -0,0 +1,104 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VideoAnalyzerOperationResultsOperations: + """VideoAnalyzerOperationResultsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location_name: str, + name: str, + **kwargs: Any + ) -> Optional["_models.VideoAnalyzer"]: + """Get operation status. + + Get operation status. + + :param location_name: + :type location_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzer, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzer or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VideoAnalyzer"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_statuses_operations.py new file mode 100644 index 0000000000000..6d618bcf9a5ab --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_statuses_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VideoAnalyzerOperationStatusesOperations: + """VideoAnalyzerOperationStatusesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + location_name: str, + name: str, + **kwargs: Any + ) -> "_models.VideoAnalyzerOperationStatus": + """Get operation status. + + Get operation status. + + :param location_name: + :type location_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzerOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzerOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('VideoAnalyzerOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationStatuses/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzers_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzers_operations.py index 59270599e4aa3..9022fb4f24e33 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzers_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzers_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def list( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzerCollection": """List Video Analyzer accounts. @@ -61,14 +61,14 @@ async def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -101,7 +101,7 @@ async def get( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": """Get a Video Analyzer account. @@ -121,14 +121,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -163,7 +163,7 @@ async def create_or_update( resource_group_name: str, account_name: str, parameters: "_models.VideoAnalyzer", - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": """Create or update a Video Analyzer account. @@ -185,7 +185,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -193,7 +193,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -219,14 +219,18 @@ async def create_or_update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if response.status_code == 201: + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore @@ -235,7 +239,7 @@ async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Video Analyzer account. @@ -255,14 +259,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -294,7 +298,7 @@ async def update( resource_group_name: str, account_name: str, parameters: "_models.VideoAnalyzerUpdate", - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": """Update a Video Analyzer account. @@ -316,7 +320,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -324,7 +328,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -345,89 +349,26 @@ async def update( 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 [202]: 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) + response_headers = {} + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - async def sync_storage_keys( - self, - resource_group_name: str, - account_name: str, - parameters: "_models.SyncStorageKeysInput", - **kwargs - ) -> None: - """Synchronizes Storage Account Keys. - - Synchronizes storage account keys for a storage account associated with the Video Analyzer - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The Video Analyzer account name. - :type account_name: str - :param parameters: The request parameters. - :type parameters: ~video_analyzer.models.SyncStorageKeysInput - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.sync_storage_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'SyncStorageKeysInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - sync_storage_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/syncStorageKeys'} # type: ignore - async def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzerCollection": """List Video Analyzer accounts. @@ -443,7 +384,7 @@ async def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_videos_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_videos_operations.py index 042b77432ff67..761208ebf2c22 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_videos_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_videos_operations.py @@ -46,11 +46,11 @@ def list( resource_group_name: str, account_name: str, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.VideoEntityCollection"]: """List all existing video resources. - List all existing video resources in the specified account. + List all existing video resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -130,17 +130,17 @@ async def get( resource_group_name: str, account_name: str, video_name: str, - **kwargs + **kwargs: Any ) -> "_models.VideoEntity": - """Retrieves a video resource. + """Retrieves an existing video resource. - Retrieves an existing video resource within an account with a given name. + Retrieves an existing video resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to retrieve. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VideoEntity, or the result of cls(response) @@ -152,14 +152,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -196,17 +196,17 @@ async def create_or_update( account_name: str, video_name: str, parameters: "_models.VideoEntity", - **kwargs + **kwargs: Any ) -> "_models.VideoEntity": - """Create or updates a video resource. + """Creates a new video resource or updates an existing one. - Creates a new video resource or updates an existing one in an account. + Creates a new video resource or updates an existing one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to create or update. + :param video_name: The Video name. :type video_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.VideoEntity @@ -220,7 +220,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -228,7 +228,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -272,9 +272,9 @@ async def delete( resource_group_name: str, account_name: str, video_name: str, - **kwargs + **kwargs: Any ) -> None: - """Deletes a video resource. + """Deletes an existing video resource and its underlying data. Deletes an existing video resource and its underlying data. This operation is irreversible. @@ -282,7 +282,7 @@ async def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to delete. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -294,14 +294,14 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -335,9 +335,9 @@ async def update( account_name: str, video_name: str, parameters: "_models.VideoEntity", - **kwargs + **kwargs: Any ) -> "_models.VideoEntity": - """Updates the properties of a video resource. + """Updates individual properties of an existing video resource. Updates individual properties of an existing video resource. @@ -345,7 +345,7 @@ async def update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to update. + :param video_name: The Video name. :type video_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.VideoEntity @@ -359,7 +359,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -367,7 +367,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -402,41 +402,41 @@ async def update( return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore - async def list_streaming_token( + async def list_content_token( self, resource_group_name: str, account_name: str, video_name: str, - **kwargs - ) -> "_models.VideoStreamingToken": - """Generates a streaming token for video playback. + **kwargs: Any + ) -> "_models.VideoContentToken": + """Generates a streaming token which can be used for accessing content from video content URLs. - Generates a streaming token used for authenticating video playback. + Generates a streaming token which can be used for accessing content from video content URLs. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to generate a token for playback. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: VideoStreamingToken, or the result of cls(response) - :rtype: ~video_analyzer.models.VideoStreamingToken + :return: VideoContentToken, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoContentToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoStreamingToken"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoContentToken"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL - url = self.list_streaming_token.metadata['url'] # type: ignore + url = self.list_content_token.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -459,10 +459,10 @@ async def list_streaming_token( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('VideoStreamingToken', pipeline_response) + deserialized = self._deserialize('VideoContentToken', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_streaming_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}/listStreamingToken'} # type: ignore + list_content_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}/listContentToken'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/__init__.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/__init__.py index 59a61c4c87ab8..53637685350b7 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/__init__.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/__init__.py @@ -10,100 +10,210 @@ from ._models_py3 import AccessPolicyEntity from ._models_py3 import AccessPolicyEntityCollection from ._models_py3 import AccountEncryption + from ._models_py3 import AudioEncoderAac + from ._models_py3 import AudioEncoderBase from ._models_py3 import AuthenticationBase + from ._models_py3 import CertificateSource from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse + from ._models_py3 import CredentialsBase from ._models_py3 import EccTokenKey from ._models_py3 import EdgeModuleEntity from ._models_py3 import EdgeModuleEntityCollection from ._models_py3 import EdgeModuleProvisioningToken + from ._models_py3 import EncoderCustomPreset + from ._models_py3 import EncoderPresetBase + from ._models_py3 import EncoderProcessor + from ._models_py3 import EncoderSystemPreset from ._models_py3 import Endpoint + from ._models_py3 import EndpointBase from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import GroupLevelAccessControl + from ._models_py3 import IotHub from ._models_py3 import JwtAuthentication from ._models_py3 import KeyVaultProperties from ._models_py3 import ListProvisioningTokenInput + from ._models_py3 import LivePipeline + from ._models_py3 import LivePipelineCollection + from ._models_py3 import LivePipelineOperationStatus from ._models_py3 import LogSpecification from ._models_py3 import MetricDimension from ._models_py3 import MetricSpecification + from ._models_py3 import NetworkAccessControl + from ._models_py3 import NodeBase + from ._models_py3 import NodeInput from ._models_py3 import Operation from ._models_py3 import OperationCollection from ._models_py3 import OperationDisplay + from ._models_py3 import ParameterDeclaration + from ._models_py3 import ParameterDefinition + from ._models_py3 import PemCertificateList + from ._models_py3 import PipelineJob + from ._models_py3 import PipelineJobCollection + from ._models_py3 import PipelineJobError + from ._models_py3 import PipelineJobOperationStatus + from ._models_py3 import PipelineTopology + from ._models_py3 import PipelineTopologyCollection + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState + from ._models_py3 import ProcessorNodeBase from ._models_py3 import Properties from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import ResourceIdentity from ._models_py3 import RsaTokenKey + from ._models_py3 import RtspSource + from ._models_py3 import SecureIotDeviceRemoteTunnel from ._models_py3 import ServiceSpecification + from ._models_py3 import SinkNodeBase + from ._models_py3 import Sku + from ._models_py3 import SourceNodeBase from ._models_py3 import StorageAccount - from ._models_py3 import SyncStorageKeysInput from ._models_py3 import SystemData + from ._models_py3 import TimeSequenceBase + from ._models_py3 import TlsEndpoint + from ._models_py3 import TlsValidationOptions from ._models_py3 import TokenClaim from ._models_py3 import TokenKey from ._models_py3 import TrackedResource + from ._models_py3 import TunnelBase + from ._models_py3 import UnsecuredEndpoint from ._models_py3 import UserAssignedManagedIdentity + from ._models_py3 import UsernamePasswordCredentials from ._models_py3 import VideoAnalyzer from ._models_py3 import VideoAnalyzerCollection from ._models_py3 import VideoAnalyzerIdentity + from ._models_py3 import VideoAnalyzerOperationStatus from ._models_py3 import VideoAnalyzerProperties + from ._models_py3 import VideoAnalyzerPropertiesBase from ._models_py3 import VideoAnalyzerPropertiesUpdate from ._models_py3 import VideoAnalyzerUpdate + from ._models_py3 import VideoArchival + from ._models_py3 import VideoContentToken + from ._models_py3 import VideoContentUrls + from ._models_py3 import VideoCreationProperties + from ._models_py3 import VideoEncoderBase + from ._models_py3 import VideoEncoderH264 from ._models_py3 import VideoEntity from ._models_py3 import VideoEntityCollection from ._models_py3 import VideoFlags from ._models_py3 import VideoMediaInfo - from ._models_py3 import VideoStreaming - from ._models_py3 import VideoStreamingToken + from ._models_py3 import VideoPreviewImageUrls + from ._models_py3 import VideoPublishingOptions + from ._models_py3 import VideoScale + from ._models_py3 import VideoSequenceAbsoluteTimeMarkers + from ._models_py3 import VideoSink + from ._models_py3 import VideoSource except (SyntaxError, ImportError): from ._models import AccessPolicyEntity # type: ignore from ._models import AccessPolicyEntityCollection # type: ignore from ._models import AccountEncryption # type: ignore + from ._models import AudioEncoderAac # type: ignore + from ._models import AudioEncoderBase # type: ignore from ._models import AuthenticationBase # type: ignore + from ._models import CertificateSource # type: ignore from ._models import CheckNameAvailabilityRequest # type: ignore from ._models import CheckNameAvailabilityResponse # type: ignore + from ._models import CredentialsBase # type: ignore from ._models import EccTokenKey # type: ignore from ._models import EdgeModuleEntity # type: ignore from ._models import EdgeModuleEntityCollection # type: ignore from ._models import EdgeModuleProvisioningToken # type: ignore + from ._models import EncoderCustomPreset # type: ignore + from ._models import EncoderPresetBase # type: ignore + from ._models import EncoderProcessor # type: ignore + from ._models import EncoderSystemPreset # type: ignore from ._models import Endpoint # type: ignore + from ._models import EndpointBase # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore + from ._models import GroupLevelAccessControl # type: ignore + from ._models import IotHub # type: ignore from ._models import JwtAuthentication # type: ignore from ._models import KeyVaultProperties # type: ignore from ._models import ListProvisioningTokenInput # type: ignore + from ._models import LivePipeline # type: ignore + from ._models import LivePipelineCollection # type: ignore + from ._models import LivePipelineOperationStatus # type: ignore from ._models import LogSpecification # type: ignore from ._models import MetricDimension # type: ignore from ._models import MetricSpecification # type: ignore + from ._models import NetworkAccessControl # type: ignore + from ._models import NodeBase # type: ignore + from ._models import NodeInput # type: ignore from ._models import Operation # type: ignore from ._models import OperationCollection # type: ignore from ._models import OperationDisplay # type: ignore + from ._models import ParameterDeclaration # type: ignore + from ._models import ParameterDefinition # type: ignore + from ._models import PemCertificateList # type: ignore + from ._models import PipelineJob # type: ignore + from ._models import PipelineJobCollection # type: ignore + from ._models import PipelineJobError # type: ignore + from ._models import PipelineJobOperationStatus # type: ignore + from ._models import PipelineTopology # type: ignore + from ._models import PipelineTopologyCollection # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore + from ._models import ProcessorNodeBase # type: ignore from ._models import Properties # type: ignore from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore from ._models import ResourceIdentity # type: ignore from ._models import RsaTokenKey # type: ignore + from ._models import RtspSource # type: ignore + from ._models import SecureIotDeviceRemoteTunnel # type: ignore from ._models import ServiceSpecification # type: ignore + from ._models import SinkNodeBase # type: ignore + from ._models import Sku # type: ignore + from ._models import SourceNodeBase # type: ignore from ._models import StorageAccount # type: ignore - from ._models import SyncStorageKeysInput # type: ignore from ._models import SystemData # type: ignore + from ._models import TimeSequenceBase # type: ignore + from ._models import TlsEndpoint # type: ignore + from ._models import TlsValidationOptions # type: ignore from ._models import TokenClaim # type: ignore from ._models import TokenKey # type: ignore from ._models import TrackedResource # type: ignore + from ._models import TunnelBase # type: ignore + from ._models import UnsecuredEndpoint # type: ignore from ._models import UserAssignedManagedIdentity # type: ignore + from ._models import UsernamePasswordCredentials # type: ignore from ._models import VideoAnalyzer # type: ignore from ._models import VideoAnalyzerCollection # type: ignore from ._models import VideoAnalyzerIdentity # type: ignore + from ._models import VideoAnalyzerOperationStatus # type: ignore from ._models import VideoAnalyzerProperties # type: ignore + from ._models import VideoAnalyzerPropertiesBase # type: ignore from ._models import VideoAnalyzerPropertiesUpdate # type: ignore from ._models import VideoAnalyzerUpdate # type: ignore + from ._models import VideoArchival # type: ignore + from ._models import VideoContentToken # type: ignore + from ._models import VideoContentUrls # type: ignore + from ._models import VideoCreationProperties # type: ignore + from ._models import VideoEncoderBase # type: ignore + from ._models import VideoEncoderH264 # type: ignore from ._models import VideoEntity # type: ignore from ._models import VideoEntityCollection # type: ignore from ._models import VideoFlags # type: ignore from ._models import VideoMediaInfo # type: ignore - from ._models import VideoStreaming # type: ignore - from ._models import VideoStreamingToken # type: ignore + from ._models import VideoPreviewImageUrls # type: ignore + from ._models import VideoPublishingOptions # type: ignore + from ._models import VideoScale # type: ignore + from ._models import VideoSequenceAbsoluteTimeMarkers # type: ignore + from ._models import VideoSink # type: ignore + from ._models import VideoSource # type: ignore from ._video_analyzer_enums import ( AccessPolicyEccAlgo, @@ -113,9 +223,22 @@ ActionType, CheckNameAvailabilityReason, CreatedByType, + EncoderSystemPresetType, + Kind, + LivePipelineState, MetricAggregationType, MetricUnit, + ParameterType, + PipelineJobState, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccess, + RtspTransport, + SkuName, + Tier, VideoAnalyzerEndpointType, + VideoScaleMode, VideoType, ) @@ -123,51 +246,106 @@ 'AccessPolicyEntity', 'AccessPolicyEntityCollection', 'AccountEncryption', + 'AudioEncoderAac', + 'AudioEncoderBase', 'AuthenticationBase', + 'CertificateSource', 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResponse', + 'CredentialsBase', 'EccTokenKey', 'EdgeModuleEntity', 'EdgeModuleEntityCollection', 'EdgeModuleProvisioningToken', + 'EncoderCustomPreset', + 'EncoderPresetBase', + 'EncoderProcessor', + 'EncoderSystemPreset', 'Endpoint', + 'EndpointBase', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', + 'GroupLevelAccessControl', + 'IotHub', 'JwtAuthentication', 'KeyVaultProperties', 'ListProvisioningTokenInput', + 'LivePipeline', + 'LivePipelineCollection', + 'LivePipelineOperationStatus', 'LogSpecification', 'MetricDimension', 'MetricSpecification', + 'NetworkAccessControl', + 'NodeBase', + 'NodeInput', 'Operation', 'OperationCollection', 'OperationDisplay', + 'ParameterDeclaration', + 'ParameterDefinition', + 'PemCertificateList', + 'PipelineJob', + 'PipelineJobCollection', + 'PipelineJobError', + 'PipelineJobOperationStatus', + 'PipelineTopology', + 'PipelineTopologyCollection', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', + 'ProcessorNodeBase', 'Properties', 'ProxyResource', 'Resource', 'ResourceIdentity', 'RsaTokenKey', + 'RtspSource', + 'SecureIotDeviceRemoteTunnel', 'ServiceSpecification', + 'SinkNodeBase', + 'Sku', + 'SourceNodeBase', 'StorageAccount', - 'SyncStorageKeysInput', 'SystemData', + 'TimeSequenceBase', + 'TlsEndpoint', + 'TlsValidationOptions', 'TokenClaim', 'TokenKey', 'TrackedResource', + 'TunnelBase', + 'UnsecuredEndpoint', 'UserAssignedManagedIdentity', + 'UsernamePasswordCredentials', 'VideoAnalyzer', 'VideoAnalyzerCollection', 'VideoAnalyzerIdentity', + 'VideoAnalyzerOperationStatus', 'VideoAnalyzerProperties', + 'VideoAnalyzerPropertiesBase', 'VideoAnalyzerPropertiesUpdate', 'VideoAnalyzerUpdate', + 'VideoArchival', + 'VideoContentToken', + 'VideoContentUrls', + 'VideoCreationProperties', + 'VideoEncoderBase', + 'VideoEncoderH264', 'VideoEntity', 'VideoEntityCollection', 'VideoFlags', 'VideoMediaInfo', - 'VideoStreaming', - 'VideoStreamingToken', + 'VideoPreviewImageUrls', + 'VideoPublishingOptions', + 'VideoScale', + 'VideoSequenceAbsoluteTimeMarkers', + 'VideoSink', + 'VideoSource', 'AccessPolicyEccAlgo', 'AccessPolicyRole', 'AccessPolicyRsaAlgo', @@ -175,8 +353,21 @@ 'ActionType', 'CheckNameAvailabilityReason', 'CreatedByType', + 'EncoderSystemPresetType', + 'Kind', + 'LivePipelineState', 'MetricAggregationType', 'MetricUnit', + 'ParameterType', + 'PipelineJobState', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'PublicNetworkAccess', + 'RtspTransport', + 'SkuName', + 'Tier', 'VideoAnalyzerEndpointType', + 'VideoScaleMode', 'VideoType', ] diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py index f4df260b97654..b8cce85edc6ee 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models.py @@ -82,7 +82,7 @@ def __init__( class AccessPolicyEntity(ProxyResource): - """Policy that determines how a video can be accessed. + """AccessPolicyEntity. Variables are only populated by the server, and will be ignored when sending a request. @@ -194,6 +194,70 @@ def __init__( self.status = None +class AudioEncoderBase(msrest.serialization.Model): + """The audio encoder base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AudioEncoderAac. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The audio encoding bitrate. + :type bitrate_kbps: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.AudioEncoderAac': 'AudioEncoderAac'} + } + + def __init__( + self, + **kwargs + ): + super(AudioEncoderBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.bitrate_kbps = kwargs.get('bitrate_kbps', None) + + +class AudioEncoderAac(AudioEncoderBase): + """The audio encoding AAC Codec. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The audio encoding bitrate. + :type bitrate_kbps: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AudioEncoderAac, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.AudioEncoderAac' # type: str + + class AuthenticationBase(msrest.serialization.Model): """Base class for access policies authentication methods. @@ -226,6 +290,38 @@ def __init__( self.type = None # type: Optional[str] +class CertificateSource(msrest.serialization.Model): + """Base class for certificate sources. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: PemCertificateList. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.PemCertificateList': 'PemCertificateList'} + } + + def __init__( + self, + **kwargs + ): + super(CertificateSource, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + class CheckNameAvailabilityRequest(msrest.serialization.Model): """The check availability request body. @@ -277,6 +373,38 @@ def __init__( self.message = kwargs.get('message', None) +class CredentialsBase(msrest.serialization.Model): + """Base class for credential objects. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UsernamePasswordCredentials. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.UsernamePasswordCredentials': 'UsernamePasswordCredentials'} + } + + def __init__( + self, + **kwargs + ): + super(CredentialsBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + class TokenKey(msrest.serialization.Model): """Key properties for JWT token validation. @@ -462,15 +590,16 @@ def __init__( self.token = None -class Endpoint(msrest.serialization.Model): - """The endpoint details. +class EncoderPresetBase(msrest.serialization.Model): + """Encoding preset base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EncoderCustomPreset, EncoderSystemPreset. All required parameters must be populated in order to send to Azure. - :param endpoint_url: The URL of the endpoint. - :type endpoint_url: str - :param type: Required. The type of the endpoint. Possible values include: "ClientApi". - :type type: str or ~video_analyzer.models.VideoAnalyzerEndpointType + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str """ _validation = { @@ -478,183 +607,499 @@ class Endpoint(msrest.serialization.Model): } _attribute_map = { - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EncoderCustomPreset': 'EncoderCustomPreset', '#Microsoft.VideoAnalyzer.EncoderSystemPreset': 'EncoderSystemPreset'} } def __init__( self, **kwargs ): - super(Endpoint, self).__init__(**kwargs) - self.endpoint_url = kwargs.get('endpoint_url', None) - self.type = kwargs['type'] + super(EncoderPresetBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. +class EncoderCustomPreset(EncoderPresetBase): + """The encoding custom preset for specifying custom encoder settings. - 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. - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: str + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param audio_encoder: The audio encoder. + :type audio_encoder: ~video_analyzer.models.AudioEncoderBase + :param video_encoder: The video encoder. + :type video_encoder: ~video_analyzer.models.VideoEncoderBase """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'audio_encoder': {'key': 'audioEncoder', 'type': 'AudioEncoderBase'}, + 'video_encoder': {'key': 'videoEncoder', 'type': 'VideoEncoderBase'}, } def __init__( self, **kwargs ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None + super(EncoderCustomPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderCustomPreset' # type: str + self.audio_encoder = kwargs.get('audio_encoder', None) + self.video_encoder = kwargs.get('video_encoder', None) -class ErrorDetail(msrest.serialization.Model): - """The error detail. +class NodeBase(msrest.serialization.Model): + """Base class for nodes. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ProcessorNodeBase, SinkNodeBase, SourceNodeBase. - :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[~video_analyzer.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~video_analyzer.models.ErrorAdditionalInfo] + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + 'type': {'required': True}, + 'name': {'required': 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]'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.ProcessorNodeBase': 'ProcessorNodeBase', '#Microsoft.VideoAnalyzer.SinkNodeBase': 'SinkNodeBase', '#Microsoft.VideoAnalyzer.SourceNodeBase': 'SourceNodeBase'} } 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 + super(NodeBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.name = kwargs['name'] -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.). +class ProcessorNodeBase(NodeBase): + """Base class for topology processor nodes. - :param error: The error object. - :type error: ~video_analyzer.models.ErrorDetail + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EncoderProcessor. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] """ + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EncoderProcessor': 'EncoderProcessor'} } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + super(ProcessorNodeBase, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.ProcessorNodeBase' # type: str + self.inputs = kwargs['inputs'] -class JwtAuthentication(AuthenticationBase): - """Properties for access validation based on JSON Web Tokens (JWT). +class EncoderProcessor(ProcessorNodeBase): + """A processor node which encodes the media. All required parameters must be populated in order to send to Azure. :param type: Required. The discriminator for derived types.Constant filled by server. :type type: str - :param issuers: List of expected token issuers. Token issuer is valid if it matches at least - one of the given values. - :type issuers: list[str] - :param audiences: List of expected token audiences. Token audience is valid if it matches at - least one of the given values. - :type audiences: list[str] - :param claims: List of additional token claims to be validated. Token must contains all claims - and respective values for it to be valid. - :type claims: list[~video_analyzer.models.TokenClaim] - :param keys: List of keys which can be used to validate access tokens. Having multiple keys - allow for seamless key rotation of the token signing key. Token signature must match exactly - one key. - :type keys: list[~video_analyzer.models.TokenKey] + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] + :param preset: Required. The encoder preset. + :type preset: ~video_analyzer.models.EncoderPresetBase """ _validation = { 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + 'preset': {'required': True}, } _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, - 'issuers': {'key': 'issuers', 'type': '[str]'}, - 'audiences': {'key': 'audiences', 'type': '[str]'}, - 'claims': {'key': 'claims', 'type': '[TokenClaim]'}, - 'keys': {'key': 'keys', 'type': '[TokenKey]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + 'preset': {'key': 'preset', 'type': 'EncoderPresetBase'}, } def __init__( self, **kwargs ): - super(JwtAuthentication, self).__init__(**kwargs) - self.type = '#Microsoft.VideoAnalyzer.JwtAuthentication' # type: str - self.issuers = kwargs.get('issuers', None) - self.audiences = kwargs.get('audiences', None) - self.claims = kwargs.get('claims', None) - self.keys = kwargs.get('keys', None) - + super(EncoderProcessor, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderProcessor' # type: str + self.preset = kwargs['preset'] -class KeyVaultProperties(msrest.serialization.Model): - """The details for accessing the encryption keys in Key Vault. - Variables are only populated by the server, and will be ignored when sending a request. +class EncoderSystemPreset(EncoderPresetBase): + """The encoding built in system preset. All required parameters must be populated in order to send to Azure. - :param key_identifier: Required. The URL of the Key Vault key used to encrypt the account. The - key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key - without a version (for example https://vault/keys/mykey). - :type key_identifier: str - :ivar current_key_identifier: The current key used to encrypt Video Analyzer account, including - the key version. - :vartype current_key_identifier: str + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. The system preset value. Possible values include: + "SingleLayer_540p_H264_AAC", "SingleLayer_720p_H264_AAC", "SingleLayer_1080p_H264_AAC", + "SingleLayer_2160p_H264_AAC". + :type name: str or ~video_analyzer.models.EncoderSystemPresetType """ _validation = { - 'key_identifier': {'required': True}, - 'current_key_identifier': {'readonly': True}, + 'type': {'required': True}, + 'name': {'required': True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EncoderSystemPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderSystemPreset' # type: str + self.name = kwargs['name'] + + +class Endpoint(msrest.serialization.Model): + """The endpoint details. + + All required parameters must be populated in order to send to Azure. + + :param endpoint_url: The URL of the endpoint. + :type endpoint_url: str + :param type: Required. The type of the endpoint. Possible values include: "ClientApi". + :type type: str or ~video_analyzer.models.VideoAnalyzerEndpointType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Endpoint, self).__init__(**kwargs) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.type = kwargs['type'] + + +class EndpointBase(msrest.serialization.Model): + """Base class for endpoints. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: TlsEndpoint, UnsecuredEndpoint. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase + """ + + _validation = { + 'type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.TlsEndpoint': 'TlsEndpoint', '#Microsoft.VideoAnalyzer.UnsecuredEndpoint': 'UnsecuredEndpoint'} + } + + def __init__( + self, + **kwargs + ): + super(EndpointBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.credentials = kwargs.get('credentials', None) + self.url = kwargs['url'] + self.tunnel = kwargs.get('tunnel', 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[~video_analyzer.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~video_analyzer.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: ~video_analyzer.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 GroupLevelAccessControl(msrest.serialization.Model): + """GroupLevelAccessControl. + + :param public_network_access: Whether or not public network access is allowed for specified + resources under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + """ + + _attribute_map = { + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GroupLevelAccessControl, self).__init__(**kwargs) + self.public_network_access = kwargs.get('public_network_access', None) + + +class IotHub(msrest.serialization.Model): + """The IoT Hub 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: Required. The IoT Hub ARM ID. + :type id: str + :param identity: Required. The IoT Hub identity. + :type identity: ~video_analyzer.models.ResourceIdentity + :ivar status: The current status of the Iot Hub mapping. + :vartype status: str + """ + + _validation = { + 'id': {'required': True}, + 'identity': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(IotHub, self).__init__(**kwargs) + self.id = kwargs['id'] + self.identity = kwargs['identity'] + self.status = None + + +class JwtAuthentication(AuthenticationBase): + """Properties for access validation based on JSON Web Tokens (JWT). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param issuers: List of expected token issuers. Token issuer is valid if it matches at least + one of the given values. + :type issuers: list[str] + :param audiences: List of expected token audiences. Token audience is valid if it matches at + least one of the given values. + :type audiences: list[str] + :param claims: List of additional token claims to be validated. Token must contains all claims + and respective values for it to be valid. + :type claims: list[~video_analyzer.models.TokenClaim] + :param keys: List of keys which can be used to validate access tokens. Having multiple keys + allow for seamless key rotation of the token signing key. Token signature must match exactly + one key. + :type keys: list[~video_analyzer.models.TokenKey] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'issuers': {'key': 'issuers', 'type': '[str]'}, + 'audiences': {'key': 'audiences', 'type': '[str]'}, + 'claims': {'key': 'claims', 'type': '[TokenClaim]'}, + 'keys': {'key': 'keys', 'type': '[TokenKey]'}, + } + + def __init__( + self, + **kwargs + ): + super(JwtAuthentication, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.JwtAuthentication' # type: str + self.issuers = kwargs.get('issuers', None) + self.audiences = kwargs.get('audiences', None) + self.claims = kwargs.get('claims', None) + self.keys = kwargs.get('keys', None) + + +class KeyVaultProperties(msrest.serialization.Model): + """The details for accessing the encryption keys in Key Vault. + + 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 key_identifier: Required. The URL of the Key Vault key used to encrypt the account. The + key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key + without a version (for example https://vault/keys/mykey). + :type key_identifier: str + :ivar current_key_identifier: The current key used to encrypt Video Analyzer account, including + the key version. + :vartype current_key_identifier: str + """ + + _validation = { + 'key_identifier': {'required': True}, + 'current_key_identifier': {'readonly': True}, + } + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, } def __init__( @@ -666,404 +1111,1350 @@ def __init__( self.current_key_identifier = None -class ListProvisioningTokenInput(msrest.serialization.Model): - """The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. +class ListProvisioningTokenInput(msrest.serialization.Model): + """The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. + + All required parameters must be populated in order to send to Azure. + + :param expiration_date: Required. The desired expiration date of the registration token. The + Azure Video Analyzer IoT edge module must be initialized and connected to the Internet prior to + the token expiration date. + :type expiration_date: ~datetime.datetime + """ + + _validation = { + 'expiration_date': {'required': True}, + } + + _attribute_map = { + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(ListProvisioningTokenInput, self).__init__(**kwargs) + self.expiration_date = kwargs['expiration_date'] + + +class LivePipeline(ProxyResource): + """Live Pipeline represents an unique instance of a pipeline topology which is used for real-time content ingestion and analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: The reference to an existing pipeline topology defined for real-time + content processing. When activated, this live pipeline will process content according to the + pipeline topology definition. + :type topology_name: str + :param description: An optional description for the pipeline. + :type description: str + :param bitrate_kbps: Bitrate capacity in kbps for the live pipeline. The support bit rate is + between 500 to 3000 kbps. + :type bitrate_kbps: int + :ivar state: Current pipeline state (read-only). Possible values include: "Inactive", + "Activating", "Active", "Deactivating". + :vartype state: str or ~video_analyzer.models.LivePipelineState + :param parameters: List of the instance level parameter values for the user-defined topology + parameters. A pipeline can only define or override parameters values for parameters which have + been declared in the referenced topology. Topology parameters without a default value must be + defined. Topology parameters with a default value can be optionally be overridden. + :type parameters: list[~video_analyzer.models.ParameterDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'topology_name': {'key': 'properties.topologyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'bitrate_kbps': {'key': 'properties.bitrateKbps', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(LivePipeline, self).__init__(**kwargs) + self.system_data = None + self.topology_name = kwargs.get('topology_name', None) + self.description = kwargs.get('description', None) + self.bitrate_kbps = kwargs.get('bitrate_kbps', None) + self.state = None + self.parameters = kwargs.get('parameters', None) + + +class LivePipelineCollection(msrest.serialization.Model): + """A collection of LivePipeline items. + + :param value: A collection of LivePipeline items. + :type value: list[~video_analyzer.models.LivePipeline] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LivePipeline]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LivePipelineCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class LivePipelineOperationStatus(msrest.serialization.Model): + """LivePipelineOperationStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the live pipeline operation. + :vartype name: str + :ivar status: The status of the live pipeline operation. + :vartype status: str + :ivar error: The error details for the live pipeline operation. + :vartype error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(LivePipelineOperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.error = None + + +class LogSpecification(msrest.serialization.Model): + """A diagnostic log emitted by service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The diagnostic log category name. + :vartype name: str + :ivar display_name: The diagnostic log category display name. + :vartype display_name: str + :ivar blob_duration: The time range for requests in each blob. + :vartype blob_duration: str + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'blob_duration': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.blob_duration = None + + +class MetricDimension(msrest.serialization.Model): + """A metric dimension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The metric dimension name. + :vartype name: str + :ivar display_name: The display name for the dimension. + :vartype display_name: str + :ivar to_be_exported_for_shoebox: Whether to export metric to shoebox. + :vartype to_be_exported_for_shoebox: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'to_be_exported_for_shoebox': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.to_be_exported_for_shoebox = None + + +class MetricSpecification(msrest.serialization.Model): + """A metric emitted by service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The metric name. + :vartype name: str + :ivar display_name: The metric display name. + :vartype display_name: str + :ivar display_description: The metric display description. + :vartype display_description: str + :ivar unit: The metric unit. Possible values include: "Bytes", "Count", "Milliseconds". + :vartype unit: str or ~video_analyzer.models.MetricUnit + :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", + "Count", "Total". + :vartype aggregation_type: str or ~video_analyzer.models.MetricAggregationType + :ivar lock_aggregation_type: The metric lock aggregation type. Possible values include: + "Average", "Count", "Total". + :vartype lock_aggregation_type: str or ~video_analyzer.models.MetricAggregationType + :param supported_aggregation_types: Supported aggregation types. + :type supported_aggregation_types: list[str] + :ivar dimensions: The metric dimensions. + :vartype dimensions: list[~video_analyzer.models.MetricDimension] + :ivar enable_regional_mdm_account: Indicates whether regional MDM account is enabled. + :vartype enable_regional_mdm_account: bool + :ivar source_mdm_account: The source MDM account. + :vartype source_mdm_account: str + :ivar source_mdm_namespace: The source MDM namespace. + :vartype source_mdm_namespace: str + :ivar supported_time_grain_types: The supported time grain types. + :vartype supported_time_grain_types: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_description': {'readonly': True}, + 'unit': {'readonly': True}, + 'aggregation_type': {'readonly': True}, + 'lock_aggregation_type': {'readonly': True}, + 'dimensions': {'readonly': True}, + 'enable_regional_mdm_account': {'readonly': True}, + 'source_mdm_account': {'readonly': True}, + 'source_mdm_namespace': {'readonly': True}, + 'supported_time_grain_types': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'lock_aggregation_type': {'key': 'lockAggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.display_description = None + self.unit = None + self.aggregation_type = None + self.lock_aggregation_type = None + self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) + self.dimensions = None + self.enable_regional_mdm_account = None + self.source_mdm_account = None + self.source_mdm_namespace = None + self.supported_time_grain_types = None + + +class NetworkAccessControl(msrest.serialization.Model): + """NetworkAccessControl. + + :param integration: Public network access for integration group. + :type integration: ~video_analyzer.models.GroupLevelAccessControl + :param ingestion: Public network access for ingestion group. + :type ingestion: ~video_analyzer.models.GroupLevelAccessControl + :param consumption: Public network access for consumption group. + :type consumption: ~video_analyzer.models.GroupLevelAccessControl + """ + + _attribute_map = { + 'integration': {'key': 'integration', 'type': 'GroupLevelAccessControl'}, + 'ingestion': {'key': 'ingestion', 'type': 'GroupLevelAccessControl'}, + 'consumption': {'key': 'consumption', 'type': 'GroupLevelAccessControl'}, + } + + def __init__( + self, + **kwargs + ): + super(NetworkAccessControl, self).__init__(**kwargs) + self.integration = kwargs.get('integration', None) + self.ingestion = kwargs.get('ingestion', None) + self.consumption = kwargs.get('consumption', None) + + +class NodeInput(msrest.serialization.Model): + """Describes an input signal to be used on a pipeline node. + + All required parameters must be populated in order to send to Azure. + + :param node_name: Required. The name of the upstream node in the pipeline which output is used + as input of the current node. + :type node_name: str + """ + + _validation = { + 'node_name': {'required': True}, + } + + _attribute_map = { + 'node_name': {'key': 'nodeName', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(NodeInput, self).__init__(**kwargs) + self.node_name = kwargs['node_name'] + + +class Operation(msrest.serialization.Model): + """An operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The operation name. + :type name: str + :param display: The operation display name. + :type display: ~video_analyzer.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param properties: Operation properties format. + :type properties: ~video_analyzer.models.Properties + :param is_data_action: Whether the operation applies to data-plane. + :type is_data_action: bool + :param action_type: Indicates the action type. Possible values include: "Internal". + :type action_type: str or ~video_analyzer.models.ActionType + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Properties'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs['name'] + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.action_type = kwargs.get('action_type', None) + + +class OperationCollection(msrest.serialization.Model): + """A collection of Operation items. + + :param value: A collection of Operation items. + :type value: list[~video_analyzer.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class OperationDisplay(msrest.serialization.Model): + """Operation details. + + :param provider: The service provider. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + :param operation: The operation type. + :type operation: str + :param description: The operation description. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class ParameterDeclaration(msrest.serialization.Model): + """Single topology parameter declaration. Declared parameters can and must be referenced throughout the topology and can optionally have default values to be used when they are not defined in the pipelines. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the parameter. + :type name: str + :param type: Required. Type of the parameter. Possible values include: "String", + "SecretString", "Int", "Double", "Bool". + :type type: str or ~video_analyzer.models.ParameterType + :param description: Description of the parameter. + :type description: str + :param default: The default value for the parameter to be used if the pipeline does not specify + a value. + :type default: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ParameterDeclaration, self).__init__(**kwargs) + self.name = kwargs['name'] + self.type = kwargs['type'] + self.description = kwargs.get('description', None) + self.default = kwargs.get('default', None) + + +class ParameterDefinition(msrest.serialization.Model): + """Defines the parameter value of an specific pipeline topology parameter. See pipeline topology parameters for more information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the parameter declared in the pipeline topology. + :type name: str + :param value: Parameter value to be applied on this specific pipeline. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ParameterDefinition, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs.get('value', None) + + +class PemCertificateList(CertificateSource): + """A list of PEM formatted certificates. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param certificates: Required. PEM formatted public certificates. One certificate per entry. + :type certificates: list[str] + """ + + _validation = { + 'type': {'required': True}, + 'certificates': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PemCertificateList, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.PemCertificateList' # type: str + self.certificates = kwargs['certificates'] + + +class PipelineJob(ProxyResource): + """Represents a pipeline job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: The reference to an existing pipeline topology defined for real-time + content processing. When activated, this live pipeline will process content according to the + pipeline topology definition. + :type topology_name: str + :param description: An optional description for the pipeline. + :type description: str + :ivar state: Current pipeline state (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The expiration time when the pipeline job will be automatically deleted. + :vartype expiration: ~datetime.datetime + :ivar error: An optional error information about the pipeline job failure. + :vartype error: ~video_analyzer.models.PipelineJobError + :param parameters: List of the instance level parameter values for the user-defined topology + parameters. A pipeline can only define or override parameters values for parameters which have + been declared in the referenced topology. Topology parameters without a default value must be + defined. Topology parameters with a default value can be optionally be overridden. + :type parameters: list[~video_analyzer.models.ParameterDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'expiration': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'topology_name': {'key': 'properties.topologyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'error': {'key': 'properties.error', 'type': 'PipelineJobError'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDefinition]'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineJob, self).__init__(**kwargs) + self.system_data = None + self.topology_name = kwargs.get('topology_name', None) + self.description = kwargs.get('description', None) + self.state = None + self.expiration = None + self.error = None + self.parameters = kwargs.get('parameters', None) + + +class PipelineJobCollection(msrest.serialization.Model): + """A collection of PipelineJob items. + + :param value: A collection of PipelineJob items. + :type value: list[~video_analyzer.models.PipelineJob] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PipelineJob]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineJobCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PipelineJobError(msrest.serialization.Model): + """The pipeline job error details. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineJobError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class PipelineJobOperationStatus(msrest.serialization.Model): + """PipelineJobOperationStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the pipeline job operation. + :vartype name: str + :ivar status: The status of the pipeline job operation. + :vartype status: str + :ivar error: The error details for the pipeline job operation. + :vartype error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineJobOperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.error = None + + +class PipelineTopology(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing media for a particular outcome. The topology should be defined according to the scenario to be achieved and can be reused across many pipeline instances which share the same processing characteristics. For instance, a pipeline topology which acquires data from a RTSP camera, process it with an specific AI model and stored the data on the cloud can be reused across many different cameras, as long as the same processing should be applied across all the cameras. Individual instance properties can be defined through the use of user-defined parameters, which allow for a topology to be parameterized, thus allowing individual pipelines to refer to different values, such as individual cameras RTSP endpoints and credentials. Overall a topology is composed of the following:\r\n\r\n - Parameters: list of user defined parameters that can be references across the topology nodes.\r\n - Sources: list of one or more data sources nodes such as an RTSP source which allows for media to be ingested from cameras.\r\n - Processors: list of nodes which perform data analysis or transformations.\r\n -Sinks: list of one or more data sinks which allow for data to be stored or exported to other destinations. + + 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 expiration_date: Required. The desired expiration date of the registration token. The - Azure Video Analyzer IoT edge module must be initialized and connected to the Internet prior to - the token expiration date. - :type expiration_date: ~datetime.datetime + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param kind: Required. Topology kind. Possible values include: "Live", "Batch". + :type kind: str or ~video_analyzer.models.Kind + :param sku: Required. The SKU details. + :type sku: ~video_analyzer.models.Sku + :param description: An optional description of the pipeline topology. It is recommended that + the expected use of the topology to be described here. + :type description: str + :param parameters: List of the topology parameter declarations. Parameters declared here can be + referenced throughout the topology nodes through the use of \"${PARAMETER_NAME}\" string + pattern. Parameters can have optional default values and can later be defined in individual + instances of the pipeline. + :type parameters: list[~video_analyzer.models.ParameterDeclaration] + :param sources: List of the topology source nodes. Source nodes enable external data to be + ingested by the pipeline. + :type sources: list[~video_analyzer.models.SourceNodeBase] + :param processors: List of the topology processor nodes. Processor nodes enable pipeline data + to be analyzed, processed or transformed. + :type processors: list[~video_analyzer.models.ProcessorNodeBase] + :param sinks: List of the topology sink nodes. Sink nodes allow pipeline data to be stored or + exported. + :type sinks: list[~video_analyzer.models.SinkNodeBase] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDeclaration]'}, + 'sources': {'key': 'properties.sources', 'type': '[SourceNodeBase]'}, + 'processors': {'key': 'properties.processors', 'type': '[ProcessorNodeBase]'}, + 'sinks': {'key': 'properties.sinks', 'type': '[SinkNodeBase]'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineTopology, self).__init__(**kwargs) + self.system_data = None + self.kind = kwargs['kind'] + self.sku = kwargs['sku'] + self.description = kwargs.get('description', None) + self.parameters = kwargs.get('parameters', None) + self.sources = kwargs.get('sources', None) + self.processors = kwargs.get('processors', None) + self.sinks = kwargs.get('sinks', None) + + +class PipelineTopologyCollection(msrest.serialization.Model): + """A collection of PipelineTopology items. + + :param value: A collection of PipelineTopology items. + :type value: list[~video_analyzer.models.PipelineTopology] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PipelineTopology]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineTopologyCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~video_analyzer.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~video_analyzer.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~video_analyzer.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~video_analyzer.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~video_analyzer.models.PrivateLinkResource] """ - _validation = { - 'expiration_date': {'required': True}, - } + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~video_analyzer.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ _attribute_map = { - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ListProvisioningTokenInput, self).__init__(**kwargs) - self.expiration_date = kwargs['expiration_date'] + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) -class LogSpecification(msrest.serialization.Model): - """A diagnostic log emitted by service. +class Properties(msrest.serialization.Model): + """Metric properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The diagnostic log category name. - :vartype name: str - :ivar display_name: The diagnostic log category display name. - :vartype display_name: str - :ivar blob_duration: The time range for requests in each blob. - :vartype blob_duration: str + :ivar service_specification: The service specifications. + :vartype service_specification: ~video_analyzer.models.ServiceSpecification """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'blob_duration': {'readonly': True}, + 'service_specification': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, } def __init__( self, **kwargs ): - super(LogSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.blob_duration = None + super(Properties, self).__init__(**kwargs) + self.service_specification = None -class MetricDimension(msrest.serialization.Model): - """A metric dimension. +class ResourceIdentity(msrest.serialization.Model): + """The user assigned managed identity to use when accessing a resource. - 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. - :ivar name: The metric dimension name. - :vartype name: str - :ivar display_name: The display name for the dimension. - :vartype display_name: str - :ivar to_be_exported_for_shoebox: Whether to export metric to shoebox. - :vartype to_be_exported_for_shoebox: bool + :param user_assigned_identity: Required. The user assigned managed identity's resource + identifier to use when accessing a resource. + :type user_assigned_identity: str """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'to_be_exported_for_shoebox': {'readonly': True}, + 'user_assigned_identity': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MetricDimension, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.to_be_exported_for_shoebox = None + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = kwargs['user_assigned_identity'] -class MetricSpecification(msrest.serialization.Model): - """A metric emitted by service. +class RsaTokenKey(TokenKey): + """Required validation properties for tokens generated with RSA algorithm. - 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. - :ivar name: The metric name. - :vartype name: str - :ivar display_name: The metric display name. - :vartype display_name: str - :ivar display_description: The metric display description. - :vartype display_description: str - :ivar unit: The metric unit. Possible values include: "Bytes", "Count", "Milliseconds". - :vartype unit: str or ~video_analyzer.models.MetricUnit - :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", - "Count", "Total". - :vartype aggregation_type: str or ~video_analyzer.models.MetricAggregationType - :ivar lock_aggregation_type: The metric lock aggregation type. Possible values include: - "Average", "Count", "Total". - :vartype lock_aggregation_type: str or ~video_analyzer.models.MetricAggregationType - :param supported_aggregation_types: Supported aggregation types. - :type supported_aggregation_types: list[str] - :ivar dimensions: The metric dimensions. - :vartype dimensions: list[~video_analyzer.models.MetricDimension] - :ivar enable_regional_mdm_account: Indicates whether regional MDM account is enabled. - :vartype enable_regional_mdm_account: bool - :ivar source_mdm_account: The source MDM account. - :vartype source_mdm_account: str - :ivar source_mdm_namespace: The source MDM namespace. - :vartype source_mdm_namespace: str - :ivar supported_time_grain_types: The supported time grain types. - :vartype supported_time_grain_types: list[str] + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param kid: Required. JWT token key id. Validation keys are looked up based on the key id + present on the JWT token header. + :type kid: str + :param alg: Required. RSA algorithm to be used: RS256, RS384 or RS512. Possible values include: + "RS256", "RS384", "RS512". + :type alg: str or ~video_analyzer.models.AccessPolicyRsaAlgo + :param n: Required. RSA public key modulus. + :type n: str + :param e: Required. RSA public key exponent. + :type e: str """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'display_description': {'readonly': True}, - 'unit': {'readonly': True}, - 'aggregation_type': {'readonly': True}, - 'lock_aggregation_type': {'readonly': True}, - 'dimensions': {'readonly': True}, - 'enable_regional_mdm_account': {'readonly': True}, - 'source_mdm_account': {'readonly': True}, - 'source_mdm_namespace': {'readonly': True}, - 'supported_time_grain_types': {'readonly': True}, + 'type': {'required': True}, + 'kid': {'required': True}, + 'alg': {'required': True}, + 'n': {'required': True}, + 'e': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'lock_aggregation_type': {'key': 'lockAggregationType', 'type': 'str'}, - 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, - 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, - 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, - 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, - 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, - 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'n': {'key': 'n', 'type': 'str'}, + 'e': {'key': 'e', 'type': 'str'}, } def __init__( self, **kwargs ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.display_description = None - self.unit = None - self.aggregation_type = None - self.lock_aggregation_type = None - self.supported_aggregation_types = kwargs.get('supported_aggregation_types', None) - self.dimensions = None - self.enable_regional_mdm_account = None - self.source_mdm_account = None - self.source_mdm_namespace = None - self.supported_time_grain_types = None + super(RsaTokenKey, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.RsaTokenKey' # type: str + self.alg = kwargs['alg'] + self.n = kwargs['n'] + self.e = kwargs['e'] -class Operation(msrest.serialization.Model): - """An operation. +class SourceNodeBase(NodeBase): + """Base class for topology source nodes. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RtspSource, VideoSource. All required parameters must be populated in order to send to Azure. - :param name: Required. The operation name. + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. :type name: str - :param display: The operation display name. - :type display: ~video_analyzer.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - :param properties: Operation properties format. - :type properties: ~video_analyzer.models.Properties - :param is_data_action: Whether the operation applies to data-plane. - :type is_data_action: bool - :param action_type: Indicates the action type. Possible values include: "Internal". - :type action_type: str or ~video_analyzer.models.ActionType """ _validation = { + 'type': {'required': True}, 'name': {'required': True}, } _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'Properties'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.RtspSource': 'RtspSource', '#Microsoft.VideoAnalyzer.VideoSource': 'VideoSource'} } def __init__( self, **kwargs ): - super(Operation, self).__init__(**kwargs) - self.name = kwargs['name'] - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.action_type = kwargs.get('action_type', None) + super(SourceNodeBase, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SourceNodeBase' # type: str -class OperationCollection(msrest.serialization.Model): - """A collection of Operation items. +class RtspSource(SourceNodeBase): + """RTSP source allows for media from an RTSP camera or generic RTSP server to be ingested into a pipeline. - :param value: A collection of Operation items. - :type value: list[~video_analyzer.models.Operation] + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param transport: Network transport utilized by the RTSP and RTP exchange: TCP or HTTP. When + using TCP, the RTP packets are interleaved on the TCP RTSP connection. When using HTTP, the + RTSP messages are exchanged through long lived HTTP connections, and the RTP packages are + interleaved in the HTTP connections alongside the RTSP messages. Possible values include: + "Http", "Tcp". + :type transport: str or ~video_analyzer.models.RtspTransport + :param endpoint: Required. RTSP endpoint information for Video Analyzer to connect to. This + contains the required information for Video Analyzer to connect to RTSP cameras and/or generic + RTSP servers. + :type endpoint: ~video_analyzer.models.EndpointBase """ + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'endpoint': {'required': True}, + } + _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'transport': {'key': 'transport', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'EndpointBase'}, } def __init__( self, **kwargs ): - super(OperationCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super(RtspSource, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.RtspSource' # type: str + self.transport = kwargs.get('transport', None) + self.endpoint = kwargs['endpoint'] -class OperationDisplay(msrest.serialization.Model): - """Operation details. +class TunnelBase(msrest.serialization.Model): + """Base class for tunnel objects. - :param provider: The service provider. - :type provider: str - :param resource: Resource on which the operation is performed. - :type resource: str - :param operation: The operation type. - :type operation: str - :param description: The operation description. - :type description: str + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SecureIotDeviceRemoteTunnel. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str """ + _validation = { + 'type': {'required': True}, + } + _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel': 'SecureIotDeviceRemoteTunnel'} } def __init__( self, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + super(TunnelBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class Properties(msrest.serialization.Model): - """Metric properties. +class SecureIotDeviceRemoteTunnel(TunnelBase): + """A remote tunnel securely established using IoT Hub device information. - 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. - :ivar service_specification: The service specifications. - :vartype service_specification: ~video_analyzer.models.ServiceSpecification + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param iot_hub_name: Required. The IoT Hub name to use when establishing the remote tunnel. + :type iot_hub_name: str + :param device_id: Required. The device id to use when establishing the remote tunnel. + :type device_id: str """ _validation = { - 'service_specification': {'readonly': True}, + 'type': {'required': True}, + 'iot_hub_name': {'required': True}, + 'device_id': {'required': True}, } _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + 'type': {'key': '@type', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'device_id': {'key': 'deviceId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Properties, self).__init__(**kwargs) - self.service_specification = None + super(SecureIotDeviceRemoteTunnel, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel' # type: str + self.iot_hub_name = kwargs['iot_hub_name'] + self.device_id = kwargs['device_id'] -class ResourceIdentity(msrest.serialization.Model): - """The user assigned managed identity to use when accessing a resource. +class ServiceSpecification(msrest.serialization.Model): + """The service metric specifications. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param user_assigned_identity: Required. The user assigned managed identity's resource - identifier to use when accessing a resource. - :type user_assigned_identity: str + :ivar log_specifications: List of log specifications. + :vartype log_specifications: list[~video_analyzer.models.LogSpecification] + :ivar metric_specifications: List of metric specifications. + :vartype metric_specifications: list[~video_analyzer.models.MetricSpecification] """ _validation = { - 'user_assigned_identity': {'required': True}, + 'log_specifications': {'readonly': True}, + 'metric_specifications': {'readonly': True}, } _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } def __init__( self, **kwargs ): - super(ResourceIdentity, self).__init__(**kwargs) - self.user_assigned_identity = kwargs['user_assigned_identity'] + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = None + self.metric_specifications = None -class RsaTokenKey(TokenKey): - """Required validation properties for tokens generated with RSA algorithm. +class SinkNodeBase(NodeBase): + """Base class for topology sink nodes. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoSink. All required parameters must be populated in order to send to Azure. :param type: Required. The discriminator for derived types.Constant filled by server. :type type: str - :param kid: Required. JWT token key id. Validation keys are looked up based on the key id - present on the JWT token header. - :type kid: str - :param alg: Required. RSA algorithm to be used: RS256, RS384 or RS512. Possible values include: - "RS256", "RS384", "RS512". - :type alg: str or ~video_analyzer.models.AccessPolicyRsaAlgo - :param n: Required. RSA public key modulus. - :type n: str - :param e: Required. RSA public key exponent. - :type e: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] """ _validation = { 'type': {'required': True}, - 'kid': {'required': True}, - 'alg': {'required': True}, - 'n': {'required': True}, - 'e': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, } _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, - 'kid': {'key': 'kid', 'type': 'str'}, - 'alg': {'key': 'alg', 'type': 'str'}, - 'n': {'key': 'n', 'type': 'str'}, - 'e': {'key': 'e', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSink': 'VideoSink'} } def __init__( self, **kwargs ): - super(RsaTokenKey, self).__init__(**kwargs) - self.type = '#Microsoft.VideoAnalyzer.RsaTokenKey' # type: str - self.alg = kwargs['alg'] - self.n = kwargs['n'] - self.e = kwargs['e'] + super(SinkNodeBase, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SinkNodeBase' # type: str + self.inputs = kwargs['inputs'] -class ServiceSpecification(msrest.serialization.Model): - """The service metric specifications. +class Sku(msrest.serialization.Model): + """The SKU details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar log_specifications: List of log specifications. - :vartype log_specifications: list[~video_analyzer.models.LogSpecification] - :ivar metric_specifications: List of metric specifications. - :vartype metric_specifications: list[~video_analyzer.models.MetricSpecification] + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Possible values include: "Live_S1", "Batch_S1". + :type name: str or ~video_analyzer.models.SkuName + :ivar tier: The SKU tier. Possible values include: "Standard". + :vartype tier: str or ~video_analyzer.models.Tier """ _validation = { - 'log_specifications': {'readonly': True}, - 'metric_specifications': {'readonly': True}, + 'name': {'required': True}, + 'tier': {'readonly': True}, } _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = None - self.metric_specifications = None + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None class StorageAccount(msrest.serialization.Model): @@ -1071,8 +2462,10 @@ class StorageAccount(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the storage account resource. Video Analyzer relies on tables, queues, and - blobs. The primary storage account must be a Standard Storage account (either + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the storage account resource. Video Analyzer relies on tables, + queues, and blobs. The primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). :type id: str :param identity: A managed identity that Video Analyzer will use to access the storage account. @@ -1082,6 +2475,7 @@ class StorageAccount(msrest.serialization.Model): """ _validation = { + 'id': {'required': True}, 'status': {'readonly': True}, } @@ -1096,30 +2490,11 @@ def __init__( **kwargs ): super(StorageAccount, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + self.id = kwargs['id'] self.identity = kwargs.get('identity', None) self.status = None -class SyncStorageKeysInput(msrest.serialization.Model): - """The input to the sync storage keys request. - - :param id: The ID of the storage account resource. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(SyncStorageKeysInput, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -1161,6 +2536,109 @@ def __init__( self.last_modified_at = kwargs.get('last_modified_at', None) +class TimeSequenceBase(msrest.serialization.Model): + """Sequence of time. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoSequenceAbsoluteTimeMarkers. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers': 'VideoSequenceAbsoluteTimeMarkers'} + } + + def __init__( + self, + **kwargs + ): + super(TimeSequenceBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class TlsEndpoint(EndpointBase): + """TLS endpoint describes an endpoint that the pipeline can connect to over TLS transport (data is encrypted in transit). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase + :param trusted_certificates: List of trusted certificate authorities when authenticating a TLS + connection. A null list designates that Azure Video Analyzer's list of trusted authorities + should be used. + :type trusted_certificates: ~video_analyzer.models.CertificateSource + :param validation_options: Validation options to use when authenticating a TLS connection. By + default, strict validation is used. + :type validation_options: ~video_analyzer.models.TlsValidationOptions + """ + + _validation = { + 'type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + 'trusted_certificates': {'key': 'trustedCertificates', 'type': 'CertificateSource'}, + 'validation_options': {'key': 'validationOptions', 'type': 'TlsValidationOptions'}, + } + + def __init__( + self, + **kwargs + ): + super(TlsEndpoint, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.TlsEndpoint' # type: str + self.trusted_certificates = kwargs.get('trusted_certificates', None) + self.validation_options = kwargs.get('validation_options', None) + + +class TlsValidationOptions(msrest.serialization.Model): + """Options for controlling the validation of TLS endpoints. + + :param ignore_hostname: When set to 'true' causes the certificate subject name validation to be + skipped. Default is 'false'. + :type ignore_hostname: str + :param ignore_signature: When set to 'true' causes the certificate chain trust validation to be + skipped. Default is 'false'. + :type ignore_signature: str + """ + + _attribute_map = { + 'ignore_hostname': {'key': 'ignoreHostname', 'type': 'str'}, + 'ignore_signature': {'key': 'ignoreSignature', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TlsValidationOptions, self).__init__(**kwargs) + self.ignore_hostname = kwargs.get('ignore_hostname', None) + self.ignore_signature = kwargs.get('ignore_signature', None) + + class TokenClaim(msrest.serialization.Model): """Properties for expected token claims. @@ -1236,6 +2714,41 @@ def __init__( self.location = kwargs['location'] +class UnsecuredEndpoint(EndpointBase): + """Unsecured endpoint describes an endpoint that the pipeline can connect to over clear transport (no encryption in transit). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase + """ + + _validation = { + 'type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + } + + def __init__( + self, + **kwargs + ): + super(UnsecuredEndpoint, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.UnsecuredEndpoint' # type: str + + class UserAssignedManagedIdentity(msrest.serialization.Model): """The details of the user assigned managed identity used by the Video Analyzer resource. @@ -1266,8 +2779,45 @@ def __init__( self.principal_id = None +class UsernamePasswordCredentials(CredentialsBase): + """Username and password credentials. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param username: Required. Username to be presented as part of the credentials. + :type username: str + :param password: Required. Password to be presented as part of the credentials. It is + recommended that this value is parameterized as a secret string in order to prevent this value + to be returned as part of the resource on API requests. + :type password: str + """ + + _validation = { + 'type': {'required': True}, + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UsernamePasswordCredentials, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.UsernamePasswordCredentials' # type: str + self.username = kwargs['username'] + self.password = kwargs['password'] + + class VideoAnalyzer(TrackedResource): - """A Video Analyzer account. + """VideoAnalyzer. Variables are only populated by the server, and will be ignored when sending a request. @@ -1287,14 +2837,27 @@ class VideoAnalyzer(TrackedResource): :type location: str :ivar system_data: The system data of the Video Analyzer account. :vartype system_data: ~video_analyzer.models.SystemData - :param identity: The set of managed identities associated with the Video Analyzer resource. + :param identity: The identities associated to the Video Analyzer resource. :type identity: ~video_analyzer.models.VideoAnalyzerIdentity :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { @@ -1304,6 +2867,8 @@ class VideoAnalyzer(TrackedResource): 'location': {'required': True}, 'system_data': {'readonly': True}, 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1317,6 +2882,11 @@ class VideoAnalyzer(TrackedResource): 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'properties.iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'properties.networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1329,6 +2899,11 @@ def __init__( self.storage_accounts = kwargs.get('storage_accounts', None) self.endpoints = None self.encryption = kwargs.get('encryption', None) + self.iot_hubs = kwargs.get('iot_hubs', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.network_access_control = kwargs.get('network_access_control', None) + self.provisioning_state = None + self.private_endpoint_connections = None class VideoAnalyzerCollection(msrest.serialization.Model): @@ -1346,100 +2921,241 @@ def __init__( self, **kwargs ): - super(VideoAnalyzerCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super(VideoAnalyzerCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VideoAnalyzerIdentity(msrest.serialization.Model): + """The managed identity for the Video Analyzer resource. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The identity type. + :type type: str + :param user_assigned_identities: The User Assigned Managed Identities. + :type user_assigned_identities: dict[str, ~video_analyzer.models.UserAssignedManagedIdentity] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerIdentity, self).__init__(**kwargs) + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class VideoAnalyzerOperationStatus(msrest.serialization.Model): + """VideoAnalyzerOperationStatus. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param id: + :type id: str + :param start_time: + :type start_time: str + :param end_time: + :type end_time: str + :param status: Required. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerOperationStatus, self).__init__(**kwargs) + self.name = kwargs['name'] + self.id = kwargs.get('id', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.status = kwargs['status'] + self.error = kwargs.get('error', None) -class VideoAnalyzerIdentity(msrest.serialization.Model): - """The managed identity for the Video Analyzer resource. +class VideoAnalyzerPropertiesBase(msrest.serialization.Model): + """The properties of the Video Analyzer account. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param type: Required. The identity type. - :type type: str - :param user_assigned_identities: The User Assigned Managed Identities. - :type user_assigned_identities: dict[str, ~video_analyzer.models.UserAssignedManagedIdentity] + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~video_analyzer.models.StorageAccount] + :ivar endpoints: The endpoints associated with this resource. + :vartype endpoints: list[~video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { - 'type': {'required': True}, + 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( self, **kwargs ): - super(VideoAnalyzerIdentity, self).__init__(**kwargs) - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + super(VideoAnalyzerPropertiesBase, self).__init__(**kwargs) + self.storage_accounts = kwargs.get('storage_accounts', None) + self.endpoints = None + self.encryption = kwargs.get('encryption', None) + self.iot_hubs = kwargs.get('iot_hubs', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.network_access_control = kwargs.get('network_access_control', None) + self.provisioning_state = None + self.private_endpoint_connections = None -class VideoAnalyzerPropertiesUpdate(msrest.serialization.Model): - """Properties of the Video Analyzer account. +class VideoAnalyzerProperties(VideoAnalyzerPropertiesBase): + """VideoAnalyzerProperties. Variables are only populated by the server, and will be ignored when sending a request. :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( self, **kwargs ): - super(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.endpoints = None - self.encryption = kwargs.get('encryption', None) + super(VideoAnalyzerProperties, self).__init__(**kwargs) -class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): - """VideoAnalyzerProperties. +class VideoAnalyzerPropertiesUpdate(VideoAnalyzerPropertiesBase): + """VideoAnalyzerPropertiesUpdate. Variables are only populated by the server, and will be ignored when sending a request. :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( self, **kwargs ): - super(VideoAnalyzerProperties, self).__init__(**kwargs) + super(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) class VideoAnalyzerUpdate(msrest.serialization.Model): @@ -1453,14 +3169,29 @@ class VideoAnalyzerUpdate(msrest.serialization.Model): :type identity: ~video_analyzer.models.VideoAnalyzerIdentity :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1469,6 +3200,11 @@ class VideoAnalyzerUpdate(msrest.serialization.Model): 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'properties.iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'properties.networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1481,10 +3217,244 @@ def __init__( self.storage_accounts = kwargs.get('storage_accounts', None) self.endpoints = None self.encryption = kwargs.get('encryption', None) + self.iot_hubs = kwargs.get('iot_hubs', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.network_access_control = kwargs.get('network_access_control', None) + self.provisioning_state = None + self.private_endpoint_connections = None + + +class VideoArchival(msrest.serialization.Model): + """Video archival properties. + + :param retention_period: Video retention period indicates the maximum age of the video archive + segments which are intended to be kept in storage. It must be provided in the ISO8601 duration + format in the granularity of days, up to a maximum of 10 years. For example, if this is set to + P30D (30 days), content older than 30 days will be periodically deleted. This value can be + updated at any time and the new desired retention period will be effective within 24 hours. + :type retention_period: str + """ + + _attribute_map = { + 'retention_period': {'key': 'retentionPeriod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoArchival, self).__init__(**kwargs) + self.retention_period = kwargs.get('retention_period', None) + + +class VideoContentToken(msrest.serialization.Model): + """"Video content token grants access to the video content URLs.". + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar expiration_date: The content token expiration date in ISO8601 format (eg. + 2021-01-01T00:00:00Z). + :vartype expiration_date: ~datetime.datetime + :ivar token: The content token value to be added to the video content URL as the value for the + "token" query string parameter. The token is specific to a single video. + :vartype token: str + """ + + _validation = { + 'expiration_date': {'readonly': True}, + 'token': {'readonly': True}, + } + + _attribute_map = { + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoContentToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None + + +class VideoContentUrls(msrest.serialization.Model): + """Set of URLs to the video content. + + :param download_url: Video file download URL. This URL can be used in conjunction with the + video content authorization token to download the video MP4 file. The resulting MP4 file can be + played on any standard media player. It is available when the video type is 'file' and video + file is available for consumption. + :type download_url: str + :param archive_base_url: Video archive streaming base URL. The archived content can be + automatically played by the Azure Video Analyzer player widget. Alternatively, this URL can be + used in conjunction with the video content authorization token on any compatible DASH or HLS + players by appending the following to the base URL: + + .. code-block:: + + - HLSv4: /manifest(format=m3u8-aapl).m3u8 + - HLS CMAF: /manifest(format=m3u8-cmaf) + - DASH CMAF: /manifest(format=mpd-time-cmaf) + + Moreover, an ongoing video recording can be played in "live mode" with latencies which are + approximately double of the chosen video segment length. It is available when the video type is + 'archive' and video archiving is enabled. + :type archive_base_url: str + :param rtsp_tunnel_url: Video low-latency streaming URL. The live content can be automatically + played by the Azure Video Analyzer player widget. Alternatively, this URL can be used in + conjunction with the video content authorization token to expose a WebSocket tunneled RTSP + stream. It is available when the video type is 'archive' and a live, low-latency feed is + available from the source. + :type rtsp_tunnel_url: str + :param preview_image_urls: Video preview image URLs. These URLs can be used in conjunction with + the video content authorization token to download the most recent still image from the video + archive in different resolutions. They are available when the video type is 'archive' and + preview images are enabled. + :type preview_image_urls: ~video_analyzer.models.VideoPreviewImageUrls + """ + + _attribute_map = { + 'download_url': {'key': 'downloadUrl', 'type': 'str'}, + 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + 'rtsp_tunnel_url': {'key': 'rtspTunnelUrl', 'type': 'str'}, + 'preview_image_urls': {'key': 'previewImageUrls', 'type': 'VideoPreviewImageUrls'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoContentUrls, self).__init__(**kwargs) + self.download_url = kwargs.get('download_url', None) + self.archive_base_url = kwargs.get('archive_base_url', None) + self.rtsp_tunnel_url = kwargs.get('rtsp_tunnel_url', None) + self.preview_image_urls = kwargs.get('preview_image_urls', None) + + +class VideoCreationProperties(msrest.serialization.Model): + """Optional video properties to be used in case a new video resource needs to be created on the service. These will not take effect if the video already exists. + + :param title: Optional video title provided by the user. Value can be up to 256 characters + long. + :type title: str + :param description: Optional video description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :param segment_length: Video segment length indicates the length of individual video files + (segments) which are persisted to storage. Smaller segments provide lower archive playback + latency but generate larger volume of storage transactions. Larger segments reduce the amount + of storage transactions while increasing the archive playback latency. Value must be specified + in ISO8601 duration format (i.e. \"PT30S\" equals 30 seconds) and can vary between 30 seconds + to 5 minutes, in 30 seconds increments. Changing this value after the video is initially + created can lead to errors when uploading media to the archive. Default value is 30 seconds. + :type segment_length: str + :param retention_period: Video retention period indicates how long the video is kept in + storage. Value must be specified in ISO8601 duration format (i.e. \"PT1D\" equals 1 day) and + can vary between 1 day to 5 years, in 1 day increments. When absent (null), all video content + is retained indefinitely. + :type retention_period: str + """ + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'segment_length': {'key': 'segmentLength', 'type': 'str'}, + 'retention_period': {'key': 'retentionPeriod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoCreationProperties, self).__init__(**kwargs) + self.title = kwargs.get('title', None) + self.description = kwargs.get('description', None) + self.segment_length = kwargs.get('segment_length', None) + self.retention_period = kwargs.get('retention_period', None) + + +class VideoEncoderBase(msrest.serialization.Model): + """The video encoder base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoEncoderH264. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The video encoding bitrate. + :type bitrate_kbps: str + :param frame_rate: Video encoder frame rate. + :type frame_rate: str + :param scale: Defines the video scale. + :type scale: ~video_analyzer.models.VideoScale + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + 'frame_rate': {'key': 'frameRate', 'type': 'str'}, + 'scale': {'key': 'scale', 'type': 'VideoScale'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoEncoderH264': 'VideoEncoderH264'} + } + + def __init__( + self, + **kwargs + ): + super(VideoEncoderBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.bitrate_kbps = kwargs.get('bitrate_kbps', None) + self.frame_rate = kwargs.get('frame_rate', None) + self.scale = kwargs.get('scale', None) + + +class VideoEncoderH264(VideoEncoderBase): + """The video H264 codec encoder. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The video encoding bitrate. + :type bitrate_kbps: str + :param frame_rate: Video encoder frame rate. + :type frame_rate: str + :param scale: Defines the video scale. + :type scale: ~video_analyzer.models.VideoScale + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + 'frame_rate': {'key': 'frameRate', 'type': 'str'}, + 'scale': {'key': 'scale', 'type': 'VideoScale'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoEncoderH264, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoEncoderH264' # type: str class VideoEntity(ProxyResource): - """The representation of a single video in a Video Analyzer account. + """VideoEntity. Variables are only populated by the server, and will be ignored when sending a request. @@ -1504,16 +3474,18 @@ class VideoEntity(ProxyResource): :param description: Optional video description provided by the user. Value can be up to 2048 characters long. :type description: str - :ivar type_properties_type: Type of the video archive. Different archive formats provide - different capabilities. Possible values include: "Archive". - :vartype type_properties_type: str or ~video_analyzer.models.VideoType + :param type_properties_type: Video content type. Different content types are suitable for + different applications and scenarios. Possible values include: "Archive", "File". + :type type_properties_type: str or ~video_analyzer.models.VideoType :ivar flags: Video flags contain information about the available video actions and its dynamic properties based on the current video state. :vartype flags: ~video_analyzer.models.VideoFlags - :ivar streaming: Video streaming holds information about video streaming URLs. - :vartype streaming: ~video_analyzer.models.VideoStreaming + :ivar content_urls: Set of URLs to the video content. + :vartype content_urls: ~video_analyzer.models.VideoContentUrls :ivar media_info: Contains information about the video and audio content. :vartype media_info: ~video_analyzer.models.VideoMediaInfo + :param archival: Video archival properties. + :type archival: ~video_analyzer.models.VideoArchival """ _validation = { @@ -1521,9 +3493,8 @@ class VideoEntity(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, - 'type_properties_type': {'readonly': True}, 'flags': {'readonly': True}, - 'streaming': {'readonly': True}, + 'content_urls': {'readonly': True}, 'media_info': {'readonly': True}, } @@ -1536,8 +3507,9 @@ class VideoEntity(ProxyResource): 'description': {'key': 'properties.description', 'type': 'str'}, 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, 'flags': {'key': 'properties.flags', 'type': 'VideoFlags'}, - 'streaming': {'key': 'properties.streaming', 'type': 'VideoStreaming'}, + 'content_urls': {'key': 'properties.contentUrls', 'type': 'VideoContentUrls'}, 'media_info': {'key': 'properties.mediaInfo', 'type': 'VideoMediaInfo'}, + 'archival': {'key': 'properties.archival', 'type': 'VideoArchival'}, } def __init__( @@ -1548,10 +3520,11 @@ def __init__( self.system_data = None self.title = kwargs.get('title', None) self.description = kwargs.get('description', None) - self.type_properties_type = None + self.type_properties_type = kwargs.get('type_properties_type', None) self.flags = None - self.streaming = None + self.content_urls = None self.media_info = None + self.archival = kwargs.get('archival', None) class VideoEntityCollection(msrest.serialization.Model): @@ -1589,23 +3562,23 @@ class VideoFlags(msrest.serialization.Model): :param has_data: Required. Value indicating whether or not there has ever been data recorded or uploaded into the video. Newly created videos have this value set to false. :type has_data: bool - :param is_recording: Required. Value indicating whether or not the video is currently being - referenced be an active live pipeline. The fact that is being referenced, doesn't necessarily + :param is_in_use: Required. Value indicating whether or not the video is currently being + referenced be an active pipeline. The fact that is being referenced, doesn't necessarily indicate that data is being received. For example, video recording may be gated on events or camera may not be accessible at the time. - :type is_recording: bool + :type is_in_use: bool """ _validation = { 'can_stream': {'required': True}, 'has_data': {'required': True}, - 'is_recording': {'required': True}, + 'is_in_use': {'required': True}, } _attribute_map = { 'can_stream': {'key': 'canStream', 'type': 'bool'}, 'has_data': {'key': 'hasData', 'type': 'bool'}, - 'is_recording': {'key': 'isRecording', 'type': 'bool'}, + 'is_in_use': {'key': 'isInUse', 'type': 'bool'}, } def __init__( @@ -1615,7 +3588,7 @@ def __init__( super(VideoFlags, self).__init__(**kwargs) self.can_stream = kwargs['can_stream'] self.has_data = kwargs['has_data'] - self.is_recording = kwargs['is_recording'] + self.is_in_use = kwargs['is_in_use'] class VideoMediaInfo(msrest.serialization.Model): @@ -1648,62 +3621,207 @@ def __init__( self.segment_length = None -class VideoStreaming(msrest.serialization.Model): - """Video streaming holds information about video streaming URLs. +class VideoPreviewImageUrls(msrest.serialization.Model): + """Video preview image URLs. These URLs can be used in conjunction with the video content authorization token to download the most recent still image from the video archive in different resolutions. They are available when the video type is 'archive' and preview images are enabled. - :param archive_base_url: Video streaming base URL for the video archive. When present, archived - video can be played through the Azure Video Analyzer player. Alternatively, this URL can be - used with compatible DASH or HLS players by appending the following to the base URL: - - - * HLSv4: /manifest(format=m3u8-aapl).m3u8 - * HLS CMAF: /manifest(format=m3u8-cmaf) - * DASH CMAF: /manifest(format=mpd-time-cmaf) - - Moreover, an ongoing video recording can be played in "live mode" with latencies which are - approximately double of the chosen video segment length. - :type archive_base_url: str + :param small: Low resolution preview image URL. + :type small: str + :param medium: Medium resolution preview image URL. + :type medium: str + :param large: High resolution preview image URL. + :type large: str """ _attribute_map = { - 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + 'small': {'key': 'small', 'type': 'str'}, + 'medium': {'key': 'medium', 'type': 'str'}, + 'large': {'key': 'large', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VideoStreaming, self).__init__(**kwargs) - self.archive_base_url = kwargs.get('archive_base_url', None) + super(VideoPreviewImageUrls, self).__init__(**kwargs) + self.small = kwargs.get('small', None) + self.medium = kwargs.get('medium', None) + self.large = kwargs.get('large', None) + + +class VideoPublishingOptions(msrest.serialization.Model): + """Options for changing video publishing behavior on the video sink and output video. + + :param disable_archive: When set to 'true' the video will not archive media content. Default is + 'false'. + :type disable_archive: str + :param disable_rtsp_publishing: When set to 'true' the video will not publish RTSP playback. + Default is 'false'. + :type disable_rtsp_publishing: str + :param disable_video_preview_image: When set to 'true' the video will not publish preview + images. Default is 'false'. + :type disable_video_preview_image: str + """ + _attribute_map = { + 'disable_archive': {'key': 'disableArchive', 'type': 'str'}, + 'disable_rtsp_publishing': {'key': 'disableRtspPublishing', 'type': 'str'}, + 'disable_video_preview_image': {'key': 'disableVideoPreviewImage', 'type': 'str'}, + } -class VideoStreamingToken(msrest.serialization.Model): - """Video streaming token grants access to the video streaming URLs which can be used by an compatible HLS or DASH player. + def __init__( + self, + **kwargs + ): + super(VideoPublishingOptions, self).__init__(**kwargs) + self.disable_archive = kwargs.get('disable_archive', None) + self.disable_rtsp_publishing = kwargs.get('disable_rtsp_publishing', None) + self.disable_video_preview_image = kwargs.get('disable_video_preview_image', None) + + +class VideoScale(msrest.serialization.Model): + """The video scaling information. + + :param height: The desired output video height. + :type height: str + :param width: The desired output video width. + :type width: str + :param mode: Describes the video scaling mode to be applied. Default mode is 'pad'. Possible + values include: "Pad", "PreserveAspectRatio", "Stretch". + :type mode: str or ~video_analyzer.models.VideoScaleMode + """ - Variables are only populated by the server, and will be ignored when sending a request. + _attribute_map = { + 'height': {'key': 'height', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } - :ivar expiration_date: The streaming token expiration date in ISO8601 format (eg. - 2021-01-01T00:00:00Z). - :vartype expiration_date: ~datetime.datetime - :ivar token: The streaming token value to be added to the video streaming URL as the value for - a "token" query string parameter. The token is specific to a single video. - :vartype token: str + def __init__( + self, + **kwargs + ): + super(VideoScale, self).__init__(**kwargs) + self.height = kwargs.get('height', None) + self.width = kwargs.get('width', None) + self.mode = kwargs.get('mode', None) + + +class VideoSequenceAbsoluteTimeMarkers(TimeSequenceBase): + """Absolute datetime sequence as a string. The datetime format supported is as per ISO8601. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param ranges: Required. The datetime sequence ranges. Example: '[["2020-10-05T03:30:00Z", + "2020-10-05T03:40:00Z"],["2020-10-05T07:30:00Z", "2020-10-05T08:30:00Z"]]'. Each range + indicates the start and end date time marker. + :type ranges: str """ _validation = { - 'expiration_date': {'readonly': True}, - 'token': {'readonly': True}, + 'type': {'required': True}, + 'ranges': {'required': True}, } _attribute_map = { - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, - 'token': {'key': 'token', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'ranges': {'key': 'ranges', 'type': 'str'}, } def __init__( self, **kwargs ): - super(VideoStreamingToken, self).__init__(**kwargs) - self.expiration_date = None - self.token = None + super(VideoSequenceAbsoluteTimeMarkers, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers' # type: str + self.ranges = kwargs['ranges'] + + +class VideoSink(SinkNodeBase): + """Video sink allows for video and audio to be recorded to the Video Analyzer service. The recorded video can be played from anywhere and further managed from the cloud. Due to security reasons, a given Video Analyzer edge module instance can only record content to new video entries, or existing video entries previously recorded by the same module. Any attempt to record content to an existing video which has not been created by the same module instance will result in failure to record. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] + :param video_name: Required. Name of a new or existing Video Analyzer video resource used for + the media recording. + :type video_name: str + :param video_creation_properties: Optional video properties to be used in case a new video + resource needs to be created on the service. + :type video_creation_properties: ~video_analyzer.models.VideoCreationProperties + :param video_publishing_options: Optional video publishing options to be used for changing + publishing behavior of the output video. + :type video_publishing_options: ~video_analyzer.models.VideoPublishingOptions + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + 'video_name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + 'video_name': {'key': 'videoName', 'type': 'str'}, + 'video_creation_properties': {'key': 'videoCreationProperties', 'type': 'VideoCreationProperties'}, + 'video_publishing_options': {'key': 'videoPublishingOptions', 'type': 'VideoPublishingOptions'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoSink, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSink' # type: str + self.video_name = kwargs['video_name'] + self.video_creation_properties = kwargs.get('video_creation_properties', None) + self.video_publishing_options = kwargs.get('video_publishing_options', None) + + +class VideoSource(SourceNodeBase): + """Enables a pipeline to use video as a source. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param video_name: Required. Video name. + :type video_name: str + :param time_sequences: Required. Video time sequences selected for the video. + :type time_sequences: ~video_analyzer.models.TimeSequenceBase + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'video_name': {'required': True}, + 'time_sequences': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'video_name': {'key': 'videoName', 'type': 'str'}, + 'time_sequences': {'key': 'timeSequences', 'type': 'TimeSequenceBase'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoSource, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSource' # type: str + self.video_name = kwargs['video_name'] + self.time_sequences = kwargs['time_sequences'] diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models_py3.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models_py3.py index 29a6e66ece3b0..add922a669b71 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models_py3.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_models_py3.py @@ -87,7 +87,7 @@ def __init__( class AccessPolicyEntity(ProxyResource): - """Policy that determines how a video can be accessed. + """AccessPolicyEntity. Variables are only populated by the server, and will be ignored when sending a request. @@ -209,6 +209,74 @@ def __init__( self.status = None +class AudioEncoderBase(msrest.serialization.Model): + """The audio encoder base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AudioEncoderAac. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The audio encoding bitrate. + :type bitrate_kbps: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.AudioEncoderAac': 'AudioEncoderAac'} + } + + def __init__( + self, + *, + bitrate_kbps: Optional[str] = None, + **kwargs + ): + super(AudioEncoderBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.bitrate_kbps = bitrate_kbps + + +class AudioEncoderAac(AudioEncoderBase): + """The audio encoding AAC Codec. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The audio encoding bitrate. + :type bitrate_kbps: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + } + + def __init__( + self, + *, + bitrate_kbps: Optional[str] = None, + **kwargs + ): + super(AudioEncoderAac, self).__init__(bitrate_kbps=bitrate_kbps, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.AudioEncoderAac' # type: str + + class AuthenticationBase(msrest.serialization.Model): """Base class for access policies authentication methods. @@ -241,6 +309,38 @@ def __init__( self.type = None # type: Optional[str] +class CertificateSource(msrest.serialization.Model): + """Base class for certificate sources. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: PemCertificateList. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.PemCertificateList': 'PemCertificateList'} + } + + def __init__( + self, + **kwargs + ): + super(CertificateSource, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + class CheckNameAvailabilityRequest(msrest.serialization.Model): """The check availability request body. @@ -299,6 +399,38 @@ def __init__( self.message = message +class CredentialsBase(msrest.serialization.Model): + """Base class for credential objects. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: UsernamePasswordCredentials. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.UsernamePasswordCredentials': 'UsernamePasswordCredentials'} + } + + def __init__( + self, + **kwargs + ): + super(CredentialsBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + class TokenKey(msrest.serialization.Model): """Key properties for JWT token validation. @@ -494,15 +626,16 @@ def __init__( self.token = None -class Endpoint(msrest.serialization.Model): - """The endpoint details. +class EncoderPresetBase(msrest.serialization.Model): + """Encoding preset base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EncoderCustomPreset, EncoderSystemPreset. All required parameters must be populated in order to send to Azure. - :param endpoint_url: The URL of the endpoint. - :type endpoint_url: str - :param type: Required. The type of the endpoint. Possible values include: "ClientApi". - :type type: str or ~video_analyzer.models.VideoAnalyzerEndpointType + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str """ _validation = { @@ -510,463 +643,995 @@ class Endpoint(msrest.serialization.Model): } _attribute_map = { - 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EncoderCustomPreset': 'EncoderCustomPreset', '#Microsoft.VideoAnalyzer.EncoderSystemPreset': 'EncoderSystemPreset'} } def __init__( self, - *, - type: Union[str, "VideoAnalyzerEndpointType"], - endpoint_url: Optional[str] = None, **kwargs ): - super(Endpoint, self).__init__(**kwargs) - self.endpoint_url = endpoint_url - self.type = type + super(EncoderPresetBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. +class EncoderCustomPreset(EncoderPresetBase): + """The encoding custom preset for specifying custom encoder settings. - 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. - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: str + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param audio_encoder: The audio encoder. + :type audio_encoder: ~video_analyzer.models.AudioEncoderBase + :param video_encoder: The video encoder. + :type video_encoder: ~video_analyzer.models.VideoEncoderBase """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'audio_encoder': {'key': 'audioEncoder', 'type': 'AudioEncoderBase'}, + 'video_encoder': {'key': 'videoEncoder', 'type': 'VideoEncoderBase'}, } def __init__( self, + *, + audio_encoder: Optional["AudioEncoderBase"] = None, + video_encoder: Optional["VideoEncoderBase"] = None, **kwargs ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None + super(EncoderCustomPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderCustomPreset' # type: str + self.audio_encoder = audio_encoder + self.video_encoder = video_encoder -class ErrorDetail(msrest.serialization.Model): - """The error detail. +class NodeBase(msrest.serialization.Model): + """Base class for nodes. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ProcessorNodeBase, SinkNodeBase, SourceNodeBase. - :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[~video_analyzer.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~video_analyzer.models.ErrorAdditionalInfo] + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + 'type': {'required': True}, + 'name': {'required': 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]'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.ProcessorNodeBase': 'ProcessorNodeBase', '#Microsoft.VideoAnalyzer.SinkNodeBase': 'SinkNodeBase', '#Microsoft.VideoAnalyzer.SourceNodeBase': 'SourceNodeBase'} } def __init__( self, + *, + name: str, **kwargs ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None + super(NodeBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.name = name -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.). +class ProcessorNodeBase(NodeBase): + """Base class for topology processor nodes. - :param error: The error object. - :type error: ~video_analyzer.models.ErrorDetail + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EncoderProcessor. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] """ + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + } + _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EncoderProcessor': 'EncoderProcessor'} } def __init__( self, *, - error: Optional["ErrorDetail"] = None, + name: str, + inputs: List["NodeInput"], **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error + super(ProcessorNodeBase, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.ProcessorNodeBase' # type: str + self.inputs = inputs -class JwtAuthentication(AuthenticationBase): - """Properties for access validation based on JSON Web Tokens (JWT). +class EncoderProcessor(ProcessorNodeBase): + """A processor node which encodes the media. All required parameters must be populated in order to send to Azure. :param type: Required. The discriminator for derived types.Constant filled by server. :type type: str - :param issuers: List of expected token issuers. Token issuer is valid if it matches at least - one of the given values. - :type issuers: list[str] - :param audiences: List of expected token audiences. Token audience is valid if it matches at - least one of the given values. - :type audiences: list[str] - :param claims: List of additional token claims to be validated. Token must contains all claims - and respective values for it to be valid. - :type claims: list[~video_analyzer.models.TokenClaim] - :param keys: List of keys which can be used to validate access tokens. Having multiple keys - allow for seamless key rotation of the token signing key. Token signature must match exactly - one key. - :type keys: list[~video_analyzer.models.TokenKey] + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] + :param preset: Required. The encoder preset. + :type preset: ~video_analyzer.models.EncoderPresetBase """ _validation = { 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + 'preset': {'required': True}, } _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, - 'issuers': {'key': 'issuers', 'type': '[str]'}, - 'audiences': {'key': 'audiences', 'type': '[str]'}, - 'claims': {'key': 'claims', 'type': '[TokenClaim]'}, - 'keys': {'key': 'keys', 'type': '[TokenKey]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + 'preset': {'key': 'preset', 'type': 'EncoderPresetBase'}, } def __init__( self, *, - issuers: Optional[List[str]] = None, - audiences: Optional[List[str]] = None, - claims: Optional[List["TokenClaim"]] = None, - keys: Optional[List["TokenKey"]] = None, + name: str, + inputs: List["NodeInput"], + preset: "EncoderPresetBase", **kwargs ): - super(JwtAuthentication, self).__init__(**kwargs) - self.type = '#Microsoft.VideoAnalyzer.JwtAuthentication' # type: str - self.issuers = issuers - self.audiences = audiences - self.claims = claims - self.keys = keys + super(EncoderProcessor, self).__init__(name=name, inputs=inputs, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderProcessor' # type: str + self.preset = preset -class KeyVaultProperties(msrest.serialization.Model): - """The details for accessing the encryption keys in Key Vault. - - Variables are only populated by the server, and will be ignored when sending a request. +class EncoderSystemPreset(EncoderPresetBase): + """The encoding built in system preset. All required parameters must be populated in order to send to Azure. - :param key_identifier: Required. The URL of the Key Vault key used to encrypt the account. The - key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key - without a version (for example https://vault/keys/mykey). - :type key_identifier: str - :ivar current_key_identifier: The current key used to encrypt Video Analyzer account, including - the key version. - :vartype current_key_identifier: str + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. The system preset value. Possible values include: + "SingleLayer_540p_H264_AAC", "SingleLayer_720p_H264_AAC", "SingleLayer_1080p_H264_AAC", + "SingleLayer_2160p_H264_AAC". + :type name: str or ~video_analyzer.models.EncoderSystemPresetType """ _validation = { - 'key_identifier': {'required': True}, - 'current_key_identifier': {'readonly': True}, + 'type': {'required': True}, + 'name': {'required': True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, } def __init__( self, *, - key_identifier: str, + name: Union[str, "EncoderSystemPresetType"], **kwargs ): - super(KeyVaultProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - self.current_key_identifier = None + super(EncoderSystemPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderSystemPreset' # type: str + self.name = name -class ListProvisioningTokenInput(msrest.serialization.Model): - """The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. +class Endpoint(msrest.serialization.Model): + """The endpoint details. All required parameters must be populated in order to send to Azure. - :param expiration_date: Required. The desired expiration date of the registration token. The - Azure Video Analyzer IoT edge module must be initialized and connected to the Internet prior to - the token expiration date. - :type expiration_date: ~datetime.datetime + :param endpoint_url: The URL of the endpoint. + :type endpoint_url: str + :param type: Required. The type of the endpoint. Possible values include: "ClientApi". + :type type: str or ~video_analyzer.models.VideoAnalyzerEndpointType """ _validation = { - 'expiration_date': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, *, - expiration_date: datetime.datetime, + type: Union[str, "VideoAnalyzerEndpointType"], + endpoint_url: Optional[str] = None, **kwargs ): - super(ListProvisioningTokenInput, self).__init__(**kwargs) - self.expiration_date = expiration_date + super(Endpoint, self).__init__(**kwargs) + self.endpoint_url = endpoint_url + self.type = type -class LogSpecification(msrest.serialization.Model): - """A diagnostic log emitted by service. +class EndpointBase(msrest.serialization.Model): + """Base class for endpoints. - Variables are only populated by the server, and will be ignored when sending a request. + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: TlsEndpoint, UnsecuredEndpoint. - :ivar name: The diagnostic log category name. - :vartype name: str - :ivar display_name: The diagnostic log category display name. - :vartype display_name: str - :ivar blob_duration: The time range for requests in each blob. - :vartype blob_duration: str + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'blob_duration': {'readonly': True}, + 'type': {'required': True}, + 'url': {'required': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.TlsEndpoint': 'TlsEndpoint', '#Microsoft.VideoAnalyzer.UnsecuredEndpoint': 'UnsecuredEndpoint'} } def __init__( self, + *, + url: str, + credentials: Optional["CredentialsBase"] = None, + tunnel: Optional["TunnelBase"] = None, **kwargs ): - super(LogSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.blob_duration = None + super(EndpointBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.credentials = credentials + self.url = url + self.tunnel = tunnel -class MetricDimension(msrest.serialization.Model): - """A metric dimension. +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 name: The metric dimension name. - :vartype name: str - :ivar display_name: The display name for the dimension. - :vartype display_name: str - :ivar to_be_exported_for_shoebox: Whether to export metric to shoebox. - :vartype to_be_exported_for_shoebox: bool + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'to_be_exported_for_shoebox': {'readonly': True}, + 'type': {'readonly': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__( self, **kwargs ): - super(MetricDimension, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.to_be_exported_for_shoebox = None + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None -class MetricSpecification(msrest.serialization.Model): - """A metric emitted by service. +class ErrorDetail(msrest.serialization.Model): + """The error detail. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The metric name. - :vartype name: str - :ivar display_name: The metric display name. - :vartype display_name: str - :ivar display_description: The metric display description. - :vartype display_description: str - :ivar unit: The metric unit. Possible values include: "Bytes", "Count", "Milliseconds". - :vartype unit: str or ~video_analyzer.models.MetricUnit - :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", - "Count", "Total". - :vartype aggregation_type: str or ~video_analyzer.models.MetricAggregationType - :ivar lock_aggregation_type: The metric lock aggregation type. Possible values include: - "Average", "Count", "Total". - :vartype lock_aggregation_type: str or ~video_analyzer.models.MetricAggregationType - :param supported_aggregation_types: Supported aggregation types. - :type supported_aggregation_types: list[str] - :ivar dimensions: The metric dimensions. - :vartype dimensions: list[~video_analyzer.models.MetricDimension] - :ivar enable_regional_mdm_account: Indicates whether regional MDM account is enabled. - :vartype enable_regional_mdm_account: bool - :ivar source_mdm_account: The source MDM account. - :vartype source_mdm_account: str - :ivar source_mdm_namespace: The source MDM namespace. - :vartype source_mdm_namespace: str - :ivar supported_time_grain_types: The supported time grain types. - :vartype supported_time_grain_types: list[str] + :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[~video_analyzer.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~video_analyzer.models.ErrorAdditionalInfo] """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'display_description': {'readonly': True}, - 'unit': {'readonly': True}, - 'aggregation_type': {'readonly': True}, - 'lock_aggregation_type': {'readonly': True}, - 'dimensions': {'readonly': True}, - 'enable_regional_mdm_account': {'readonly': True}, - 'source_mdm_account': {'readonly': True}, - 'source_mdm_namespace': {'readonly': True}, - 'supported_time_grain_types': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'display_description': {'key': 'displayDescription', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, - 'lock_aggregation_type': {'key': 'lockAggregationType', 'type': 'str'}, - 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, - 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, - 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, - 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, - 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, - 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + '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, - *, - supported_aggregation_types: Optional[List[str]] = None, **kwargs ): - super(MetricSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.display_description = None - self.unit = None - self.aggregation_type = None - self.lock_aggregation_type = None - self.supported_aggregation_types = supported_aggregation_types - self.dimensions = None - self.enable_regional_mdm_account = None - self.source_mdm_account = None - self.source_mdm_namespace = None - self.supported_time_grain_types = None - + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None -class Operation(msrest.serialization.Model): - """An operation. - All required parameters must be populated in order to send to Azure. +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - :param name: Required. The operation name. - :type name: str - :param display: The operation display name. - :type display: ~video_analyzer.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - :param properties: Operation properties format. - :type properties: ~video_analyzer.models.Properties - :param is_data_action: Whether the operation applies to data-plane. - :type is_data_action: bool - :param action_type: Indicates the action type. Possible values include: "Internal". - :type action_type: str or ~video_analyzer.models.ActionType + :param error: The error object. + :type error: ~video_analyzer.models.ErrorDetail """ - _validation = { - 'name': {'required': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'Properties'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'action_type': {'key': 'actionType', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, } def __init__( self, *, - name: str, - display: Optional["OperationDisplay"] = None, - origin: Optional[str] = None, - properties: Optional["Properties"] = None, - is_data_action: Optional[bool] = None, - action_type: Optional[Union[str, "ActionType"]] = None, + error: Optional["ErrorDetail"] = None, **kwargs ): - super(Operation, self).__init__(**kwargs) - self.name = name - self.display = display - self.origin = origin - self.properties = properties - self.is_data_action = is_data_action - self.action_type = action_type + super(ErrorResponse, self).__init__(**kwargs) + self.error = error -class OperationCollection(msrest.serialization.Model): - """A collection of Operation items. +class GroupLevelAccessControl(msrest.serialization.Model): + """GroupLevelAccessControl. - :param value: A collection of Operation items. - :type value: list[~video_analyzer.models.Operation] + :param public_network_access: Whether or not public network access is allowed for specified + resources under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, } def __init__( self, *, - value: Optional[List["Operation"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, **kwargs ): - super(OperationCollection, self).__init__(**kwargs) - self.value = value + super(GroupLevelAccessControl, self).__init__(**kwargs) + self.public_network_access = public_network_access -class OperationDisplay(msrest.serialization.Model): - """Operation details. +class IotHub(msrest.serialization.Model): + """The IoT Hub 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: Required. The IoT Hub ARM ID. + :type id: str + :param identity: Required. The IoT Hub identity. + :type identity: ~video_analyzer.models.ResourceIdentity + :ivar status: The current status of the Iot Hub mapping. + :vartype status: str + """ + + _validation = { + 'id': {'required': True}, + 'identity': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + id: str, + identity: "ResourceIdentity", + **kwargs + ): + super(IotHub, self).__init__(**kwargs) + self.id = id + self.identity = identity + self.status = None + + +class JwtAuthentication(AuthenticationBase): + """Properties for access validation based on JSON Web Tokens (JWT). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param issuers: List of expected token issuers. Token issuer is valid if it matches at least + one of the given values. + :type issuers: list[str] + :param audiences: List of expected token audiences. Token audience is valid if it matches at + least one of the given values. + :type audiences: list[str] + :param claims: List of additional token claims to be validated. Token must contains all claims + and respective values for it to be valid. + :type claims: list[~video_analyzer.models.TokenClaim] + :param keys: List of keys which can be used to validate access tokens. Having multiple keys + allow for seamless key rotation of the token signing key. Token signature must match exactly + one key. + :type keys: list[~video_analyzer.models.TokenKey] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'issuers': {'key': 'issuers', 'type': '[str]'}, + 'audiences': {'key': 'audiences', 'type': '[str]'}, + 'claims': {'key': 'claims', 'type': '[TokenClaim]'}, + 'keys': {'key': 'keys', 'type': '[TokenKey]'}, + } + + def __init__( + self, + *, + issuers: Optional[List[str]] = None, + audiences: Optional[List[str]] = None, + claims: Optional[List["TokenClaim"]] = None, + keys: Optional[List["TokenKey"]] = None, + **kwargs + ): + super(JwtAuthentication, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.JwtAuthentication' # type: str + self.issuers = issuers + self.audiences = audiences + self.claims = claims + self.keys = keys + + +class KeyVaultProperties(msrest.serialization.Model): + """The details for accessing the encryption keys in Key Vault. + + 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 key_identifier: Required. The URL of the Key Vault key used to encrypt the account. The + key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key + without a version (for example https://vault/keys/mykey). + :type key_identifier: str + :ivar current_key_identifier: The current key used to encrypt Video Analyzer account, including + the key version. + :vartype current_key_identifier: str + """ + + _validation = { + 'key_identifier': {'required': True}, + 'current_key_identifier': {'readonly': True}, + } + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, + } + + def __init__( + self, + *, + key_identifier: str, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_identifier = key_identifier + self.current_key_identifier = None + + +class ListProvisioningTokenInput(msrest.serialization.Model): + """The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. + + All required parameters must be populated in order to send to Azure. + + :param expiration_date: Required. The desired expiration date of the registration token. The + Azure Video Analyzer IoT edge module must be initialized and connected to the Internet prior to + the token expiration date. + :type expiration_date: ~datetime.datetime + """ + + _validation = { + 'expiration_date': {'required': True}, + } + + _attribute_map = { + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + expiration_date: datetime.datetime, + **kwargs + ): + super(ListProvisioningTokenInput, self).__init__(**kwargs) + self.expiration_date = expiration_date + + +class LivePipeline(ProxyResource): + """Live Pipeline represents an unique instance of a pipeline topology which is used for real-time content ingestion and analysis. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: The reference to an existing pipeline topology defined for real-time + content processing. When activated, this live pipeline will process content according to the + pipeline topology definition. + :type topology_name: str + :param description: An optional description for the pipeline. + :type description: str + :param bitrate_kbps: Bitrate capacity in kbps for the live pipeline. The support bit rate is + between 500 to 3000 kbps. + :type bitrate_kbps: int + :ivar state: Current pipeline state (read-only). Possible values include: "Inactive", + "Activating", "Active", "Deactivating". + :vartype state: str or ~video_analyzer.models.LivePipelineState + :param parameters: List of the instance level parameter values for the user-defined topology + parameters. A pipeline can only define or override parameters values for parameters which have + been declared in the referenced topology. Topology parameters without a default value must be + defined. Topology parameters with a default value can be optionally be overridden. + :type parameters: list[~video_analyzer.models.ParameterDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'topology_name': {'key': 'properties.topologyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'bitrate_kbps': {'key': 'properties.bitrateKbps', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDefinition]'}, + } + + def __init__( + self, + *, + topology_name: Optional[str] = None, + description: Optional[str] = None, + bitrate_kbps: Optional[int] = None, + parameters: Optional[List["ParameterDefinition"]] = None, + **kwargs + ): + super(LivePipeline, self).__init__(**kwargs) + self.system_data = None + self.topology_name = topology_name + self.description = description + self.bitrate_kbps = bitrate_kbps + self.state = None + self.parameters = parameters + + +class LivePipelineCollection(msrest.serialization.Model): + """A collection of LivePipeline items. + + :param value: A collection of LivePipeline items. + :type value: list[~video_analyzer.models.LivePipeline] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LivePipeline]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["LivePipeline"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(LivePipelineCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class LivePipelineOperationStatus(msrest.serialization.Model): + """LivePipelineOperationStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the live pipeline operation. + :vartype name: str + :ivar status: The status of the live pipeline operation. + :vartype status: str + :ivar error: The error details for the live pipeline operation. + :vartype error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(LivePipelineOperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.error = None + + +class LogSpecification(msrest.serialization.Model): + """A diagnostic log emitted by service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The diagnostic log category name. + :vartype name: str + :ivar display_name: The diagnostic log category display name. + :vartype display_name: str + :ivar blob_duration: The time range for requests in each blob. + :vartype blob_duration: str + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'blob_duration': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogSpecification, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.blob_duration = None + + +class MetricDimension(msrest.serialization.Model): + """A metric dimension. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The metric dimension name. + :vartype name: str + :ivar display_name: The display name for the dimension. + :vartype display_name: str + :ivar to_be_exported_for_shoebox: Whether to export metric to shoebox. + :vartype to_be_exported_for_shoebox: bool + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'to_be_exported_for_shoebox': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(MetricDimension, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.to_be_exported_for_shoebox = None + + +class MetricSpecification(msrest.serialization.Model): + """A metric emitted by service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The metric name. + :vartype name: str + :ivar display_name: The metric display name. + :vartype display_name: str + :ivar display_description: The metric display description. + :vartype display_description: str + :ivar unit: The metric unit. Possible values include: "Bytes", "Count", "Milliseconds". + :vartype unit: str or ~video_analyzer.models.MetricUnit + :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", + "Count", "Total". + :vartype aggregation_type: str or ~video_analyzer.models.MetricAggregationType + :ivar lock_aggregation_type: The metric lock aggregation type. Possible values include: + "Average", "Count", "Total". + :vartype lock_aggregation_type: str or ~video_analyzer.models.MetricAggregationType + :param supported_aggregation_types: Supported aggregation types. + :type supported_aggregation_types: list[str] + :ivar dimensions: The metric dimensions. + :vartype dimensions: list[~video_analyzer.models.MetricDimension] + :ivar enable_regional_mdm_account: Indicates whether regional MDM account is enabled. + :vartype enable_regional_mdm_account: bool + :ivar source_mdm_account: The source MDM account. + :vartype source_mdm_account: str + :ivar source_mdm_namespace: The source MDM namespace. + :vartype source_mdm_namespace: str + :ivar supported_time_grain_types: The supported time grain types. + :vartype supported_time_grain_types: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'display_description': {'readonly': True}, + 'unit': {'readonly': True}, + 'aggregation_type': {'readonly': True}, + 'lock_aggregation_type': {'readonly': True}, + 'dimensions': {'readonly': True}, + 'enable_regional_mdm_account': {'readonly': True}, + 'source_mdm_account': {'readonly': True}, + 'source_mdm_namespace': {'readonly': True}, + 'supported_time_grain_types': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'display_description': {'key': 'displayDescription', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'aggregation_type': {'key': 'aggregationType', 'type': 'str'}, + 'lock_aggregation_type': {'key': 'lockAggregationType', 'type': 'str'}, + 'supported_aggregation_types': {'key': 'supportedAggregationTypes', 'type': '[str]'}, + 'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'}, + 'enable_regional_mdm_account': {'key': 'enableRegionalMdmAccount', 'type': 'bool'}, + 'source_mdm_account': {'key': 'sourceMdmAccount', 'type': 'str'}, + 'source_mdm_namespace': {'key': 'sourceMdmNamespace', 'type': 'str'}, + 'supported_time_grain_types': {'key': 'supportedTimeGrainTypes', 'type': '[str]'}, + } + + def __init__( + self, + *, + supported_aggregation_types: Optional[List[str]] = None, + **kwargs + ): + super(MetricSpecification, self).__init__(**kwargs) + self.name = None + self.display_name = None + self.display_description = None + self.unit = None + self.aggregation_type = None + self.lock_aggregation_type = None + self.supported_aggregation_types = supported_aggregation_types + self.dimensions = None + self.enable_regional_mdm_account = None + self.source_mdm_account = None + self.source_mdm_namespace = None + self.supported_time_grain_types = None + + +class NetworkAccessControl(msrest.serialization.Model): + """NetworkAccessControl. + + :param integration: Public network access for integration group. + :type integration: ~video_analyzer.models.GroupLevelAccessControl + :param ingestion: Public network access for ingestion group. + :type ingestion: ~video_analyzer.models.GroupLevelAccessControl + :param consumption: Public network access for consumption group. + :type consumption: ~video_analyzer.models.GroupLevelAccessControl + """ + + _attribute_map = { + 'integration': {'key': 'integration', 'type': 'GroupLevelAccessControl'}, + 'ingestion': {'key': 'ingestion', 'type': 'GroupLevelAccessControl'}, + 'consumption': {'key': 'consumption', 'type': 'GroupLevelAccessControl'}, + } + + def __init__( + self, + *, + integration: Optional["GroupLevelAccessControl"] = None, + ingestion: Optional["GroupLevelAccessControl"] = None, + consumption: Optional["GroupLevelAccessControl"] = None, + **kwargs + ): + super(NetworkAccessControl, self).__init__(**kwargs) + self.integration = integration + self.ingestion = ingestion + self.consumption = consumption + + +class NodeInput(msrest.serialization.Model): + """Describes an input signal to be used on a pipeline node. + + All required parameters must be populated in order to send to Azure. + + :param node_name: Required. The name of the upstream node in the pipeline which output is used + as input of the current node. + :type node_name: str + """ + + _validation = { + 'node_name': {'required': True}, + } + + _attribute_map = { + 'node_name': {'key': 'nodeName', 'type': 'str'}, + } + + def __init__( + self, + *, + node_name: str, + **kwargs + ): + super(NodeInput, self).__init__(**kwargs) + self.node_name = node_name + + +class Operation(msrest.serialization.Model): + """An operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The operation name. + :type name: str + :param display: The operation display name. + :type display: ~video_analyzer.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param properties: Operation properties format. + :type properties: ~video_analyzer.models.Properties + :param is_data_action: Whether the operation applies to data-plane. + :type is_data_action: bool + :param action_type: Indicates the action type. Possible values include: "Internal". + :type action_type: str or ~video_analyzer.models.ActionType + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'Properties'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'action_type': {'key': 'actionType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + display: Optional["OperationDisplay"] = None, + origin: Optional[str] = None, + properties: Optional["Properties"] = None, + is_data_action: Optional[bool] = None, + action_type: Optional[Union[str, "ActionType"]] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + self.is_data_action = is_data_action + self.action_type = action_type + + +class OperationCollection(msrest.serialization.Model): + """A collection of Operation items. + + :param value: A collection of Operation items. + :type value: list[~video_analyzer.models.Operation] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + **kwargs + ): + super(OperationCollection, self).__init__(**kwargs) + self.value = value + + +class OperationDisplay(msrest.serialization.Model): + """Operation details. :param provider: The service provider. :type provider: str @@ -979,26 +1644,616 @@ class OperationDisplay(msrest.serialization.Model): """ _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class ParameterDeclaration(msrest.serialization.Model): + """Single topology parameter declaration. Declared parameters can and must be referenced throughout the topology and can optionally have default values to be used when they are not defined in the pipelines. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the parameter. + :type name: str + :param type: Required. Type of the parameter. Possible values include: "String", + "SecretString", "Int", "Double", "Bool". + :type type: str or ~video_analyzer.models.ParameterType + :param description: Description of the parameter. + :type description: str + :param default: The default value for the parameter to be used if the pipeline does not specify + a value. + :type default: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + type: Union[str, "ParameterType"], + description: Optional[str] = None, + default: Optional[str] = None, + **kwargs + ): + super(ParameterDeclaration, self).__init__(**kwargs) + self.name = name + self.type = type + self.description = description + self.default = default + + +class ParameterDefinition(msrest.serialization.Model): + """Defines the parameter value of an specific pipeline topology parameter. See pipeline topology parameters for more information. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the parameter declared in the pipeline topology. + :type name: str + :param value: Parameter value to be applied on this specific pipeline. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: Optional[str] = None, + **kwargs + ): + super(ParameterDefinition, self).__init__(**kwargs) + self.name = name + self.value = value + + +class PemCertificateList(CertificateSource): + """A list of PEM formatted certificates. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param certificates: Required. PEM formatted public certificates. One certificate per entry. + :type certificates: list[str] + """ + + _validation = { + 'type': {'required': True}, + 'certificates': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + } + + def __init__( + self, + *, + certificates: List[str], + **kwargs + ): + super(PemCertificateList, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.PemCertificateList' # type: str + self.certificates = certificates + + +class PipelineJob(ProxyResource): + """Represents a pipeline job. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: The reference to an existing pipeline topology defined for real-time + content processing. When activated, this live pipeline will process content according to the + pipeline topology definition. + :type topology_name: str + :param description: An optional description for the pipeline. + :type description: str + :ivar state: Current pipeline state (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The expiration time when the pipeline job will be automatically deleted. + :vartype expiration: ~datetime.datetime + :ivar error: An optional error information about the pipeline job failure. + :vartype error: ~video_analyzer.models.PipelineJobError + :param parameters: List of the instance level parameter values for the user-defined topology + parameters. A pipeline can only define or override parameters values for parameters which have + been declared in the referenced topology. Topology parameters without a default value must be + defined. Topology parameters with a default value can be optionally be overridden. + :type parameters: list[~video_analyzer.models.ParameterDefinition] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'state': {'readonly': True}, + 'expiration': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'topology_name': {'key': 'properties.topologyName', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'expiration': {'key': 'properties.expiration', 'type': 'iso-8601'}, + 'error': {'key': 'properties.error', 'type': 'PipelineJobError'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDefinition]'}, + } + + def __init__( + self, + *, + topology_name: Optional[str] = None, + description: Optional[str] = None, + parameters: Optional[List["ParameterDefinition"]] = None, + **kwargs + ): + super(PipelineJob, self).__init__(**kwargs) + self.system_data = None + self.topology_name = topology_name + self.description = description + self.state = None + self.expiration = None + self.error = None + self.parameters = parameters + + +class PipelineJobCollection(msrest.serialization.Model): + """A collection of PipelineJob items. + + :param value: A collection of PipelineJob items. + :type value: list[~video_analyzer.models.PipelineJob] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PipelineJob]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PipelineJob"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PipelineJobCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PipelineJobError(msrest.serialization.Model): + """The pipeline job error details. + + :param code: The error code. + :type code: str + :param message: The error message. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(PipelineJobError, self).__init__(**kwargs) + self.code = code + self.message = message + + +class PipelineJobOperationStatus(msrest.serialization.Model): + """PipelineJobOperationStatus. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the pipeline job operation. + :vartype name: str + :ivar status: The status of the pipeline job operation. + :vartype status: str + :ivar error: The error details for the pipeline job operation. + :vartype error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'error': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(PipelineJobOperationStatus, self).__init__(**kwargs) + self.name = None + self.status = None + self.error = None + + +class PipelineTopology(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing media for a particular outcome. The topology should be defined according to the scenario to be achieved and can be reused across many pipeline instances which share the same processing characteristics. For instance, a pipeline topology which acquires data from a RTSP camera, process it with an specific AI model and stored the data on the cloud can be reused across many different cameras, as long as the same processing should be applied across all the cameras. Individual instance properties can be defined through the use of user-defined parameters, which allow for a topology to be parameterized, thus allowing individual pipelines to refer to different values, such as individual cameras RTSP endpoints and credentials. Overall a topology is composed of the following:\r\n\r\n - Parameters: list of user defined parameters that can be references across the topology nodes.\r\n - Sources: list of one or more data sources nodes such as an RTSP source which allows for media to be ingested from cameras.\r\n - Processors: list of nodes which perform data analysis or transformations.\r\n -Sinks: list of one or more data sinks which allow for data to be stored or exported to other destinations. + + 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. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~video_analyzer.models.SystemData + :param kind: Required. Topology kind. Possible values include: "Live", "Batch". + :type kind: str or ~video_analyzer.models.Kind + :param sku: Required. The SKU details. + :type sku: ~video_analyzer.models.Sku + :param description: An optional description of the pipeline topology. It is recommended that + the expected use of the topology to be described here. + :type description: str + :param parameters: List of the topology parameter declarations. Parameters declared here can be + referenced throughout the topology nodes through the use of \"${PARAMETER_NAME}\" string + pattern. Parameters can have optional default values and can later be defined in individual + instances of the pipeline. + :type parameters: list[~video_analyzer.models.ParameterDeclaration] + :param sources: List of the topology source nodes. Source nodes enable external data to be + ingested by the pipeline. + :type sources: list[~video_analyzer.models.SourceNodeBase] + :param processors: List of the topology processor nodes. Processor nodes enable pipeline data + to be analyzed, processed or transformed. + :type processors: list[~video_analyzer.models.ProcessorNodeBase] + :param sinks: List of the topology sink nodes. Sink nodes allow pipeline data to be stored or + exported. + :type sinks: list[~video_analyzer.models.SinkNodeBase] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'parameters': {'key': 'properties.parameters', 'type': '[ParameterDeclaration]'}, + 'sources': {'key': 'properties.sources', 'type': '[SourceNodeBase]'}, + 'processors': {'key': 'properties.processors', 'type': '[ProcessorNodeBase]'}, + 'sinks': {'key': 'properties.sinks', 'type': '[SinkNodeBase]'}, + } + + def __init__( + self, + *, + kind: Union[str, "Kind"], + sku: "Sku", + description: Optional[str] = None, + parameters: Optional[List["ParameterDeclaration"]] = None, + sources: Optional[List["SourceNodeBase"]] = None, + processors: Optional[List["ProcessorNodeBase"]] = None, + sinks: Optional[List["SinkNodeBase"]] = None, + **kwargs + ): + super(PipelineTopology, self).__init__(**kwargs) + self.system_data = None + self.kind = kind + self.sku = sku + self.description = description + self.parameters = parameters + self.sources = sources + self.processors = processors + self.sinks = sinks + + +class PipelineTopologyCollection(msrest.serialization.Model): + """A collection of PipelineTopology items. + + :param value: A collection of PipelineTopology items. + :type value: list[~video_analyzer.models.PipelineTopology] + :param next_link: A link to the next page of the collection (when the collection contains too + many results to return in one response). + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PipelineTopology]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PipelineTopology"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(PipelineTopologyCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~video_analyzer.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~video_analyzer.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~video_analyzer.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~video_analyzer.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(Resource): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~video_analyzer.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~video_analyzer.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } def __init__( self, *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, description: Optional[str] = None, + actions_required: Optional[str] = None, **kwargs ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status self.description = description + self.actions_required = actions_required class Properties(msrest.serialization.Model): @@ -1037,102 +2292,337 @@ class ResourceIdentity(msrest.serialization.Model): """ _validation = { - 'user_assigned_identity': {'required': True}, + 'user_assigned_identity': {'required': True}, + } + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + *, + user_assigned_identity: str, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + + +class RsaTokenKey(TokenKey): + """Required validation properties for tokens generated with RSA algorithm. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param kid: Required. JWT token key id. Validation keys are looked up based on the key id + present on the JWT token header. + :type kid: str + :param alg: Required. RSA algorithm to be used: RS256, RS384 or RS512. Possible values include: + "RS256", "RS384", "RS512". + :type alg: str or ~video_analyzer.models.AccessPolicyRsaAlgo + :param n: Required. RSA public key modulus. + :type n: str + :param e: Required. RSA public key exponent. + :type e: str + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + 'alg': {'required': True}, + 'n': {'required': True}, + 'e': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'n': {'key': 'n', 'type': 'str'}, + 'e': {'key': 'e', 'type': 'str'}, + } + + def __init__( + self, + *, + kid: str, + alg: Union[str, "AccessPolicyRsaAlgo"], + n: str, + e: str, + **kwargs + ): + super(RsaTokenKey, self).__init__(kid=kid, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.RsaTokenKey' # type: str + self.alg = alg + self.n = n + self.e = e + + +class SourceNodeBase(NodeBase): + """Base class for topology source nodes. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: RtspSource, VideoSource. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.RtspSource': 'RtspSource', '#Microsoft.VideoAnalyzer.VideoSource': 'VideoSource'} + } + + def __init__( + self, + *, + name: str, + **kwargs + ): + super(SourceNodeBase, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.SourceNodeBase' # type: str + + +class RtspSource(SourceNodeBase): + """RTSP source allows for media from an RTSP camera or generic RTSP server to be ingested into a pipeline. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param transport: Network transport utilized by the RTSP and RTP exchange: TCP or HTTP. When + using TCP, the RTP packets are interleaved on the TCP RTSP connection. When using HTTP, the + RTSP messages are exchanged through long lived HTTP connections, and the RTP packages are + interleaved in the HTTP connections alongside the RTSP messages. Possible values include: + "Http", "Tcp". + :type transport: str or ~video_analyzer.models.RtspTransport + :param endpoint: Required. RTSP endpoint information for Video Analyzer to connect to. This + contains the required information for Video Analyzer to connect to RTSP cameras and/or generic + RTSP servers. + :type endpoint: ~video_analyzer.models.EndpointBase + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'endpoint': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'transport': {'key': 'transport', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'EndpointBase'}, + } + + def __init__( + self, + *, + name: str, + endpoint: "EndpointBase", + transport: Optional[Union[str, "RtspTransport"]] = None, + **kwargs + ): + super(RtspSource, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.RtspSource' # type: str + self.transport = transport + self.endpoint = endpoint + + +class TunnelBase(msrest.serialization.Model): + """Base class for tunnel objects. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: SecureIotDeviceRemoteTunnel. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel': 'SecureIotDeviceRemoteTunnel'} + } + + def __init__( + self, + **kwargs + ): + super(TunnelBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class SecureIotDeviceRemoteTunnel(TunnelBase): + """A remote tunnel securely established using IoT Hub device information. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param iot_hub_name: Required. The IoT Hub name to use when establishing the remote tunnel. + :type iot_hub_name: str + :param device_id: Required. The device id to use when establishing the remote tunnel. + :type device_id: str + """ + + _validation = { + 'type': {'required': True}, + 'iot_hub_name': {'required': True}, + 'device_id': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'device_id': {'key': 'deviceId', 'type': 'str'}, + } + + def __init__( + self, + *, + iot_hub_name: str, + device_id: str, + **kwargs + ): + super(SecureIotDeviceRemoteTunnel, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel' # type: str + self.iot_hub_name = iot_hub_name + self.device_id = device_id + + +class ServiceSpecification(msrest.serialization.Model): + """The service metric specifications. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar log_specifications: List of log specifications. + :vartype log_specifications: list[~video_analyzer.models.LogSpecification] + :ivar metric_specifications: List of metric specifications. + :vartype metric_specifications: list[~video_analyzer.models.MetricSpecification] + """ + + _validation = { + 'log_specifications': {'readonly': True}, + 'metric_specifications': {'readonly': True}, } _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, } def __init__( self, - *, - user_assigned_identity: str, **kwargs ): - super(ResourceIdentity, self).__init__(**kwargs) - self.user_assigned_identity = user_assigned_identity + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = None + self.metric_specifications = None -class RsaTokenKey(TokenKey): - """Required validation properties for tokens generated with RSA algorithm. +class SinkNodeBase(NodeBase): + """Base class for topology sink nodes. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoSink. All required parameters must be populated in order to send to Azure. :param type: Required. The discriminator for derived types.Constant filled by server. :type type: str - :param kid: Required. JWT token key id. Validation keys are looked up based on the key id - present on the JWT token header. - :type kid: str - :param alg: Required. RSA algorithm to be used: RS256, RS384 or RS512. Possible values include: - "RS256", "RS384", "RS512". - :type alg: str or ~video_analyzer.models.AccessPolicyRsaAlgo - :param n: Required. RSA public key modulus. - :type n: str - :param e: Required. RSA public key exponent. - :type e: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] """ _validation = { 'type': {'required': True}, - 'kid': {'required': True}, - 'alg': {'required': True}, - 'n': {'required': True}, - 'e': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, } _attribute_map = { 'type': {'key': '@type', 'type': 'str'}, - 'kid': {'key': 'kid', 'type': 'str'}, - 'alg': {'key': 'alg', 'type': 'str'}, - 'n': {'key': 'n', 'type': 'str'}, - 'e': {'key': 'e', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSink': 'VideoSink'} } def __init__( self, *, - kid: str, - alg: Union[str, "AccessPolicyRsaAlgo"], - n: str, - e: str, + name: str, + inputs: List["NodeInput"], **kwargs ): - super(RsaTokenKey, self).__init__(kid=kid, **kwargs) - self.type = '#Microsoft.VideoAnalyzer.RsaTokenKey' # type: str - self.alg = alg - self.n = n - self.e = e + super(SinkNodeBase, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.SinkNodeBase' # type: str + self.inputs = inputs -class ServiceSpecification(msrest.serialization.Model): - """The service metric specifications. +class Sku(msrest.serialization.Model): + """The SKU details. Variables are only populated by the server, and will be ignored when sending a request. - :ivar log_specifications: List of log specifications. - :vartype log_specifications: list[~video_analyzer.models.LogSpecification] - :ivar metric_specifications: List of metric specifications. - :vartype metric_specifications: list[~video_analyzer.models.MetricSpecification] + All required parameters must be populated in order to send to Azure. + + :param name: Required. The SKU name. Possible values include: "Live_S1", "Batch_S1". + :type name: str or ~video_analyzer.models.SkuName + :ivar tier: The SKU tier. Possible values include: "Standard". + :vartype tier: str or ~video_analyzer.models.Tier """ _validation = { - 'log_specifications': {'readonly': True}, - 'metric_specifications': {'readonly': True}, + 'name': {'required': True}, + 'tier': {'readonly': True}, } _attribute_map = { - 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, - 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, } def __init__( self, + *, + name: Union[str, "SkuName"], **kwargs ): - super(ServiceSpecification, self).__init__(**kwargs) - self.log_specifications = None - self.metric_specifications = None + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None class StorageAccount(msrest.serialization.Model): @@ -1140,8 +2630,10 @@ class StorageAccount(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. - :param id: The ID of the storage account resource. Video Analyzer relies on tables, queues, and - blobs. The primary storage account must be a Standard Storage account (either + All required parameters must be populated in order to send to Azure. + + :param id: Required. The ID of the storage account resource. Video Analyzer relies on tables, + queues, and blobs. The primary storage account must be a Standard Storage account (either Microsoft.ClassicStorage or Microsoft.Storage). :type id: str :param identity: A managed identity that Video Analyzer will use to access the storage account. @@ -1151,6 +2643,7 @@ class StorageAccount(msrest.serialization.Model): """ _validation = { + 'id': {'required': True}, 'status': {'readonly': True}, } @@ -1163,7 +2656,7 @@ class StorageAccount(msrest.serialization.Model): def __init__( self, *, - id: Optional[str] = None, + id: str, identity: Optional["ResourceIdentity"] = None, **kwargs ): @@ -1173,27 +2666,6 @@ def __init__( self.status = None -class SyncStorageKeysInput(msrest.serialization.Model): - """The input to the sync storage keys request. - - :param id: The ID of the storage account resource. - :type id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - super(SyncStorageKeysInput, self).__init__(**kwargs) - self.id = id - - class SystemData(msrest.serialization.Model): """Metadata pertaining to creation and last modification of the resource. @@ -1242,6 +2714,118 @@ def __init__( self.last_modified_at = last_modified_at +class TimeSequenceBase(msrest.serialization.Model): + """Sequence of time. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoSequenceAbsoluteTimeMarkers. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers': 'VideoSequenceAbsoluteTimeMarkers'} + } + + def __init__( + self, + **kwargs + ): + super(TimeSequenceBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class TlsEndpoint(EndpointBase): + """TLS endpoint describes an endpoint that the pipeline can connect to over TLS transport (data is encrypted in transit). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase + :param trusted_certificates: List of trusted certificate authorities when authenticating a TLS + connection. A null list designates that Azure Video Analyzer's list of trusted authorities + should be used. + :type trusted_certificates: ~video_analyzer.models.CertificateSource + :param validation_options: Validation options to use when authenticating a TLS connection. By + default, strict validation is used. + :type validation_options: ~video_analyzer.models.TlsValidationOptions + """ + + _validation = { + 'type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + 'trusted_certificates': {'key': 'trustedCertificates', 'type': 'CertificateSource'}, + 'validation_options': {'key': 'validationOptions', 'type': 'TlsValidationOptions'}, + } + + def __init__( + self, + *, + url: str, + credentials: Optional["CredentialsBase"] = None, + tunnel: Optional["TunnelBase"] = None, + trusted_certificates: Optional["CertificateSource"] = None, + validation_options: Optional["TlsValidationOptions"] = None, + **kwargs + ): + super(TlsEndpoint, self).__init__(credentials=credentials, url=url, tunnel=tunnel, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.TlsEndpoint' # type: str + self.trusted_certificates = trusted_certificates + self.validation_options = validation_options + + +class TlsValidationOptions(msrest.serialization.Model): + """Options for controlling the validation of TLS endpoints. + + :param ignore_hostname: When set to 'true' causes the certificate subject name validation to be + skipped. Default is 'false'. + :type ignore_hostname: str + :param ignore_signature: When set to 'true' causes the certificate chain trust validation to be + skipped. Default is 'false'. + :type ignore_signature: str + """ + + _attribute_map = { + 'ignore_hostname': {'key': 'ignoreHostname', 'type': 'str'}, + 'ignore_signature': {'key': 'ignoreSignature', 'type': 'str'}, + } + + def __init__( + self, + *, + ignore_hostname: Optional[str] = None, + ignore_signature: Optional[str] = None, + **kwargs + ): + super(TlsValidationOptions, self).__init__(**kwargs) + self.ignore_hostname = ignore_hostname + self.ignore_signature = ignore_signature + + class TokenClaim(msrest.serialization.Model): """Properties for expected token claims. @@ -1323,6 +2907,45 @@ def __init__( self.location = location +class UnsecuredEndpoint(EndpointBase): + """Unsecured endpoint describes an endpoint that the pipeline can connect to over clear transport (no encryption in transit). + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param credentials: Credentials to be presented to the endpoint. + :type credentials: ~video_analyzer.models.CredentialsBase + :param url: Required. The endpoint URL for Video Analyzer to connect to. + :type url: str + :param tunnel: Optional tunnel used to connect to the endpoint. + :type tunnel: ~video_analyzer.models.TunnelBase + """ + + _validation = { + 'type': {'required': True}, + 'url': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'CredentialsBase'}, + 'url': {'key': 'url', 'type': 'str'}, + 'tunnel': {'key': 'tunnel', 'type': 'TunnelBase'}, + } + + def __init__( + self, + *, + url: str, + credentials: Optional["CredentialsBase"] = None, + tunnel: Optional["TunnelBase"] = None, + **kwargs + ): + super(UnsecuredEndpoint, self).__init__(credentials=credentials, url=url, tunnel=tunnel, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.UnsecuredEndpoint' # type: str + + class UserAssignedManagedIdentity(msrest.serialization.Model): """The details of the user assigned managed identity used by the Video Analyzer resource. @@ -1353,8 +2976,48 @@ def __init__( self.principal_id = None +class UsernamePasswordCredentials(CredentialsBase): + """Username and password credentials. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param username: Required. Username to be presented as part of the credentials. + :type username: str + :param password: Required. Password to be presented as part of the credentials. It is + recommended that this value is parameterized as a secret string in order to prevent this value + to be returned as part of the resource on API requests. + :type password: str + """ + + _validation = { + 'type': {'required': True}, + 'username': {'required': True}, + 'password': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'password': {'key': 'password', 'type': 'str'}, + } + + def __init__( + self, + *, + username: str, + password: str, + **kwargs + ): + super(UsernamePasswordCredentials, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.UsernamePasswordCredentials' # type: str + self.username = username + self.password = password + + class VideoAnalyzer(TrackedResource): - """A Video Analyzer account. + """VideoAnalyzer. Variables are only populated by the server, and will be ignored when sending a request. @@ -1374,14 +3037,27 @@ class VideoAnalyzer(TrackedResource): :type location: str :ivar system_data: The system data of the Video Analyzer account. :vartype system_data: ~video_analyzer.models.SystemData - :param identity: The set of managed identities associated with the Video Analyzer resource. + :param identity: The identities associated to the Video Analyzer resource. :type identity: ~video_analyzer.models.VideoAnalyzerIdentity :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { @@ -1391,6 +3067,8 @@ class VideoAnalyzer(TrackedResource): 'location': {'required': True}, 'system_data': {'readonly': True}, 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1404,6 +3082,11 @@ class VideoAnalyzer(TrackedResource): 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'properties.iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'properties.networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1414,6 +3097,9 @@ def __init__( identity: Optional["VideoAnalyzerIdentity"] = None, storage_accounts: Optional[List["StorageAccount"]] = None, encryption: Optional["AccountEncryption"] = None, + iot_hubs: Optional[List["IotHub"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + network_access_control: Optional["NetworkAccessControl"] = None, **kwargs ): super(VideoAnalyzer, self).__init__(tags=tags, location=location, **kwargs) @@ -1422,6 +3108,11 @@ def __init__( self.storage_accounts = storage_accounts self.endpoints = None self.encryption = encryption + self.iot_hubs = iot_hubs + self.public_network_access = public_network_access + self.network_access_control = network_access_control + self.provisioning_state = None + self.private_endpoint_connections = None class VideoAnalyzerCollection(msrest.serialization.Model): @@ -1457,47 +3148,184 @@ class VideoAnalyzerIdentity(msrest.serialization.Model): """ _validation = { - 'type': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + } + + def __init__( + self, + *, + type: str, + user_assigned_identities: Optional[Dict[str, "UserAssignedManagedIdentity"]] = None, + **kwargs + ): + super(VideoAnalyzerIdentity, self).__init__(**kwargs) + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class VideoAnalyzerOperationStatus(msrest.serialization.Model): + """VideoAnalyzerOperationStatus. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. + :type name: str + :param id: + :type id: str + :param start_time: + :type start_time: str + :param end_time: + :type end_time: str + :param status: Required. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'required': True}, + 'status': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + name: str, + status: str, + id: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(VideoAnalyzerOperationStatus, self).__init__(**kwargs) + self.name = name + self.id = id + self.start_time = start_time + self.end_time = end_time + self.status = status + self.error = error + + +class VideoAnalyzerPropertiesBase(msrest.serialization.Model): + """The properties of the Video Analyzer account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~video_analyzer.models.StorageAccount] + :ivar endpoints: The endpoints associated with this resource. + :vartype endpoints: list[~video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] + """ + + _validation = { + 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( self, *, - type: str, - user_assigned_identities: Optional[Dict[str, "UserAssignedManagedIdentity"]] = None, + storage_accounts: Optional[List["StorageAccount"]] = None, + encryption: Optional["AccountEncryption"] = None, + iot_hubs: Optional[List["IotHub"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + network_access_control: Optional["NetworkAccessControl"] = None, **kwargs ): - super(VideoAnalyzerIdentity, self).__init__(**kwargs) - self.type = type - self.user_assigned_identities = user_assigned_identities + super(VideoAnalyzerPropertiesBase, self).__init__(**kwargs) + self.storage_accounts = storage_accounts + self.endpoints = None + self.encryption = encryption + self.iot_hubs = iot_hubs + self.public_network_access = public_network_access + self.network_access_control = network_access_control + self.provisioning_state = None + self.private_endpoint_connections = None -class VideoAnalyzerPropertiesUpdate(msrest.serialization.Model): - """Properties of the Video Analyzer account. +class VideoAnalyzerProperties(VideoAnalyzerPropertiesBase): + """VideoAnalyzerProperties. Variables are only populated by the server, and will be ignored when sending a request. :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1505,35 +3333,55 @@ def __init__( *, storage_accounts: Optional[List["StorageAccount"]] = None, encryption: Optional["AccountEncryption"] = None, + iot_hubs: Optional[List["IotHub"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + network_access_control: Optional["NetworkAccessControl"] = None, **kwargs ): - super(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) - self.storage_accounts = storage_accounts - self.endpoints = None - self.encryption = encryption + super(VideoAnalyzerProperties, self).__init__(storage_accounts=storage_accounts, encryption=encryption, iot_hubs=iot_hubs, public_network_access=public_network_access, network_access_control=network_access_control, **kwargs) -class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): - """VideoAnalyzerProperties. +class VideoAnalyzerPropertiesUpdate(VideoAnalyzerPropertiesBase): + """VideoAnalyzerPropertiesUpdate. Variables are only populated by the server, and will be ignored when sending a request. :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1541,9 +3389,12 @@ def __init__( *, storage_accounts: Optional[List["StorageAccount"]] = None, encryption: Optional["AccountEncryption"] = None, + iot_hubs: Optional[List["IotHub"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + network_access_control: Optional["NetworkAccessControl"] = None, **kwargs ): - super(VideoAnalyzerProperties, self).__init__(storage_accounts=storage_accounts, encryption=encryption, **kwargs) + super(VideoAnalyzerPropertiesUpdate, self).__init__(storage_accounts=storage_accounts, encryption=encryption, iot_hubs=iot_hubs, public_network_access=public_network_access, network_access_control=network_access_control, **kwargs) class VideoAnalyzerUpdate(msrest.serialization.Model): @@ -1557,14 +3408,29 @@ class VideoAnalyzerUpdate(msrest.serialization.Model): :type identity: ~video_analyzer.models.VideoAnalyzerIdentity :param storage_accounts: The storage accounts for this resource. :type storage_accounts: list[~video_analyzer.models.StorageAccount] - :ivar endpoints: The list of endpoints associated with this resource. + :ivar endpoints: The endpoints associated with this resource. :vartype endpoints: list[~video_analyzer.models.Endpoint] :param encryption: The account encryption properties. :type encryption: ~video_analyzer.models.AccountEncryption + :param iot_hubs: The IoT Hubs for this resource. + :type iot_hubs: list[~video_analyzer.models.IotHub] + :param public_network_access: Whether or not public network access is allowed for resources + under the Video Analyzer account. Possible values include: "Enabled", "Disabled". + :type public_network_access: str or ~video_analyzer.models.PublicNetworkAccess + :param network_access_control: Network access control for Video Analyzer. + :type network_access_control: ~video_analyzer.models.NetworkAccessControl + :ivar provisioning_state: Provisioning state of the Video Analyzer account. Possible values + include: "Failed", "InProgress", "Succeeded". + :vartype provisioning_state: str or ~video_analyzer.models.ProvisioningState + :ivar private_endpoint_connections: Private Endpoint Connections created under Video Analyzer + account. + :vartype private_endpoint_connections: list[~video_analyzer.models.PrivateEndpointConnection] """ _validation = { 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -1573,6 +3439,11 @@ class VideoAnalyzerUpdate(msrest.serialization.Model): 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[StorageAccount]'}, 'endpoints': {'key': 'properties.endpoints', 'type': '[Endpoint]'}, 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + 'iot_hubs': {'key': 'properties.iotHubs', 'type': '[IotHub]'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'network_access_control': {'key': 'properties.networkAccessControl', 'type': 'NetworkAccessControl'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, } def __init__( @@ -1582,6 +3453,9 @@ def __init__( identity: Optional["VideoAnalyzerIdentity"] = None, storage_accounts: Optional[List["StorageAccount"]] = None, encryption: Optional["AccountEncryption"] = None, + iot_hubs: Optional[List["IotHub"]] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + network_access_control: Optional["NetworkAccessControl"] = None, **kwargs ): super(VideoAnalyzerUpdate, self).__init__(**kwargs) @@ -1590,10 +3464,264 @@ def __init__( self.storage_accounts = storage_accounts self.endpoints = None self.encryption = encryption + self.iot_hubs = iot_hubs + self.public_network_access = public_network_access + self.network_access_control = network_access_control + self.provisioning_state = None + self.private_endpoint_connections = None + + +class VideoArchival(msrest.serialization.Model): + """Video archival properties. + + :param retention_period: Video retention period indicates the maximum age of the video archive + segments which are intended to be kept in storage. It must be provided in the ISO8601 duration + format in the granularity of days, up to a maximum of 10 years. For example, if this is set to + P30D (30 days), content older than 30 days will be periodically deleted. This value can be + updated at any time and the new desired retention period will be effective within 24 hours. + :type retention_period: str + """ + + _attribute_map = { + 'retention_period': {'key': 'retentionPeriod', 'type': 'str'}, + } + + def __init__( + self, + *, + retention_period: Optional[str] = None, + **kwargs + ): + super(VideoArchival, self).__init__(**kwargs) + self.retention_period = retention_period + + +class VideoContentToken(msrest.serialization.Model): + """"Video content token grants access to the video content URLs.". + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar expiration_date: The content token expiration date in ISO8601 format (eg. + 2021-01-01T00:00:00Z). + :vartype expiration_date: ~datetime.datetime + :ivar token: The content token value to be added to the video content URL as the value for the + "token" query string parameter. The token is specific to a single video. + :vartype token: str + """ + + _validation = { + 'expiration_date': {'readonly': True}, + 'token': {'readonly': True}, + } + + _attribute_map = { + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoContentToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None + + +class VideoContentUrls(msrest.serialization.Model): + """Set of URLs to the video content. + + :param download_url: Video file download URL. This URL can be used in conjunction with the + video content authorization token to download the video MP4 file. The resulting MP4 file can be + played on any standard media player. It is available when the video type is 'file' and video + file is available for consumption. + :type download_url: str + :param archive_base_url: Video archive streaming base URL. The archived content can be + automatically played by the Azure Video Analyzer player widget. Alternatively, this URL can be + used in conjunction with the video content authorization token on any compatible DASH or HLS + players by appending the following to the base URL: + + .. code-block:: + + - HLSv4: /manifest(format=m3u8-aapl).m3u8 + - HLS CMAF: /manifest(format=m3u8-cmaf) + - DASH CMAF: /manifest(format=mpd-time-cmaf) + + Moreover, an ongoing video recording can be played in "live mode" with latencies which are + approximately double of the chosen video segment length. It is available when the video type is + 'archive' and video archiving is enabled. + :type archive_base_url: str + :param rtsp_tunnel_url: Video low-latency streaming URL. The live content can be automatically + played by the Azure Video Analyzer player widget. Alternatively, this URL can be used in + conjunction with the video content authorization token to expose a WebSocket tunneled RTSP + stream. It is available when the video type is 'archive' and a live, low-latency feed is + available from the source. + :type rtsp_tunnel_url: str + :param preview_image_urls: Video preview image URLs. These URLs can be used in conjunction with + the video content authorization token to download the most recent still image from the video + archive in different resolutions. They are available when the video type is 'archive' and + preview images are enabled. + :type preview_image_urls: ~video_analyzer.models.VideoPreviewImageUrls + """ + + _attribute_map = { + 'download_url': {'key': 'downloadUrl', 'type': 'str'}, + 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + 'rtsp_tunnel_url': {'key': 'rtspTunnelUrl', 'type': 'str'}, + 'preview_image_urls': {'key': 'previewImageUrls', 'type': 'VideoPreviewImageUrls'}, + } + + def __init__( + self, + *, + download_url: Optional[str] = None, + archive_base_url: Optional[str] = None, + rtsp_tunnel_url: Optional[str] = None, + preview_image_urls: Optional["VideoPreviewImageUrls"] = None, + **kwargs + ): + super(VideoContentUrls, self).__init__(**kwargs) + self.download_url = download_url + self.archive_base_url = archive_base_url + self.rtsp_tunnel_url = rtsp_tunnel_url + self.preview_image_urls = preview_image_urls + + +class VideoCreationProperties(msrest.serialization.Model): + """Optional video properties to be used in case a new video resource needs to be created on the service. These will not take effect if the video already exists. + + :param title: Optional video title provided by the user. Value can be up to 256 characters + long. + :type title: str + :param description: Optional video description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :param segment_length: Video segment length indicates the length of individual video files + (segments) which are persisted to storage. Smaller segments provide lower archive playback + latency but generate larger volume of storage transactions. Larger segments reduce the amount + of storage transactions while increasing the archive playback latency. Value must be specified + in ISO8601 duration format (i.e. \"PT30S\" equals 30 seconds) and can vary between 30 seconds + to 5 minutes, in 30 seconds increments. Changing this value after the video is initially + created can lead to errors when uploading media to the archive. Default value is 30 seconds. + :type segment_length: str + :param retention_period: Video retention period indicates how long the video is kept in + storage. Value must be specified in ISO8601 duration format (i.e. \"PT1D\" equals 1 day) and + can vary between 1 day to 5 years, in 1 day increments. When absent (null), all video content + is retained indefinitely. + :type retention_period: str + """ + + _attribute_map = { + 'title': {'key': 'title', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'segment_length': {'key': 'segmentLength', 'type': 'str'}, + 'retention_period': {'key': 'retentionPeriod', 'type': 'str'}, + } + + def __init__( + self, + *, + title: Optional[str] = None, + description: Optional[str] = None, + segment_length: Optional[str] = None, + retention_period: Optional[str] = None, + **kwargs + ): + super(VideoCreationProperties, self).__init__(**kwargs) + self.title = title + self.description = description + self.segment_length = segment_length + self.retention_period = retention_period + + +class VideoEncoderBase(msrest.serialization.Model): + """The video encoder base. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VideoEncoderH264. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The video encoding bitrate. + :type bitrate_kbps: str + :param frame_rate: Video encoder frame rate. + :type frame_rate: str + :param scale: Defines the video scale. + :type scale: ~video_analyzer.models.VideoScale + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + 'frame_rate': {'key': 'frameRate', 'type': 'str'}, + 'scale': {'key': 'scale', 'type': 'VideoScale'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoEncoderH264': 'VideoEncoderH264'} + } + + def __init__( + self, + *, + bitrate_kbps: Optional[str] = None, + frame_rate: Optional[str] = None, + scale: Optional["VideoScale"] = None, + **kwargs + ): + super(VideoEncoderBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.bitrate_kbps = bitrate_kbps + self.frame_rate = frame_rate + self.scale = scale + + +class VideoEncoderH264(VideoEncoderBase): + """The video H264 codec encoder. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The video encoding bitrate. + :type bitrate_kbps: str + :param frame_rate: Video encoder frame rate. + :type frame_rate: str + :param scale: Defines the video scale. + :type scale: ~video_analyzer.models.VideoScale + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'bitrate_kbps': {'key': 'bitrateKbps', 'type': 'str'}, + 'frame_rate': {'key': 'frameRate', 'type': 'str'}, + 'scale': {'key': 'scale', 'type': 'VideoScale'}, + } + + def __init__( + self, + *, + bitrate_kbps: Optional[str] = None, + frame_rate: Optional[str] = None, + scale: Optional["VideoScale"] = None, + **kwargs + ): + super(VideoEncoderH264, self).__init__(bitrate_kbps=bitrate_kbps, frame_rate=frame_rate, scale=scale, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoEncoderH264' # type: str class VideoEntity(ProxyResource): - """The representation of a single video in a Video Analyzer account. + """VideoEntity. Variables are only populated by the server, and will be ignored when sending a request. @@ -1613,16 +3741,18 @@ class VideoEntity(ProxyResource): :param description: Optional video description provided by the user. Value can be up to 2048 characters long. :type description: str - :ivar type_properties_type: Type of the video archive. Different archive formats provide - different capabilities. Possible values include: "Archive". - :vartype type_properties_type: str or ~video_analyzer.models.VideoType + :param type_properties_type: Video content type. Different content types are suitable for + different applications and scenarios. Possible values include: "Archive", "File". + :type type_properties_type: str or ~video_analyzer.models.VideoType :ivar flags: Video flags contain information about the available video actions and its dynamic properties based on the current video state. :vartype flags: ~video_analyzer.models.VideoFlags - :ivar streaming: Video streaming holds information about video streaming URLs. - :vartype streaming: ~video_analyzer.models.VideoStreaming + :ivar content_urls: Set of URLs to the video content. + :vartype content_urls: ~video_analyzer.models.VideoContentUrls :ivar media_info: Contains information about the video and audio content. :vartype media_info: ~video_analyzer.models.VideoMediaInfo + :param archival: Video archival properties. + :type archival: ~video_analyzer.models.VideoArchival """ _validation = { @@ -1630,9 +3760,8 @@ class VideoEntity(ProxyResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'system_data': {'readonly': True}, - 'type_properties_type': {'readonly': True}, 'flags': {'readonly': True}, - 'streaming': {'readonly': True}, + 'content_urls': {'readonly': True}, 'media_info': {'readonly': True}, } @@ -1645,8 +3774,9 @@ class VideoEntity(ProxyResource): 'description': {'key': 'properties.description', 'type': 'str'}, 'type_properties_type': {'key': 'properties.type', 'type': 'str'}, 'flags': {'key': 'properties.flags', 'type': 'VideoFlags'}, - 'streaming': {'key': 'properties.streaming', 'type': 'VideoStreaming'}, + 'content_urls': {'key': 'properties.contentUrls', 'type': 'VideoContentUrls'}, 'media_info': {'key': 'properties.mediaInfo', 'type': 'VideoMediaInfo'}, + 'archival': {'key': 'properties.archival', 'type': 'VideoArchival'}, } def __init__( @@ -1654,16 +3784,19 @@ def __init__( *, title: Optional[str] = None, description: Optional[str] = None, + type_properties_type: Optional[Union[str, "VideoType"]] = None, + archival: Optional["VideoArchival"] = None, **kwargs ): super(VideoEntity, self).__init__(**kwargs) self.system_data = None self.title = title self.description = description - self.type_properties_type = None + self.type_properties_type = type_properties_type self.flags = None - self.streaming = None + self.content_urls = None self.media_info = None + self.archival = archival class VideoEntityCollection(msrest.serialization.Model): @@ -1704,23 +3837,23 @@ class VideoFlags(msrest.serialization.Model): :param has_data: Required. Value indicating whether or not there has ever been data recorded or uploaded into the video. Newly created videos have this value set to false. :type has_data: bool - :param is_recording: Required. Value indicating whether or not the video is currently being - referenced be an active live pipeline. The fact that is being referenced, doesn't necessarily + :param is_in_use: Required. Value indicating whether or not the video is currently being + referenced be an active pipeline. The fact that is being referenced, doesn't necessarily indicate that data is being received. For example, video recording may be gated on events or camera may not be accessible at the time. - :type is_recording: bool + :type is_in_use: bool """ _validation = { 'can_stream': {'required': True}, 'has_data': {'required': True}, - 'is_recording': {'required': True}, + 'is_in_use': {'required': True}, } _attribute_map = { 'can_stream': {'key': 'canStream', 'type': 'bool'}, 'has_data': {'key': 'hasData', 'type': 'bool'}, - 'is_recording': {'key': 'isRecording', 'type': 'bool'}, + 'is_in_use': {'key': 'isInUse', 'type': 'bool'}, } def __init__( @@ -1728,13 +3861,13 @@ def __init__( *, can_stream: bool, has_data: bool, - is_recording: bool, + is_in_use: bool, **kwargs ): super(VideoFlags, self).__init__(**kwargs) self.can_stream = can_stream self.has_data = has_data - self.is_recording = is_recording + self.is_in_use = is_in_use class VideoMediaInfo(msrest.serialization.Model): @@ -1767,64 +3900,231 @@ def __init__( self.segment_length = None -class VideoStreaming(msrest.serialization.Model): - """Video streaming holds information about video streaming URLs. +class VideoPreviewImageUrls(msrest.serialization.Model): + """Video preview image URLs. These URLs can be used in conjunction with the video content authorization token to download the most recent still image from the video archive in different resolutions. They are available when the video type is 'archive' and preview images are enabled. - :param archive_base_url: Video streaming base URL for the video archive. When present, archived - video can be played through the Azure Video Analyzer player. Alternatively, this URL can be - used with compatible DASH or HLS players by appending the following to the base URL: - - - * HLSv4: /manifest(format=m3u8-aapl).m3u8 - * HLS CMAF: /manifest(format=m3u8-cmaf) - * DASH CMAF: /manifest(format=mpd-time-cmaf) - - Moreover, an ongoing video recording can be played in "live mode" with latencies which are - approximately double of the chosen video segment length. - :type archive_base_url: str + :param small: Low resolution preview image URL. + :type small: str + :param medium: Medium resolution preview image URL. + :type medium: str + :param large: High resolution preview image URL. + :type large: str """ _attribute_map = { - 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + 'small': {'key': 'small', 'type': 'str'}, + 'medium': {'key': 'medium', 'type': 'str'}, + 'large': {'key': 'large', 'type': 'str'}, } def __init__( self, *, - archive_base_url: Optional[str] = None, + small: Optional[str] = None, + medium: Optional[str] = None, + large: Optional[str] = None, **kwargs ): - super(VideoStreaming, self).__init__(**kwargs) - self.archive_base_url = archive_base_url + super(VideoPreviewImageUrls, self).__init__(**kwargs) + self.small = small + self.medium = medium + self.large = large + + +class VideoPublishingOptions(msrest.serialization.Model): + """Options for changing video publishing behavior on the video sink and output video. + + :param disable_archive: When set to 'true' the video will not archive media content. Default is + 'false'. + :type disable_archive: str + :param disable_rtsp_publishing: When set to 'true' the video will not publish RTSP playback. + Default is 'false'. + :type disable_rtsp_publishing: str + :param disable_video_preview_image: When set to 'true' the video will not publish preview + images. Default is 'false'. + :type disable_video_preview_image: str + """ + + _attribute_map = { + 'disable_archive': {'key': 'disableArchive', 'type': 'str'}, + 'disable_rtsp_publishing': {'key': 'disableRtspPublishing', 'type': 'str'}, + 'disable_video_preview_image': {'key': 'disableVideoPreviewImage', 'type': 'str'}, + } + + def __init__( + self, + *, + disable_archive: Optional[str] = None, + disable_rtsp_publishing: Optional[str] = None, + disable_video_preview_image: Optional[str] = None, + **kwargs + ): + super(VideoPublishingOptions, self).__init__(**kwargs) + self.disable_archive = disable_archive + self.disable_rtsp_publishing = disable_rtsp_publishing + self.disable_video_preview_image = disable_video_preview_image + + +class VideoScale(msrest.serialization.Model): + """The video scaling information. + + :param height: The desired output video height. + :type height: str + :param width: The desired output video width. + :type width: str + :param mode: Describes the video scaling mode to be applied. Default mode is 'pad'. Possible + values include: "Pad", "PreserveAspectRatio", "Stretch". + :type mode: str or ~video_analyzer.models.VideoScaleMode + """ + + _attribute_map = { + 'height': {'key': 'height', 'type': 'str'}, + 'width': {'key': 'width', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + def __init__( + self, + *, + height: Optional[str] = None, + width: Optional[str] = None, + mode: Optional[Union[str, "VideoScaleMode"]] = None, + **kwargs + ): + super(VideoScale, self).__init__(**kwargs) + self.height = height + self.width = width + self.mode = mode -class VideoStreamingToken(msrest.serialization.Model): - """Video streaming token grants access to the video streaming URLs which can be used by an compatible HLS or DASH player. - Variables are only populated by the server, and will be ignored when sending a request. +class VideoSequenceAbsoluteTimeMarkers(TimeSequenceBase): + """Absolute datetime sequence as a string. The datetime format supported is as per ISO8601. - :ivar expiration_date: The streaming token expiration date in ISO8601 format (eg. - 2021-01-01T00:00:00Z). - :vartype expiration_date: ~datetime.datetime - :ivar token: The streaming token value to be added to the video streaming URL as the value for - a "token" query string parameter. The token is specific to a single video. - :vartype token: str + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param ranges: Required. The datetime sequence ranges. Example: '[["2020-10-05T03:30:00Z", + "2020-10-05T03:40:00Z"],["2020-10-05T07:30:00Z", "2020-10-05T08:30:00Z"]]'. Each range + indicates the start and end date time marker. + :type ranges: str """ _validation = { - 'expiration_date': {'readonly': True}, - 'token': {'readonly': True}, + 'type': {'required': True}, + 'ranges': {'required': True}, } _attribute_map = { - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, - 'token': {'key': 'token', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + 'ranges': {'key': 'ranges', 'type': 'str'}, } def __init__( self, + *, + ranges: str, **kwargs ): - super(VideoStreamingToken, self).__init__(**kwargs) - self.expiration_date = None - self.token = None + super(VideoSequenceAbsoluteTimeMarkers, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSequenceAbsoluteTimeMarkers' # type: str + self.ranges = ranges + + +class VideoSink(SinkNodeBase): + """Video sink allows for video and audio to be recorded to the Video Analyzer service. The recorded video can be played from anywhere and further managed from the cloud. Due to security reasons, a given Video Analyzer edge module instance can only record content to new video entries, or existing video entries previously recorded by the same module. Any attempt to record content to an existing video which has not been created by the same module instance will result in failure to record. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param inputs: Required. An array of upstream node references within the topology to be used as + inputs for this node. + :type inputs: list[~video_analyzer.models.NodeInput] + :param video_name: Required. Name of a new or existing Video Analyzer video resource used for + the media recording. + :type video_name: str + :param video_creation_properties: Optional video properties to be used in case a new video + resource needs to be created on the service. + :type video_creation_properties: ~video_analyzer.models.VideoCreationProperties + :param video_publishing_options: Optional video publishing options to be used for changing + publishing behavior of the output video. + :type video_publishing_options: ~video_analyzer.models.VideoPublishingOptions + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'inputs': {'required': True}, + 'video_name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + 'video_name': {'key': 'videoName', 'type': 'str'}, + 'video_creation_properties': {'key': 'videoCreationProperties', 'type': 'VideoCreationProperties'}, + 'video_publishing_options': {'key': 'videoPublishingOptions', 'type': 'VideoPublishingOptions'}, + } + + def __init__( + self, + *, + name: str, + inputs: List["NodeInput"], + video_name: str, + video_creation_properties: Optional["VideoCreationProperties"] = None, + video_publishing_options: Optional["VideoPublishingOptions"] = None, + **kwargs + ): + super(VideoSink, self).__init__(name=name, inputs=inputs, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSink' # type: str + self.video_name = video_name + self.video_creation_properties = video_creation_properties + self.video_publishing_options = video_publishing_options + + +class VideoSource(SourceNodeBase): + """Enables a pipeline to use video as a source. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param name: Required. Node name. Must be unique within the topology. + :type name: str + :param video_name: Required. Video name. + :type video_name: str + :param time_sequences: Required. Video time sequences selected for the video. + :type time_sequences: ~video_analyzer.models.TimeSequenceBase + """ + + _validation = { + 'type': {'required': True}, + 'name': {'required': True}, + 'video_name': {'required': True}, + 'time_sequences': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'video_name': {'key': 'videoName', 'type': 'str'}, + 'time_sequences': {'key': 'timeSequences', 'type': 'TimeSequenceBase'}, + } + + def __init__( + self, + *, + name: str, + video_name: str, + time_sequences: "TimeSequenceBase", + **kwargs + ): + super(VideoSource, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.VideoSource' # type: str + self.video_name = video_name + self.time_sequences = time_sequences diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_video_analyzer_enums.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_video_analyzer_enums.py index 09fc0523fd7ac..5d3df7833e98a 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_video_analyzer_enums.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/models/_video_analyzer_enums.py @@ -87,6 +87,44 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +class EncoderSystemPresetType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The system preset value. + """ + + #: SingleLayer 540p H264 video codec and AAC audio codec encoder system preset. + SINGLE_LAYER540_P_H264_AAC = "SingleLayer_540p_H264_AAC" + #: SingleLayer 720p H264 video codec and AAC audio codec encoder system preset. + SINGLE_LAYER720_P_H264_AAC = "SingleLayer_720p_H264_AAC" + #: SingleLayer 1080p H264 video codec and AAC audio codec encoder system preset. + SINGLE_LAYER1080_P_H264_AAC = "SingleLayer_1080p_H264_AAC" + #: SingleLayer 2160p H264 video codec and AAC audio codec encoder system preset. + SINGLE_LAYER2160_P_H264_AAC = "SingleLayer_2160p_H264_AAC" + +class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Topology kind. + """ + + #: Live pipeline topology resource. + LIVE = "Live" + #: Batch pipeline topology resource. + BATCH = "Batch" + +class LivePipelineState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current pipeline state (read-only). + """ + + #: The live pipeline is idle and not processing media. + INACTIVE = "Inactive" + #: The live pipeline is transitioning into the active state. + ACTIVATING = "Activating" + #: The live pipeline is active and able to process media. If your data source is not available, + #: for instance, if your RTSP camera is powered off or unreachable, the pipeline will still be + #: active and periodically retrying the connection. Your Azure subscription will be billed for the + #: duration in which the live pipeline is in the active state. + ACTIVE = "Active" + #: The live pipeline is transitioning into the inactive state. + DEACTIVATING = "Deactivating" + class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The metric aggregation type """ @@ -109,6 +147,101 @@ class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): #: The number of milliseconds. MILLISECONDS = "Milliseconds" +class ParameterType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the parameter. + """ + + #: The parameter's value is a string. + STRING = "String" + #: The parameter's value is a string that holds sensitive information. + SECRET_STRING = "SecretString" + #: The parameter's value is a 32-bit signed integer. + INT = "Int" + #: The parameter's value is a 64-bit double-precision floating point. + DOUBLE = "Double" + #: The parameter's value is a boolean value that is either true or false. + BOOL = "Bool" + +class PipelineJobState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Current pipeline state (read-only). + """ + + #: Pipeline job is processing. + PROCESSING = "Processing" + #: Pipeline job is canceled. + CANCELED = "Canceled" + #: Pipeline job completed. + COMPLETED = "Completed" + #: Pipeline job failed. + FAILED = "Failed" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + +class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of the Video Analyzer account. + """ + + #: Provisioning state failed. + FAILED = "Failed" + #: Provisioning state in progress. + IN_PROGRESS = "InProgress" + #: Provisioning state succeeded. + SUCCEEDED = "Succeeded" + +class PublicNetworkAccess(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Whether or not public network access is allowed for resources under the Video Analyzer account. + """ + + #: Public network access is enabled. + ENABLED = "Enabled" + #: Public network access is disabled. + DISABLED = "Disabled" + +class RtspTransport(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Network transport utilized by the RTSP and RTP exchange: TCP or HTTP. When using TCP, the RTP + packets are interleaved on the TCP RTSP connection. When using HTTP, the RTSP messages are + exchanged through long lived HTTP connections, and the RTP packages are interleaved in the HTTP + connections alongside the RTSP messages. + """ + + #: HTTP transport. RTSP messages are exchanged over long running HTTP requests and RTP packets are + #: interleaved within the HTTP channel. + HTTP = "Http" + #: TCP transport. RTSP is used directly over TCP and RTP packets are interleaved within the TCP + #: channel. + TCP = "Tcp" + +class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU name. + """ + + #: Live S1 sku name. + LIVE_S1 = "Live_S1" + #: Batch S1 sku name. + BATCH_S1 = "Batch_S1" + +class Tier(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The SKU tier. + """ + + #: Standard tier. + STANDARD = "Standard" + class VideoAnalyzerEndpointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of the endpoint. """ @@ -116,15 +249,35 @@ class VideoAnalyzerEndpointType(with_metaclass(_CaseInsensitiveEnumMeta, str, En #: The client API endpoint. CLIENT_API = "ClientApi" +class VideoScaleMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes the video scaling mode to be applied. Default mode is 'pad'. + """ + + #: Pads the video with black horizontal stripes (letterbox) or black vertical stripes (pillar-box) + #: so the video is resized to the specified dimensions while not altering the content aspect + #: ratio. + PAD = "Pad" + #: Preserves the same aspect ratio as the input video. If only one video dimension is provided, + #: the second dimension is calculated based on the input video aspect ratio. When 2 dimensions are + #: provided, the video is resized to fit the most constraining dimension, considering the input + #: video size and aspect ratio. + PRESERVE_ASPECT_RATIO = "PreserveAspectRatio" + #: Stretches the original video so it resized to the specified dimensions. + STRETCH = "Stretch" + class VideoType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """Type of the video archive. Different archive formats provide different capabilities. + """Video content type. Different content types are suitable for different applications and + scenarios. """ #: Archive is flexible format that represents a video stream associated with wall-clock time. The #: video archive can either be continuous or discontinuous. An archive is discontinuous when there #: are gaps in the recording due to various reasons, such as the live pipeline being stopped, #: camera being disconnected or due to the use of event based recordings through the use of a - #: signal gate. Finally, there is no limit to the archive duration and new video data can be - #: appended to the existing archive at any time, as long as the same video codec and codec - #: parameters are being used. + #: signal gate. There is no limit to the archive duration and new video data can be appended to + #: the existing archive at any time, as long as the same video codec and codec parameters are + #: being used. Videos of this type are suitable for appending and long term archival. ARCHIVE = "Archive" + #: File represents a video which is stored as a single media file, such as MP4. Videos of this + #: type are suitable to be downloaded for external consumption. + FILE = "File" diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/__init__.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/__init__.py index 1ee2a23110a08..eed3976cadd80 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/__init__.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/__init__.py @@ -6,18 +6,36 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._edge_modules_operations import EdgeModulesOperations +from ._pipeline_topologies_operations import PipelineTopologiesOperations +from ._live_pipelines_operations import LivePipelinesOperations +from ._pipeline_jobs_operations import PipelineJobsOperations +from ._live_pipeline_operation_statuses_operations import LivePipelineOperationStatusesOperations +from ._pipeline_job_operation_statuses_operations import PipelineJobOperationStatusesOperations from ._operations import Operations from ._video_analyzers_operations import VideoAnalyzersOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._video_analyzer_operation_statuses_operations import VideoAnalyzerOperationStatusesOperations +from ._video_analyzer_operation_results_operations import VideoAnalyzerOperationResultsOperations from ._locations_operations import LocationsOperations -from ._edge_modules_operations import EdgeModulesOperations from ._videos_operations import VideosOperations from ._access_policies_operations import AccessPoliciesOperations __all__ = [ + 'EdgeModulesOperations', + 'PipelineTopologiesOperations', + 'LivePipelinesOperations', + 'PipelineJobsOperations', + 'LivePipelineOperationStatusesOperations', + 'PipelineJobOperationStatusesOperations', 'Operations', 'VideoAnalyzersOperations', + 'PrivateLinkResourcesOperations', + 'PrivateEndpointConnectionsOperations', + 'VideoAnalyzerOperationStatusesOperations', + 'VideoAnalyzerOperationResultsOperations', 'LocationsOperations', - 'EdgeModulesOperations', 'VideosOperations', 'AccessPoliciesOperations', ] diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_access_policies_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_access_policies_operations.py index eeeb1c2ee1af8..de7a1ed25349b 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_access_policies_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_access_policies_operations.py @@ -53,9 +53,9 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.AccessPolicyEntityCollection"] - """List access policy resources. + """List all existing access policy resources. - List all existing access policy resources for the specified account. + List all existing access policy resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -75,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -88,7 +88,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -138,15 +138,15 @@ def get( **kwargs # type: Any ): # type: (...) -> "_models.AccessPolicyEntity" - """Retrieves an access policy resource. + """Retrieves an existing access policy resource. - Retrieves an existing access policy resource from an account by name. + Retrieves an existing access policy resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to retrieve. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessPolicyEntity, or the result of cls(response) @@ -158,14 +158,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -205,7 +205,7 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> "_models.AccessPolicyEntity" - """Creates or updates an access policy. + """Creates a new access policy resource or updates an existing one. Creates a new access policy resource or updates an existing one. @@ -213,7 +213,7 @@ def create_or_update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to create or update. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.AccessPolicyEntity @@ -227,7 +227,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +235,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -282,7 +282,7 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Deletes an access policy. + """Deletes an existing access policy resource. Deletes an existing access policy resource. @@ -290,7 +290,7 @@ def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to delete. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -302,14 +302,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } @@ -346,7 +346,7 @@ def update( **kwargs # type: Any ): # type: (...) -> "_models.AccessPolicyEntity" - """Updates an existing access policy. + """Updates individual properties of an existing access policy resource. Updates individual properties of an existing access policy resource. @@ -354,7 +354,7 @@ def update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param access_policy_name: The name of the access policy to update. + :param access_policy_name: The Access Policy name. :type access_policy_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.AccessPolicyEntity @@ -368,7 +368,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -376,7 +376,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_name, 'str'), } diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_edge_modules_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_edge_modules_operations.py index 82fef48d30700..e99c513bdcc27 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_edge_modules_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_edge_modules_operations.py @@ -49,28 +49,22 @@ def list( self, resource_group_name, # type: str account_name, # type: str - filter=None, # type: Optional[str] top=None, # type: Optional[int] - orderby=None, # type: Optional[str] **kwargs # type: Any ): # type: (...) -> Iterable["_models.EdgeModuleEntityCollection"] - """List edge module resources. + """List all existing edge module resources. - List all of the existing edge module resources for a given Video Analyzer account. + List all existing edge module resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param filter: Restricts the set of items returned. - :type filter: str :param top: Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. :type top: int - :param orderby: Specifies the key by which the result collection should be ordered. - :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EdgeModuleEntityCollection or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~video_analyzer.models.EdgeModuleEntityCollection] @@ -81,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -94,19 +88,15 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if filter is not None: - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query("top", top, 'int') - if orderby is not None: - query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') request = self._client.get(url, query_parameters, header_parameters) else: @@ -150,13 +140,13 @@ def get( # type: (...) -> "_models.EdgeModuleEntity" """Retrieves an existing edge module resource. - Retrieves a specific existing edge module resource in the given Video Analyzer account. + Retrieves an existing edge module resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to retrieve. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EdgeModuleEntity, or the result of cls(response) @@ -168,14 +158,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -229,7 +219,7 @@ def create_or_update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to create or update. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.EdgeModuleEntity @@ -243,7 +233,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -251,7 +241,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -308,7 +298,7 @@ def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module to be deleted. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -320,14 +310,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } @@ -378,7 +368,7 @@ def list_provisioning_token( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param edge_module_name: The name of the edge module used to create a new provisioning token. + :param edge_module_name: The Edge Module name. :type edge_module_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.ListProvisioningTokenInput @@ -392,7 +382,7 @@ def list_provisioning_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -400,7 +390,7 @@ def list_provisioning_token( url = self.list_provisioning_token.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_name, 'str'), } diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipeline_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipeline_operation_statuses_operations.py new file mode 100644 index 0000000000000..858c2ed4cecc7 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipeline_operation_statuses_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LivePipelineOperationStatusesOperations(object): + """LivePipelineOperationStatusesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.LivePipelineOperationStatus" + """Get the operation status. + + Get the operation status of a live pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param operation_id: The operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipelineOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipelineOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipelineOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('LivePipelineOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/operationStatuses/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipelines_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipelines_operations.py new file mode 100644 index 0000000000000..ff79eaeb52fa5 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipelines_operations.py @@ -0,0 +1,660 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class LivePipelinesOperations(object): + """LivePipelinesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LivePipelineCollection"] + """Retrieves a list of live pipeline. + + Retrieves a list of live pipeline that have been created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LivePipelineCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~video_analyzer.models.LivePipelineCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipelineCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('LivePipelineCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.LivePipeline" + """Gets a Live Pipeline by name. + + Retrieves a Live Pipeline by name. If a live pipeline with that name has been previously + created, the call will return the JSON representation of that instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + parameters, # type: "_models.LivePipeline" + **kwargs # type: Any + ): + # type: (...) -> "_models.LivePipeline" + """Creates or updates a live pipeline. + + Creates a new live pipeline or updates an existing one, with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.LivePipeline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LivePipeline') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a live pipeline. + + Deletes a live pipeline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + parameters, # type: "_models.LivePipeline" + **kwargs # type: Any + ): + # type: (...) -> "_models.LivePipeline" + """Update live pipeline entity. + + Updates the live pipeline entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.LivePipeline + :keyword callable cls: A custom type or function that will be passed the direct response + :return: LivePipeline, or the result of cls(response) + :rtype: ~video_analyzer.models.LivePipeline + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LivePipeline"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LivePipeline') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('LivePipeline', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}'} # type: ignore + + def _activate_initial( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._activate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _activate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/activate'} # type: ignore + + def begin_activate( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Activates a live pipeline. + + Activates a live pipeline with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_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: 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) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._activate_initial( + resource_group_name=resource_group_name, + account_name=account_name, + live_pipeline_name=live_pipeline_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_activate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/activate'} # type: ignore + + def _deactivate_initial( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._deactivate_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _deactivate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/deactivate'} # type: ignore + + def begin_deactivate( + self, + resource_group_name, # type: str + account_name, # type: str + live_pipeline_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deactivates a live pipeline. + + Deactivates a live pipeline with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param live_pipeline_name: Live pipeline unique identifier. + :type live_pipeline_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: 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) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._deactivate_initial( + resource_group_name=resource_group_name, + account_name=account_name, + live_pipeline_name=live_pipeline_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'livePipelineName': self._serialize.url("live_pipeline_name", live_pipeline_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_deactivate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/livePipelines/{livePipelineName}/deactivate'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_locations_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_locations_operations.py index 5fb77c49ec056..2ac129fa86d33 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_locations_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/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-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operations.py index ba0392551bca9..115ef91180df2 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operations.py @@ -63,7 +63,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_job_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_job_operation_statuses_operations.py new file mode 100644 index 0000000000000..821040630afab --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_job_operation_statuses_operations.py @@ -0,0 +1,115 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PipelineJobOperationStatusesOperations(object): + """PipelineJobOperationStatusesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineJobOperationStatus" + """Get the operation statuses. + + Get the operation status of a pipeline job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param operation_id: The operation ID. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJobOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJobOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJobOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineJobOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/operationStatuses/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_jobs_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_jobs_operations.py new file mode 100644 index 0000000000000..a8f57340c54b1 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_jobs_operations.py @@ -0,0 +1,540 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PipelineJobsOperations(object): + """PipelineJobsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PipelineJobCollection"] + """Retrieves a list of pipeline jobs. + + Retrieves a list of pipeline jobs that have been created. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PipelineJobCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~video_analyzer.models.PipelineJobCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJobCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('PipelineJobCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineJob" + """Gets a pipeline job by name. + + Retrieves a pipeline job by name. If a pipeline job with that name has been previously created, + the call will return the JSON representation of that instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + parameters, # type: "_models.PipelineJob" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineJob" + """Creates or updates a pipeline job. + + Creates a new pipeline job or updates an existing one, with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineJob + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineJob') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a pipeline job. + + Deletes a pipeline job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + parameters, # type: "_models.PipelineJob" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineJob" + """Update pipeline job entity. + + Updates the pipeline job entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineJob + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineJob, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineJob + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineJob"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineJob') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PipelineJob', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}'} # type: ignore + + def _cancel_initial( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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 = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self._cancel_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + _cancel_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/cancel'} # type: ignore + + def begin_cancel( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_job_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Cancels a pipeline job. + + Cancels a pipeline job with the name provided. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_job_name: The pipeline job name. + :type pipeline_job_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: 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) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._cancel_initial( + resource_group_name=resource_group_name, + account_name=account_name, + pipeline_job_name=pipeline_job_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineJobName': self._serialize.url("pipeline_job_name", pipeline_job_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineJobs/{pipelineJobName}/cancel'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_topologies_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_topologies_operations.py new file mode 100644 index 0000000000000..926fb131ba3ee --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_topologies_operations.py @@ -0,0 +1,420 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PipelineTopologiesOperations(object): + """PipelineTopologiesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PipelineTopologyCollection"] + """Retrieves a list of pipeline topologies. + + Retrieves a list of pipeline topologies that have been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param filter: Restricts the set of items returned. + :type filter: str + :param top: Specifies a non-negative integer n that limits the number of items returned from a + collection. The service returns the number of available items up to but not greater than the + specified value n. + :type top: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PipelineTopologyCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~video_analyzer.models.PipelineTopologyCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopologyCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + + 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('PipelineTopologyCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.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.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_topology_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineTopology" + """Gets a pipeline topology by name. + + Retrieves a pipeline topology by name. If a topology with that name has been previously + created, the call will return the JSON representation of that topology. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_topology_name, # type: str + parameters, # type: "_models.PipelineTopology" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineTopology" + """Creates or updates a pipeline topology. + + Creates a new pipeline topology or updates an existing one, with the given name. A pipeline + topology is a blueprint defining what nodes are in a pipeline, and how they are interconnected. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineTopology + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineTopology') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_topology_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a pipeline topology. + + Deletes a pipeline topology with the given name. This method should be called after all + instances of the topology have been stopped and deleted. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + pipeline_topology_name, # type: str + parameters, # type: "_models.PipelineTopology" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineTopology" + """Update pipeline topology entity. + + Updates the pipeline topology entity. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param pipeline_topology_name: Pipeline topology unique identifier. + :type pipeline_topology_name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PipelineTopology + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PipelineTopology, or the result of cls(response) + :rtype: ~video_analyzer.models.PipelineTopology + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PipelineTopology"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'pipelineTopologyName': self._serialize.url("pipeline_topology_name", pipeline_topology_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PipelineTopology') + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PipelineTopology', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/pipelineTopologies/{pipelineTopologyName}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_endpoint_connections_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..4a42ad3184574 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,314 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnectionListResult" + """Get all private endpoint connections. + + Get all private endpoint connections. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnectionListResult, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnectionListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # 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('PrivateEndpointConnectionListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Get private endpoint connection. + + Get private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + parameters, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Update private endpoint connection. + + Update private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :param parameters: The request parameters. + :type parameters: ~video_analyzer.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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) + + response_headers = {} + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete private endpoint connection. + + Delete private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_link_resources_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..efbb85e20fd86 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_private_link_resources_operations.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourceListResult" + """Get list of group IDs. + + Get list of group IDs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # 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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateLinkResources'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResource" + """Get group ID. + + Get group ID. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResource, or the result of cls(response) + :rtype: ~video_analyzer.models.PrivateLinkResource + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('PrivateLinkResource', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateLinkResources/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_results_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_results_operations.py new file mode 100644 index 0000000000000..4413aa88f0662 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_results_operations.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VideoAnalyzerOperationResultsOperations(object): + """VideoAnalyzerOperationResultsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VideoAnalyzer"] + """Get operation status. + + Get operation status. + + :param location_name: + :type location_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzer, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzer or None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.VideoAnalyzer"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_statuses_operations.py new file mode 100644 index 0000000000000..985e0dd92d8cc --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_statuses_operations.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class VideoAnalyzerOperationStatusesOperations(object): + """VideoAnalyzerOperationStatusesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~video_analyzer.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + location_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VideoAnalyzerOperationStatus" + """Get operation status. + + Get operation status. + + :param location_name: + :type location_name: str + :param name: + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzerOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzerOperationStatus"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-11-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'name': self._serialize.url("name", name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + 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('VideoAnalyzerOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationStatuses/{name}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzers_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzers_operations.py index 080ee6d2e428d..424b7d97ad103 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzers_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzers_operations.py @@ -66,14 +66,14 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) @@ -127,14 +127,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -192,7 +192,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -200,7 +200,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -226,14 +226,18 @@ def create_or_update( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} if response.status_code == 200: deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if response.status_code == 201: + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore @@ -263,14 +267,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -325,7 +329,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -333,7 +337,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -354,87 +358,23 @@ def update( 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 [202]: 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) + response_headers = {} + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) deserialized = self._deserialize('VideoAnalyzer', pipeline_response) if cls: - return cls(pipeline_response, deserialized, {}) + return cls(pipeline_response, deserialized, response_headers) return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - def sync_storage_keys( - self, - resource_group_name, # type: str - account_name, # type: str - parameters, # type: "_models.SyncStorageKeysInput" - **kwargs # type: Any - ): - # type: (...) -> None - """Synchronizes Storage Account Keys. - - Synchronizes storage account keys for a storage account associated with the Video Analyzer - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param account_name: The Video Analyzer account name. - :type account_name: str - :param parameters: The request parameters. - :type parameters: ~video_analyzer.models.SyncStorageKeysInput - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.sync_storage_keys.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'SyncStorageKeysInput') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - sync_storage_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/syncStorageKeys'} # type: ignore - def list_by_subscription( self, **kwargs # type: Any @@ -454,7 +394,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_videos_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_videos_operations.py index f87e0422fb769..1839daf0d3107 100644 --- a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_videos_operations.py +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_videos_operations.py @@ -55,7 +55,7 @@ def list( # type: (...) -> Iterable["_models.VideoEntityCollection"] """List all existing video resources. - List all existing video resources in the specified account. + List all existing video resources. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -75,7 +75,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -88,7 +88,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -138,15 +138,15 @@ def get( **kwargs # type: Any ): # type: (...) -> "_models.VideoEntity" - """Retrieves a video resource. + """Retrieves an existing video resource. - Retrieves an existing video resource within an account with a given name. + Retrieves an existing video resource. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to retrieve. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: VideoEntity, or the result of cls(response) @@ -158,14 +158,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -205,15 +205,15 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> "_models.VideoEntity" - """Create or updates a video resource. + """Creates a new video resource or updates an existing one. - Creates a new video resource or updates an existing one in an account. + Creates a new video resource or updates an existing one. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to create or update. + :param video_name: The Video name. :type video_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.VideoEntity @@ -227,7 +227,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -235,7 +235,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -282,7 +282,7 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Deletes a video resource. + """Deletes an existing video resource and its underlying data. Deletes an existing video resource and its underlying data. This operation is irreversible. @@ -290,7 +290,7 @@ def delete( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to delete. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -302,14 +302,14 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -346,7 +346,7 @@ def update( **kwargs # type: Any ): # type: (...) -> "_models.VideoEntity" - """Updates the properties of a video resource. + """Updates individual properties of an existing video resource. Updates individual properties of an existing video resource. @@ -354,7 +354,7 @@ def update( :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to update. + :param video_name: The Video name. :type video_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.VideoEntity @@ -368,7 +368,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -376,7 +376,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -411,42 +411,42 @@ def update( return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore - def list_streaming_token( + def list_content_token( self, resource_group_name, # type: str account_name, # type: str video_name, # type: str **kwargs # type: Any ): - # type: (...) -> "_models.VideoStreamingToken" - """Generates a streaming token for video playback. + # type: (...) -> "_models.VideoContentToken" + """Generates a streaming token which can be used for accessing content from video content URLs. - Generates a streaming token used for authenticating video playback. + Generates a streaming token which can be used for accessing content from video content URLs. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str :param account_name: The Azure Video Analyzer account name. :type account_name: str - :param video_name: The name of the video to generate a token for playback. + :param video_name: The Video name. :type video_name: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: VideoStreamingToken, or the result of cls(response) - :rtype: ~video_analyzer.models.VideoStreamingToken + :return: VideoContentToken, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoContentToken :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoStreamingToken"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoContentToken"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-05-01-preview" + api_version = "2021-11-01-preview" accept = "application/json" # Construct URL - url = self.list_streaming_token.metadata['url'] # type: ignore + url = self.list_content_token.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str'), 'videoName': self._serialize.url("video_name", video_name, 'str'), } @@ -469,10 +469,10 @@ def list_streaming_token( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize('VideoStreamingToken', pipeline_response) + deserialized = self._deserialize('VideoContentToken', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - list_streaming_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}/listStreamingToken'} # type: ignore + list_content_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}/listContentToken'} # type: ignore