From 2b464bf9c763d1afe571f6a3ec0aa3865c6968ce Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 29 Sep 2021 05:15:59 +0000 Subject: [PATCH] CodeGen from PR 16089 in Azure/azure-rest-api-specs Merge 930ef835513b90ad0340ffc658161f76c498e6ea into 9f70268eb3c71b3d79a7ded837ea20d3e7383d30 --- .../azure-mgmt-videoanalyzer/_meta.json | 11 +- .../mgmt/videoanalyzer/_configuration.py | 2 +- .../azure/mgmt/videoanalyzer/_metadata.json | 21 +- .../azure/mgmt/videoanalyzer/_version.py | 2 +- .../mgmt/videoanalyzer/_video_analyzer.py | 68 +- .../mgmt/videoanalyzer/aio/_configuration.py | 2 +- .../mgmt/videoanalyzer/aio/_video_analyzer.py | 68 +- .../videoanalyzer/aio/operations/__init__.py | 26 +- .../operations/_access_policies_operations.py | 58 +- .../operations/_edge_modules_operations.py | 54 +- ..._pipeline_operation_statuses_operations.py | 110 + .../operations/_live_pipelines_operations.py | 650 +++ .../aio/operations/_locations_operations.py | 6 +- .../_operation_results_operations.py | 176 + .../_operation_statuses_operations.py | 110 + .../aio/operations/_operations.py | 4 +- ...eline_job_operation_statuses_operations.py | 110 + .../operations/_pipeline_jobs_operations.py | 531 +++ .../_pipeline_topologies_operations.py | 417 ++ ...private_endpoint_connections_operations.py | 306 ++ .../_private_link_resources_operations.py | 167 + ...o_analyzer_operation_results_operations.py | 162 + ..._analyzer_operation_statuses_operations.py | 102 + .../operations/_video_analyzers_operations.py | 274 +- .../aio/operations/_videos_operations.py | 86 +- .../mgmt/videoanalyzer/models/__init__.py | 224 +- .../mgmt/videoanalyzer/models/_models.py | 3159 ++++++++++++--- .../mgmt/videoanalyzer/models/_models_py3.py | 3470 ++++++++++++++--- .../models/_video_analyzer_enums.py | 178 +- .../mgmt/videoanalyzer/operations/__init__.py | 26 +- .../operations/_access_policies_operations.py | 48 +- .../operations/_edge_modules_operations.py | 44 +- ..._pipeline_operation_statuses_operations.py | 115 + .../operations/_live_pipelines_operations.py | 663 ++++ .../operations/_locations_operations.py | 4 +- .../_operation_results_operations.py | 182 + .../_operation_statuses_operations.py | 115 + .../videoanalyzer/operations/_operations.py | 2 +- ...eline_job_operation_statuses_operations.py | 115 + .../operations/_pipeline_jobs_operations.py | 542 +++ .../_pipeline_topologies_operations.py | 426 ++ ...private_endpoint_connections_operations.py | 314 ++ .../_private_link_resources_operations.py | 173 + ...o_analyzer_operation_results_operations.py | 168 + ..._analyzer_operation_statuses_operations.py | 107 + .../operations/_video_analyzers_operations.py | 261 +- .../operations/_videos_operations.py | 74 +- 47 files changed, 12555 insertions(+), 1378 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/_operation_results_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operation_statuses_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/_operation_results_operations.py create mode 100644 sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operation_statuses_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..cde3775d36d0e 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": "0eb3a909aff59153c7874c5cf1d0d8efb97df19f", "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..f0468762497e6 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,21 @@ "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", + "operation_statuses": "OperationStatusesOperations", + "operation_results": "OperationResultsOperations", + "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..5f81517d53673 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,59 @@ 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 OperationStatusesOperations +from .operations import OperationResultsOperations +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 operation_statuses: OperationStatusesOperations operations + :vartype operation_statuses: video_analyzer.operations.OperationStatusesOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: video_analyzer.operations.OperationResultsOperations + :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 +81,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 +102,35 @@ 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.operation_statuses = OperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + 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..6c943e0ea78d4 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,59 @@ 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 OperationStatusesOperations +from .operations import OperationResultsOperations +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 operation_statuses: OperationStatusesOperations operations + :vartype operation_statuses: video_analyzer.aio.operations.OperationStatusesOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: video_analyzer.aio.operations.OperationResultsOperations + :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 +79,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 +99,35 @@ 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.operation_statuses = OperationStatusesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + 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..62393a002a63d 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,40 @@ # 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 ._operation_statuses_operations import OperationStatusesOperations +from ._operation_results_operations import OperationResultsOperations +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', + 'OperationStatusesOperations', + 'OperationResultsOperations', + '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..919cb8290d9bc 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. + Retrieves all existing access policy resources, along with their JSON representations. :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 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 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,17 +196,17 @@ 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. + Creates a new access policy resource 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 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,17 +272,17 @@ 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. + Deletes an existing access policy resource 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 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,17 +335,17 @@ 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. + Updates individual properties of an existing access policy resource 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 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..903012e620888 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, along with their JSON representations. :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 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 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..62e6a76d6e6d6 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_live_pipelines_operations.py @@ -0,0 +1,650 @@ +# 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 pipelines. + + Retrieves a list of live pipelines that have been created, along with their JSON + representations. + + :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": + """Retrieves a specific live pipeline by name. + + Retrieves a specific 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 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 + :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.LivePipelineUpdate", + **kwargs: Any + ) -> "_models.LivePipeline": + """Updates an existing live pipeline. + + Updates an existing live pipeline with the given name. Properties that can be updated include: + description, bitrateKbps, and parameter definitions. Only the description can be updated while + the live pipeline is active. + + :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.LivePipelineUpdate + :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, 'LivePipelineUpdate') + 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 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 + :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 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 + :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..14693f0b4139d 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,13 +44,13 @@ async def check_name_availability( self, location_name: str, parameters: "_models.CheckNameAvailabilityRequest", - **kwargs + **kwargs: Any ) -> "_models.CheckNameAvailabilityResponse": """Check Name Availability. Checks whether the Video Analyzer resource name is available. - :param location_name: The name of the location. + :param location_name: Location Name. :type location_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.CheckNameAvailabilityRequest @@ -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/_operation_results_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operation_results_operations.py new file mode 100644 index 0000000000000..34aecd0a482cc --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operation_results_operations.py @@ -0,0 +1,176 @@ +# 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, Union +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.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 OperationResultsOperations: + """OperationResultsOperations 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_initial( + self, + resource_group_name: str, + account_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> Optional["_models.PrivateEndpointConnection"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_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_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'), + 'name': self._serialize.url("name", 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, 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}/operationResults/{operationId}'} # type: ignore + + async def begin_get( + self, + resource_group_name: str, + account_name: str, + name: str, + operation_id: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.PrivateEndpointConnection"]: + """Get operation result. + + Get private endpoint connection operation result. + + :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: Private endpoint connection name. + :type name: str + :param operation_id: Operation Id. + :type operation_id: 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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~video_analyzer.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + 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._get_initial( + resource_group_name=resource_group_name, + account_name=account_name, + name=name, + operation_id=operation_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'operationId': self._serialize.url("operation_id", operation_id, '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_get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_operation_statuses_operations.py new file mode 100644 index 0000000000000..5e58c11175ea9 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_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 OperationStatusesOperations: + """OperationStatusesOperations 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, + name: str, + operation_id: str, + **kwargs: Any + ) -> "_models.VideoAnalyzerPrivateEndpointConnectionOperationStatus": + """Get operation status. + + Get private endpoint connection operation status. + + :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: Private endpoint connection name. + :type name: str + :param operation_id: Operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerPrivateEndpointConnectionOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzerPrivateEndpointConnectionOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzerPrivateEndpointConnectionOperationStatus"] + 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'), + '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('VideoAnalyzerPrivateEndpointConnectionOperationStatus', 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}/operationStatuses/{operationId}'} # type: ignore 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..8709efef2199e --- /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 with the given operationId. + + :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..516fa720eb048 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_jobs_operations.py @@ -0,0 +1,531 @@ +# 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 all live pipelines that have been created, along with their JSON + representations. + + :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 specific pipeline job by name. + + Retrieves a specific 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 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 + :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.PipelineJobUpdate", + **kwargs: Any + ) -> "_models.PipelineJob": + """Updates an existing pipeline job. + + Updates an existing pipeline job with the given name. Properties that can be updated include: + description. + + :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.PipelineJobUpdate + :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, 'PipelineJobUpdate') + 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 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 + :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..f98c82443f10c --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_pipeline_topologies_operations.py @@ -0,0 +1,417 @@ +# 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 to the account, if any, along with + their JSON representation. + + :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": + """Retrieves a specific pipeline topology by name. + + Retrieves a specific 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 describes the processing steps to be applied when processing content 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. + + :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.PipelineTopologyUpdate", + **kwargs: Any + ) -> "_models.PipelineTopology": + """Updates an existing pipeline topology. + + Updates an existing pipeline topology with the given name. If the associated live pipelines or + pipeline jobs are in active or processing state, respectively, then only the description can be + updated. Else, the properties that can be updated include: description, parameter declarations, + sources, processors, and sinks. + + :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.PipelineTopologyUpdate + :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, 'PipelineTopologyUpdate') + 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..525355f49003f --- /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 under 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 + :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 under 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 name: Private endpoint connection 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 state under 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 name: Private endpoint connection 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 [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) + + 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 under 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 name: Private endpoint connection 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..c8c38a4a8f153 --- /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 for 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 + :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 for 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 name: Name of the private link resource (Group ID). + :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..bc5c050edd550 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/aio/operations/_video_analyzer_operation_results_operations.py @@ -0,0 +1,162 @@ +# 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, Union +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.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 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_initial( + self, + location_name: str, + operation_id: str, + **kwargs: Any + ) -> Optional["_models.VideoAnalyzer"]: + 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_initial.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'), + '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, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{operationId}'} # type: ignore + + async def begin_get( + self, + location_name: str, + operation_id: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.VideoAnalyzer"]: + """Get operation result. + + Get video analyzer operation result. + + :param location_name: Location name. + :type location_name: str + :param operation_id: Operation Id. + :type operation_id: 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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~video_analyzer.models.VideoAnalyzer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._get_initial( + location_name=location_name, + operation_id=operation_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'operationId': self._serialize.url("operation_id", operation_id, '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_get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{operationId}'} # 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..c4b276f70f373 --- /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, + operation_id: str, + **kwargs: Any + ) -> "_models.VideoAnalyzerOperationStatus": + """Get operation status. + + Get video analyzer operation status. + + :param location_name: Location name. + :type location_name: str + :param operation_id: Operation Id. + :type operation_id: 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'), + '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('VideoAnalyzerOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationStatuses/{operationId}'} # 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..9381a44dd49c8 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 @@ -11,7 +11,9 @@ 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 @@ -43,7 +45,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 +63,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 +103,7 @@ async def get( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": """Get a Video Analyzer account. @@ -121,14 +123,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) @@ -158,42 +160,27 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - async def create_or_update( + async def _create_or_update_initial( self, resource_group_name: str, account_name: str, parameters: "_models.VideoAnalyzer", - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": - """Create or update a Video Analyzer account. - - Create or update an instance of a 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.VideoAnalyzer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] 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" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_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, 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,23 +206,100 @@ 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + account_name: str, + parameters: "_models.VideoAnalyzer", + **kwargs: Any + ) -> AsyncLROPoller["_models.VideoAnalyzer"]: + """Create or update a Video Analyzer account. + + Create or update an instance of a 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.VideoAnalyzer + :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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~video_analyzer.models.VideoAnalyzer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + 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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore async def delete( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a Video Analyzer account. @@ -255,14 +319,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) @@ -289,42 +353,27 @@ async def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - async def update( + async def _update_initial( self, resource_group_name: str, account_name: str, parameters: "_models.VideoAnalyzerUpdate", - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzer": - """Update a Video Analyzer account. - - Updates an existing instance of 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.VideoAnalyzerUpdate - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] 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" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self._update_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, 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,93 +394,108 @@ 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 + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - async def sync_storage_keys( + async def begin_update( self, resource_group_name: str, account_name: str, - parameters: "_models.SyncStorageKeysInput", - **kwargs - ) -> None: - """Synchronizes Storage Account Keys. + parameters: "_models.VideoAnalyzerUpdate", + **kwargs: Any + ) -> AsyncLROPoller["_models.VideoAnalyzer"]: + """Update a Video Analyzer account. - Synchronizes storage account keys for a storage account associated with the Video Analyzer - account. + Updates an existing instance of 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 + :type parameters: ~video_analyzer.models.VideoAnalyzerUpdate :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 + :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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~video_analyzer.models.VideoAnalyzer] + :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" + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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, response_headers) + return deserialized - # 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\._\(\)]+$'), + '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['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 + 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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore async def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> "_models.VideoAnalyzerCollection": """List Video Analyzer accounts. - Lists the Video Analyzer accounts in the specific subscription. + List all Video Analyzer accounts in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: VideoAnalyzerCollection, or the result of cls(response) @@ -443,7 +507,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..5c2b6b7bf85a5 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,12 @@ def list( resource_group_name: str, account_name: str, top: Optional[int] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.VideoEntityCollection"]: - """List all existing video resources. + """Retrieves all existing video resources. - List all existing video resources in the specified account. + Retrieves a list of video resources that have been created, along with their JSON + representations. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -70,7 +71,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 +84,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 +131,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 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 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 +153,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 +197,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 video resource 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 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 +221,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 +229,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 +273,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 +283,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 +295,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,17 +336,17 @@ 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. + Updates individual properties of an existing video resource 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 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 +360,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 +368,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 +403,42 @@ 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, + for a video resource 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 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 +461,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..780b3ad619109 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,212 @@ 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 LivePipelineUpdate 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 PipelineJobUpdate + from ._models_py3 import PipelineTopology + from ._models_py3 import PipelineTopologyCollection + from ._models_py3 import PipelineTopologyUpdate + 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 VideoAnalyzerProperties - from ._models_py3 import VideoAnalyzerPropertiesUpdate + from ._models_py3 import VideoAnalyzerOperationStatus + from ._models_py3 import VideoAnalyzerPrivateEndpointConnectionOperationStatus 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 LivePipelineUpdate # 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 PipelineJobUpdate # type: ignore + from ._models import PipelineTopology # type: ignore + from ._models import PipelineTopologyCollection # type: ignore + from ._models import PipelineTopologyUpdate # 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 VideoAnalyzerProperties # type: ignore - from ._models import VideoAnalyzerPropertiesUpdate # type: ignore + from ._models import VideoAnalyzerOperationStatus # type: ignore + from ._models import VideoAnalyzerPrivateEndpointConnectionOperationStatus # 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 +225,22 @@ ActionType, CheckNameAvailabilityReason, CreatedByType, + EncoderSystemPresetType, + Kind, + LivePipelineState, MetricAggregationType, MetricUnit, + ParameterType, + PipelineJobState, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, + ProvisioningState, + PublicNetworkAccess, + RtspTransport, + SkuName, + SkuTier, VideoAnalyzerEndpointType, + VideoScaleMode, VideoType, ) @@ -123,51 +248,107 @@ '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', + 'LivePipelineUpdate', 'LogSpecification', 'MetricDimension', 'MetricSpecification', + 'NetworkAccessControl', + 'NodeBase', + 'NodeInput', 'Operation', 'OperationCollection', 'OperationDisplay', + 'ParameterDeclaration', + 'ParameterDefinition', + 'PemCertificateList', + 'PipelineJob', + 'PipelineJobCollection', + 'PipelineJobError', + 'PipelineJobOperationStatus', + 'PipelineJobUpdate', + 'PipelineTopology', + 'PipelineTopologyCollection', + 'PipelineTopologyUpdate', + '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', - 'VideoAnalyzerProperties', - 'VideoAnalyzerPropertiesUpdate', + 'VideoAnalyzerOperationStatus', + 'VideoAnalyzerPrivateEndpointConnectionOperationStatus', 'VideoAnalyzerUpdate', + 'VideoArchival', + 'VideoContentToken', + 'VideoContentUrls', + 'VideoCreationProperties', + 'VideoEncoderBase', + 'VideoEncoderH264', 'VideoEntity', 'VideoEntityCollection', 'VideoFlags', 'VideoMediaInfo', - 'VideoStreaming', - 'VideoStreamingToken', + 'VideoPreviewImageUrls', + 'VideoPublishingOptions', + 'VideoScale', + 'VideoSequenceAbsoluteTimeMarkers', + 'VideoSink', + 'VideoSource', 'AccessPolicyEccAlgo', 'AccessPolicyRole', 'AccessPolicyRsaAlgo', @@ -175,8 +356,21 @@ 'ActionType', 'CheckNameAvailabilityReason', 'CreatedByType', + 'EncoderSystemPresetType', + 'Kind', + 'LivePipelineState', 'MetricAggregationType', 'MetricUnit', + 'ParameterType', + 'PipelineJobState', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', + 'ProvisioningState', + 'PublicNetworkAccess', + 'RtspTransport', + 'SkuName', + 'SkuTier', '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..b14898e85c057 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 @@ -23,18 +23,23 @@ class Resource(msrest.serialization.Model): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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'}, } def __init__( @@ -45,6 +50,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None class ProxyResource(Resource): @@ -60,18 +66,23 @@ class ProxyResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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'}, } def __init__( @@ -82,7 +93,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. @@ -94,7 +105,8 @@ class AccessPolicyEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :param role: Defines the access level granted by this policy. Possible values include: "Reader". @@ -124,7 +136,6 @@ def __init__( **kwargs ): super(AccessPolicyEntity, self).__init__(**kwargs) - self.system_data = None self.role = kwargs.get('role', None) self.authentication = kwargs.get('authentication', None) @@ -194,6 +205,74 @@ def __init__( self.status = None +class AudioEncoderBase(msrest.serialization.Model): + """Base type for all audio encoder presets, which define the recipe or instructions on how audio should be processed. + + 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: Bitrate, in kilobits per second or Kbps, at which audio should be encoded + (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, + 192, 224, and 256. If omitted, the bitrate of the input audio is used. + :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): + """A custom preset for encoding audio with the 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: Bitrate, in kilobits per second or Kbps, at which audio should be encoded + (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, + 192, 224, and 256. If omitted, the bitrate of the input audio is used. + :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 +305,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 +388,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. @@ -374,7 +517,8 @@ class EdgeModuleEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :ivar edge_module_id: Internal ID generated for the instance of the Video Analyzer edge module. :vartype edge_module_id: str @@ -401,7 +545,6 @@ def __init__( **kwargs ): super(EdgeModuleEntity, self).__init__(**kwargs) - self.system_data = None self.edge_module_id = None @@ -462,15 +605,16 @@ def __init__( self.token = None -class Endpoint(msrest.serialization.Model): - """The endpoint details. +class EncoderPresetBase(msrest.serialization.Model): + """Base type for all encoder presets, which define the recipe or instructions on how the input content should be processed. + + 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,562 +622,1995 @@ 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): + """Describes a custom preset for encoding the input content using the encoder processor. - 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: Describes a custom preset for encoding audio. + :type audio_encoder: ~video_analyzer.models.AudioEncoderBase + :param video_encoder: Describes a custom preset for encoding video. + :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): + """Encoder processor allows for encoding of the input content. For example, it can used to change the resolution from 4K to 1280x720. 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, which defines the recipe or instructions on how + the input content should be processed. + :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): + """Describes a built-in preset for encoding the input content using the encoder processor. 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. Name of the built-in encoding preset. 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(KeyVaultProperties, self).__init__(**kwargs) - self.key_identifier = kwargs['key_identifier'] - self.current_key_identifier = None + super(EncoderSystemPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderSystemPreset' # type: str + self.name = kwargs['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, **kwargs ): - super(ListProvisioningTokenInput, self).__init__(**kwargs) - self.expiration_date = kwargs['expiration_date'] + super(Endpoint, self).__init__(**kwargs) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.type = kwargs['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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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, **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 = kwargs.get('credentials', None) + self.url = kwargs['url'] + self.tunnel = kwargs.get('tunnel', None) -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, **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(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, **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(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) -class OperationCollection(msrest.serialization.Model): - """A collection of Operation items. +class GroupLevelAccessControl(msrest.serialization.Model): + """Group level network access control. - :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, **kwargs ): - super(OperationCollection, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super(GroupLevelAccessControl, self).__init__(**kwargs) + self.public_network_access = kwargs.get('public_network_access', None) -class OperationDisplay(msrest.serialization.Model): - """Operation details. +class IotHub(msrest.serialization.Model): + """The IoT Hub 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 + 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 resource identifier. + :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__( + self, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_identifier = kwargs['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, + **kwargs + ): + super(ListProvisioningTokenInput, self).__init__(**kwargs) + self.expiration_date = kwargs['expiration_date'] + + +class LivePipeline(ProxyResource): + """Live pipeline represents a unique instance of a live topology, used for real-time ingestion, archiving and publishing of content for a unique RTSP camera. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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: Maximum bitrate capacity in Kbps reserved for the live pipeline. The + allowed range is from 500 to 3000 Kbps in increments of 100 Kbps. If the RTSP camera exceeds + this capacity, then the service will disconnect temporarily from the camera. It will retry to + re-establish connection (with exponential backoff), checking to see if the camera bitrate is + now below the reserved capacity. Doing so will ensure that one 'noisy neighbor' does not affect + other live pipelines in your account. + :type bitrate_kbps: int + :ivar state: Current state of the pipeline (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.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 LivePipelineUpdate(ProxyResource): + """Live pipeline represents a unique instance of a live topology, used for real-time ingestion, archiving and publishing of content for a unique RTSP camera. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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: Maximum bitrate capacity in Kbps reserved for the live pipeline. The + allowed range is from 500 to 3000 Kbps in increments of 100 Kbps. If the RTSP camera exceeds + this capacity, then the service will disconnect temporarily from the camera. It will retry to + re-establish connection (with exponential backoff), checking to see if the camera bitrate is + now below the reserved capacity. Doing so will ensure that one 'noisy neighbor' does not affect + other live pipelines in your account. + :type bitrate_kbps: int + :ivar state: Current state of the pipeline (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(LivePipelineUpdate, self).__init__(**kwargs) + 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 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): + """Network access control for video analyzer account. + + :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): + """Pipeline job represents a unique instance of a batch topology, used for offline processing of selected portions of archived content. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: Reference to an existing pipeline topology. When activated, this pipeline + job 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 state of the pipeline (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The date-time by when this pipeline job will be automatically deleted from + your account. + :vartype expiration: ~datetime.datetime + :ivar error: Details about the error, in case the pipeline job fails. + :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.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): + """Details about the error for a failed pipeline job. + + :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 PipelineJobUpdate(ProxyResource): + """Pipeline job represents a unique instance of a batch topology, used for offline processing of selected portions of archived content. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: Reference to an existing pipeline topology. When activated, this pipeline + job 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 state of the pipeline (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The date-time by when this pipeline job will be automatically deleted from + your account. + :vartype expiration: ~datetime.datetime + :ivar error: Details about the error, in case the pipeline job fails. + :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(PipelineJobUpdate, self).__init__(**kwargs) + 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 PipelineTopology(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing content 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 captures content from a RTSP camera and archives the content can be reused across many different cameras, as long as the same processing is to 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. This allows individual pipelines refer to different values, such as individual cameras' RTSP endpoints and credentials. Overall a topology is composed of the following: + + +* Parameters: list of user defined parameters that can be references across the topology nodes. +* Sources: list of one or more data sources nodes such as an RTSP source which allows for content to be ingested from cameras. +* Processors: list of nodes which perform data analysis or transformations. +* 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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. Describes the properties of a SKU. + :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.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 PipelineTopologyUpdate(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing content 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 captures content from a RTSP camera and archives the content can be reused across many different cameras, as long as the same processing is to 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. This allows individual pipelines refer to different values, such as individual cameras' RTSP endpoints and credentials. Overall a topology is composed of the following: + + +* Parameters: list of user defined parameters that can be references across the topology nodes. +* Sources: list of one or more data sources nodes such as an RTSP source which allows for content to be ingested from cameras.\r\n - Processors: list of nodes which perform data analysis or transformations. + -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. + + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param kind: Topology kind. Possible values include: "Live", "Batch". + :type kind: str or ~video_analyzer.models.Kind + :param sku: Describes the properties of a SKU. + :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}, + } + + _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(PipelineTopologyUpdate, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.sku = kwargs.get('sku', None) + 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 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 + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :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}, + 'system_data': {'readonly': True}, + 'provisioning_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'}, + '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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :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}, + 'system_data': {'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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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] + """ + + _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 = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + +class Properties(msrest.serialization.Model): + """Metric properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar service_specification: The service specifications. + :vartype service_specification: ~video_analyzer.models.ServiceSpecification + """ + + _validation = { + 'service_specification': {'readonly': True}, + } + + _attribute_map = { + 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__( + self, + **kwargs + ): + super(Properties, self).__init__(**kwargs) + self.service_specification = None + + +class ResourceIdentity(msrest.serialization.Model): + """The user assigned managed identity to use when accessing a resource. + + All required parameters must be populated in order to send to Azure. + + :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 = { + 'user_assigned_identity': {'required': True}, + } + + _attribute_map = { + 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = kwargs['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, + **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'] + + +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 = { - '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'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.RtspSource': 'RtspSource', '#Microsoft.VideoAnalyzer.VideoSource': 'VideoSource'} } 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(SourceNodeBase, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SourceNodeBase' # type: str -class Properties(msrest.serialization.Model): - """Metric properties. +class RtspSource(SourceNodeBase): + """RTSP source allows for media from an RTSP camera or generic RTSP server to be ingested into a pipeline. - 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 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 = { - 'service_specification': {'readonly': True}, + 'type': {'required': True}, + 'name': {'required': True}, + 'endpoint': {'required': True}, } _attribute_map = { - 'service_specification': {'key': 'serviceSpecification', 'type': 'ServiceSpecification'}, + '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(Properties, self).__init__(**kwargs) - self.service_specification = None + super(RtspSource, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.RtspSource' # type: str + self.transport = kwargs.get('transport', None) + self.endpoint = kwargs['endpoint'] -class ResourceIdentity(msrest.serialization.Model): - """The user assigned managed identity to use when accessing a resource. +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 user_assigned_identity: Required. The user assigned managed identity's resource - identifier to use when accessing a resource. - :type user_assigned_identity: str + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str """ _validation = { - 'user_assigned_identity': {'required': True}, + 'type': {'required': True}, } _attribute_map = { - 'user_assigned_identity': {'key': 'userAssignedIdentity', 'type': 'str'}, + 'type': {'key': '@type', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.SecureIotDeviceRemoteTunnel': 'SecureIotDeviceRemoteTunnel'} } def __init__( self, **kwargs ): - super(ResourceIdentity, self).__init__(**kwargs) - self.user_assigned_identity = kwargs['user_assigned_identity'] + super(TunnelBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] -class RsaTokenKey(TokenKey): - """Required validation properties for tokens generated with RSA algorithm. +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 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 iot_hub_name: Required. Name of the IoT Hub. + :type iot_hub_name: str + :param device_id: Required. The IoT device id to use when establishing the remote tunnel. This + string is case-sensitive. + :type device_id: str """ _validation = { 'type': {'required': True}, - 'kid': {'required': True}, - 'alg': {'required': True}, - 'n': {'required': True}, - 'e': {'required': True}, + 'iot_hub_name': {'required': True}, + 'device_id': {'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'}, + 'iot_hub_name': {'key': 'iotHubName', 'type': 'str'}, + 'device_id': {'key': 'deviceId', 'type': 'str'}, } 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(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 ServiceSpecification(msrest.serialization.Model): @@ -1066,13 +2643,89 @@ def __init__( self.metric_specifications = None +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 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 = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSink': 'VideoSink'} + } + + def __init__( + self, + **kwargs + ): + super(SinkNodeBase, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.SinkNodeBase' # type: str + self.inputs = kwargs['inputs'] + + +class Sku(msrest.serialization.Model): + """The SKU 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 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.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = kwargs['name'] + self.tier = None + + class StorageAccount(msrest.serialization.Model): """The details about the associated storage account. 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 +2735,7 @@ class StorageAccount(msrest.serialization.Model): """ _validation = { + 'id': {'required': True}, 'status': {'readonly': True}, } @@ -1096,30 +2750,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 +2796,110 @@ def __init__( self.last_modified_at = kwargs.get('last_modified_at', None) +class TimeSequenceBase(msrest.serialization.Model): + """A sequence of datetime ranges as a string. + + 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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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. @@ -1206,6 +2945,9 @@ class TrackedResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. @@ -1216,6 +2958,7 @@ class TrackedResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'location': {'required': True}, } @@ -1223,6 +2966,7 @@ class TrackedResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, } @@ -1236,6 +2980,42 @@ 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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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 +3046,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. + """The Video Analyzer account. Variables are only populated by the server, and will be ignored when sending a request. @@ -1281,42 +3098,63 @@ class VideoAnalyzer(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :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 = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'required': True}, 'system_data': {'readonly': True}, + 'location': {'required': True}, 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'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'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'identity': {'key': 'identity', 'type': 'VideoAnalyzerIdentity'}, '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__( @@ -1324,11 +3162,15 @@ def __init__( **kwargs ): super(VideoAnalyzer, self).__init__(**kwargs) - self.system_data = None self.identity = kwargs.get('identity', None) 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): @@ -1379,67 +3221,94 @@ def __init__( self.user_assigned_identities = kwargs.get('user_assigned_identities', None) -class VideoAnalyzerPropertiesUpdate(msrest.serialization.Model): - """Properties of the Video Analyzer account. +class VideoAnalyzerOperationStatus(msrest.serialization.Model): + """Status of video analyzer operation. - 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 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. - :vartype endpoints: list[~video_analyzer.models.Endpoint] - :param encryption: The account encryption properties. - :type encryption: ~video_analyzer.models.AccountEncryption + :param name: Required. Operation identifier. + :type name: str + :param id: Operation resource ID. + :type id: str + :param start_time: Operation start time. + :type start_time: str + :param end_time: Operation end time. + :type end_time: str + :param status: Operation status. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail """ _validation = { - 'endpoints': {'readonly': True}, + 'name': {'required': True}, } _attribute_map = { - 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + '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(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) - self.storage_accounts = kwargs.get('storage_accounts', None) - self.endpoints = None - self.encryption = kwargs.get('encryption', None) + 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.get('status', None) + self.error = kwargs.get('error', None) -class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): - """VideoAnalyzerProperties. +class VideoAnalyzerPrivateEndpointConnectionOperationStatus(msrest.serialization.Model): + """Status of private endpoint connection operation. - 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 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. - :vartype endpoints: list[~video_analyzer.models.Endpoint] - :param encryption: The account encryption properties. - :type encryption: ~video_analyzer.models.AccountEncryption + :param name: Required. Operation identifier. + :type name: str + :param id: Operation resource ID. + :type id: str + :param start_time: Operation start time. + :type start_time: str + :param end_time: Operation end time. + :type end_time: str + :param status: Operation status. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail """ _validation = { - 'endpoints': {'readonly': True}, + 'name': {'required': True}, } _attribute_map = { - 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + '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(VideoAnalyzerProperties, self).__init__(**kwargs) + super(VideoAnalyzerPrivateEndpointConnectionOperationStatus, 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.get('status', None) + self.error = kwargs.get('error', None) class VideoAnalyzerUpdate(msrest.serialization.Model): @@ -1453,14 +3322,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 +3353,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 +3370,255 @@ 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 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 title provided by the user. Value can be up to 256 characters long. + :type title: str + :param description: Optional description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :param segment_length: Segment length indicates the length of individual content 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 initial call to create the + video resource can lead to errors when uploading content to the archive. Default value is 30 + seconds. This property is only allowed for topologies where "kind" is set to "live". + :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 10 years, in 1 day increments. When absent (null), all video content is + retained indefinitely. This property is only allowed for topologies where "kind" is set to + "live". + :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): + """Base type for all video encoding presets, which define the recipe or instructions on how the input video should be processed. + + 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 maximum bitrate, in kilobits per second or Kbps, at which video should + be encoded. If omitted, encoder sets it automatically to try and match the quality of the input + video. + :type bitrate_kbps: str + :param frame_rate: The frame rate (in frames per second) of the encoded video. The value must + be greater than zero, and less than or equal to 300. If omitted, the encoder uses the average + frame rate of the input video. + :type frame_rate: str + :param scale: Describes the resolution of the encoded video. If omitted, the encoder uses the + resolution of the input video. + :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): + """A custom preset for encoding video with the H.264 (AVC) 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 maximum bitrate, in kilobits per second or Kbps, at which video should + be encoded. If omitted, encoder sets it automatically to try and match the quality of the input + video. + :type bitrate_kbps: str + :param frame_rate: The frame rate (in frames per second) of the encoded video. The value must + be greater than zero, and less than or equal to 300. If omitted, the encoder uses the average + frame rate of the input video. + :type frame_rate: str + :param scale: Describes the resolution of the encoded video. If omitted, the encoder uses the + resolution of the input video. + :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. @@ -1496,7 +3630,8 @@ class VideoEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :param title: Optional video title provided by the user. Value can be up to 256 characters long. @@ -1504,16 +3639,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". + :ivar type_properties_type: Video content type. Different content types are suitable for + different applications and scenarios. Possible values include: "Archive", "File". :vartype 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 = { @@ -1523,7 +3660,7 @@ class VideoEntity(ProxyResource): '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 +3673,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__( @@ -1545,13 +3683,13 @@ def __init__( **kwargs ): super(VideoEntity, self).__init__(**kwargs) - self.system_data = None self.title = kwargs.get('title', None) self.description = kwargs.get('description', None) self.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 +3727,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 +3753,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 +3786,215 @@ 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): + """Optional flags used to change how video is published. These are only allowed for topologies where "kind" is set to "live". + + :param disable_archive: When set to 'true' content will not be archived or recorded. This is + used, for example, when the topology is used only for low latency video streaming. Default is + 'false'. If set to 'true', then "disableRtspPublishing" must be set to 'false'. + :type disable_archive: str + :param disable_rtsp_publishing: When set to 'true' the RTSP playback URL will not be published, + disabling low latency streaming. This is used, for example, when the topology is used only for + archiving content. Default is 'false'. If set to 'true', then "disableArchive" must be set to + 'false'. + :type disable_rtsp_publishing: str + :param disable_video_preview_image: When set to 'true' preview images will not be generated. + This is used, for example, when the topology is used only for low latency video streaming. + Default is 'false'. If set to 'false', then "disableArchive" must be set to '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'. If the mode + is 'Pad' or 'Stretch' then both width and height must be specified. Else if the mode is + 'PreserveAspectRatio' then only one of width or height need be provided. 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): + """A sequence of absolute datetime ranges as a string. The datetime values should follow IS08601, and the sum of the ranges should add up to 24 hours or less. Currently, there can be only one range specified in the sequence. + + 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 sequence of datetime ranges. Example: '[["2021-10-05T03:30:00Z", + "2021-10-05T03:40:00Z"]]'. + :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 in a live topology allows for video and audio to be captured, optionally archived, and published via a video resource. If archiving is enabled, this results in a video of type 'archive'. If used in a batch topology, this allows for video and audio to be stored as a file, and published via a video resource of type 'file'. + + 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 resource used to capture and + publish content. Note: if downstream of RTSP source, and if disableArchive is set to true, then + no content is archived. + :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: Options to change how the video sink publishes content via the + video resource. This property is only allowed for topologies where "kind" is set to "live". + :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): + """Video source allows for content from a Video Analyzer video resource to be ingested into a pipeline. Currently supported only with batch pipelines. + + 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. Name of the Video Analyzer video resource to be used as the + source. + :type video_name: str + :param time_sequences: Required. Describes a sequence of datetime ranges. The video source only + picks up recorded media within these ranges. + :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..bc02bcd31e26d 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 @@ -28,18 +28,23 @@ class Resource(msrest.serialization.Model): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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'}, } def __init__( @@ -50,6 +55,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None class ProxyResource(Resource): @@ -65,18 +71,23 @@ class ProxyResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'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'}, } def __init__( @@ -87,7 +98,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. @@ -99,7 +110,8 @@ class AccessPolicyEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :param role: Defines the access level granted by this policy. Possible values include: "Reader". @@ -132,7 +144,6 @@ def __init__( **kwargs ): super(AccessPolicyEntity, self).__init__(**kwargs) - self.system_data = None self.role = role self.authentication = authentication @@ -209,6 +220,78 @@ def __init__( self.status = None +class AudioEncoderBase(msrest.serialization.Model): + """Base type for all audio encoder presets, which define the recipe or instructions on how audio should be processed. + + 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: Bitrate, in kilobits per second or Kbps, at which audio should be encoded + (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, + 192, 224, and 256. If omitted, the bitrate of the input audio is used. + :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): + """A custom preset for encoding audio with the 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: Bitrate, in kilobits per second or Kbps, at which audio should be encoded + (2-channel stereo audio at a sampling rate of 48 kHz). Allowed values are 96, 112, 128, 160, + 192, 224, and 256. If omitted, the bitrate of the input audio is used. + :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 +324,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 +414,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. @@ -403,7 +550,8 @@ class EdgeModuleEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :ivar edge_module_id: Internal ID generated for the instance of the Video Analyzer edge module. :vartype edge_module_id: str @@ -430,7 +578,6 @@ def __init__( **kwargs ): super(EdgeModuleEntity, self).__init__(**kwargs) - self.system_data = None self.edge_module_id = None @@ -494,15 +641,16 @@ def __init__( self.token = None -class Endpoint(msrest.serialization.Model): - """The endpoint details. +class EncoderPresetBase(msrest.serialization.Model): + """Base type for all encoder presets, which define the recipe or instructions on how the input content should be processed. + + 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,495 +658,1878 @@ 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): + """Describes a custom preset for encoding the input content using the encoder processor. - 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: Describes a custom preset for encoding audio. + :type audio_encoder: ~video_analyzer.models.AudioEncoderBase + :param video_encoder: Describes a custom preset for encoding video. + :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): + """Encoder processor allows for encoding of the input content. For example, it can used to change the resolution from 4K to 1280x720. 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, which defines the recipe or instructions on how + the input content should be processed. + :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 + super(EncoderProcessor, self).__init__(name=name, inputs=inputs, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderProcessor' # type: str + self.preset = preset + + +class EncoderSystemPreset(EncoderPresetBase): + """Describes a built-in preset for encoding the input content using the encoder processor. + + 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. Name of the built-in encoding preset. 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 = { + 'type': {'required': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "EncoderSystemPresetType"], + **kwargs + ): + super(EncoderSystemPreset, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EncoderSystemPreset' # type: str + self.name = 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, + *, + type: Union[str, "VideoAnalyzerEndpointType"], + endpoint_url: Optional[str] = None, + **kwargs + ): + super(Endpoint, self).__init__(**kwargs) + self.endpoint_url = endpoint_url + self.type = 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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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, + *, + url: str, + credentials: Optional["CredentialsBase"] = None, + tunnel: Optional["TunnelBase"] = None, + **kwargs + ): + super(EndpointBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.credentials = credentials + self.url = url + self.tunnel = tunnel + + +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, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class GroupLevelAccessControl(msrest.serialization.Model): + """Group level network access control. + + :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, + *, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + **kwargs + ): + super(GroupLevelAccessControl, self).__init__(**kwargs) + self.public_network_access = public_network_access + + +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 resource identifier. + :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. +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 a unique instance of a live topology, used for real-time ingestion, archiving and publishing of content for a unique RTSP camera. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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: Maximum bitrate capacity in Kbps reserved for the live pipeline. The + allowed range is from 500 to 3000 Kbps in increments of 100 Kbps. If the RTSP camera exceeds + this capacity, then the service will disconnect temporarily from the camera. It will retry to + re-establish connection (with exponential backoff), checking to see if the camera bitrate is + now below the reserved capacity. Doing so will ensure that one 'noisy neighbor' does not affect + other live pipelines in your account. + :type bitrate_kbps: int + :ivar state: Current state of the pipeline (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.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 LivePipelineUpdate(ProxyResource): + """Live pipeline represents a unique instance of a live topology, used for real-time ingestion, archiving and publishing of content for a unique RTSP camera. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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: Maximum bitrate capacity in Kbps reserved for the live pipeline. The + allowed range is from 500 to 3000 Kbps in increments of 100 Kbps. If the RTSP camera exceeds + this capacity, then the service will disconnect temporarily from the camera. It will retry to + re-establish connection (with exponential backoff), checking to see if the camera bitrate is + now below the reserved capacity. Doing so will ensure that one 'noisy neighbor' does not affect + other live pipelines in your account. + :type bitrate_kbps: int + :ivar state: Current state of the pipeline (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(LivePipelineUpdate, self).__init__(**kwargs) + self.topology_name = topology_name + self.description = description + self.bitrate_kbps = bitrate_kbps + self.state = None + self.parameters = parameters + + +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): + """Network access control for video analyzer account. + + :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 + :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, + *, + 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): + """Pipeline job represents a unique instance of a batch topology, used for offline processing of selected portions of archived content. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: Reference to an existing pipeline topology. When activated, this pipeline + job 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 state of the pipeline (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The date-time by when this pipeline job will be automatically deleted from + your account. + :vartype expiration: ~datetime.datetime + :ivar error: Details about the error, in case the pipeline job fails. + :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.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): + """Details about the error for a failed pipeline job. + + :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 PipelineJobUpdate(ProxyResource): + """Pipeline job represents a unique instance of a batch topology, used for offline processing of selected portions of archived content. + + 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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param topology_name: Reference to an existing pipeline topology. When activated, this pipeline + job 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 state of the pipeline (read-only). Possible values include: "Processing", + "Canceled", "Completed", "Failed". + :vartype state: str or ~video_analyzer.models.PipelineJobState + :ivar expiration: The date-time by when this pipeline job will be automatically deleted from + your account. + :vartype expiration: ~datetime.datetime + :ivar error: Details about the error, in case the pipeline job fails. + :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(PipelineJobUpdate, self).__init__(**kwargs) + self.topology_name = topology_name + self.description = description + self.state = None + self.expiration = None + self.error = None + self.parameters = parameters + + +class PipelineTopology(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing content 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 captures content from a RTSP camera and archives the content can be reused across many different cameras, as long as the same processing is to 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. This allows individual pipelines refer to different values, such as individual cameras' RTSP endpoints and credentials. Overall a topology is composed of the following: + + +* Parameters: list of user defined parameters that can be references across the topology nodes. +* Sources: list of one or more data sources nodes such as an RTSP source which allows for content to be ingested from cameras. +* Processors: list of nodes which perform data analysis or transformations. +* 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 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 + :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: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :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. Describes the properties of a SKU. + :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 = { - 'key_identifier': {'required': True}, - 'current_key_identifier': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'kind': {'required': True}, + 'sku': {'required': True}, } _attribute_map = { - 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, - 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, + '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, *, - key_identifier: str, + 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(KeyVaultProperties, self).__init__(**kwargs) - self.key_identifier = key_identifier - self.current_key_identifier = None - + super(PipelineTopology, self).__init__(**kwargs) + self.kind = kind + self.sku = sku + self.description = description + self.parameters = parameters + self.sources = sources + self.processors = processors + self.sinks = sinks -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. +class PipelineTopologyCollection(msrest.serialization.Model): + """A collection of PipelineTopology items. - :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 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 """ - _validation = { - 'expiration_date': {'required': True}, - } - _attribute_map = { - 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': '[PipelineTopology]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, } def __init__( self, *, - expiration_date: datetime.datetime, + value: Optional[List["PipelineTopology"]] = None, + next_link: Optional[str] = None, **kwargs ): - super(ListProvisioningTokenInput, self).__init__(**kwargs) - self.expiration_date = expiration_date + super(PipelineTopologyCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link -class LogSpecification(msrest.serialization.Model): - """A diagnostic log emitted by service. +class PipelineTopologyUpdate(ProxyResource): + """Pipeline topology describes the processing steps to be applied when processing content 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 captures content from a RTSP camera and archives the content can be reused across many different cameras, as long as the same processing is to 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. This allows individual pipelines refer to different values, such as individual cameras' RTSP endpoints and credentials. Overall a topology is composed of the following: + + +* Parameters: list of user defined parameters that can be references across the topology nodes. +* Sources: list of one or more data sources nodes such as an RTSP source which allows for content to be ingested from cameras.\r\n - Processors: list of nodes which perform data analysis or transformations. + -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. - :ivar name: The diagnostic log category name. + :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 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 type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param kind: Topology kind. Possible values include: "Live", "Batch". + :type kind: str or ~video_analyzer.models.Kind + :param sku: Describes the properties of a SKU. + :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}, - 'display_name': {'readonly': True}, - 'blob_duration': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'blob_duration': {'key': 'blobDuration', '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: Optional[Union[str, "Kind"]] = None, + sku: Optional["Sku"] = None, + 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(LogSpecification, self).__init__(**kwargs) - self.name = None - self.display_name = None - self.blob_duration = None + super(PipelineTopologyUpdate, self).__init__(**kwargs) + self.kind = kind + self.sku = sku + self.description = description + self.parameters = parameters + self.sources = sources + self.processors = processors + self.sinks = sinks -class MetricDimension(msrest.serialization.Model): - """A metric dimension. +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 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 id: The ARM identifier for Private Endpoint. + :vartype id: str """ _validation = { - 'name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'to_be_exported_for_shoebox': {'readonly': True}, + 'id': {'readonly': True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'to_be_exported_for_shoebox': {'key': 'toBeExportedForShoebox', 'type': 'bool'}, + 'id': {'key': 'id', '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(PrivateEndpoint, self).__init__(**kwargs) + self.id = None -class MetricSpecification(msrest.serialization.Model): - """A metric emitted by service. +class PrivateEndpointConnection(Resource): + """The Private Endpoint Connection resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The metric name. + :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 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 type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :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}, - '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': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, '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'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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, *, - supported_aggregation_types: Optional[List[str]] = None, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = 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(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 Operation(msrest.serialization.Model): - """An operation. +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. - All required parameters must be populated in order to send to Azure. + :param value: Array of private endpoint connections. + :type value: list[~video_analyzer.models.PrivateEndpointConnection] + """ - :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 + _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 system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :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 = { - 'name': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', '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'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + '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, *, - 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, + required_zone_names: Optional[List[str]] = 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(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names -class OperationCollection(msrest.serialization.Model): - """A collection of Operation items. +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. - :param value: A collection of Operation items. - :type value: list[~video_analyzer.models.Operation] + :param value: Array of private link resources. + :type value: list[~video_analyzer.models.PrivateLinkResource] """ _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, } def __init__( self, *, - value: Optional[List["Operation"]] = None, + value: Optional[List["PrivateLinkResource"]] = None, **kwargs ): - super(OperationCollection, self).__init__(**kwargs) + super(PrivateLinkResourceListResult, self).__init__(**kwargs) self.value = value -class OperationDisplay(msrest.serialization.Model): - """Operation details. +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. - :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. + :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 = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': '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): @@ -1105,6 +2636,163 @@ def __init__( 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. Name of the IoT Hub. + :type iot_hub_name: str + :param device_id: Required. The IoT device id to use when establishing the remote tunnel. This + string is case-sensitive. + :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. @@ -1135,13 +2823,94 @@ def __init__( self.metric_specifications = None +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 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 = { + 'type': {'key': '@type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'inputs': {'key': 'inputs', 'type': '[NodeInput]'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.VideoSink': 'VideoSink'} + } + + def __init__( + self, + *, + name: str, + inputs: List["NodeInput"], + **kwargs + ): + super(SinkNodeBase, self).__init__(name=name, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.SinkNodeBase' # type: str + self.inputs = inputs + + +class Sku(msrest.serialization.Model): + """The SKU 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 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.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Union[str, "SkuName"], + **kwargs + ): + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None + + class StorageAccount(msrest.serialization.Model): """The details about the associated storage account. 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 +2920,7 @@ class StorageAccount(msrest.serialization.Model): """ _validation = { + 'id': {'required': True}, 'status': {'readonly': True}, } @@ -1163,7 +2933,7 @@ class StorageAccount(msrest.serialization.Model): def __init__( self, *, - id: Optional[str] = None, + id: str, identity: Optional["ResourceIdentity"] = None, **kwargs ): @@ -1173,73 +2943,165 @@ def __init__( self.status = None -class SyncStorageKeysInput(msrest.serialization.Model): - """The input to the sync storage keys request. +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. - :param id: The ID of the storage account resource. - :type id: str + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~video_analyzer.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~video_analyzer.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TimeSequenceBase(msrest.serialization.Model): + """A sequence of datetime ranges as a string. + + 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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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 = { - 'id': {'key': 'id', 'type': 'str'}, + '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, *, - id: Optional[str] = None, + url: str, + credentials: Optional["CredentialsBase"] = None, + tunnel: Optional["TunnelBase"] = None, + trusted_certificates: Optional["CertificateSource"] = None, + validation_options: Optional["TlsValidationOptions"] = None, **kwargs ): - super(SyncStorageKeysInput, self).__init__(**kwargs) - self.id = id + 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 SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. +class TlsValidationOptions(msrest.serialization.Model): + """Options for controlling the validation of TLS endpoints. - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :type created_by_type: str or ~video_analyzer.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :type last_modified_by_type: str or ~video_analyzer.models.CreatedByType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime + :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 = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + 'ignore_hostname': {'key': 'ignoreHostname', 'type': 'str'}, + 'ignore_signature': {'key': 'ignoreSignature', 'type': 'str'}, } def __init__( self, *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, + ignore_hostname: Optional[str] = None, + ignore_signature: Optional[str] = None, **kwargs ): - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at + super(TlsValidationOptions, self).__init__(**kwargs) + self.ignore_hostname = ignore_hostname + self.ignore_signature = ignore_signature class TokenClaim(msrest.serialization.Model): @@ -1290,6 +3152,9 @@ class TrackedResource(Resource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. @@ -1300,6 +3165,7 @@ class TrackedResource(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'location': {'required': True}, } @@ -1307,6 +3173,7 @@ class TrackedResource(Resource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, } @@ -1323,6 +3190,46 @@ 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: Describes the tunnel through which Video Analyzer can connect to the endpoint + URL. This is an optional property, typically used when the endpoint is behind a firewall. + :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 +3260,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. + """The Video Analyzer account. Variables are only populated by the server, and will be ignored when sending a request. @@ -1368,232 +3315,583 @@ class VideoAnalyzer(TrackedResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~video_analyzer.models.SystemData + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives. + :type location: str + :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 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 = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'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'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'VideoAnalyzerIdentity'}, + '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__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + 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) + self.identity = identity + 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): + """A collection of VideoAnalyzer items. + + :param value: A collection of VideoAnalyzer items. + :type value: list[~video_analyzer.models.VideoAnalyzer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VideoAnalyzer]'}, + } + + def __init__( + self, + *, + value: Optional[List["VideoAnalyzer"]] = None, + **kwargs + ): + super(VideoAnalyzerCollection, self).__init__(**kwargs) + self.value = value + + +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, + *, + 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): + """Status of video analyzer operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Operation identifier. + :type name: str + :param id: Operation resource ID. + :type id: str + :param start_time: Operation start time. + :type start_time: str + :param end_time: Operation end time. + :type end_time: str + :param status: Operation status. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'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, + id: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + status: 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 VideoAnalyzerPrivateEndpointConnectionOperationStatus(msrest.serialization.Model): + """Status of private endpoint connection operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Operation identifier. + :type name: str + :param id: Operation resource ID. + :type id: str + :param start_time: Operation start time. + :type start_time: str + :param end_time: Operation end time. + :type end_time: str + :param status: Operation status. + :type status: str + :param error: The error detail. + :type error: ~video_analyzer.models.ErrorDetail + """ + + _validation = { + 'name': {'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, + id: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + status: Optional[str] = None, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(VideoAnalyzerPrivateEndpointConnectionOperationStatus, 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 VideoAnalyzerUpdate(msrest.serialization.Model): + """The update operation for a Video Analyzer account. + + Variables are only populated by the server, and will be ignored when sending a request. + :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives. - :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 = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'system_data': {'readonly': True}, 'endpoints': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'identity': {'key': 'identity', 'type': 'VideoAnalyzerIdentity'}, '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__( self, *, - location: str, tags: Optional[Dict[str, str]] = None, 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) - self.system_data = None + super(VideoAnalyzerUpdate, self).__init__(**kwargs) + self.tags = tags self.identity = identity self.storage_accounts = storage_accounts self.endpoints = None self.encryption = encryption - - -class VideoAnalyzerCollection(msrest.serialization.Model): - """A collection of VideoAnalyzer items. - - :param value: A collection of VideoAnalyzer items. - :type value: list[~video_analyzer.models.VideoAnalyzer] + 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 = { - 'value': {'key': 'value', 'type': '[VideoAnalyzer]'}, + 'retention_period': {'key': 'retentionPeriod', 'type': 'str'}, } def __init__( self, *, - value: Optional[List["VideoAnalyzer"]] = None, + retention_period: Optional[str] = None, **kwargs ): - super(VideoAnalyzerCollection, self).__init__(**kwargs) - self.value = value + super(VideoArchival, self).__init__(**kwargs) + self.retention_period = retention_period -class VideoAnalyzerIdentity(msrest.serialization.Model): - """The managed identity for the Video Analyzer resource. +class VideoContentToken(msrest.serialization.Model): + """"Video content token grants access to the video content URLs.". - 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] + :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 = { - 'type': {'required': True}, + 'expiration_date': {'readonly': True}, + 'token': {'readonly': True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + 'token': {'key': 'token', 'type': 'str'}, } 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 - + super(VideoContentToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None -class VideoAnalyzerPropertiesUpdate(msrest.serialization.Model): - """Properties of the Video Analyzer account. - Variables are only populated by the server, and will be ignored when sending a request. +class VideoContentUrls(msrest.serialization.Model): + """Set of URLs to the video content. - :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. - :vartype endpoints: list[~video_analyzer.models.Endpoint] - :param encryption: The account encryption properties. - :type encryption: ~video_analyzer.models.AccountEncryption + :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 """ - _validation = { - 'endpoints': {'readonly': True}, + _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 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 title provided by the user. Value can be up to 256 characters long. + :type title: str + :param description: Optional description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :param segment_length: Segment length indicates the length of individual content 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 initial call to create the + video resource can lead to errors when uploading content to the archive. Default value is 30 + seconds. This property is only allowed for topologies where "kind" is set to "live". + :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 10 years, in 1 day increments. When absent (null), all video content is + retained indefinitely. This property is only allowed for topologies where "kind" is set to + "live". + :type retention_period: str + """ + _attribute_map = { - 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + '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, *, - storage_accounts: Optional[List["StorageAccount"]] = None, - encryption: Optional["AccountEncryption"] = None, + title: Optional[str] = None, + description: Optional[str] = None, + segment_length: Optional[str] = None, + retention_period: Optional[str] = None, **kwargs ): - super(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) - self.storage_accounts = storage_accounts - self.endpoints = None - self.encryption = encryption + super(VideoCreationProperties, self).__init__(**kwargs) + self.title = title + self.description = description + self.segment_length = segment_length + self.retention_period = retention_period -class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): - """VideoAnalyzerProperties. +class VideoEncoderBase(msrest.serialization.Model): + """Base type for all video encoding presets, which define the recipe or instructions on how the input video should be processed. - 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: VideoEncoderH264. - :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. - :vartype endpoints: list[~video_analyzer.models.Endpoint] - :param encryption: The account encryption properties. - :type encryption: ~video_analyzer.models.AccountEncryption + 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 maximum bitrate, in kilobits per second or Kbps, at which video should + be encoded. If omitted, encoder sets it automatically to try and match the quality of the input + video. + :type bitrate_kbps: str + :param frame_rate: The frame rate (in frames per second) of the encoded video. The value must + be greater than zero, and less than or equal to 300. If omitted, the encoder uses the average + frame rate of the input video. + :type frame_rate: str + :param scale: Describes the resolution of the encoded video. If omitted, the encoder uses the + resolution of the input video. + :type scale: ~video_analyzer.models.VideoScale """ _validation = { - 'endpoints': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, - 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, - 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + '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, *, - storage_accounts: Optional[List["StorageAccount"]] = None, - encryption: Optional["AccountEncryption"] = None, + bitrate_kbps: Optional[str] = None, + frame_rate: Optional[str] = None, + scale: Optional["VideoScale"] = None, **kwargs ): - super(VideoAnalyzerProperties, self).__init__(storage_accounts=storage_accounts, encryption=encryption, **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 VideoAnalyzerUpdate(msrest.serialization.Model): - """The update operation for a Video Analyzer account. +class VideoEncoderH264(VideoEncoderBase): + """A custom preset for encoding video with the H.264 (AVC) codec. - 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 tags: A set of tags. Resource tags. - :type tags: dict[str, str] - :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. - :vartype endpoints: list[~video_analyzer.models.Endpoint] - :param encryption: The account encryption properties. - :type encryption: ~video_analyzer.models.AccountEncryption + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param bitrate_kbps: The maximum bitrate, in kilobits per second or Kbps, at which video should + be encoded. If omitted, encoder sets it automatically to try and match the quality of the input + video. + :type bitrate_kbps: str + :param frame_rate: The frame rate (in frames per second) of the encoded video. The value must + be greater than zero, and less than or equal to 300. If omitted, the encoder uses the average + frame rate of the input video. + :type frame_rate: str + :param scale: Describes the resolution of the encoded video. If omitted, the encoder uses the + resolution of the input video. + :type scale: ~video_analyzer.models.VideoScale """ _validation = { - 'endpoints': {'readonly': True}, + 'type': {'required': True}, } _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'VideoAnalyzerIdentity'}, - 'storage_accounts': {'key': 'properties.storageAccounts', 'type': '[StorageAccount]'}, - 'endpoints': {'key': 'properties.endpoints', 'type': '[Endpoint]'}, - 'encryption': {'key': 'properties.encryption', 'type': 'AccountEncryption'}, + '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, *, - tags: Optional[Dict[str, str]] = None, - identity: Optional["VideoAnalyzerIdentity"] = None, - storage_accounts: Optional[List["StorageAccount"]] = None, - encryption: Optional["AccountEncryption"] = None, + bitrate_kbps: Optional[str] = None, + frame_rate: Optional[str] = None, + scale: Optional["VideoScale"] = None, **kwargs ): - super(VideoAnalyzerUpdate, self).__init__(**kwargs) - self.tags = tags - self.identity = identity - self.storage_accounts = storage_accounts - self.endpoints = None - self.encryption = encryption + 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. @@ -1605,7 +3903,8 @@ class VideoEntity(ProxyResource): :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: The system metadata relating to this resource. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~video_analyzer.models.SystemData :param title: Optional video title provided by the user. Value can be up to 256 characters long. @@ -1613,16 +3912,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". + :ivar type_properties_type: Video content type. Different content types are suitable for + different applications and scenarios. Possible values include: "Archive", "File". :vartype 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 = { @@ -1632,7 +3933,7 @@ class VideoEntity(ProxyResource): '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 +3946,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 +3956,17 @@ def __init__( *, title: Optional[str] = None, description: Optional[str] = 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.flags = None - self.streaming = None + self.content_urls = None self.media_info = None + self.archival = archival class VideoEntityCollection(msrest.serialization.Model): @@ -1704,23 +4007,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 +4031,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 +4070,239 @@ 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): + """Optional flags used to change how video is published. These are only allowed for topologies where "kind" is set to "live". + + :param disable_archive: When set to 'true' content will not be archived or recorded. This is + used, for example, when the topology is used only for low latency video streaming. Default is + 'false'. If set to 'true', then "disableRtspPublishing" must be set to 'false'. + :type disable_archive: str + :param disable_rtsp_publishing: When set to 'true' the RTSP playback URL will not be published, + disabling low latency streaming. This is used, for example, when the topology is used only for + archiving content. Default is 'false'. If set to 'true', then "disableArchive" must be set to + 'false'. + :type disable_rtsp_publishing: str + :param disable_video_preview_image: When set to 'true' preview images will not be generated. + This is used, for example, when the topology is used only for low latency video streaming. + Default is 'false'. If set to 'false', then "disableArchive" must be set to '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'. If the mode + is 'Pad' or 'Stretch' then both width and height must be specified. Else if the mode is + 'PreserveAspectRatio' then only one of width or height need be provided. 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): + """A sequence of absolute datetime ranges as a string. The datetime values should follow IS08601, and the sum of the ranges should add up to 24 hours or less. Currently, there can be only one range specified in the sequence. - :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 sequence of datetime ranges. Example: '[["2021-10-05T03:30:00Z", + "2021-10-05T03:40:00Z"]]'. + :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 in a live topology allows for video and audio to be captured, optionally archived, and published via a video resource. If archiving is enabled, this results in a video of type 'archive'. If used in a batch topology, this allows for video and audio to be stored as a file, and published via a video resource of type 'file'. + + 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 resource used to capture and + publish content. Note: if downstream of RTSP source, and if disableArchive is set to true, then + no content is archived. + :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: Options to change how the video sink publishes content via the + video resource. This property is only allowed for topologies where "kind" is set to "live". + :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): + """Video source allows for content from a Video Analyzer video resource to be ingested into a pipeline. Currently supported only with batch pipelines. + + 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. Name of the Video Analyzer video resource to be used as the + source. + :type video_name: str + :param time_sequences: Required. Describes a sequence of datetime ranges. The video source only + picks up recorded media within these ranges. + :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..cf225e110615a 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,56 @@ class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +class EncoderSystemPresetType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Name of the built-in encoding preset. + """ + + #: Produces an MP4 file where the video is encoded with H.264 codec at a picture height of 540 + #: pixels, and at a maximum bitrate of 2000 Kbps. Encoded video has the same average frame rate as + #: the input. The aspect ratio of the input is preserved. If the input content has audio, then it + #: is encoded with AAC-LC codec at 96 Kbps. + SINGLE_LAYER540_P_H264_AAC = "SingleLayer_540p_H264_AAC" + #: Produces an MP4 file where the video is encoded with H.264 codec at a picture height of 720 + #: pixels, and at a maximum bitrate of 3500 Kbps. Encoded video has the same average frame rate as + #: the input. The aspect ratio of the input is preserved. If the input content has audio, then it + #: is encoded with AAC-LC codec at 96 Kbps. + SINGLE_LAYER720_P_H264_AAC = "SingleLayer_720p_H264_AAC" + #: Produces an MP4 file where the video is encoded with H.264 codec at a picture height of 1080 + #: pixels, and at a maximum bitrate of 6000 Kbps. Encoded video has the same average frame rate as + #: the input. The aspect ratio of the input is preserved. If the input content has audio, then it + #: is encoded with AAC-LC codec at 128 Kbps. + SINGLE_LAYER1080_P_H264_AAC = "SingleLayer_1080p_H264_AAC" + #: Produces an MP4 file where the video is encoded with H.264 codec at a picture height of 2160 + #: pixels, and at a maximum bitrate of 16000 Kbps. Encoded video has the same average frame rate + #: as the input. The aspect ratio of the input is preserved. If the input content has audio, then + #: it is encoded with AAC-LC codec at 128 Kbps. + 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 state of the pipeline (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 +159,104 @@ 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 state of the pipeline (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. + """ + + #: Represents the Live S1 SKU name. Using this SKU you can create live pipelines to capture, + #: record, and stream live video from RTSP-capable cameras at bitrate settings from 0.5 Kbps to + #: 3000 Kbps. + LIVE_S1 = "Live_S1" + #: Represents the Batch S1 SKU name. Using this SKU you can create pipeline jobs to to process + #: recorded content. + BATCH_S1 = "Batch_S1" + +class SkuTier(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 +264,37 @@ 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'. If the mode is 'Pad' or + 'Stretch' then both width and height must be specified. Else if the mode is + 'PreserveAspectRatio' then only one of width or height need be provided. + """ + + #: 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..62393a002a63d 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,40 @@ # 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 ._operation_statuses_operations import OperationStatusesOperations +from ._operation_results_operations import OperationResultsOperations +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', + 'OperationStatusesOperations', + 'OperationResultsOperations', + '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..bc55cd89a9aa6 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. + Retrieves all existing access policy resources, along with their JSON representations. :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 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 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,15 +205,15 @@ 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. + Creates a new access policy resource 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 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,15 +282,15 @@ def delete( **kwargs # type: Any ): # type: (...) -> None - """Deletes an access policy. + """Deletes an existing access policy resource. - Deletes an existing access policy resource. + Deletes an existing access policy resource 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 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,15 +346,15 @@ 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. + Updates individual properties of an existing access policy resource 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 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..d0415efb1f008 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, along with their JSON representations. :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 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 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..3d5a77eb7619f --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_live_pipelines_operations.py @@ -0,0 +1,663 @@ +# 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 pipelines. + + Retrieves a list of live pipelines that have been created, along with their JSON + representations. + + :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" + """Retrieves a specific live pipeline by name. + + Retrieves a specific 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 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 + :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.LivePipelineUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.LivePipeline" + """Updates an existing live pipeline. + + Updates an existing live pipeline with the given name. Properties that can be updated include: + description, bitrateKbps, and parameter definitions. Only the description can be updated while + the live pipeline is active. + + :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.LivePipelineUpdate + :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, 'LivePipelineUpdate') + 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 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 + :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 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 + :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..75989ff00edaa 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 @@ -55,7 +55,7 @@ def check_name_availability( Checks whether the Video Analyzer resource name is available. - :param location_name: The name of the location. + :param location_name: Location Name. :type location_name: str :param parameters: The request parameters. :type parameters: ~video_analyzer.models.CheckNameAvailabilityRequest @@ -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/_operation_results_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operation_results_operations.py new file mode 100644 index 0000000000000..fe8d88823e702 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operation_results_operations.py @@ -0,0 +1,182 @@ +# 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.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, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationResultsOperations(object): + """OperationResultsOperations 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_initial( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.PrivateEndpointConnection"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_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_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'), + 'name': self._serialize.url("name", 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, 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}/operationResults/{operationId}'} # type: ignore + + def begin_get( + self, + resource_group_name, # type: str + account_name, # type: str + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PrivateEndpointConnection"] + """Get operation result. + + Get private endpoint connection operation result. + + :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: Private endpoint connection name. + :type name: str + :param operation_id: Operation Id. + :type operation_id: 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 PrivateEndpointConnection or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~video_analyzer.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + 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._get_initial( + resource_group_name=resource_group_name, + account_name=account_name, + name=name, + operation_id=operation_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'operationId': self._serialize.url("operation_id", operation_id, '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_get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/privateEndpointConnections/{name}/operationResults/{operationId}'} # type: ignore diff --git a/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operation_statuses_operations.py b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_operation_statuses_operations.py new file mode 100644 index 0000000000000..d5ae754d78062 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_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 OperationStatusesOperations(object): + """OperationStatusesOperations 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 + name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VideoAnalyzerPrivateEndpointConnectionOperationStatus" + """Get operation status. + + Get private endpoint connection operation status. + + :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: Private endpoint connection name. + :type name: str + :param operation_id: Operation Id. + :type operation_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerPrivateEndpointConnectionOperationStatus, or the result of cls(response) + :rtype: ~video_analyzer.models.VideoAnalyzerPrivateEndpointConnectionOperationStatus + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzerPrivateEndpointConnectionOperationStatus"] + 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'), + '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('VideoAnalyzerPrivateEndpointConnectionOperationStatus', 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}/operationStatuses/{operationId}'} # type: ignore 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..a734e3568bc09 --- /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 with the given operationId. + + :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..b0135e4e436d4 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_jobs_operations.py @@ -0,0 +1,542 @@ +# 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 all live pipelines that have been created, along with their JSON + representations. + + :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 specific pipeline job by name. + + Retrieves a specific 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 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 + :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.PipelineJobUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineJob" + """Updates an existing pipeline job. + + Updates an existing pipeline job with the given name. Properties that can be updated include: + description. + + :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.PipelineJobUpdate + :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, 'PipelineJobUpdate') + 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 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 + :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..11f276a054709 --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_pipeline_topologies_operations.py @@ -0,0 +1,426 @@ +# 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 to the account, if any, along with + their JSON representation. + + :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" + """Retrieves a specific pipeline topology by name. + + Retrieves a specific 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 describes the processing steps to be applied when processing content 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. + + :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.PipelineTopologyUpdate" + **kwargs # type: Any + ): + # type: (...) -> "_models.PipelineTopology" + """Updates an existing pipeline topology. + + Updates an existing pipeline topology with the given name. If the associated live pipelines or + pipeline jobs are in active or processing state, respectively, then only the description can be + updated. Else, the properties that can be updated include: description, parameter declarations, + sources, processors, and sinks. + + :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.PipelineTopologyUpdate + :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, 'PipelineTopologyUpdate') + 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..c3b766fd902b8 --- /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 under 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 + :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 under 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 name: Private endpoint connection 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 state under 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 name: Private endpoint connection 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 [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) + + 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 under 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 name: Private endpoint connection 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..939af8cae0e44 --- /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 for 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 + :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 for 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 name: Name of the private link resource (Group ID). + :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..c24cfd8cc7bed --- /dev/null +++ b/sdk/videoanalyzer/azure-mgmt-videoanalyzer/azure/mgmt/videoanalyzer/operations/_video_analyzer_operation_results_operations.py @@ -0,0 +1,168 @@ +# 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.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, Optional, TypeVar, Union + + 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_initial( + self, + location_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.VideoAnalyzer"] + 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_initial.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'), + '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, 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_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{operationId}'} # type: ignore + + def begin_get( + self, + location_name, # type: str + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VideoAnalyzer"] + """Get operation result. + + Get video analyzer operation result. + + :param location_name: Location name. + :type location_name: str + :param operation_id: Operation Id. + :type operation_id: 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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~video_analyzer.models.VideoAnalyzer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._get_initial( + location_name=location_name, + operation_id=operation_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'operationId': self._serialize.url("operation_id", operation_id, '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_get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationResults/{operationId}'} # 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..06a067e8df24c --- /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 + operation_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VideoAnalyzerOperationStatus" + """Get operation status. + + Get video analyzer operation status. + + :param location_name: Location name. + :type location_name: str + :param operation_id: Operation Id. + :type operation_id: 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'), + '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('VideoAnalyzerOperationStatus', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/videoAnalyzerOperationStatuses/{operationId}'} # 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..05b6b1a521c24 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 @@ -11,7 +11,9 @@ 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.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 @@ -66,14 +68,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 +129,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) @@ -164,7 +166,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - def create_or_update( + def _create_or_update_initial( self, resource_group_name, # type: str account_name, # type: str @@ -172,35 +174,20 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> "_models.VideoAnalyzer" - """Create or update a Video Analyzer account. - - Create or update an instance of a 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.VideoAnalyzer - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] 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" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_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, 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,17 +213,95 @@ 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 + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "_models.VideoAnalyzer" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.VideoAnalyzer"] + """Create or update a Video Analyzer account. + + Create or update an instance of a 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.VideoAnalyzer + :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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~video_analyzer.models.VideoAnalyzer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._create_or_update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + } + + 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_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore def delete( self, @@ -263,14 +328,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) @@ -297,7 +362,7 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - def update( + def _update_initial( self, resource_group_name, # type: str account_name, # type: str @@ -305,35 +370,20 @@ def update( **kwargs # type: Any ): # type: (...) -> "_models.VideoAnalyzer" - """Update a Video Analyzer account. - - Updates an existing instance of 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.VideoAnalyzerUpdate - :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 - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] 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" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.update.metadata['url'] # type: ignore + url = self._update_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, 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,86 +404,101 @@ 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 + _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore - def sync_storage_keys( + def begin_update( self, resource_group_name, # type: str account_name, # type: str - parameters, # type: "_models.SyncStorageKeysInput" + parameters, # type: "_models.VideoAnalyzerUpdate" **kwargs # type: Any ): - # type: (...) -> None - """Synchronizes Storage Account Keys. + # type: (...) -> LROPoller["_models.VideoAnalyzer"] + """Update a Video Analyzer account. - Synchronizes storage account keys for a storage account associated with the Video Analyzer - account. + Updates an existing instance of 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 + :type parameters: ~video_analyzer.models.VideoAnalyzerUpdate :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 + :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 VideoAnalyzer or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~video_analyzer.models.VideoAnalyzer] + :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" + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.VideoAnalyzer"] + 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._update_initial( + resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + 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, response_headers) + return deserialized - # 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\._\(\)]+$'), + '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['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 + 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_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore def list_by_subscription( self, @@ -442,7 +507,7 @@ def list_by_subscription( # type: (...) -> "_models.VideoAnalyzerCollection" """List Video Analyzer accounts. - Lists the Video Analyzer accounts in the specific subscription. + List all Video Analyzer accounts in the specified subscription. :keyword callable cls: A custom type or function that will be passed the direct response :return: VideoAnalyzerCollection, or the result of cls(response) @@ -454,7 +519,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..31265c5126e20 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 @@ -53,9 +53,10 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.VideoEntityCollection"] - """List all existing video resources. + """Retrieves all existing video resources. - List all existing video resources in the specified account. + Retrieves a list of video resources that have been created, along with their JSON + representations. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str @@ -75,7 +76,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 +89,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 +139,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 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 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 +159,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 +206,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 video resource 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 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 +228,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 +236,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 +283,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 +291,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 +303,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,15 +347,15 @@ 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. + Updates individual properties of an existing video resource 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 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 +369,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 +377,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 +412,43 @@ 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, + for a video resource 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 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 +471,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