From 7cc7ba68c44a7242d04ef5bb79e08a627c126edb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 23 Apr 2021 07:26:03 +0000 Subject: [PATCH] CodeGen from PR 13838 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.Media to add version preview/2021-05-01-preview (#13838) * New Readme Config File * New Go Language Readme Config File * New Azure AZ Readme Config File * New Azure CLI Readme Config File * New Typescript Language Readme Config File * New Python Language Readme Config File * New C# Language Readme Config File * New AzureResourceSchema Readme Config File * New Swagger Spec File * New Swagger Example Spec File * Copy Signed off 2021-03-01 swaggers here * Update swaggers to 2021=05-01-preview * add missing examples * update title * fix Operation id * fix video analyzer examples * update Video swagger * add format for $top * remove unnecessary example file * use chackname definitions from types.json * fix segment length readonly * change getStreamingToken to listStreamingToken, getProvisioningToken to listProvisioningToken * fix the example file name * fix a readonly issue with a video property * make type readonly * edits to descriptions * adding missing descriptions * address review feedback, * few cleanup for update class Co-authored-by: Christopher Bennage --- src/videoanalyzer/HISTORY.rst | 8 + src/videoanalyzer/README.md | 116 ++ .../azext_videoanalyzer/__init__.py | 50 + .../azext_videoanalyzer/action.py | 17 + .../azext_videoanalyzer/azext_metadata.json | 4 + .../azext_videoanalyzer/custom.py | 17 + .../azext_videoanalyzer/generated/__init__.py | 12 + .../generated/_client_factory.py | 32 + .../azext_videoanalyzer/generated/_help.py | 342 +++ .../azext_videoanalyzer/generated/_params.py | 203 ++ .../generated/_validators.py | 9 + .../azext_videoanalyzer/generated/action.py | 73 + .../azext_videoanalyzer/generated/commands.py | 73 + .../azext_videoanalyzer/generated/custom.py | 297 +++ .../azext_videoanalyzer/manual/__init__.py | 12 + .../azext_videoanalyzer/tests/__init__.py | 116 ++ .../tests/latest/__init__.py | 12 + .../tests/latest/example_steps.py | 308 +++ .../latest/test_videoanalyzer_scenario.py | 142 ++ .../vendored_sdks/__init__.py | 12 + .../vendored_sdks/videoanalyzer/__init__.py | 16 + .../videoanalyzer/_azure_video_analyzer.py | 94 + .../videoanalyzer/_configuration.py | 76 + .../videoanalyzer/aio/__init__.py | 10 + .../aio/_azure_video_analyzer.py | 88 + .../videoanalyzer/aio/_configuration.py | 72 + .../videoanalyzer/aio/operations/__init__.py | 23 + .../operations/_access_policies_operations.py | 409 ++++ .../operations/_edge_modules_operations.py | 433 ++++ .../aio/operations/_locations_operations.py | 106 + .../aio/operations/_operations.py | 90 + .../operations/_video_analyzers_operations.py | 479 +++++ .../aio/operations/_videos_operations.py | 474 +++++ .../videoanalyzer/models/__init__.py | 182 ++ .../models/_azure_video_analyzer_enums.py | 106 + .../videoanalyzer/models/_models.py | 1710 +++++++++++++++ .../videoanalyzer/models/_models_py3.py | 1831 +++++++++++++++++ .../videoanalyzer/operations/__init__.py | 23 + .../operations/_access_policies_operations.py | 418 ++++ .../operations/_edge_modules_operations.py | 442 ++++ .../operations/_locations_operations.py | 111 + .../videoanalyzer/operations/_operations.py | 95 + .../operations/_video_analyzers_operations.py | 490 +++++ .../operations/_videos_operations.py | 484 +++++ .../vendored_sdks/videoanalyzer/py.typed | 1 + src/videoanalyzer/report.md | 409 ++++ src/videoanalyzer/setup.cfg | 1 + src/videoanalyzer/setup.py | 58 + 48 files changed, 10586 insertions(+) create mode 100644 src/videoanalyzer/HISTORY.rst create mode 100644 src/videoanalyzer/README.md create mode 100644 src/videoanalyzer/azext_videoanalyzer/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/action.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/azext_metadata.json create mode 100644 src/videoanalyzer/azext_videoanalyzer/custom.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/_client_factory.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/_help.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/_params.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/_validators.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/action.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/commands.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/generated/custom.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/manual/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/tests/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/tests/latest/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/tests/latest/example_steps.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/tests/latest/test_videoanalyzer_scenario.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_azure_video_analyzer.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_configuration.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_azure_video_analyzer.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_configuration.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_access_policies_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_edge_modules_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_locations_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_video_analyzers_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_videos_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_azure_video_analyzer_enums.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models_py3.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/__init__.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_access_policies_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_edge_modules_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_locations_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_video_analyzers_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_videos_operations.py create mode 100644 src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/py.typed create mode 100644 src/videoanalyzer/report.md create mode 100644 src/videoanalyzer/setup.cfg create mode 100644 src/videoanalyzer/setup.py diff --git a/src/videoanalyzer/HISTORY.rst b/src/videoanalyzer/HISTORY.rst new file mode 100644 index 00000000000..1c139576ba0 --- /dev/null +++ b/src/videoanalyzer/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. diff --git a/src/videoanalyzer/README.md b/src/videoanalyzer/README.md new file mode 100644 index 00000000000..5e2827d0975 --- /dev/null +++ b/src/videoanalyzer/README.md @@ -0,0 +1,116 @@ +# Azure CLI videoanalyzer Extension # +This is the extension for videoanalyzer + +### How to use ### +Install this extension using the below CLI command +``` +az extension add --name videoanalyzer +``` + +### Included Features ### +#### videoanalyzer video-analyzer #### +##### Create ##### +``` +az videoanalyzer video-analyzer create --account-name "contosotv" --video-analyzer-identity-type "UserAssigned" \ + --user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1\\":{},\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2\\":{},\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id3\\":{}}" \ + --location "South Central US" --type "SystemKey" \ + --storage-accounts id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/storage1" user-assigned-identity="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2" \ + --tags tag1="value1" tag2="value2" --resource-group "contoso" +``` +##### Show ##### +``` +az videoanalyzer video-analyzer show --account-name "contosotv" --resource-group "contoso" +``` +##### List ##### +``` +az videoanalyzer video-analyzer list --resource-group "contoso" +``` +##### Update ##### +``` +az videoanalyzer video-analyzer update --account-name "contosotv" --tags key1="value3" --resource-group "contoso" +``` +##### Sync-storage-key ##### +``` +az videoanalyzer video-analyzer sync-storage-key --account-name "contosotv" \ + --id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts/contosotvstore" \ + --resource-group "contoso" +``` +##### Delete ##### +``` +az videoanalyzer video-analyzer delete --account-name "contosotv" --resource-group "contoso" +``` +#### videoanalyzer edge-module #### +##### Create ##### +``` +az videoanalyzer edge-module create --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +##### Show ##### +``` +az videoanalyzer edge-module show --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +##### List ##### +``` +az videoanalyzer edge-module list --account-name "testaccount2" --resource-group "testrg" +``` +##### List-provisioning-token ##### +``` +az videoanalyzer edge-module list-provisioning-token --account-name "testaccount2" --name "edgeModule1" \ + --expiration-date "3021-01-23T11:04:49.0526841-08:00" --resource-group "testrg" +``` +##### Delete ##### +``` +az videoanalyzer edge-module delete --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +#### videoanalyzer video #### +##### Create ##### +``` +az videoanalyzer video create --account-name "testaccount2" --description "Sample Description 1" \ + --title "Sample Title 1" --resource-group "testrg" --name "video1" +``` +##### Show ##### +``` +az videoanalyzer video show --account-name "testaccount2" --resource-group "testrg" --name "video1" +``` +##### List ##### +``` +az videoanalyzer video list --top "2" --account-name "testaccount2" --resource-group "testrg" +``` +##### Update ##### +``` +az videoanalyzer video update --account-name "testaccount2" --description "Parking Lot East Entrance" \ + --resource-group "testrg" --name "video1" +``` +##### List-streaming-token ##### +``` +az videoanalyzer video list-streaming-token --account-name "testaccount2" --resource-group "testrg" --name "video3" +``` +##### Delete ##### +``` +az videoanalyzer video delete --account-name "testaccount2" --resource-group "testrg" --name "video1" +``` +#### videoanalyzer access-policy #### +##### Create ##### +``` +az videoanalyzer access-policy create --name "accessPolicyName1" --account-name "testaccount2" \ + --authentication "{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"audiences\\":[\\"audience1\\"],\\"claims\\":[{\\"name\\":\\"claimname1\\",\\"value\\":\\"claimvalue1\\"},{\\"name\\":\\"claimname2\\",\\"value\\":\\"claimvalue2\\"}],\\"issuers\\":[\\"issuer1\\",\\"issuer2\\"],\\"keys\\":[{\\"@type\\":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"},{\\"@type\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\":\\"ES256\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}]}" \ + --resource-group "testrg" +``` +##### Show ##### +``` +az videoanalyzer access-policy show --name "accessPolicyName1" --account-name "testaccount2" --resource-group "testrg" +``` +##### List ##### +``` +az videoanalyzer access-policy list --top "2" --account-name "testaccount2" --resource-group "testrg" +``` +##### Update ##### +``` +az videoanalyzer access-policy update --name "accessPolicyName1" --account-name "testaccount2" \ + --authentication "{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"keys\\":[{\\"@type\\":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"},{\\"@type\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\":\\"Updated\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}]}" \ + --resource-group "testrg" +``` +##### Delete ##### +``` +az videoanalyzer access-policy delete --name "accessPolicyName1" --account-name "testaccount2" \ + --resource-group "testrg" +``` \ No newline at end of file diff --git a/src/videoanalyzer/azext_videoanalyzer/__init__.py b/src/videoanalyzer/azext_videoanalyzer/__init__.py new file mode 100644 index 00000000000..ba0cba987c8 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/__init__.py @@ -0,0 +1,50 @@ +# -------------------------------------------------------------------------- +# 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 azure.cli.core import AzCommandsLoader +from azext_videoanalyzer.generated._help import helps # pylint: disable=unused-import +try: + from azext_videoanalyzer.manual._help import helps # pylint: disable=reimported +except ImportError: + pass + + +class AzureVideoAnalyzerCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_videoanalyzer.generated._client_factory import cf_videoanalyzer_cl + videoanalyzer_custom = CliCommandType( + operations_tmpl='azext_videoanalyzer.custom#{}', + client_factory=cf_videoanalyzer_cl) + parent = super(AzureVideoAnalyzerCommandsLoader, self) + parent.__init__(cli_ctx=cli_ctx, custom_command_type=videoanalyzer_custom) + + def load_command_table(self, args): + from azext_videoanalyzer.generated.commands import load_command_table + load_command_table(self, args) + try: + from azext_videoanalyzer.manual.commands import load_command_table as load_command_table_manual + load_command_table_manual(self, args) + except ImportError: + pass + return self.command_table + + def load_arguments(self, command): + from azext_videoanalyzer.generated._params import load_arguments + load_arguments(self, command) + try: + from azext_videoanalyzer.manual._params import load_arguments as load_arguments_manual + load_arguments_manual(self, command) + except ImportError: + pass + + +COMMAND_LOADER_CLS = AzureVideoAnalyzerCommandsLoader diff --git a/src/videoanalyzer/azext_videoanalyzer/action.py b/src/videoanalyzer/azext_videoanalyzer/action.py new file mode 100644 index 00000000000..d95d53bf711 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/action.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.action import * # noqa: F403 +try: + from .manual.action import * # noqa: F403 +except ImportError: + pass diff --git a/src/videoanalyzer/azext_videoanalyzer/azext_metadata.json b/src/videoanalyzer/azext_videoanalyzer/azext_metadata.json new file mode 100644 index 00000000000..cfc30c747c7 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/azext_metadata.json @@ -0,0 +1,4 @@ +{ + "azext.isExperimental": true, + "azext.minCliCoreVersion": "2.15.0" +} \ No newline at end of file diff --git a/src/videoanalyzer/azext_videoanalyzer/custom.py b/src/videoanalyzer/azext_videoanalyzer/custom.py new file mode 100644 index 00000000000..dbe9d5f9742 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/custom.py @@ -0,0 +1,17 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=wildcard-import +# pylint: disable=unused-wildcard-import + +from .generated.custom import * # noqa: F403 +try: + from .manual.custom import * # noqa: F403 +except ImportError: + pass diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/__init__.py b/src/videoanalyzer/azext_videoanalyzer/generated/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/_client_factory.py b/src/videoanalyzer/azext_videoanalyzer/generated/_client_factory.py new file mode 100644 index 00000000000..a4d1c4c22bd --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/_client_factory.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + + +def cf_videoanalyzer_cl(cli_ctx, *_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_videoanalyzer.vendored_sdks.videoanalyzer import AzureVideoAnalyzer + return get_mgmt_service_client(cli_ctx, + AzureVideoAnalyzer) + + +def cf_video_analyzer(cli_ctx, *_): + return cf_videoanalyzer_cl(cli_ctx).video_analyzers + + +def cf_edge_module(cli_ctx, *_): + return cf_videoanalyzer_cl(cli_ctx).edge_modules + + +def cf_video(cli_ctx, *_): + return cf_videoanalyzer_cl(cli_ctx).videos + + +def cf_access_policy(cli_ctx, *_): + return cf_videoanalyzer_cl(cli_ctx).access_policies diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/_help.py b/src/videoanalyzer/azext_videoanalyzer/generated/_help.py new file mode 100644 index 00000000000..b0ece445b31 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/_help.py @@ -0,0 +1,342 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.help_files import helps + + +helps['videoanalyzer video-analyzer'] = """ + type: group + short-summary: Manage video analyzer with videoanalyzer +""" + +helps['videoanalyzer video-analyzer list'] = """ + type: command + short-summary: "Lists the Video Analyzer accounts in the specified resource group. And Lists the Video Analyzer \ +accounts in the specific subscription." + examples: + - name: List all Video Analyzer accounts + text: |- + az videoanalyzer video-analyzer list --resource-group "contoso" + - name: List all Video Analyzer accounts by subscription + text: |- + az videoanalyzer video-analyzer list +""" + +helps['videoanalyzer video-analyzer show'] = """ + type: command + short-summary: "Get the details of the specified Video Analyzer account." + examples: + - name: Get a Video Analyzer account by name + text: |- + az videoanalyzer video-analyzer show --account-name "contosotv" --resource-group "contoso" +""" + +helps['videoanalyzer video-analyzer create'] = """ + type: command + short-summary: "Create an instance of a Video Analyzer account." + parameters: + - name: --storage-accounts + short-summary: "The storage accounts for this resource." + long-summary: | + Usage: --storage-accounts id=XX user-assigned-identity=XX + + 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 Microsoft.ClassicStorage or Microsoft.Storage). + user-assigned-identity: The user assigned managed identity's resource identifier to use when accessing a \ +resource. + + Multiple actions can be specified by using more than one --storage-accounts argument. + examples: + - name: Create a Video Analyzer account + text: |- + az videoanalyzer video-analyzer create --account-name "contosotv" --video-analyzer-identity-type \ +"UserAssigned" --user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/pr\ +oviders/Microsoft.ManagedIdentity/userAssignedIdentities/id1\\":{},\\"/subscriptions/00000000-0000-0000-0000-0000000000\ +00/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2\\":{},\\"/subscriptions/00000000-00\ +00-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id3\\":{}}" \ +--location "South Central US" --type "SystemKey" --storage-accounts id="/subscriptions/00000000-0000-0000-0000-00000000\ +0000/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/storage1" user-assigned-identity="/subscriptions/000\ +00000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2" \ +--tags tag1="value1" tag2="value2" --resource-group "contoso" +""" + +helps['videoanalyzer video-analyzer update'] = """ + type: command + short-summary: "Updates an existing instance of Video Analyzer account." + parameters: + - name: --storage-accounts + short-summary: "The storage accounts for this resource." + long-summary: | + Usage: --storage-accounts id=XX user-assigned-identity=XX + + 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 Microsoft.ClassicStorage or Microsoft.Storage). + user-assigned-identity: The user assigned managed identity's resource identifier to use when accessing a \ +resource. + + Multiple actions can be specified by using more than one --storage-accounts argument. + examples: + - name: Update a Video Analyzer accounts + text: |- + az videoanalyzer video-analyzer update --account-name "contosotv" --tags key1="value3" --resource-group \ +"contoso" +""" + +helps['videoanalyzer video-analyzer delete'] = """ + type: command + short-summary: "Delete the specified Video Analyzer account." + examples: + - name: Delete a Video Analyzer account + text: |- + az videoanalyzer video-analyzer delete --account-name "contosotv" --resource-group "contoso" +""" + +helps['videoanalyzer video-analyzer sync-storage-key'] = """ + type: command + short-summary: "Synchronizes storage account keys for a storage account associated with the Video Analyzer \ +account." + examples: + - name: Synchronizes Storage Account Keys + text: |- + az videoanalyzer video-analyzer sync-storage-key --account-name "contosotv" --id \ +"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts\ +/contosotvstore" --resource-group "contoso" +""" + +helps['videoanalyzer edge-module'] = """ + type: group + short-summary: Manage edge module with videoanalyzer +""" + +helps['videoanalyzer edge-module list'] = """ + type: command + short-summary: "List all of the existing edge module resources for a given Video Analyzer account." + examples: + - name: Lists the registered edge modules. + text: |- + az videoanalyzer edge-module list --account-name "testaccount2" --resource-group "testrg" +""" + +helps['videoanalyzer edge-module show'] = """ + type: command + short-summary: "Retrieves a specific existing edge module resource in the given Video Analyzer account." + examples: + - name: Gets edge module registration. + text: |- + az videoanalyzer edge-module show --account-name "testaccount2" --name "edgeModule1" --resource-group \ +"testrg" +""" + +helps['videoanalyzer edge-module create'] = """ + type: command + short-summary: "Creates a new edge module or updates an existing one. An edge module resource enables a single \ +instance of an Azure Video Analyzer IoT edge module to interact with the Video Analyzer Account. This is used for \ +authorization and also to make sure that the particular edge module instance only has access to the data it requires \ +from the Azure Video Analyzer service. A new edge module resource should be created for every new instance of an Azure \ +Video Analyzer edge module deployed to you Azure IoT edge environment. Edge module resources can be deleted if the \ +specific module is not in use anymore." + examples: + - name: Registers an edge module. + text: |- + az videoanalyzer edge-module create --account-name "testaccount2" --name "edgeModule1" --resource-group \ +"testrg" +""" + +helps['videoanalyzer edge-module update'] = """ + type: command + short-summary: "Update a new edge module or updates an existing one. An edge module resource enables a single \ +instance of an Azure Video Analyzer IoT edge module to interact with the Video Analyzer Account. This is used for \ +authorization and also to make sure that the particular edge module instance only has access to the data it requires \ +from the Azure Video Analyzer service. A new edge module resource should be Updated for every new instance of an Azure \ +Video Analyzer edge module deployed to you Azure IoT edge environment. Edge module resources can be deleted if the \ +specific module is not in use anymore." +""" + +helps['videoanalyzer edge-module delete'] = """ + type: command + short-summary: "Deletes an existing edge module resource. Deleting the edge module resource will prevent an Azure \ +Video Analyzer IoT edge module which was previously initiated with the module provisioning token from communicating \ +with the cloud." + examples: + - name: Deletes an edge module registration. + text: |- + az videoanalyzer edge-module delete --account-name "testaccount2" --name "edgeModule1" --resource-group \ +"testrg" +""" + +helps['videoanalyzer edge-module list-provisioning-token'] = """ + type: command + short-summary: "Creates a new provisioning token. A provisioning token allows for a single instance of Azure Video \ +analyzer IoT edge module to be initialized and authorized to the cloud account. The provisioning token itself is short \ +lived and it is only used for the initial handshake between IoT edge module and the cloud. After the initial \ +handshake, the IoT edge module will agree on a set of authentication keys which will be auto-rotated as long as the \ +module is able to periodically connect to the cloud. A new provisioning token can be generated for the same IoT edge \ +module in case the module state lost or reset." + examples: + - name: Generate the Provisioning token for an edge module registration. + text: |- + az videoanalyzer edge-module list-provisioning-token --account-name "testaccount2" --name "edgeModule1" \ +--expiration-date "3021-01-23T11:04:49.0526841-08:00" --resource-group "testrg" +""" + +helps['videoanalyzer video'] = """ + type: group + short-summary: Manage video with videoanalyzer +""" + +helps['videoanalyzer video list'] = """ + type: command + short-summary: "List all existing video resources in the specified account." + examples: + - name: Lists video entities. + text: |- + az videoanalyzer video list --top "2" --account-name "testaccount2" --resource-group "testrg" +""" + +helps['videoanalyzer video show'] = """ + type: command + short-summary: "Retrieves an existing video resource within an account with a given name." + examples: + - name: Gets a video entity. + text: |- + az videoanalyzer video show --account-name "testaccount2" --resource-group "testrg" --name "video1" +""" + +helps['videoanalyzer video create'] = """ + type: command + short-summary: "Creates a new video resource or updates an existing one in an account." + examples: + - name: Register video entity. + text: |- + az videoanalyzer video create --account-name "testaccount2" --description "Sample Description 1" \ +--title "Sample Title 1" --resource-group "testrg" --name "video1" +""" + +helps['videoanalyzer video update'] = """ + type: command + short-summary: "Updates individual properties of an existing video resource." + examples: + - name: Update video entity. + text: |- + az videoanalyzer video update --account-name "testaccount2" --description "Parking Lot East Entrance" \ +--resource-group "testrg" --name "video1" +""" + +helps['videoanalyzer video delete'] = """ + type: command + short-summary: "Deletes an existing video resource and its underlying data. This operation is irreversible." + examples: + - name: Deletes a video entity. + text: |- + az videoanalyzer video delete --account-name "testaccount2" --resource-group "testrg" --name "video1" +""" + +helps['videoanalyzer video list-streaming-token'] = """ + type: command + short-summary: "Generates a streaming token used for authenticating video playback." + examples: + - name: Generate a streaming token for media endpoint authorization. + text: |- + az videoanalyzer video list-streaming-token --account-name "testaccount2" --resource-group "testrg" \ +--name "video3" +""" + +helps['videoanalyzer access-policy'] = """ + type: group + short-summary: Manage access policy with videoanalyzer +""" + +helps['videoanalyzer access-policy list'] = """ + type: command + short-summary: "List all existing access policy resources for the specified account." + examples: + - name: Lists access policy entities. + text: |- + az videoanalyzer access-policy list --top "2" --account-name "testaccount2" --resource-group "testrg" +""" + +helps['videoanalyzer access-policy show'] = """ + type: command + short-summary: "Retrieves an existing access policy resource from an account by name." + examples: + - name: Gets an access policy entity. + text: |- + az videoanalyzer access-policy show --name "accessPolicyName1" --account-name "testaccount2" \ +--resource-group "testrg" +""" + +helps['videoanalyzer access-policy create'] = """ + type: command + short-summary: "Creates a new access policy resource or updates an existing one." + parameters: + - name: --jwt-authentication + short-summary: "Properties for access validation based on JSON Web Tokens (JWT)." + long-summary: | + Usage: --jwt-authentication issuers=XX audiences=XX claims=XX keys=XX type=XX + + issuers: List of expected token issuers. Token issuer is valid if it matches at least one of the given \ +values. + audiences: List of expected token audiences. Token audience is valid if it matches at least one of the \ +given values. + claims: List of additional token claims to be validated. Token must contains all claims and respective \ +values for it to be valid. + 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: Required. The discriminator for derived types. + examples: + - name: Register access policy entity. + text: |- + az videoanalyzer access-policy create --name "accessPolicyName1" --account-name "testaccount2" \ +--authentication "{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"audiences\\":[\\"audience1\\"],\\"cl\ +aims\\":[{\\"name\\":\\"claimname1\\",\\"value\\":\\"claimvalue1\\"},{\\"name\\":\\"claimname2\\",\\"value\\":\\"claimv\ +alue2\\"}],\\"issuers\\":[\\"issuer1\\",\\"issuer2\\"],\\"keys\\":[{\\"@type\\":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\ +\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"},{\\"@type\\":\\"#M\ +icrosoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\":\\"ES256\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}]\ +}" --resource-group "testrg" +""" + +helps['videoanalyzer access-policy update'] = """ + type: command + short-summary: "Updates individual properties of an existing access policy resource." + parameters: + - name: --jwt-authentication + short-summary: "Properties for access validation based on JSON Web Tokens (JWT)." + long-summary: | + Usage: --jwt-authentication issuers=XX audiences=XX claims=XX keys=XX type=XX + + issuers: List of expected token issuers. Token issuer is valid if it matches at least one of the given \ +values. + audiences: List of expected token audiences. Token audience is valid if it matches at least one of the \ +given values. + claims: List of additional token claims to be validated. Token must contains all claims and respective \ +values for it to be valid. + 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: Required. The discriminator for derived types. + examples: + - name: Update access policy entity. + text: |- + az videoanalyzer access-policy update --name "accessPolicyName1" --account-name "testaccount2" \ +--authentication "{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"keys\\":[{\\"@type\\":\\"#Microsoft.\ +VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ\ +==\\"},{\\"@type\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\":\\"Updated\\",\\"kid\\":\\"124\\",\\"x\\":\\"X\ +X==\\",\\"y\\":\\"YY==\\"}]}" --resource-group "testrg" +""" + +helps['videoanalyzer access-policy delete'] = """ + type: command + short-summary: "Deletes an existing access policy resource." + examples: + - name: Deletes an access policy entity. + text: |- + az videoanalyzer access-policy delete --name "accessPolicyName1" --account-name "testaccount2" \ +--resource-group "testrg" +""" diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/_params.py b/src/videoanalyzer/azext_videoanalyzer/generated/_params.py new file mode 100644 index 00000000000..17da3017c5a --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/_params.py @@ -0,0 +1,203 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines +# pylint: disable=too-many-statements + +from azure.cli.core.commands.parameters import ( + tags_type, + get_enum_type, + resource_group_name_type, + get_location_type +) +from azure.cli.core.commands.validators import ( + get_default_location_from_resource_group, + validate_file_or_dict +) +from azext_videoanalyzer.action import ( + AddStorageAccounts, + AddJwtAuthentication +) + + +def load_arguments(self, _): + + with self.argument_context('videoanalyzer video-analyzer list') as c: + c.argument('resource_group_name', resource_group_name_type) + + with self.argument_context('videoanalyzer video-analyzer show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Video Analyzer account name.', id_part='name') + + with self.argument_context('videoanalyzer video-analyzer create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Video Analyzer account name.') + c.argument('tags', tags_type) + c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, + validator=get_default_location_from_resource_group) + c.argument('storage_accounts', action=AddStorageAccounts, nargs='+', help='The storage accounts for this ' + 'resource.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemKey', 'CustomerKey']), help='The ' + 'type of key used to encrypt the Account Key.', arg_group='Encryption') + c.argument('user_assigned_identity', type=str, help='The user assigned managed identity\'s resource identifier ' + 'to use when accessing a resource.', arg_group='Encryption Identity') + c.argument('key_identifier', type=str, help='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).', arg_group='Encryption Key Vault Properties') + c.argument('video_analyzer_identity_type', type=str, help='The identity type.', arg_group='Identity') + c.argument('user_assigned_identities', type=validate_file_or_dict, help='The User Assigned Managed Identities. ' + 'Expected value: json-string/@json-file.', arg_group='Identity') + + with self.argument_context('videoanalyzer video-analyzer update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Video Analyzer account name.', id_part='name') + c.argument('tags', tags_type) + c.argument('storage_accounts', action=AddStorageAccounts, nargs='+', help='The storage accounts for this ' + 'resource.') + c.argument('type_', options_list=['--type'], arg_type=get_enum_type(['SystemKey', 'CustomerKey']), help='The ' + 'type of key used to encrypt the Account Key.', arg_group='Encryption') + c.argument('user_assigned_identity', type=str, help='The user assigned managed identity\'s resource identifier ' + 'to use when accessing a resource.', arg_group='Encryption Identity') + c.argument('key_identifier', type=str, help='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).', arg_group='Encryption Key Vault Properties') + c.argument('video_analyzer_identity_type', type=str, help='The identity type.', arg_group='Identity') + c.argument('user_assigned_identities', type=validate_file_or_dict, help='The User Assigned Managed Identities. ' + 'Expected value: json-string/@json-file.', arg_group='Identity') + + with self.argument_context('videoanalyzer video-analyzer delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Video Analyzer account name.', id_part='name') + + with self.argument_context('videoanalyzer video-analyzer sync-storage-key') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Video Analyzer account name.', id_part='name') + c.argument('id_', options_list=['--id'], type=str, help='The ID of the storage account resource.') + + with self.argument_context('videoanalyzer edge-module list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('filter_', options_list=['--filter'], type=str, help='Restricts the set of items returned.') + c.argument('top', type=int, help='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.') + c.argument('orderby', type=str, help='Specifies the key by which the result collection should be ordered.') + + with self.argument_context('videoanalyzer edge-module show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('edge_module_name', options_list=['--name', '-n', '--edge-module-name'], type=str, help='The name ' + 'of the edge module to retrieve.', id_part='child_name_1') + + with self.argument_context('videoanalyzer edge-module create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('edge_module_name', options_list=['--name', '-n', '--edge-module-name'], type=str, help='The name ' + 'of the edge module to create or update.') + + with self.argument_context('videoanalyzer edge-module update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('edge_module_name', options_list=['--name', '-n', '--edge-module-name'], type=str, help='The name ' + 'of the edge module to create or update.', id_part='child_name_1') + + with self.argument_context('videoanalyzer edge-module delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('edge_module_name', options_list=['--name', '-n', '--edge-module-name'], type=str, help='The name ' + 'of the edge module to be deleted.', id_part='child_name_1') + + with self.argument_context('videoanalyzer edge-module list-provisioning-token') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('edge_module_name', options_list=['--name', '-n', '--edge-module-name'], type=str, help='The name ' + 'of the edge module used to create a new provisioning token.') + c.argument('expiration_date', help='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.') + + with self.argument_context('videoanalyzer video list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('top', type=int, help='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.') + + with self.argument_context('videoanalyzer video show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('video_name', options_list=['--name', '-n', '--video-name'], type=str, help='The name of the video ' + 'to retrieve.', id_part='child_name_1') + + with self.argument_context('videoanalyzer video create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('video_name', options_list=['--name', '-n', '--video-name'], type=str, help='The name of the video ' + 'to create or update.') + c.argument('title', type=str, help='Optional video title provided by the user. Value can be up to 256 ' + 'characters long.') + c.argument('description', type=str, help='Optional video description provided by the user. Value can be up to ' + '2048 characters long.') + + with self.argument_context('videoanalyzer video update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('video_name', options_list=['--name', '-n', '--video-name'], type=str, help='The name of the video ' + 'to update.', id_part='child_name_1') + c.argument('title', type=str, help='Optional video title provided by the user. Value can be up to 256 ' + 'characters long.') + c.argument('description', type=str, help='Optional video description provided by the user. Value can be up to ' + '2048 characters long.') + + with self.argument_context('videoanalyzer video delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('video_name', options_list=['--name', '-n', '--video-name'], type=str, help='The name of the video ' + 'to delete.', id_part='child_name_1') + + with self.argument_context('videoanalyzer video list-streaming-token') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('video_name', options_list=['--name', '-n', '--video-name'], type=str, help='The name of the video ' + 'to generate a token for playback.') + + with self.argument_context('videoanalyzer access-policy list') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('top', type=int, help='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.') + + with self.argument_context('videoanalyzer access-policy show') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('access_policy_name', options_list=['--name', '-n', '--access-policy-name'], type=str, help='The ' + 'name of the access policy to retrieve.', id_part='child_name_1') + + with self.argument_context('videoanalyzer access-policy create') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.') + c.argument('access_policy_name', options_list=['--name', '-n', '--access-policy-name'], type=str, help='The ' + 'name of the access policy to create or update.') + c.argument('jwt_authentication', action=AddJwtAuthentication, nargs='+', help='Properties for access ' + 'validation based on JSON Web Tokens (JWT).', arg_group='Authentication') + + with self.argument_context('videoanalyzer access-policy update') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('access_policy_name', options_list=['--name', '-n', '--access-policy-name'], type=str, help='The ' + 'name of the access policy to update.', id_part='child_name_1') + c.argument('jwt_authentication', action=AddJwtAuthentication, nargs='+', help='Properties for access ' + 'validation based on JSON Web Tokens (JWT).', arg_group='Authentication') + + with self.argument_context('videoanalyzer access-policy delete') as c: + c.argument('resource_group_name', resource_group_name_type) + c.argument('account_name', type=str, help='The Azure Video Analyzer account name.', id_part='name') + c.argument('access_policy_name', options_list=['--name', '-n', '--access-policy-name'], type=str, help='The ' + 'name of the access policy to delete.', id_part='child_name_1') diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/_validators.py b/src/videoanalyzer/azext_videoanalyzer/generated/_validators.py new file mode 100644 index 00000000000..b33a44c1ebf --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/_validators.py @@ -0,0 +1,9 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/action.py b/src/videoanalyzer/azext_videoanalyzer/generated/action.py new file mode 100644 index 00000000000..e1291a37ede --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/action.py @@ -0,0 +1,73 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access + +import argparse +from collections import defaultdict +from knack.util import CLIError + + +class AddStorageAccounts(argparse._AppendAction): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + super(AddStorageAccounts, self).__call__(parser, namespace, action, option_string) + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'id': + d['id'] = v[0] + elif kl == 'user-assigned-identity': + d['user_assigned_identity'] = v[0] + else: + raise CLIError('Unsupported Key {} is provided for parameter storage_accounts. All possible keys are: ' + 'id, user-assigned-identity'.format(k)) + return d + + +class AddJwtAuthentication(argparse.Action): + def __call__(self, parser, namespace, values, option_string=None): + action = self.get_action(values, option_string) + namespace.jwt_authentication = action + + def get_action(self, values, option_string): # pylint: disable=no-self-use + try: + properties = defaultdict(list) + for (k, v) in (x.split('=', 1) for x in values): + properties[k].append(v) + properties = dict(properties) + except ValueError: + raise CLIError('usage error: {} [KEY=VALUE ...]'.format(option_string)) + d = {} + for k in properties: + kl = k.lower() + v = properties[k] + if kl == 'issuers': + d['issuers'] = v + elif kl == 'audiences': + d['audiences'] = v + elif kl == 'claims': + d['claims'] = v + elif kl == 'keys': + d['keys'] = v + else: + raise CLIError('Unsupported Key {} is provided for parameter jwt_authentication. All possible keys ' + 'are: issuers, audiences, claims, keys'.format(k)) + d['type'] = '#Microsoft.VideoAnalyzer.JwtAuthentication' + return d diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/commands.py b/src/videoanalyzer/azext_videoanalyzer/generated/commands.py new file mode 100644 index 00000000000..85be27917e1 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/commands.py @@ -0,0 +1,73 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-statements +# pylint: disable=too-many-locals + +from azure.cli.core.commands import CliCommandType + + +def load_command_table(self, _): + + from azext_videoanalyzer.generated._client_factory import cf_video_analyzer + videoanalyzer_video_analyzer = CliCommandType( + operations_tmpl='azext_videoanalyzer.vendored_sdks.videoanalyzer.operations._video_analyzers_operations#VideoAn' + 'alyzersOperations.{}', + client_factory=cf_video_analyzer) + with self.command_group('videoanalyzer video-analyzer', videoanalyzer_video_analyzer, + client_factory=cf_video_analyzer) as g: + g.custom_command('list', 'videoanalyzer_video_analyzer_list') + g.custom_show_command('show', 'videoanalyzer_video_analyzer_show') + g.custom_command('create', 'videoanalyzer_video_analyzer_create') + g.custom_command('update', 'videoanalyzer_video_analyzer_update') + g.custom_command('delete', 'videoanalyzer_video_analyzer_delete', confirmation=True) + g.custom_command('sync-storage-key', 'videoanalyzer_video_analyzer_sync_storage_key') + + from azext_videoanalyzer.generated._client_factory import cf_edge_module + videoanalyzer_edge_module = CliCommandType( + operations_tmpl='azext_videoanalyzer.vendored_sdks.videoanalyzer.operations._edge_modules_operations#EdgeModule' + 'sOperations.{}', + client_factory=cf_edge_module) + with self.command_group('videoanalyzer edge-module', videoanalyzer_edge_module, + client_factory=cf_edge_module) as g: + g.custom_command('list', 'videoanalyzer_edge_module_list') + g.custom_show_command('show', 'videoanalyzer_edge_module_show') + g.custom_command('create', 'videoanalyzer_edge_module_create') + g.custom_command('update', 'videoanalyzer_edge_module_update') + g.custom_command('delete', 'videoanalyzer_edge_module_delete', confirmation=True) + g.custom_command('list-provisioning-token', 'videoanalyzer_edge_module_list_provisioning_token') + + from azext_videoanalyzer.generated._client_factory import cf_video + videoanalyzer_video = CliCommandType( + operations_tmpl='azext_videoanalyzer.vendored_sdks.videoanalyzer.operations._videos_operations#VideosOperations' + '.{}', + client_factory=cf_video) + with self.command_group('videoanalyzer video', videoanalyzer_video, client_factory=cf_video) as g: + g.custom_command('list', 'videoanalyzer_video_list') + g.custom_show_command('show', 'videoanalyzer_video_show') + g.custom_command('create', 'videoanalyzer_video_create') + g.custom_command('update', 'videoanalyzer_video_update') + g.custom_command('delete', 'videoanalyzer_video_delete', confirmation=True) + g.custom_command('list-streaming-token', 'videoanalyzer_video_list_streaming_token') + + from azext_videoanalyzer.generated._client_factory import cf_access_policy + videoanalyzer_access_policy = CliCommandType( + operations_tmpl='azext_videoanalyzer.vendored_sdks.videoanalyzer.operations._access_policies_operations#AccessP' + 'oliciesOperations.{}', + client_factory=cf_access_policy) + with self.command_group('videoanalyzer access-policy', videoanalyzer_access_policy, + client_factory=cf_access_policy) as g: + g.custom_command('list', 'videoanalyzer_access_policy_list') + g.custom_show_command('show', 'videoanalyzer_access_policy_show') + g.custom_command('create', 'videoanalyzer_access_policy_create') + g.custom_command('update', 'videoanalyzer_access_policy_update') + g.custom_command('delete', 'videoanalyzer_access_policy_delete', confirmation=True) + + with self.command_group('videoanalyzer', is_experimental=True): + pass diff --git a/src/videoanalyzer/azext_videoanalyzer/generated/custom.py b/src/videoanalyzer/azext_videoanalyzer/generated/custom.py new file mode 100644 index 00000000000..1c93b7b4187 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/generated/custom.py @@ -0,0 +1,297 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- +# pylint: disable=too-many-lines + +from knack.util import CLIError + + +def videoanalyzer_video_analyzer_list(client, + resource_group_name=None): + if resource_group_name: + return client.list(resource_group_name=resource_group_name) + return client.list_by_subscription() + + +def videoanalyzer_video_analyzer_show(client, + resource_group_name, + account_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name) + + +def videoanalyzer_video_analyzer_create(client, + resource_group_name, + account_name, + location, + tags=None, + storage_accounts=None, + type_=None, + user_assigned_identity=None, + key_identifier=None, + video_analyzer_identity_type=None, + user_assigned_identities=None): + parameters = {} + parameters['tags'] = tags + parameters['location'] = location + parameters['storage_accounts'] = storage_accounts + parameters['encryption'] = {} + parameters['encryption']['type'] = type_ + parameters['encryption']['identity'] = {} + parameters['encryption']['identity']['user_assigned_identity'] = user_assigned_identity + parameters['encryption']['key_vault_properties'] = {} + parameters['encryption']['key_vault_properties']['key_identifier'] = key_identifier + parameters['identity'] = {} + parameters['identity']['type'] = video_analyzer_identity_type + parameters['identity']['user_assigned_identities'] = user_assigned_identities + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters) + + +def videoanalyzer_video_analyzer_update(client, + resource_group_name, + account_name, + tags=None, + storage_accounts=None, + type_=None, + user_assigned_identity=None, + key_identifier=None, + video_analyzer_identity_type=None, + user_assigned_identities=None): + parameters = {} + parameters['tags'] = tags + parameters['storage_accounts'] = storage_accounts + parameters['encryption'] = {} + parameters['encryption']['type'] = type_ + parameters['encryption']['identity'] = {} + parameters['encryption']['identity']['user_assigned_identity'] = user_assigned_identity + parameters['encryption']['key_vault_properties'] = {} + parameters['encryption']['key_vault_properties']['key_identifier'] = key_identifier + parameters['identity'] = {} + parameters['identity']['type'] = video_analyzer_identity_type + parameters['identity']['user_assigned_identities'] = user_assigned_identities + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters) + + +def videoanalyzer_video_analyzer_delete(client, + resource_group_name, + account_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name) + + +def videoanalyzer_video_analyzer_sync_storage_key(client, + resource_group_name, + account_name, + id_=None): + parameters = {} + parameters['id'] = id_ + return client.sync_storage_keys(resource_group_name=resource_group_name, + account_name=account_name, + parameters=parameters) + + +def videoanalyzer_edge_module_list(client, + resource_group_name, + account_name, + filter_=None, + top=None, + orderby=None): + return client.list(resource_group_name=resource_group_name, + account_name=account_name, + filter=filter_, + top=top, + orderby=orderby) + + +def videoanalyzer_edge_module_show(client, + resource_group_name, + account_name, + edge_module_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + edge_module_name=edge_module_name) + + +def videoanalyzer_edge_module_create(client, + resource_group_name, + account_name, + edge_module_name): + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + edge_module_name=edge_module_name, + parameters=None) + + +def videoanalyzer_edge_module_update(client, + resource_group_name, + account_name, + edge_module_name): + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + edge_module_name=edge_module_name, + parameters=None) + + +def videoanalyzer_edge_module_delete(client, + resource_group_name, + account_name, + edge_module_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + edge_module_name=edge_module_name) + + +def videoanalyzer_edge_module_list_provisioning_token(client, + resource_group_name, + account_name, + edge_module_name, + expiration_date): + parameters = {} + parameters['expiration_date'] = expiration_date + return client.list_provisioning_token(resource_group_name=resource_group_name, + account_name=account_name, + edge_module_name=edge_module_name, + parameters=parameters) + + +def videoanalyzer_video_list(client, + resource_group_name, + account_name, + top=None): + return client.list(resource_group_name=resource_group_name, + account_name=account_name, + top=top) + + +def videoanalyzer_video_show(client, + resource_group_name, + account_name, + video_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + video_name=video_name) + + +def videoanalyzer_video_create(client, + resource_group_name, + account_name, + video_name, + title=None, + description=None): + parameters = {} + parameters['title'] = title + parameters['description'] = description + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + video_name=video_name, + parameters=parameters) + + +def videoanalyzer_video_update(client, + resource_group_name, + account_name, + video_name, + title=None, + description=None): + parameters = {} + parameters['title'] = title + parameters['description'] = description + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + video_name=video_name, + parameters=parameters) + + +def videoanalyzer_video_delete(client, + resource_group_name, + account_name, + video_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + video_name=video_name) + + +def videoanalyzer_video_list_streaming_token(client, + resource_group_name, + account_name, + video_name): + return client.list_streaming_token(resource_group_name=resource_group_name, + account_name=account_name, + video_name=video_name) + + +def videoanalyzer_access_policy_list(client, + resource_group_name, + account_name, + top=None): + return client.list(resource_group_name=resource_group_name, + account_name=account_name, + top=top) + + +def videoanalyzer_access_policy_show(client, + resource_group_name, + account_name, + access_policy_name): + return client.get(resource_group_name=resource_group_name, + account_name=account_name, + access_policy_name=access_policy_name) + + +def videoanalyzer_access_policy_create(client, + resource_group_name, + account_name, + access_policy_name, + jwt_authentication=None): + all_authentication = [] + if jwt_authentication is not None: + all_authentication.append(jwt_authentication) + if len(all_authentication) > 1: + raise CLIError('at most one of jwt_authentication is needed for authentication!') + authentication = all_authentication[0] if len(all_authentication) == 1 else None + parameters = {} + parameters['role'] = "Reader" + parameters['authentication'] = authentication + return client.create_or_update(resource_group_name=resource_group_name, + account_name=account_name, + access_policy_name=access_policy_name, + parameters=parameters) + + +def videoanalyzer_access_policy_update(client, + resource_group_name, + account_name, + access_policy_name, + jwt_authentication=None): + all_authentication = [] + if jwt_authentication is not None: + all_authentication.append(jwt_authentication) + if len(all_authentication) > 1: + raise CLIError('at most one of jwt_authentication is needed for authentication!') + authentication = all_authentication[0] if len(all_authentication) == 1 else None + parameters = {} + parameters['role'] = "Reader" + parameters['authentication'] = authentication + return client.update(resource_group_name=resource_group_name, + account_name=account_name, + access_policy_name=access_policy_name, + parameters=parameters) + + +def videoanalyzer_access_policy_delete(client, + resource_group_name, + account_name, + access_policy_name): + return client.delete(resource_group_name=resource_group_name, + account_name=account_name, + access_policy_name=access_policy_name) diff --git a/src/videoanalyzer/azext_videoanalyzer/manual/__init__.py b/src/videoanalyzer/azext_videoanalyzer/manual/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/manual/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/videoanalyzer/azext_videoanalyzer/tests/__init__.py b/src/videoanalyzer/azext_videoanalyzer/tests/__init__.py new file mode 100644 index 00000000000..70488e93851 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/tests/__init__.py @@ -0,0 +1,116 @@ +# 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. +# -------------------------------------------------------------------------- +import inspect +import logging +import os +import sys +import traceback +import datetime as dt + +from azure.core.exceptions import AzureError +from azure.cli.testsdk.exceptions import CliTestError, CliExecutionError, JMESPathCheckAssertionError + + +logger = logging.getLogger('azure.cli.testsdk') +logger.addHandler(logging.StreamHandler()) +__path__ = __import__('pkgutil').extend_path(__path__, __name__) +exceptions = [] +test_map = dict() +SUCCESSED = "successed" +FAILED = "failed" + + +def try_manual(func): + def import_manual_function(origin_func): + from importlib import import_module + decorated_path = inspect.getfile(origin_func).lower() + module_path = __path__[0].lower() + if not decorated_path.startswith(module_path): + raise Exception("Decorator can only be used in submodules!") + manual_path = os.path.join( + decorated_path[module_path.rfind(os.path.sep) + 1:]) + manual_file_path, manual_file_name = os.path.split(manual_path) + module_name, _ = os.path.splitext(manual_file_name) + manual_module = "..manual." + \ + ".".join(manual_file_path.split(os.path.sep) + [module_name, ]) + return getattr(import_module(manual_module, package=__name__), origin_func.__name__) + + def get_func_to_call(): + func_to_call = func + try: + func_to_call = import_manual_function(func) + logger.info("Found manual override for %s(...)", func.__name__) + except (ImportError, AttributeError): + pass + return func_to_call + + def wrapper(*args, **kwargs): + func_to_call = get_func_to_call() + logger.info("running %s()...", func.__name__) + try: + test_map[func.__name__] = dict() + test_map[func.__name__]["result"] = SUCCESSED + test_map[func.__name__]["error_message"] = "" + test_map[func.__name__]["error_stack"] = "" + test_map[func.__name__]["error_normalized"] = "" + test_map[func.__name__]["start_dt"] = dt.datetime.utcnow() + ret = func_to_call(*args, **kwargs) + except (AssertionError, AzureError, CliTestError, CliExecutionError, SystemExit, + JMESPathCheckAssertionError) as e: + use_exception_cache = os.getenv("TEST_EXCEPTION_CACHE") + if use_exception_cache is None or use_exception_cache.lower() != "true": + raise + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + test_map[func.__name__]["result"] = FAILED + test_map[func.__name__]["error_message"] = str(e).replace("\r\n", " ").replace("\n", " ")[:500] + test_map[func.__name__]["error_stack"] = traceback.format_exc().replace( + "\r\n", " ").replace("\n", " ")[:500] + logger.info("--------------------------------------") + logger.info("step exception: %s", e) + logger.error("--------------------------------------") + logger.error("step exception in %s: %s", func.__name__, e) + logger.info(traceback.format_exc()) + exceptions.append((func.__name__, sys.exc_info())) + else: + test_map[func.__name__]["end_dt"] = dt.datetime.utcnow() + return ret + + if inspect.isclass(func): + return get_func_to_call() + return wrapper + + +def calc_coverage(filename): + filename = filename.split(".")[0] + coverage_name = filename + "_coverage.md" + with open(coverage_name, "w") as f: + f.write("|Scenario|Result|ErrorMessage|ErrorStack|ErrorNormalized|StartDt|EndDt|\n") + total = len(test_map) + covered = 0 + for k, v in test_map.items(): + if not k.startswith("step_"): + total -= 1 + continue + if v["result"] == SUCCESSED: + covered += 1 + f.write("|{step_name}|{result}|{error_message}|{error_stack}|{error_normalized}|{start_dt}|" + "{end_dt}|\n".format(step_name=k, **v)) + f.write("Coverage: {}/{}\n".format(covered, total)) + print("Create coverage\n", file=sys.stderr) + + +def raise_if(): + if exceptions: + if len(exceptions) <= 1: + raise exceptions[0][1][1] + message = "{}\nFollowed with exceptions in other steps:\n".format(str(exceptions[0][1][1])) + message += "\n".join(["{}: {}".format(h[0], h[1][1]) for h in exceptions[1:]]) + raise exceptions[0][1][0](message).with_traceback(exceptions[0][1][2]) diff --git a/src/videoanalyzer/azext_videoanalyzer/tests/latest/__init__.py b/src/videoanalyzer/azext_videoanalyzer/tests/latest/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/tests/latest/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/videoanalyzer/azext_videoanalyzer/tests/latest/example_steps.py b/src/videoanalyzer/azext_videoanalyzer/tests/latest/example_steps.py new file mode 100644 index 00000000000..cce9b287d45 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/tests/latest/example_steps.py @@ -0,0 +1,308 @@ +# -------------------------------------------------------------------------- +# 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 .. import try_manual + + +# EXAMPLE: /AccessPolicies/put/Register access policy entity. +@try_manual +def step_access_policy_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer access-policy create ' + '--name "{myAccessPolicy}" ' + '--account-name "testaccount2" ' + '--authentication "{{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"audiences\\":[\\"audi' + 'ence1\\"],\\"claims\\":[{{\\"name\\":\\"claimname1\\",\\"value\\":\\"claimvalue1\\"}},{{\\"name\\":\\"cla' + 'imname2\\",\\"value\\":\\"claimvalue2\\"}}],\\"issuers\\":[\\"issuer1\\",\\"issuer2\\"],\\"keys\\":[{{\\"' + '@type\\":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"k' + 'id\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"}},{{\\"@type\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"' + 'alg\\":\\"ES256\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}}]}}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /AccessPolicies/get/Gets an access policy entity. +@try_manual +def step_access_policy_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer access-policy show ' + '--name "{myAccessPolicy}" ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /AccessPolicies/get/Lists access policy entities. +@try_manual +def step_access_policy_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer access-policy list ' + '--top "2" ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /AccessPolicies/patch/Update access policy entity. +@try_manual +def step_access_policy_update(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer access-policy update ' + '--name "{myAccessPolicy}" ' + '--account-name "testaccount2" ' + '--authentication "{{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"keys\\":[{{\\"@type\\' + '":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":' + '\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"}},{{\\"@type\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\"' + ':\\"Updated\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}}]}}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /AccessPolicies/delete/Deletes an access policy entity. +@try_manual +def step_access_policy_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer access-policy delete -y ' + '--name "{myAccessPolicy}" ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /EdgeModules/put/Registers an edge module. +@try_manual +def step_edge_module_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer edge-module create ' + '--account-name "testaccount2" ' + '--name "{myEdgeModule}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /EdgeModules/get/Gets edge module registration. +@try_manual +def step_edge_module_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer edge-module show ' + '--account-name "testaccount2" ' + '--name "{myEdgeModule}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /EdgeModules/get/Lists the registered edge modules. +@try_manual +def step_edge_module_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer edge-module list ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /EdgeModules/post/Generate the Provisioning token for an edge module registration. +@try_manual +def step_edge_module_list_provisioning_token(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer edge-module list-provisioning-token ' + '--account-name "testaccount2" ' + '--name "{myEdgeModule}" ' + '--expiration-date "3021-01-23T11:04:49.0526841-08:00" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /EdgeModules/delete/Deletes an edge module registration. +@try_manual +def step_edge_module_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer edge-module delete -y ' + '--account-name "testaccount2" ' + '--name "{myEdgeModule}" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/put/Create a Video Analyzer account +@try_manual +def step_video_analyzer_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer create ' + '--account-name "contosotv" ' + '--video-analyzer-identity-type "UserAssigned" ' + '--user-assigned-identities "{{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/pr' + 'oviders/Microsoft.ManagedIdentity/userAssignedIdentities/id1\\":{{}},\\"/subscriptions/00000000-0000-0000' + '-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2\\":{{' + '}},\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.ManagedId' + 'entity/userAssignedIdentities/id3\\":{{}}}}" ' + '--location "South Central US" ' + '--type "SystemKey" ' + '--storage-accounts id="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/providers/Microsoft.Storage' + '/storageAccounts/{sa}" user-assigned-identity="/subscriptions/{subscription_id}/resourceGroups/{rg_2}/pro' + 'viders/Microsoft.ManagedIdentity/userAssignedIdentities/id2" ' + '--tags tag1="value1" tag2="value2" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/get/Get a Video Analyzer account by name +@try_manual +def step_video_analyzer_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer show ' + '--account-name "contosotv" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/get/List all Video Analyzer accounts +@try_manual +def step_video_analyzer_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer list ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/get/List all Video Analyzer accounts by subscription +@try_manual +def step_video_analyzer_list2(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer list ' + '-g ""', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/patch/Update a Video Analyzer accounts +@try_manual +def step_video_analyzer_update(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer update ' + '--account-name "contosotv" ' + '--tags key1="value3" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/post/Synchronizes Storage Account Keys +@try_manual +def step_video_analyzer_sync_storage_key(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer sync-storage-key ' + '--account-name "contosotv" ' + '--id "/subscriptions/{subscription_id}/resourceGroups/{rg}/providers/Microsoft.Storage/storageAccounts/{s' + 'a_2}" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /VideoAnalyzers/delete/Delete a Video Analyzer account +@try_manual +def step_video_analyzer_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video-analyzer delete -y ' + '--account-name "contosotv" ' + '--resource-group "{rg}"', + checks=checks) + + +# EXAMPLE: /Videos/put/Register video entity. +@try_manual +def step_video_create(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video create ' + '--account-name "testaccount2" ' + '--description "Sample Description 1" ' + '--title "Sample Title 1" ' + '--resource-group "{rg_3}" ' + '--name "{myVideo}"', + checks=checks) + + +# EXAMPLE: /Videos/get/Gets a video entity. +@try_manual +def step_video_show(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video show ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}" ' + '--name "{myVideo}"', + checks=checks) + + +# EXAMPLE: /Videos/get/Lists video entities. +@try_manual +def step_video_list(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video list ' + '--top "2" ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}"', + checks=checks) + + +# EXAMPLE: /Videos/patch/Update video entity. +@try_manual +def step_video_update(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video update ' + '--account-name "testaccount2" ' + '--description "Parking Lot East Entrance" ' + '--resource-group "{rg_3}" ' + '--name "{myVideo}"', + checks=checks) + + +# EXAMPLE: /Videos/post/Generate a streaming token for media endpoint authorization. +@try_manual +def step_video_list_streaming_token(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video list-streaming-token ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}" ' + '--name "{myVideo2}"', + checks=checks) + + +# EXAMPLE: /Videos/delete/Deletes a video entity. +@try_manual +def step_video_delete(test, rg_2, rg, rg_3, checks=None): + if checks is None: + checks = [] + test.cmd('az videoanalyzer video delete -y ' + '--account-name "testaccount2" ' + '--resource-group "{rg_3}" ' + '--name "{myVideo}"', + checks=checks) + diff --git a/src/videoanalyzer/azext_videoanalyzer/tests/latest/test_videoanalyzer_scenario.py b/src/videoanalyzer/azext_videoanalyzer/tests/latest/test_videoanalyzer_scenario.py new file mode 100644 index 00000000000..b0e778d9b53 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/tests/latest/test_videoanalyzer_scenario.py @@ -0,0 +1,142 @@ +# -------------------------------------------------------------------------- +# 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. +# -------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest +from azure.cli.testsdk import ResourceGroupPreparer +from azure.cli.testsdk import StorageAccountPreparer +from .example_steps import step_access_policy_create +from .example_steps import step_access_policy_show +from .example_steps import step_access_policy_list +from .example_steps import step_access_policy_update +from .example_steps import step_access_policy_delete +from .example_steps import step_edge_module_create +from .example_steps import step_edge_module_show +from .example_steps import step_edge_module_list +from .example_steps import step_edge_module_list_provisioning_token +from .example_steps import step_edge_module_delete +from .example_steps import step_video_analyzer_create +from .example_steps import step_video_analyzer_show +from .example_steps import step_video_analyzer_list +from .example_steps import step_video_analyzer_list2 +from .example_steps import step_video_analyzer_update +from .example_steps import step_video_analyzer_sync_storage_key +from .example_steps import step_video_analyzer_delete +from .example_steps import step_video_create +from .example_steps import step_video_show +from .example_steps import step_video_list +from .example_steps import step_video_update +from .example_steps import step_video_list_streaming_token +from .example_steps import step_video_delete +from .. import ( + try_manual, + raise_if, + calc_coverage +) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +# Env setup_scenario +@try_manual +def setup_scenario(test, rg_2, rg, rg_3): + pass + + +# Env cleanup_scenario +@try_manual +def cleanup_scenario(test, rg_2, rg, rg_3): + pass + + +# Testcase: Scenario +@try_manual +def call_scenario(test, rg_2, rg, rg_3): + setup_scenario(test, rg_2, rg, rg_3) + step_access_policy_create(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myAccessPolicy}", case_sensitive=False), + ]) + step_access_policy_show(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myAccessPolicy}", case_sensitive=False), + ]) + step_access_policy_list(test, rg_2, rg, rg_3, checks=[]) + step_access_policy_update(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myAccessPolicy}", case_sensitive=False), + ]) + step_access_policy_delete(test, rg_2, rg, rg_3, checks=[]) + step_edge_module_create(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myEdgeModule}", case_sensitive=False), + ]) + step_edge_module_show(test, rg_2, rg, rg_3, checks=[ + test.check("name", "{myEdgeModule}", case_sensitive=False), + ]) + step_edge_module_list(test, rg_2, rg, rg_3, checks=[ + test.check('length(@)', 1), + ]) + step_edge_module_list_provisioning_token(test, rg_2, rg, rg_3, checks=[]) + step_edge_module_delete(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_create(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_show(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_list(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_list2(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_update(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_sync_storage_key(test, rg_2, rg, rg_3, checks=[]) + step_video_analyzer_delete(test, rg_2, rg, rg_3, checks=[]) + step_video_create(test, rg_2, rg, rg_3, checks=[ + test.check("description", "Sample Description 1", case_sensitive=False), + test.check("title", "Sample Title 1", case_sensitive=False), + test.check("name", "{myVideo}", case_sensitive=False), + ]) + step_video_show(test, rg_2, rg, rg_3, checks=[ + test.check("description", "Sample Description 1", case_sensitive=False), + test.check("title", "Sample Title 1", case_sensitive=False), + test.check("name", "{myVideo}", case_sensitive=False), + ]) + step_video_list(test, rg_2, rg, rg_3, checks=[]) + step_video_update(test, rg_2, rg, rg_3, checks=[ + test.check("title", "Sample Title 1", case_sensitive=False), + test.check("name", "{myVideo}", case_sensitive=False), + ]) + step_video_list_streaming_token(test, rg_2, rg, rg_3, checks=[]) + step_video_delete(test, rg_2, rg, rg_3, checks=[]) + cleanup_scenario(test, rg_2, rg, rg_3) + + +# Test class for Scenario +@try_manual +class VideoanalyzerScenarioTest(ScenarioTest): + + def __init__(self, *args, **kwargs): + super(VideoanalyzerScenarioTest, self).__init__(*args, **kwargs) + self.kwargs.update({ + 'subscription_id': self.get_subscription_id() + }) + + self.kwargs.update({ + 'myEdgeModule': 'edgeModule1', + 'myVideo': 'video1', + 'myVideo2': 'video3', + 'myAccessPolicy': 'accessPolicyName1', + }) + + + @ResourceGroupPreparer(name_prefix='clitestvideoanalyzer_rg'[:7], key='rg_2', parameter_name='rg_2') + @ResourceGroupPreparer(name_prefix='clitestvideoanalyzer_contoso'[:7], key='rg', parameter_name='rg') + @ResourceGroupPreparer(name_prefix='clitestvideoanalyzer_testrg'[:7], key='rg_3', parameter_name='rg_3') + @StorageAccountPreparer(name_prefix='clitestvideoanalyzer_storage1'[:7], key='sa', + resource_group_parameter_name='rg_2') + @StorageAccountPreparer(name_prefix='clitestvideoanalyzer_contosotvstore'[:7], key='sa_2', + resource_group_parameter_name='rg') + def test_videoanalyzer_Scenario(self, rg_2, rg, rg_3): + call_scenario(self, rg_2, rg, rg_3) + calc_coverage(__file__) + raise_if() + diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/__init__.py new file mode 100644 index 00000000000..c9cfdc73e77 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/__init__.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +__path__ = __import__('pkgutil').extend_path(__path__, __name__) diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/__init__.py new file mode 100644 index 00000000000..46cce6ada6c --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/__init__.py @@ -0,0 +1,16 @@ +# 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 ._azure_video_analyzer import AzureVideoAnalyzer +__all__ = ['AzureVideoAnalyzer'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_azure_video_analyzer.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_azure_video_analyzer.py new file mode 100644 index 00000000000..85d6a147cce --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_azure_video_analyzer.py @@ -0,0 +1,94 @@ +# 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 + +from azure.mgmt.core import ARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +from ._configuration import AzureVideoAnalyzerConfiguration +from .operations import Operations +from .operations import VideoAnalyzersOperations +from .operations import LocationsOperations +from .operations import EdgeModulesOperations +from .operations import VideosOperations +from .operations import AccessPoliciesOperations +from . import models + + +class AzureVideoAnalyzer(object): + """Azure Video Analyzer resource provider API definition. + + :ivar operations: Operations operations + :vartype operations: azure_video_analyzer.operations.Operations + :ivar video_analyzers: VideoAnalyzersOperations operations + :vartype video_analyzers: azure_video_analyzer.operations.VideoAnalyzersOperations + :ivar locations: LocationsOperations operations + :vartype locations: azure_video_analyzer.operations.LocationsOperations + :ivar edge_modules: EdgeModulesOperations operations + :vartype edge_modules: azure_video_analyzer.operations.EdgeModulesOperations + :ivar videos: VideosOperations operations + :vartype videos: azure_video_analyzer.operations.VideosOperations + :ivar access_policies: AccessPoliciesOperations operations + :vartype access_policies: azure_video_analyzer.operations.AccessPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param host: server parameter. + :type host: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + host="https://management.azure.com", # type: str + **kwargs # type: Any + ): + # type: (...) -> None + base_url = 'None' + self._config = AzureVideoAnalyzerConfiguration(credential, subscription_id, host, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + 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._client, self._config, self._serialize, self._deserialize) + self.edge_modules = EdgeModulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.videos = VideosOperations( + self._client, self._config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureVideoAnalyzer + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_configuration.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_configuration.py new file mode 100644 index 00000000000..08b64c61269 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/_configuration.py @@ -0,0 +1,76 @@ +# 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 + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + +VERSION = "unknown" + +class AzureVideoAnalyzerConfiguration(Configuration): + """Configuration for AzureVideoAnalyzer. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param host: server parameter. + :type host: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + host="https://management.azure.com", # type: str + **kwargs # type: Any + ): + # type: (...) -> None + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if host is None: + raise ValueError("Parameter 'host' must not be None.") + super(AzureVideoAnalyzerConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.host = host + self.api_version = "2021-05-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'azurevideoanalyzer/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/__init__.py new file mode 100644 index 00000000000..d006eeee0c4 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/__init__.py @@ -0,0 +1,10 @@ +# 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 ._azure_video_analyzer import AzureVideoAnalyzer +__all__ = ['AzureVideoAnalyzer'] diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_azure_video_analyzer.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_azure_video_analyzer.py new file mode 100644 index 00000000000..c58a5697f44 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_azure_video_analyzer.py @@ -0,0 +1,88 @@ +# 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, TYPE_CHECKING + +from azure.mgmt.core import AsyncARMPipelineClient +from msrest import Deserializer, Serializer + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +from ._configuration import AzureVideoAnalyzerConfiguration +from .operations import Operations +from .operations import VideoAnalyzersOperations +from .operations import LocationsOperations +from .operations import EdgeModulesOperations +from .operations import VideosOperations +from .operations import AccessPoliciesOperations +from .. import models + + +class AzureVideoAnalyzer(object): + """Azure Video Analyzer resource provider API definition. + + :ivar operations: Operations operations + :vartype operations: azure_video_analyzer.aio.operations.Operations + :ivar video_analyzers: VideoAnalyzersOperations operations + :vartype video_analyzers: azure_video_analyzer.aio.operations.VideoAnalyzersOperations + :ivar locations: LocationsOperations operations + :vartype locations: azure_video_analyzer.aio.operations.LocationsOperations + :ivar edge_modules: EdgeModulesOperations operations + :vartype edge_modules: azure_video_analyzer.aio.operations.EdgeModulesOperations + :ivar videos: VideosOperations operations + :vartype videos: azure_video_analyzer.aio.operations.VideosOperations + :ivar access_policies: AccessPoliciesOperations operations + :vartype access_policies: azure_video_analyzer.aio.operations.AccessPoliciesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param host: server parameter. + :type host: str + :param str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + host: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + base_url = 'None' + self._config = AzureVideoAnalyzerConfiguration(credential, subscription_id, host, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + 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._client, self._config, self._serialize, self._deserialize) + self.edge_modules = EdgeModulesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.videos = VideosOperations( + self._client, self._config, self._serialize, self._deserialize) + self.access_policies = AccessPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureVideoAnalyzer": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_configuration.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_configuration.py new file mode 100644 index 00000000000..6d14b903129 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/_configuration.py @@ -0,0 +1,72 @@ +# 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, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +VERSION = "unknown" + +class AzureVideoAnalyzerConfiguration(Configuration): + """Configuration for AzureVideoAnalyzer. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param host: server parameter. + :type host: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + host: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if host is None: + raise ValueError("Parameter 'host' must not be None.") + super(AzureVideoAnalyzerConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.host = host + self.api_version = "2021-05-01-preview" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'azurevideoanalyzer/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/__init__.py new file mode 100644 index 00000000000..1ee2a23110a --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/__init__.py @@ -0,0 +1,23 @@ +# 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 ._operations import Operations +from ._video_analyzers_operations import VideoAnalyzersOperations +from ._locations_operations import LocationsOperations +from ._edge_modules_operations import EdgeModulesOperations +from ._videos_operations import VideosOperations +from ._access_policies_operations import AccessPoliciesOperations + +__all__ = [ + 'Operations', + 'VideoAnalyzersOperations', + 'LocationsOperations', + 'EdgeModulesOperations', + 'VideosOperations', + 'AccessPoliciesOperations', +] diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_access_policies_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_access_policies_operations.py new file mode 100644 index 00000000000..a14b1030ce6 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_access_policies_operations.py @@ -0,0 +1,409 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class AccessPoliciesOperations: + """AccessPoliciesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.AccessPolicyEntityCollection"]: + """List access policy resources. + + List all existing access policy resources for the specified 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 Azure Video Analyzer account name. + :type account_name: 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 AccessPolicyEntityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_video_analyzer.models.AccessPolicyEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccessPolicyEntityCollection', 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(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}/accessPolicies'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + access_policy_name: str, + **kwargs + ) -> "models.AccessPolicyEntity": + """Retrieves an access policy resource. + + Retrieves an existing access policy resource from an account by 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. + :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) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/accessPolicies/{accessPolicyName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + access_policy_name: str, + parameters: "models.AccessPolicyEntity", + **kwargs + ) -> "models.AccessPolicyEntity": + """Creates or updates an access policy. + + Creates a new access policy resource or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to create or update. + :type access_policy_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.AccessPolicyEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessPolicyEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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, 'AccessPolicyEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AccessPolicyEntity', 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}/accessPolicies/{accessPolicyName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + access_policy_name: str, + **kwargs + ) -> None: + """Deletes an access policy. + + Deletes an existing access policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to delete. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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(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}/accessPolicies/{accessPolicyName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + access_policy_name: str, + parameters: "models.AccessPolicyEntity", + **kwargs + ) -> "models.AccessPolicyEntity": + """Updates an existing access policy. + + Updates individual properties of an existing access policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to update. + :type access_policy_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.AccessPolicyEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessPolicyEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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, 'AccessPolicyEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/accessPolicies/{accessPolicyName}'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_edge_modules_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_edge_modules_operations.py new file mode 100644 index 00000000000..a25a0bf398e --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_edge_modules_operations.py @@ -0,0 +1,433 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class EdgeModulesOperations: + """EdgeModulesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + orderby: Optional[str] = None, + **kwargs + ) -> AsyncIterable["models.EdgeModuleEntityCollection"]: + """List edge module resources. + + List all of the existing edge module resources for a given 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 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[~azure_video_analyzer.models.EdgeModuleEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('EdgeModuleEntityCollection', 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(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}/edgeModules'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + edge_module_name: str, + **kwargs + ) -> "models.EdgeModuleEntity": + """Retrieves an existing edge module resource. + + Retrieves a specific existing edge module resource in the given 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 Azure Video Analyzer account name. + :type account_name: str + :param edge_module_name: The name of the edge module to retrieve. + :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) + :rtype: ~azure_video_analyzer.models.EdgeModuleEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EdgeModuleEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/edgeModules/{edgeModuleName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + edge_module_name: str, + parameters: "models.EdgeModuleEntity", + **kwargs + ) -> "models.EdgeModuleEntity": + """Creates a new edge module or updates an existing one. + + Creates a new edge module or updates an existing one. An edge module resource enables a single + instance of an Azure Video Analyzer IoT edge module to interact with the Video Analyzer + Account. This is used for authorization and also to make sure that the particular edge module + instance only has access to the data it requires from the Azure Video Analyzer service. A new + edge module resource should be created for every new instance of an Azure Video Analyzer edge + module deployed to you Azure IoT edge environment. Edge module resources can be deleted if the + specific module is not in use anymore. + + :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 create or update. + :type edge_module_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.EdgeModuleEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EdgeModuleEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.EdgeModuleEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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, 'EdgeModuleEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EdgeModuleEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EdgeModuleEntity', 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}/edgeModules/{edgeModuleName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + edge_module_name: str, + **kwargs + ) -> None: + """Deletes an existing edge module resource. + + Deletes an existing edge module resource. Deleting the edge module resource will prevent an + Azure Video Analyzer IoT edge module which was previously initiated with the module + provisioning token from communicating with the cloud. + + :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 be deleted. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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(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}/edgeModules/{edgeModuleName}'} # type: ignore + + async def list_provisioning_token( + self, + resource_group_name: str, + account_name: str, + edge_module_name: str, + parameters: "models.ListProvisioningTokenInput", + **kwargs + ) -> "models.EdgeModuleProvisioningToken": + """Creates a new provisioning token. + + Creates a new provisioning token. A provisioning token allows for a single instance of Azure + Video analyzer IoT edge module to be initialized and authorized to the cloud account. The + provisioning token itself is short lived and it is only used for the initial handshake between + IoT edge module and the cloud. After the initial handshake, the IoT edge module will agree on a + set of authentication keys which will be auto-rotated as long as the module is able to + periodically connect to the cloud. A new provisioning token can be generated for the same IoT + edge module in case the module state lost or reset. + + :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 used to create a new provisioning token. + :type edge_module_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.ListProvisioningTokenInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EdgeModuleProvisioningToken, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.EdgeModuleProvisioningToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleProvisioningToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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, 'ListProvisioningTokenInput') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EdgeModuleProvisioningToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_provisioning_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/edgeModules/{edgeModuleName}/listProvisioningToken'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_locations_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_locations_operations.py new file mode 100644 index 00000000000..7428a678dd2 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_locations_operations.py @@ -0,0 +1,106 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class LocationsOperations: + """LocationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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 check_name_availability( + self, + location_name: str, + parameters: "models.CheckNameAvailabilityRequest", + **kwargs + ) -> "models.CheckNameAvailabilityResponse": + """Check Name Availability. + + Checks whether the Video Analyzer resource name is available. + + :param location_name: The name of the location. + :type location_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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'), + } + 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, 'CheckNameAvailabilityRequest') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_operations.py new file mode 100644 index 00000000000..c59fd01ca83 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_operations.py @@ -0,0 +1,90 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + **kwargs + ) -> "models.OperationCollection": + """List Operations. + + Lists all the Media operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.OperationCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Media/operations'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_video_analyzers_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_video_analyzers_operations.py new file mode 100644 index 00000000000..56ce89eb36a --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_video_analyzers_operations.py @@ -0,0 +1,479 @@ +# 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VideoAnalyzersOperations: + """VideoAnalyzersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + **kwargs + ) -> "models.VideoAnalyzerCollection": + """List Video Analyzer accounts. + + Lists the Video Analyzer accounts in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoAnalyzerCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoAnalyzerCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + } + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzerCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> "models.VideoAnalyzer": + """Get a Video Analyzer account. + + Get the details of the specified 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: VideoAnalyzer, or the result of cls(response) + :rtype: ~azure_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" + 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\._\(\)]+$'), + '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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + parameters: "models.VideoAnalyzer", + **kwargs + ) -> "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: ~azure_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: ~azure_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" + 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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VideoAnalyzer') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VideoAnalyzer', 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}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + **kwargs + ) -> None: + """Delete a Video Analyzer account. + + Delete the specified 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: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + '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.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(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}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + parameters: "models.VideoAnalyzerUpdate", + **kwargs + ) -> "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: ~azure_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: ~azure_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" + 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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VideoAnalyzerUpdate') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + async def sync_storage_keys( + self, + resource_group_name: str, + account_name: str, + parameters: "models.SyncStorageKeysInput", + **kwargs + ) -> None: + """Synchronizes Storage Account Keys. + + Synchronizes storage account keys for a storage account associated with the Video Analyzer + account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.SyncStorageKeysInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.sync_storage_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SyncStorageKeysInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_storage_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/syncStorageKeys'} # type: ignore + + async def list_by_subscription( + self, + **kwargs + ) -> "models.VideoAnalyzerCollection": + """List Video Analyzer accounts. + + Lists the Video Analyzer accounts in the specific subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoAnalyzerCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoAnalyzerCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzerCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/videoAnalyzers'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_videos_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_videos_operations.py new file mode 100644 index 00000000000..6c624ce9dc0 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/aio/operations/_videos_operations.py @@ -0,0 +1,474 @@ +# 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 + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class VideosOperations: + """VideosOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + top: Optional[int] = None, + **kwargs + ) -> AsyncIterable["models.VideoEntityCollection"]: + """List all existing video resources. + + List all existing video resources in the specified 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 Azure Video Analyzer account name. + :type account_name: 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 VideoEntityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure_video_analyzer.models.VideoEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('VideoEntityCollection', 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(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}/videos'} # type: ignore + + async def get( + self, + resource_group_name: str, + account_name: str, + video_name: str, + **kwargs + ) -> "models.VideoEntity": + """Retrieves a video resource. + + Retrieves an existing video resource within an account with a 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. + :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) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + account_name: str, + video_name: str, + parameters: "models.VideoEntity", + **kwargs + ) -> "models.VideoEntity": + """Create or updates a video resource. + + Creates a new video resource or updates an existing one in an 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 Azure Video Analyzer account name. + :type account_name: str + :param video_name: The name of the video to create or update. + :type video_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.VideoEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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, 'VideoEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VideoEntity', 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}/videos/{videoName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + account_name: str, + video_name: str, + **kwargs + ) -> None: + """Deletes a video resource. + + Deletes an existing video resource and its underlying data. This operation is irreversible. + + :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 delete. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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(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}/videos/{videoName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + account_name: str, + video_name: str, + parameters: "models.VideoEntity", + **kwargs + ) -> "models.VideoEntity": + """Updates the properties of a video resource. + + Updates individual properties of an existing video resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param video_name: The name of the video to update. + :type video_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.VideoEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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, 'VideoEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore + + async def list_streaming_token( + self, + resource_group_name: str, + account_name: str, + video_name: str, + **kwargs + ) -> "models.VideoStreamingToken": + """Generates a streaming token for video playback. + + Generates a streaming token used for authenticating video playback. + + :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. + :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: ~azure_video_analyzer.models.VideoStreamingToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoStreamingToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_streaming_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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoStreamingToken', 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 diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/__init__.py new file mode 100644 index 00000000000..1685814b505 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/__init__.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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AccessPolicyEntity + from ._models_py3 import AccessPolicyEntityCollection + from ._models_py3 import AccountEncryption + from ._models_py3 import AuthenticationBase + from ._models_py3 import CheckNameAvailabilityRequest + from ._models_py3 import CheckNameAvailabilityResponse + from ._models_py3 import EccTokenKey + from ._models_py3 import EdgeModuleEntity + from ._models_py3 import EdgeModuleEntityCollection + from ._models_py3 import EdgeModuleProvisioningToken + from ._models_py3 import Endpoint + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import JwtAuthentication + from ._models_py3 import KeyVaultProperties + from ._models_py3 import ListProvisioningTokenInput + from ._models_py3 import LogSpecification + from ._models_py3 import MetricDimension + from ._models_py3 import MetricSpecification + from ._models_py3 import Operation + from ._models_py3 import OperationCollection + from ._models_py3 import OperationDisplay + 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 ServiceSpecification + from ._models_py3 import StorageAccount + from ._models_py3 import SyncStorageKeysInput + from ._models_py3 import SystemData + from ._models_py3 import TokenClaim + from ._models_py3 import TokenKey + from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedManagedIdentity + 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 VideoAnalyzerUpdate + 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 +except (SyntaxError, ImportError): + from ._models import AccessPolicyEntity # type: ignore + from ._models import AccessPolicyEntityCollection # type: ignore + from ._models import AccountEncryption # type: ignore + from ._models import AuthenticationBase # type: ignore + from ._models import CheckNameAvailabilityRequest # type: ignore + from ._models import CheckNameAvailabilityResponse # 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 Endpoint # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import JwtAuthentication # type: ignore + from ._models import KeyVaultProperties # type: ignore + from ._models import ListProvisioningTokenInput # type: ignore + from ._models import LogSpecification # type: ignore + from ._models import MetricDimension # type: ignore + from ._models import MetricSpecification # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationCollection # type: ignore + from ._models import OperationDisplay # 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 ServiceSpecification # type: ignore + from ._models import StorageAccount # type: ignore + from ._models import SyncStorageKeysInput # type: ignore + from ._models import SystemData # type: ignore + from ._models import TokenClaim # type: ignore + from ._models import TokenKey # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UserAssignedManagedIdentity # 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 VideoAnalyzerUpdate # 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 ._azure_video_analyzer_enums import ( + AccessPolicyEccAlgo, + AccessPolicyRole, + AccessPolicyRsaAlgo, + AccountEncryptionKeyType, + ActionType, + CheckNameAvailabilityReason, + CreatedByType, + MetricAggregationType, + MetricUnit, + VideoAnalyzerEndpointType, + VideoType, +) + +__all__ = [ + 'AccessPolicyEntity', + 'AccessPolicyEntityCollection', + 'AccountEncryption', + 'AuthenticationBase', + 'CheckNameAvailabilityRequest', + 'CheckNameAvailabilityResponse', + 'EccTokenKey', + 'EdgeModuleEntity', + 'EdgeModuleEntityCollection', + 'EdgeModuleProvisioningToken', + 'Endpoint', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'JwtAuthentication', + 'KeyVaultProperties', + 'ListProvisioningTokenInput', + 'LogSpecification', + 'MetricDimension', + 'MetricSpecification', + 'Operation', + 'OperationCollection', + 'OperationDisplay', + 'Properties', + 'ProxyResource', + 'Resource', + 'ResourceIdentity', + 'RsaTokenKey', + 'ServiceSpecification', + 'StorageAccount', + 'SyncStorageKeysInput', + 'SystemData', + 'TokenClaim', + 'TokenKey', + 'TrackedResource', + 'UserAssignedManagedIdentity', + 'VideoAnalyzer', + 'VideoAnalyzerCollection', + 'VideoAnalyzerIdentity', + 'VideoAnalyzerProperties', + 'VideoAnalyzerPropertiesUpdate', + 'VideoAnalyzerUpdate', + 'VideoEntity', + 'VideoEntityCollection', + 'VideoFlags', + 'VideoMediaInfo', + 'VideoStreaming', + 'VideoStreamingToken', + 'AccessPolicyEccAlgo', + 'AccessPolicyRole', + 'AccessPolicyRsaAlgo', + 'AccountEncryptionKeyType', + 'ActionType', + 'CheckNameAvailabilityReason', + 'CreatedByType', + 'MetricAggregationType', + 'MetricUnit', + 'VideoAnalyzerEndpointType', + 'VideoType', +] diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_azure_video_analyzer_enums.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_azure_video_analyzer_enums.py new file mode 100644 index 00000000000..353715a9a27 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_azure_video_analyzer_enums.py @@ -0,0 +1,106 @@ +# 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 enum import Enum, EnumMeta +from six import with_metaclass + +class _CaseInsensitiveEnumMeta(EnumMeta): + def __getitem__(self, name): + return super().__getitem__(name.upper()) + + def __getattr__(cls, name): + """Return the enum member matching `name` + We use __getattr__ instead of descriptors or inserting into the enum + class' __dict__ in order to support `name` and `value` being both + properties for enum members (which live in the class' __dict__) and + enum members themselves. + """ + try: + return cls._member_map_[name.upper()] + except KeyError: + raise AttributeError(name) + + +class AccessPolicyEccAlgo(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Elliptical curve algorithm to be used: ES256, ES384 or ES512. + """ + + ES256 = "ES256" #: ES265. + ES384 = "ES384" #: ES384. + ES512 = "ES512" #: ES512. + +class AccessPolicyRole(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Defines the access level granted by this policy. + """ + + READER = "Reader" #: Reader role allows for read-only operations to be performed through the client APIs. + +class AccessPolicyRsaAlgo(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """RSA algorithm to be used: RS256, RS384 or RS512. + """ + + RS256 = "RS256" #: RS256. + RS384 = "RS384" #: RS384. + RS512 = "RS512" #: RS512. + +class AccountEncryptionKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of key used to encrypt the Account Key. + """ + + SYSTEM_KEY = "SystemKey" #: The Account Key is encrypted with a System Key. + CUSTOMER_KEY = "CustomerKey" #: The Account Key is encrypted with a Customer Key. + +class ActionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates the action type. + """ + + INTERNAL = "Internal" #: An internal action. + +class CheckNameAvailabilityReason(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason why the given name is not available. + """ + + INVALID = "Invalid" + ALREADY_EXISTS = "AlreadyExists" + +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class MetricAggregationType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The metric aggregation type + """ + + AVERAGE = "Average" #: The average. + COUNT = "Count" #: The count of a number of items, usually requests. + TOTAL = "Total" #: The sum. + +class MetricUnit(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The metric unit + """ + + BYTES = "Bytes" #: The number of bytes. + COUNT = "Count" #: The count. + MILLISECONDS = "Milliseconds" #: The number of milliseconds. + +class VideoAnalyzerEndpointType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of the endpoint. + """ + + CLIENT_API = "ClientApi" #: The client API endpoint. + +class VideoType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of the video archive. Different archive formats provide different capabilities. + """ + + ARCHIVE = "Archive" #: 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. diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models.py new file mode 100644 index 00000000000..eb12c00ed28 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models.py @@ -0,0 +1,1710 @@ +# 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 azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyEntity(Resource): + """Policy that determines how a video can be accessed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_video_analyzer.models.SystemData + :param role: Defines the access level granted by this policy. Possible values include: + "Reader". + :type role: str or ~azure_video_analyzer.models.AccessPolicyRole + :param authentication: Authentication method to be used when validating client API access. + :type authentication: ~azure_video_analyzer.models.AuthenticationBase + """ + + _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'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'authentication': {'key': 'properties.authentication', 'type': 'AuthenticationBase'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessPolicyEntity, self).__init__(**kwargs) + self.system_data = None + self.role = kwargs.get('role', None) + self.authentication = kwargs.get('authentication', None) + + +class AccessPolicyEntityCollection(msrest.serialization.Model): + """A collection of AccessPolicyEntity items. + + :param value: A collection of AccessPolicyEntity items. + :type value: list[~azure_video_analyzer.models.AccessPolicyEntity] + :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': '[AccessPolicyEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessPolicyEntityCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class AccountEncryption(msrest.serialization.Model): + """Defines how the Video Analyzer account is (optionally) encrypted. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of key used to encrypt the Account Key. Possible values + include: "SystemKey", "CustomerKey". + :type type: str or ~azure_video_analyzer.models.AccountEncryptionKeyType + :param key_vault_properties: The properties of the key used to encrypt the account. + :type key_vault_properties: ~azure_video_analyzer.models.KeyVaultProperties + :param identity: The Key Vault identity. + :type identity: ~azure_video_analyzer.models.ResourceIdentity + :ivar status: The current status of the Key Vault mapping. + :vartype status: str + """ + + _validation = { + 'type': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccountEncryption, self).__init__(**kwargs) + self.type = kwargs['type'] + self.key_vault_properties = kwargs.get('key_vault_properties', None) + self.identity = kwargs.get('identity', None) + self.status = None + + +class AuthenticationBase(msrest.serialization.Model): + """Base class for access policies authentication methods. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: JwtAuthentication. + + 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.JwtAuthentication': 'JwtAuthentication'} + } + + def __init__( + self, + **kwargs + ): + super(AuthenticationBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The check availability request body. + + :param name: The name of the resource for which availability needs to be checked. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class CheckNameAvailabilityResponse(msrest.serialization.Model): + """The check availability result. + + :param name_available: Indicates if the resource name is available. + :type name_available: bool + :param reason: The reason why the given name is not available. Possible values include: + "Invalid", "AlreadyExists". + :type reason: str or ~azure_video_analyzer.models.CheckNameAvailabilityReason + :param message: Detailed reason why the given name is available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = kwargs.get('name_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) + + +class TokenKey(msrest.serialization.Model): + """Key properties for JWT token validation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EccTokenKey, RsaTokenKey. + + 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 + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EccTokenKey': 'EccTokenKey', '#Microsoft.VideoAnalyzer.RsaTokenKey': 'RsaTokenKey'} + } + + def __init__( + self, + **kwargs + ): + super(TokenKey, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.kid = kwargs['kid'] + + +class EccTokenKey(TokenKey): + """Required validation properties for tokens generated with Elliptical Curve 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. Elliptical curve algorithm to be used: ES256, ES384 or ES512. Possible + values include: "ES256", "ES384", "ES512". + :type alg: str or ~azure_video_analyzer.models.AccessPolicyEccAlgo + :param x: Required. X coordinate. + :type x: str + :param y: Required. Y coordinate. + :type y: str + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + 'alg': {'required': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'str'}, + 'y': {'key': 'y', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EccTokenKey, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.EccTokenKey' # type: str + self.alg = kwargs['alg'] + self.x = kwargs['x'] + self.y = kwargs['y'] + + +class EdgeModuleEntity(Resource): + """The representation of an edge module. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'edge_module_id': {'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'}, + 'edge_module_id': {'key': 'properties.edgeModuleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeModuleEntity, self).__init__(**kwargs) + self.system_data = None + self.edge_module_id = None + + +class EdgeModuleEntityCollection(msrest.serialization.Model): + """A collection of EdgeModuleEntity items. + + :param value: A collection of EdgeModuleEntity items. + :type value: list[~azure_video_analyzer.models.EdgeModuleEntity] + :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': '[EdgeModuleEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeModuleEntityCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class EdgeModuleProvisioningToken(msrest.serialization.Model): + """Provisioning token properties. A provisioning token allows for a single instance of Azure Video analyzer IoT edge module to be initialized and authorized to the cloud account. The provisioning token itself is short lived and it is only used for the initial handshake between IoT edge module and the cloud. After the initial handshake, the IoT edge module will agree on a set of authentication keys which will be auto-rotated as long as the module is able to periodically connect to the cloud. A new provisioning token can be generated for the same IoT edge module in case the module state lost or reset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar expiration_date: The 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. + :vartype expiration_date: ~datetime.datetime + :ivar token: The token blob to be provided to the Azure Video Analyzer IoT edge module through + the Azure IoT Edge module twin properties. + :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(EdgeModuleProvisioningToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None + + +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 ~azure_video_analyzer.models.VideoAnalyzerEndpointType + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Endpoint, self).__init__(**kwargs) + self.endpoint_url = kwargs.get('endpoint_url', None) + self.type = kwargs['type'] + + +class 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: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure_video_analyzer.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure_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: ~azure_video_analyzer.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class 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[~azure_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[~azure_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 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 ~azure_video_analyzer.models.MetricUnit + :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", + "Count", "Total". + :vartype aggregation_type: str or ~azure_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 ~azure_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[~azure_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 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: ~azure_video_analyzer.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param properties: Operation properties format. + :type properties: ~azure_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 ~azure_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[~azure_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 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: ~azure_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 ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +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 ~azure_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 ServiceSpecification(msrest.serialization.Model): + """The service metric specifications. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar log_specifications: List of log specifications. + :vartype log_specifications: list[~azure_video_analyzer.models.LogSpecification] + :ivar metric_specifications: List of metric specifications. + :vartype metric_specifications: list[~azure_video_analyzer.models.MetricSpecification] + """ + + _validation = { + 'log_specifications': {'readonly': True}, + 'metric_specifications': {'readonly': True}, + } + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = None + self.metric_specifications = 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 + Microsoft.ClassicStorage or Microsoft.Storage). + :type id: str + :param identity: A managed identity that Video Analyzer will use to access the storage account. + :type identity: ~azure_video_analyzer.models.ResourceIdentity + :ivar status: The current status of the storage account mapping. + :vartype status: str + """ + + _validation = { + '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(StorageAccount, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + 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. + + :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 ~azure_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 ~azure_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, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TokenClaim(msrest.serialization.Model): + """Properties for expected token claims. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the claim which must be present on the token. + :type name: str + :param value: Required. Expected value of the claim to be present on the token. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TokenClaim, self).__init__(**kwargs) + self.name = kwargs['name'] + self.value = kwargs['value'] + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + 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 + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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'}, + } + + def __init__( + self, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class UserAssignedManagedIdentity(msrest.serialization.Model): + """The details of the user assigned managed identity used by the Video Analyzer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str + """ + + _validation = { + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None + + +class VideoAnalyzer(TrackedResource): + """A Video Analyzer account. + + 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 + :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: ~azure_video_analyzer.models.SystemData + :param identity: The set of managed identities associated with the Video Analyzer resource. + :type identity: ~azure_video_analyzer.models.VideoAnalyzerIdentity + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'endpoints': {'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'}, + } + + def __init__( + self, + **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) + + +class VideoAnalyzerCollection(msrest.serialization.Model): + """A collection of VideoAnalyzer items. + + :param value: A collection of VideoAnalyzer items. + :type value: list[~azure_video_analyzer.models.VideoAnalyzer] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[VideoAnalyzer]'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class VideoAnalyzerIdentity(msrest.serialization.Model): + """The managed identity for the Video Analyzer resource. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The identity type. + :type type: str + :param user_assigned_identities: The User Assigned Managed Identities. + :type user_assigned_identities: dict[str, + ~azure_video_analyzer.models.UserAssignedManagedIdentity] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedManagedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerIdentity, self).__init__(**kwargs) + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class 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. + + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': True}, + } + + _attribute_map = { + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + } + + 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) + + +class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): + """VideoAnalyzerProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': True}, + } + + _attribute_map = { + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerProperties, self).__init__(**kwargs) + + +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 identity: The identities associated to the Video Analyzer resource. + :type identity: ~azure_video_analyzer.models.VideoAnalyzerIdentity + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': 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'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoAnalyzerUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + self.storage_accounts = kwargs.get('storage_accounts', None) + self.endpoints = None + self.encryption = kwargs.get('encryption', None) + + +class VideoEntity(Resource): + """The representation of a single video in a Video Analyzer account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_video_analyzer.models.SystemData + :param title: Optional video title provided by the user. Value can be up to 256 characters + long. + :type title: str + :param description: Optional video description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :ivar type_properties_type: Type of the video archive. Different archive formats provide + different capabilities. Possible values include: "Archive". + :vartype type_properties_type: str or ~azure_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: ~azure_video_analyzer.models.VideoFlags + :ivar streaming: Video streaming holds information about video streaming URLs. + :vartype streaming: ~azure_video_analyzer.models.VideoStreaming + :ivar media_info: Contains information about the video and audio content. + :vartype media_info: ~azure_video_analyzer.models.VideoMediaInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type_properties_type': {'readonly': True}, + 'flags': {'readonly': True}, + 'streaming': {'readonly': True}, + 'media_info': {'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'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + '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'}, + 'media_info': {'key': 'properties.mediaInfo', 'type': 'VideoMediaInfo'}, + } + + def __init__( + self, + **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.media_info = None + + +class VideoEntityCollection(msrest.serialization.Model): + """A collection of VideoEntity items. + + :param value: A collection of VideoEntity items. + :type value: list[~azure_video_analyzer.models.VideoEntity] + :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': '[VideoEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoEntityCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class VideoFlags(msrest.serialization.Model): + """Video flags contain information about the available video actions and its dynamic properties based on the current video state. + + All required parameters must be populated in order to send to Azure. + + :param can_stream: Required. Value indicating whether or not the video can be streamed. Only + "archive" type videos can be streamed. + :type can_stream: bool + :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 + 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 + """ + + _validation = { + 'can_stream': {'required': True}, + 'has_data': {'required': True}, + 'is_recording': {'required': True}, + } + + _attribute_map = { + 'can_stream': {'key': 'canStream', 'type': 'bool'}, + 'has_data': {'key': 'hasData', 'type': 'bool'}, + 'is_recording': {'key': 'isRecording', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoFlags, self).__init__(**kwargs) + self.can_stream = kwargs['can_stream'] + self.has_data = kwargs['has_data'] + self.is_recording = kwargs['is_recording'] + + +class VideoMediaInfo(msrest.serialization.Model): + """Contains information about the video and audio content. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar segment_length: Video segment length indicates the length of individual video files + (segments) which are persisted to storage. Smaller segments provide lower archive playback + latency but generate larger volume of storage transactions. Larger segments reduce the amount + of storage transactions while increasing the archive playback latency. Value must be specified + in ISO8601 duration format (i.e. "PT30S" equals 30 seconds) and can vary between 30 seconds to + 5 minutes, in 30 seconds increments. + :vartype segment_length: str + """ + + _validation = { + 'segment_length': {'readonly': True}, + } + + _attribute_map = { + 'segment_length': {'key': 'segmentLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoMediaInfo, self).__init__(**kwargs) + self.segment_length = None + + +class VideoStreaming(msrest.serialization.Model): + """Video streaming holds information about video streaming URLs. + + :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 + """ + + _attribute_map = { + 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoStreaming, self).__init__(**kwargs) + self.archive_base_url = kwargs.get('archive_base_url', None) + + +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. + + :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 + """ + + _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(VideoStreamingToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models_py3.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models_py3.py new file mode 100644 index 00000000000..75f1a173b0c --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/models/_models_py3.py @@ -0,0 +1,1831 @@ +# 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. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._azure_video_analyzer_enums import * + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessPolicyEntity(Resource): + """Policy that determines how a video can be accessed. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_video_analyzer.models.SystemData + :param role: Defines the access level granted by this policy. Possible values include: + "Reader". + :type role: str or ~azure_video_analyzer.models.AccessPolicyRole + :param authentication: Authentication method to be used when validating client API access. + :type authentication: ~azure_video_analyzer.models.AuthenticationBase + """ + + _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'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'authentication': {'key': 'properties.authentication', 'type': 'AuthenticationBase'}, + } + + def __init__( + self, + *, + role: Optional[Union[str, "AccessPolicyRole"]] = None, + authentication: Optional["AuthenticationBase"] = None, + **kwargs + ): + super(AccessPolicyEntity, self).__init__(**kwargs) + self.system_data = None + self.role = role + self.authentication = authentication + + +class AccessPolicyEntityCollection(msrest.serialization.Model): + """A collection of AccessPolicyEntity items. + + :param value: A collection of AccessPolicyEntity items. + :type value: list[~azure_video_analyzer.models.AccessPolicyEntity] + :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': '[AccessPolicyEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["AccessPolicyEntity"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(AccessPolicyEntityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class AccountEncryption(msrest.serialization.Model): + """Defines how the Video Analyzer account is (optionally) encrypted. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The type of key used to encrypt the Account Key. Possible values + include: "SystemKey", "CustomerKey". + :type type: str or ~azure_video_analyzer.models.AccountEncryptionKeyType + :param key_vault_properties: The properties of the key used to encrypt the account. + :type key_vault_properties: ~azure_video_analyzer.models.KeyVaultProperties + :param identity: The Key Vault identity. + :type identity: ~azure_video_analyzer.models.ResourceIdentity + :ivar status: The current status of the Key Vault mapping. + :vartype status: str + """ + + _validation = { + 'type': {'required': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Union[str, "AccountEncryptionKeyType"], + key_vault_properties: Optional["KeyVaultProperties"] = None, + identity: Optional["ResourceIdentity"] = None, + **kwargs + ): + super(AccountEncryption, self).__init__(**kwargs) + self.type = type + self.key_vault_properties = key_vault_properties + self.identity = identity + self.status = None + + +class AuthenticationBase(msrest.serialization.Model): + """Base class for access policies authentication methods. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: JwtAuthentication. + + 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.JwtAuthentication': 'JwtAuthentication'} + } + + def __init__( + self, + **kwargs + ): + super(AuthenticationBase, self).__init__(**kwargs) + self.type = None # type: Optional[str] + + +class CheckNameAvailabilityRequest(msrest.serialization.Model): + """The check availability request body. + + :param name: The name of the resource for which availability needs to be checked. + :type name: str + :param type: The resource type. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + super(CheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name + self.type = type + + +class CheckNameAvailabilityResponse(msrest.serialization.Model): + """The check availability result. + + :param name_available: Indicates if the resource name is available. + :type name_available: bool + :param reason: The reason why the given name is not available. Possible values include: + "Invalid", "AlreadyExists". + :type reason: str or ~azure_video_analyzer.models.CheckNameAvailabilityReason + :param message: Detailed reason why the given name is available. + :type message: str + """ + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + name_available: Optional[bool] = None, + reason: Optional[Union[str, "CheckNameAvailabilityReason"]] = None, + message: Optional[str] = None, + **kwargs + ): + super(CheckNameAvailabilityResponse, self).__init__(**kwargs) + self.name_available = name_available + self.reason = reason + self.message = message + + +class TokenKey(msrest.serialization.Model): + """Key properties for JWT token validation. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: EccTokenKey, RsaTokenKey. + + 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 + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + } + + _subtype_map = { + 'type': {'#Microsoft.VideoAnalyzer.EccTokenKey': 'EccTokenKey', '#Microsoft.VideoAnalyzer.RsaTokenKey': 'RsaTokenKey'} + } + + def __init__( + self, + *, + kid: str, + **kwargs + ): + super(TokenKey, self).__init__(**kwargs) + self.type = None # type: Optional[str] + self.kid = kid + + +class EccTokenKey(TokenKey): + """Required validation properties for tokens generated with Elliptical Curve 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. Elliptical curve algorithm to be used: ES256, ES384 or ES512. Possible + values include: "ES256", "ES384", "ES512". + :type alg: str or ~azure_video_analyzer.models.AccessPolicyEccAlgo + :param x: Required. X coordinate. + :type x: str + :param y: Required. Y coordinate. + :type y: str + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + 'alg': {'required': True}, + 'x': {'required': True}, + 'y': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'str'}, + 'y': {'key': 'y', 'type': 'str'}, + } + + def __init__( + self, + *, + kid: str, + alg: Union[str, "AccessPolicyEccAlgo"], + x: str, + y: str, + **kwargs + ): + super(EccTokenKey, self).__init__(kid=kid, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.EccTokenKey' # type: str + self.alg = alg + self.x = x + self.y = y + + +class EdgeModuleEntity(Resource): + """The representation of an edge module. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'edge_module_id': {'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'}, + 'edge_module_id': {'key': 'properties.edgeModuleId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(EdgeModuleEntity, self).__init__(**kwargs) + self.system_data = None + self.edge_module_id = None + + +class EdgeModuleEntityCollection(msrest.serialization.Model): + """A collection of EdgeModuleEntity items. + + :param value: A collection of EdgeModuleEntity items. + :type value: list[~azure_video_analyzer.models.EdgeModuleEntity] + :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': '[EdgeModuleEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["EdgeModuleEntity"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(EdgeModuleEntityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class EdgeModuleProvisioningToken(msrest.serialization.Model): + """Provisioning token properties. A provisioning token allows for a single instance of Azure Video analyzer IoT edge module to be initialized and authorized to the cloud account. The provisioning token itself is short lived and it is only used for the initial handshake between IoT edge module and the cloud. After the initial handshake, the IoT edge module will agree on a set of authentication keys which will be auto-rotated as long as the module is able to periodically connect to the cloud. A new provisioning token can be generated for the same IoT edge module in case the module state lost or reset. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar expiration_date: The 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. + :vartype expiration_date: ~datetime.datetime + :ivar token: The token blob to be provided to the Azure Video Analyzer IoT edge module through + the Azure IoT Edge module twin properties. + :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(EdgeModuleProvisioningToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None + + +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 ~azure_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 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: object + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure_video_analyzer.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure_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: ~azure_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 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[~azure_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[~azure_video_analyzer.models.TokenKey] + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'issuers': {'key': 'issuers', 'type': '[str]'}, + 'audiences': {'key': 'audiences', 'type': '[str]'}, + 'claims': {'key': 'claims', 'type': '[TokenClaim]'}, + 'keys': {'key': 'keys', 'type': '[TokenKey]'}, + } + + def __init__( + self, + *, + issuers: Optional[List[str]] = None, + audiences: Optional[List[str]] = None, + claims: Optional[List["TokenClaim"]] = None, + keys: Optional[List["TokenKey"]] = None, + **kwargs + ): + super(JwtAuthentication, self).__init__(**kwargs) + self.type = '#Microsoft.VideoAnalyzer.JwtAuthentication' # type: str + self.issuers = issuers + self.audiences = audiences + self.claims = claims + self.keys = keys + + +class KeyVaultProperties(msrest.serialization.Model): + """The details for accessing the encryption keys in Key Vault. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :param key_identifier: Required. The URL of the Key Vault key used to encrypt the account. The + key may either be versioned (for example https://vault/keys/mykey/version1) or reference a key + without a version (for example https://vault/keys/mykey). + :type key_identifier: str + :ivar current_key_identifier: The current key used to encrypt Video Analyzer account, including + the key version. + :vartype current_key_identifier: str + """ + + _validation = { + 'key_identifier': {'required': True}, + 'current_key_identifier': {'readonly': True}, + } + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'current_key_identifier': {'key': 'currentKeyIdentifier', 'type': 'str'}, + } + + def __init__( + self, + *, + key_identifier: str, + **kwargs + ): + super(KeyVaultProperties, self).__init__(**kwargs) + self.key_identifier = key_identifier + self.current_key_identifier = None + + +class ListProvisioningTokenInput(msrest.serialization.Model): + """The input parameters to generate registration token for the Azure Video Analyzer IoT edge module. + + All required parameters must be populated in order to send to Azure. + + :param expiration_date: Required. The desired expiration date of the registration token. The + Azure Video Analyzer IoT edge module must be initialized and connected to the Internet prior to + the token expiration date. + :type expiration_date: ~datetime.datetime + """ + + _validation = { + 'expiration_date': {'required': True}, + } + + _attribute_map = { + 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + expiration_date: datetime.datetime, + **kwargs + ): + super(ListProvisioningTokenInput, self).__init__(**kwargs) + self.expiration_date = expiration_date + + +class 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 ~azure_video_analyzer.models.MetricUnit + :ivar aggregation_type: The metric aggregation type. Possible values include: "Average", + "Count", "Total". + :vartype aggregation_type: str or ~azure_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 ~azure_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[~azure_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 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: ~azure_video_analyzer.models.OperationDisplay + :param origin: Origin of the operation. + :type origin: str + :param properties: Operation properties format. + :type properties: ~azure_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 ~azure_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[~azure_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 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: ~azure_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 ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + 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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ProxyResource, self).__init__(**kwargs) + + +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, + *, + user_assigned_identity: str, + **kwargs + ): + super(ResourceIdentity, self).__init__(**kwargs) + self.user_assigned_identity = user_assigned_identity + + +class RsaTokenKey(TokenKey): + """Required validation properties for tokens generated with RSA algorithm. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. The discriminator for derived types.Constant filled by server. + :type type: str + :param kid: Required. JWT token key id. Validation keys are looked up based on the key id + present on the JWT token header. + :type kid: str + :param alg: Required. RSA algorithm to be used: RS256, RS384 or RS512. Possible values include: + "RS256", "RS384", "RS512". + :type alg: str or ~azure_video_analyzer.models.AccessPolicyRsaAlgo + :param n: Required. RSA public key modulus. + :type n: str + :param e: Required. RSA public key exponent. + :type e: str + """ + + _validation = { + 'type': {'required': True}, + 'kid': {'required': True}, + 'alg': {'required': True}, + 'n': {'required': True}, + 'e': {'required': True}, + } + + _attribute_map = { + 'type': {'key': '@type', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'alg': {'key': 'alg', 'type': 'str'}, + 'n': {'key': 'n', 'type': 'str'}, + 'e': {'key': 'e', 'type': 'str'}, + } + + def __init__( + self, + *, + kid: str, + alg: Union[str, "AccessPolicyRsaAlgo"], + n: str, + e: str, + **kwargs + ): + super(RsaTokenKey, self).__init__(kid=kid, **kwargs) + self.type = '#Microsoft.VideoAnalyzer.RsaTokenKey' # type: str + self.alg = alg + self.n = n + self.e = e + + +class ServiceSpecification(msrest.serialization.Model): + """The service metric specifications. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar log_specifications: List of log specifications. + :vartype log_specifications: list[~azure_video_analyzer.models.LogSpecification] + :ivar metric_specifications: List of metric specifications. + :vartype metric_specifications: list[~azure_video_analyzer.models.MetricSpecification] + """ + + _validation = { + 'log_specifications': {'readonly': True}, + 'metric_specifications': {'readonly': True}, + } + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + 'metric_specifications': {'key': 'metricSpecifications', 'type': '[MetricSpecification]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = None + self.metric_specifications = 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 + Microsoft.ClassicStorage or Microsoft.Storage). + :type id: str + :param identity: A managed identity that Video Analyzer will use to access the storage account. + :type identity: ~azure_video_analyzer.models.ResourceIdentity + :ivar status: The current status of the storage account mapping. + :vartype status: str + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + identity: Optional["ResourceIdentity"] = None, + **kwargs + ): + super(StorageAccount, self).__init__(**kwargs) + self.id = id + self.identity = identity + self.status = None + + +class SyncStorageKeysInput(msrest.serialization.Model): + """The input to the sync storage keys request. + + :param id: The ID of the storage account resource. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + super(SyncStorageKeysInput, self).__init__(**kwargs) + self.id = id + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :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 ~azure_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 ~azure_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 TokenClaim(msrest.serialization.Model): + """Properties for expected token claims. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Name of the claim which must be present on the token. + :type name: str + :param value: Required. Expected value of the claim to be present on the token. + :type value: str + """ + + _validation = { + 'name': {'required': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + *, + name: str, + value: str, + **kwargs + ): + super(TokenClaim, self).__init__(**kwargs) + self.name = name + self.value = value + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + 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 + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': 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'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class UserAssignedManagedIdentity(msrest.serialization.Model): + """The details of the user assigned managed identity used by the Video Analyzer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar client_id: The client ID. + :vartype client_id: str + :ivar principal_id: The principal ID. + :vartype principal_id: str + """ + + _validation = { + 'client_id': {'readonly': True}, + 'principal_id': {'readonly': True}, + } + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedManagedIdentity, self).__init__(**kwargs) + self.client_id = None + self.principal_id = None + + +class VideoAnalyzer(TrackedResource): + """A Video Analyzer account. + + 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 + :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: ~azure_video_analyzer.models.SystemData + :param identity: The set of managed identities associated with the Video Analyzer resource. + :type identity: ~azure_video_analyzer.models.VideoAnalyzerIdentity + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'endpoints': {'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'}, + } + + 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, + **kwargs + ): + super(VideoAnalyzer, self).__init__(tags=tags, location=location, **kwargs) + self.system_data = None + 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[~azure_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, + ~azure_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 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. + + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': True}, + } + + _attribute_map = { + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + } + + def __init__( + self, + *, + storage_accounts: Optional[List["StorageAccount"]] = None, + encryption: Optional["AccountEncryption"] = None, + **kwargs + ): + super(VideoAnalyzerPropertiesUpdate, self).__init__(**kwargs) + self.storage_accounts = storage_accounts + self.endpoints = None + self.encryption = encryption + + +class VideoAnalyzerProperties(VideoAnalyzerPropertiesUpdate): + """VideoAnalyzerProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': True}, + } + + _attribute_map = { + 'storage_accounts': {'key': 'storageAccounts', 'type': '[StorageAccount]'}, + 'endpoints': {'key': 'endpoints', 'type': '[Endpoint]'}, + 'encryption': {'key': 'encryption', 'type': 'AccountEncryption'}, + } + + def __init__( + self, + *, + storage_accounts: Optional[List["StorageAccount"]] = None, + encryption: Optional["AccountEncryption"] = None, + **kwargs + ): + super(VideoAnalyzerProperties, self).__init__(storage_accounts=storage_accounts, encryption=encryption, **kwargs) + + +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 identity: The identities associated to the Video Analyzer resource. + :type identity: ~azure_video_analyzer.models.VideoAnalyzerIdentity + :param storage_accounts: The storage accounts for this resource. + :type storage_accounts: list[~azure_video_analyzer.models.StorageAccount] + :ivar endpoints: The list of endpoints associated with this resource. + :vartype endpoints: list[~azure_video_analyzer.models.Endpoint] + :param encryption: The account encryption properties. + :type encryption: ~azure_video_analyzer.models.AccountEncryption + """ + + _validation = { + 'endpoints': {'readonly': 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'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + identity: Optional["VideoAnalyzerIdentity"] = None, + storage_accounts: Optional[List["StorageAccount"]] = None, + encryption: Optional["AccountEncryption"] = None, + **kwargs + ): + super(VideoAnalyzerUpdate, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + self.storage_accounts = storage_accounts + self.endpoints = None + self.encryption = encryption + + +class VideoEntity(Resource): + """The representation of a single video in a Video Analyzer account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: The system metadata relating to this resource. + :vartype system_data: ~azure_video_analyzer.models.SystemData + :param title: Optional video title provided by the user. Value can be up to 256 characters + long. + :type title: str + :param description: Optional video description provided by the user. Value can be up to 2048 + characters long. + :type description: str + :ivar type_properties_type: Type of the video archive. Different archive formats provide + different capabilities. Possible values include: "Archive". + :vartype type_properties_type: str or ~azure_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: ~azure_video_analyzer.models.VideoFlags + :ivar streaming: Video streaming holds information about video streaming URLs. + :vartype streaming: ~azure_video_analyzer.models.VideoStreaming + :ivar media_info: Contains information about the video and audio content. + :vartype media_info: ~azure_video_analyzer.models.VideoMediaInfo + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'type_properties_type': {'readonly': True}, + 'flags': {'readonly': True}, + 'streaming': {'readonly': True}, + 'media_info': {'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'}, + 'title': {'key': 'properties.title', 'type': 'str'}, + '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'}, + 'media_info': {'key': 'properties.mediaInfo', 'type': 'VideoMediaInfo'}, + } + + def __init__( + self, + *, + title: Optional[str] = None, + description: Optional[str] = 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.media_info = None + + +class VideoEntityCollection(msrest.serialization.Model): + """A collection of VideoEntity items. + + :param value: A collection of VideoEntity items. + :type value: list[~azure_video_analyzer.models.VideoEntity] + :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': '[VideoEntity]'}, + 'next_link': {'key': '@nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["VideoEntity"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(VideoEntityCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class VideoFlags(msrest.serialization.Model): + """Video flags contain information about the available video actions and its dynamic properties based on the current video state. + + All required parameters must be populated in order to send to Azure. + + :param can_stream: Required. Value indicating whether or not the video can be streamed. Only + "archive" type videos can be streamed. + :type can_stream: bool + :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 + 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 + """ + + _validation = { + 'can_stream': {'required': True}, + 'has_data': {'required': True}, + 'is_recording': {'required': True}, + } + + _attribute_map = { + 'can_stream': {'key': 'canStream', 'type': 'bool'}, + 'has_data': {'key': 'hasData', 'type': 'bool'}, + 'is_recording': {'key': 'isRecording', 'type': 'bool'}, + } + + def __init__( + self, + *, + can_stream: bool, + has_data: bool, + is_recording: bool, + **kwargs + ): + super(VideoFlags, self).__init__(**kwargs) + self.can_stream = can_stream + self.has_data = has_data + self.is_recording = is_recording + + +class VideoMediaInfo(msrest.serialization.Model): + """Contains information about the video and audio content. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar segment_length: Video segment length indicates the length of individual video files + (segments) which are persisted to storage. Smaller segments provide lower archive playback + latency but generate larger volume of storage transactions. Larger segments reduce the amount + of storage transactions while increasing the archive playback latency. Value must be specified + in ISO8601 duration format (i.e. "PT30S" equals 30 seconds) and can vary between 30 seconds to + 5 minutes, in 30 seconds increments. + :vartype segment_length: str + """ + + _validation = { + 'segment_length': {'readonly': True}, + } + + _attribute_map = { + 'segment_length': {'key': 'segmentLength', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(VideoMediaInfo, self).__init__(**kwargs) + self.segment_length = None + + +class VideoStreaming(msrest.serialization.Model): + """Video streaming holds information about video streaming URLs. + + :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 + """ + + _attribute_map = { + 'archive_base_url': {'key': 'archiveBaseUrl', 'type': 'str'}, + } + + def __init__( + self, + *, + archive_base_url: Optional[str] = None, + **kwargs + ): + super(VideoStreaming, self).__init__(**kwargs) + self.archive_base_url = archive_base_url + + +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. + + :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 + """ + + _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(VideoStreamingToken, self).__init__(**kwargs) + self.expiration_date = None + self.token = None diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/__init__.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/__init__.py new file mode 100644 index 00000000000..1ee2a23110a --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/__init__.py @@ -0,0 +1,23 @@ +# 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 ._operations import Operations +from ._video_analyzers_operations import VideoAnalyzersOperations +from ._locations_operations import LocationsOperations +from ._edge_modules_operations import EdgeModulesOperations +from ._videos_operations import VideosOperations +from ._access_policies_operations import AccessPoliciesOperations + +__all__ = [ + 'Operations', + 'VideoAnalyzersOperations', + 'LocationsOperations', + 'EdgeModulesOperations', + 'VideosOperations', + 'AccessPoliciesOperations', +] diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_access_policies_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_access_policies_operations.py new file mode 100644 index 00000000000..0f7a3072b1d --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_access_policies_operations.py @@ -0,0 +1,418 @@ +# 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 + +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 AccessPoliciesOperations(object): + """AccessPoliciesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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 + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.AccessPolicyEntityCollection"] + """List access policy resources. + + List all existing access policy resources for the specified 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 Azure Video Analyzer account name. + :type account_name: 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 AccessPolicyEntityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_video_analyzer.models.AccessPolicyEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccessPolicyEntityCollection', 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(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}/accessPolicies'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + access_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.AccessPolicyEntity" + """Retrieves an access policy resource. + + Retrieves an existing access policy resource from an account by 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. + :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) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/accessPolicies/{accessPolicyName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + access_policy_name, # type: str + parameters, # type: "models.AccessPolicyEntity" + **kwargs # type: Any + ): + # type: (...) -> "models.AccessPolicyEntity" + """Creates or updates an access policy. + + Creates a new access policy resource or updates an existing one. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to create or update. + :type access_policy_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.AccessPolicyEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessPolicyEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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, 'AccessPolicyEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('AccessPolicyEntity', 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}/accessPolicies/{accessPolicyName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + access_policy_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an access policy. + + Deletes an existing access policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to delete. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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(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}/accessPolicies/{accessPolicyName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + access_policy_name, # type: str + parameters, # type: "models.AccessPolicyEntity" + **kwargs # type: Any + ): + # type: (...) -> "models.AccessPolicyEntity" + """Updates an existing access policy. + + Updates individual properties of an existing access policy resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param access_policy_name: The name of the access policy to update. + :type access_policy_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.AccessPolicyEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessPolicyEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.AccessPolicyEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.AccessPolicyEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'accessPolicyName': self._serialize.url("access_policy_name", access_policy_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, 'AccessPolicyEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('AccessPolicyEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/accessPolicies/{accessPolicyName}'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_edge_modules_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_edge_modules_operations.py new file mode 100644 index 00000000000..aa8f0ce252b --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_edge_modules_operations.py @@ -0,0 +1,442 @@ +# 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 + +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 EdgeModulesOperations(object): + """EdgeModulesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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] + orderby=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.EdgeModuleEntityCollection"] + """List edge module resources. + + List all of the existing edge module resources for a given 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 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[~azure_video_analyzer.models.EdgeModuleEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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: + url = next_link + query_parameters = {} # type: Dict[str, Any] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('EdgeModuleEntityCollection', 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(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}/edgeModules'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + edge_module_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.EdgeModuleEntity" + """Retrieves an existing edge module resource. + + Retrieves a specific existing edge module resource in the given 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 Azure Video Analyzer account name. + :type account_name: str + :param edge_module_name: The name of the edge module to retrieve. + :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) + :rtype: ~azure_video_analyzer.models.EdgeModuleEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EdgeModuleEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/edgeModules/{edgeModuleName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + edge_module_name, # type: str + parameters, # type: "models.EdgeModuleEntity" + **kwargs # type: Any + ): + # type: (...) -> "models.EdgeModuleEntity" + """Creates a new edge module or updates an existing one. + + Creates a new edge module or updates an existing one. An edge module resource enables a single + instance of an Azure Video Analyzer IoT edge module to interact with the Video Analyzer + Account. This is used for authorization and also to make sure that the particular edge module + instance only has access to the data it requires from the Azure Video Analyzer service. A new + edge module resource should be created for every new instance of an Azure Video Analyzer edge + module deployed to you Azure IoT edge environment. Edge module resources can be deleted if the + specific module is not in use anymore. + + :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 create or update. + :type edge_module_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.EdgeModuleEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EdgeModuleEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.EdgeModuleEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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, 'EdgeModuleEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('EdgeModuleEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('EdgeModuleEntity', 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}/edgeModules/{edgeModuleName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + edge_module_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes an existing edge module resource. + + Deletes an existing edge module resource. Deleting the edge module resource will prevent an + Azure Video Analyzer IoT edge module which was previously initiated with the module + provisioning token from communicating with the cloud. + + :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 be deleted. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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(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}/edgeModules/{edgeModuleName}'} # type: ignore + + def list_provisioning_token( + self, + resource_group_name, # type: str + account_name, # type: str + edge_module_name, # type: str + parameters, # type: "models.ListProvisioningTokenInput" + **kwargs # type: Any + ): + # type: (...) -> "models.EdgeModuleProvisioningToken" + """Creates a new provisioning token. + + Creates a new provisioning token. A provisioning token allows for a single instance of Azure + Video analyzer IoT edge module to be initialized and authorized to the cloud account. The + provisioning token itself is short lived and it is only used for the initial handshake between + IoT edge module and the cloud. After the initial handshake, the IoT edge module will agree on a + set of authentication keys which will be auto-rotated as long as the module is able to + periodically connect to the cloud. A new provisioning token can be generated for the same IoT + edge module in case the module state lost or reset. + + :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 used to create a new provisioning token. + :type edge_module_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.ListProvisioningTokenInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: EdgeModuleProvisioningToken, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.EdgeModuleProvisioningToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.EdgeModuleProvisioningToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'edgeModuleName': self._serialize.url("edge_module_name", edge_module_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, 'ListProvisioningTokenInput') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('EdgeModuleProvisioningToken', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_provisioning_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/edgeModules/{edgeModuleName}/listProvisioningToken'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_locations_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_locations_operations.py new file mode 100644 index 00000000000..9df1ff17fc1 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_locations_operations.py @@ -0,0 +1,111 @@ +# 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 + +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 LocationsOperations(object): + """LocationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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 check_name_availability( + self, + location_name, # type: str + parameters, # type: "models.CheckNameAvailabilityRequest" + **kwargs # type: Any + ): + # type: (...) -> "models.CheckNameAvailabilityResponse" + """Check Name Availability. + + Checks whether the Video Analyzer resource name is available. + + :param location_name: The name of the location. + :type location_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.CheckNameAvailabilityRequest + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CheckNameAvailabilityResponse, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.CheckNameAvailabilityResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.CheckNameAvailabilityResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.check_name_availability.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'), + } + 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, 'CheckNameAvailabilityRequest') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CheckNameAvailabilityResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/checkNameAvailability'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_operations.py new file mode 100644 index 00000000000..d5343cc8c26 --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_operations.py @@ -0,0 +1,95 @@ +# 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 + +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 Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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, + **kwargs # type: Any + ): + # type: (...) -> "models.OperationCollection" + """List Operations. + + Lists all the Media operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OperationCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.OperationCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.OperationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list.metadata['url'] # type: ignore + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('OperationCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.Media/operations'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_video_analyzers_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_video_analyzers_operations.py new file mode 100644 index 00000000000..0befe63581c --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_video_analyzers_operations.py @@ -0,0 +1,490 @@ +# 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 + +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 VideoAnalyzersOperations(object): + """VideoAnalyzersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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 + **kwargs # type: Any + ): + # type: (...) -> "models.VideoAnalyzerCollection" + """List Video Analyzer accounts. + + Lists the Video Analyzer accounts in the specified resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoAnalyzerCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoAnalyzerCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + } + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzerCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VideoAnalyzer" + """Get a Video Analyzer account. + + Get the details of the specified 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: VideoAnalyzer, or the result of cls(response) + :rtype: ~azure_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" + 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\._\(\)]+$'), + '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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "models.VideoAnalyzer" + **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: ~azure_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: ~azure_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" + 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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VideoAnalyzer') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VideoAnalyzer', 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}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a Video Analyzer account. + + Delete the specified 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: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + '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.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(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}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "models.VideoAnalyzerUpdate" + **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: ~azure_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: ~azure_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" + 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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'VideoAnalyzerUpdate') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzer', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}'} # type: ignore + + def sync_storage_keys( + self, + resource_group_name, # type: str + account_name, # type: str + parameters, # type: "models.SyncStorageKeysInput" + **kwargs # type: Any + ): + # type: (...) -> None + """Synchronizes Storage Account Keys. + + Synchronizes storage account keys for a storage account associated with the Video Analyzer + account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Video Analyzer account name. + :type account_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.SyncStorageKeysInput + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.sync_storage_keys.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'SyncStorageKeysInput') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + sync_storage_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/syncStorageKeys'} # type: ignore + + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> "models.VideoAnalyzerCollection" + """List Video Analyzer accounts. + + Lists the Video Analyzer accounts in the specific subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoAnalyzerCollection, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoAnalyzerCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoAnalyzerCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_subscription.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoAnalyzerCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Media/videoAnalyzers'} # type: ignore diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_videos_operations.py b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_videos_operations.py new file mode 100644 index 00000000000..c6788bc1ccb --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/operations/_videos_operations.py @@ -0,0 +1,484 @@ +# 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 + +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 VideosOperations(object): + """VideosOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure_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 + top=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["models.VideoEntityCollection"] + """List all existing video resources. + + List all existing video resources in the specified 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 Azure Video Analyzer account name. + :type account_name: 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 VideoEntityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure_video_analyzer.models.VideoEntityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + 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] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('VideoEntityCollection', 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(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}/videos'} # type: ignore + + def get( + self, + resource_group_name, # type: str + account_name, # type: str + video_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "models.VideoEntity" + """Retrieves a video resource. + + Retrieves an existing video resource within an account with a 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. + :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) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + account_name, # type: str + video_name, # type: str + parameters, # type: "models.VideoEntity" + **kwargs # type: Any + ): + # type: (...) -> "models.VideoEntity" + """Create or updates a video resource. + + Creates a new video resource or updates an existing one in an 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 Azure Video Analyzer account name. + :type account_name: str + :param video_name: The name of the video to create or update. + :type video_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.VideoEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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, 'VideoEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('VideoEntity', 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}/videos/{videoName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + account_name, # type: str + video_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes a video resource. + + Deletes an existing video resource and its underlying data. This operation is irreversible. + + :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 delete. + :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) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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(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}/videos/{videoName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + account_name, # type: str + video_name, # type: str + parameters, # type: "models.VideoEntity" + **kwargs # type: Any + ): + # type: (...) -> "models.VideoEntity" + """Updates the properties of a video resource. + + Updates individual properties of an existing video resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: The Azure Video Analyzer account name. + :type account_name: str + :param video_name: The name of the video to update. + :type video_name: str + :param parameters: The request parameters. + :type parameters: ~azure_video_analyzer.models.VideoEntity + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VideoEntity, or the result of cls(response) + :rtype: ~azure_video_analyzer.models.VideoEntity + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoEntity"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_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, 'VideoEntity') + 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(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoEntity', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Media/videoAnalyzers/{accountName}/videos/{videoName}'} # type: ignore + + def list_streaming_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. + + Generates a streaming token used for authenticating video playback. + + :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. + :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: ~azure_video_analyzer.models.VideoStreamingToken + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["models.VideoStreamingToken"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_streaming_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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str'), + 'videoName': self._serialize.url("video_name", video_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VideoStreamingToken', 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 diff --git a/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/py.typed b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/videoanalyzer/azext_videoanalyzer/vendored_sdks/videoanalyzer/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/videoanalyzer/report.md b/src/videoanalyzer/report.md new file mode 100644 index 00000000000..ded6ecf88b7 --- /dev/null +++ b/src/videoanalyzer/report.md @@ -0,0 +1,409 @@ +# Azure CLI Module Creation Report + +## EXTENSION +|CLI Extension|Command Groups| +|---------|------------| +|az videoanalyzer|[groups](#CommandGroups) + +## GROUPS +### Command groups in `az videoanalyzer` extension +|CLI Command Group|Group Swagger name|Commands| +|---------|------------|--------| +|az videoanalyzer video-analyzer|VideoAnalyzers|[commands](#CommandsInVideoAnalyzers)| +|az videoanalyzer edge-module|EdgeModules|[commands](#CommandsInEdgeModules)| +|az videoanalyzer video|Videos|[commands](#CommandsInVideos)| +|az videoanalyzer access-policy|AccessPolicies|[commands](#CommandsInAccessPolicies)| + +## COMMANDS +### Commands in `az videoanalyzer access-policy` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az videoanalyzer access-policy list](#AccessPoliciesList)|List|[Parameters](#ParametersAccessPoliciesList)|[Example](#ExamplesAccessPoliciesList)| +|[az videoanalyzer access-policy show](#AccessPoliciesGet)|Get|[Parameters](#ParametersAccessPoliciesGet)|[Example](#ExamplesAccessPoliciesGet)| +|[az videoanalyzer access-policy create](#AccessPoliciesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersAccessPoliciesCreateOrUpdate#Create)|[Example](#ExamplesAccessPoliciesCreateOrUpdate#Create)| +|[az videoanalyzer access-policy update](#AccessPoliciesUpdate)|Update|[Parameters](#ParametersAccessPoliciesUpdate)|[Example](#ExamplesAccessPoliciesUpdate)| +|[az videoanalyzer access-policy delete](#AccessPoliciesDelete)|Delete|[Parameters](#ParametersAccessPoliciesDelete)|[Example](#ExamplesAccessPoliciesDelete)| + +### Commands in `az videoanalyzer edge-module` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az videoanalyzer edge-module list](#EdgeModulesList)|List|[Parameters](#ParametersEdgeModulesList)|[Example](#ExamplesEdgeModulesList)| +|[az videoanalyzer edge-module show](#EdgeModulesGet)|Get|[Parameters](#ParametersEdgeModulesGet)|[Example](#ExamplesEdgeModulesGet)| +|[az videoanalyzer edge-module create](#EdgeModulesCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersEdgeModulesCreateOrUpdate#Create)|[Example](#ExamplesEdgeModulesCreateOrUpdate#Create)| +|[az videoanalyzer edge-module update](#EdgeModulesCreateOrUpdate#Update)|CreateOrUpdate#Update|[Parameters](#ParametersEdgeModulesCreateOrUpdate#Update)|Not Found| +|[az videoanalyzer edge-module delete](#EdgeModulesDelete)|Delete|[Parameters](#ParametersEdgeModulesDelete)|[Example](#ExamplesEdgeModulesDelete)| +|[az videoanalyzer edge-module list-provisioning-token](#EdgeModulesListProvisioningToken)|ListProvisioningToken|[Parameters](#ParametersEdgeModulesListProvisioningToken)|[Example](#ExamplesEdgeModulesListProvisioningToken)| + +### Commands in `az videoanalyzer video` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az videoanalyzer video list](#VideosList)|List|[Parameters](#ParametersVideosList)|[Example](#ExamplesVideosList)| +|[az videoanalyzer video show](#VideosGet)|Get|[Parameters](#ParametersVideosGet)|[Example](#ExamplesVideosGet)| +|[az videoanalyzer video create](#VideosCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersVideosCreateOrUpdate#Create)|[Example](#ExamplesVideosCreateOrUpdate#Create)| +|[az videoanalyzer video update](#VideosUpdate)|Update|[Parameters](#ParametersVideosUpdate)|[Example](#ExamplesVideosUpdate)| +|[az videoanalyzer video delete](#VideosDelete)|Delete|[Parameters](#ParametersVideosDelete)|[Example](#ExamplesVideosDelete)| +|[az videoanalyzer video list-streaming-token](#VideosListStreamingToken)|ListStreamingToken|[Parameters](#ParametersVideosListStreamingToken)|[Example](#ExamplesVideosListStreamingToken)| + +### Commands in `az videoanalyzer video-analyzer` group +|CLI Command|Operation Swagger name|Parameters|Examples| +|---------|------------|--------|-----------| +|[az videoanalyzer video-analyzer list](#VideoAnalyzersList)|List|[Parameters](#ParametersVideoAnalyzersList)|[Example](#ExamplesVideoAnalyzersList)| +|[az videoanalyzer video-analyzer list](#VideoAnalyzersListBySubscription)|ListBySubscription|[Parameters](#ParametersVideoAnalyzersListBySubscription)|[Example](#ExamplesVideoAnalyzersListBySubscription)| +|[az videoanalyzer video-analyzer show](#VideoAnalyzersGet)|Get|[Parameters](#ParametersVideoAnalyzersGet)|[Example](#ExamplesVideoAnalyzersGet)| +|[az videoanalyzer video-analyzer create](#VideoAnalyzersCreateOrUpdate#Create)|CreateOrUpdate#Create|[Parameters](#ParametersVideoAnalyzersCreateOrUpdate#Create)|[Example](#ExamplesVideoAnalyzersCreateOrUpdate#Create)| +|[az videoanalyzer video-analyzer update](#VideoAnalyzersUpdate)|Update|[Parameters](#ParametersVideoAnalyzersUpdate)|[Example](#ExamplesVideoAnalyzersUpdate)| +|[az videoanalyzer video-analyzer delete](#VideoAnalyzersDelete)|Delete|[Parameters](#ParametersVideoAnalyzersDelete)|[Example](#ExamplesVideoAnalyzersDelete)| +|[az videoanalyzer video-analyzer sync-storage-key](#VideoAnalyzersSyncStorageKeys)|SyncStorageKeys|[Parameters](#ParametersVideoAnalyzersSyncStorageKeys)|[Example](#ExamplesVideoAnalyzersSyncStorageKeys)| + + +## COMMAND DETAILS + +### group `az videoanalyzer access-policy` +#### Command `az videoanalyzer access-policy list` + +##### Example +``` +az videoanalyzer access-policy list --top "2" --account-name "testaccount2" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--top**|integer|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.|top|$top| + +#### Command `az videoanalyzer access-policy show` + +##### Example +``` +az videoanalyzer access-policy show --name "accessPolicyName1" --account-name "testaccount2" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--access-policy-name**|string|The name of the access policy to retrieve.|access_policy_name|accessPolicyName| + +#### Command `az videoanalyzer access-policy create` + +##### Example +``` +az videoanalyzer access-policy create --name "accessPolicyName1" --account-name "testaccount2" --authentication \ +"{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"audiences\\":[\\"audience1\\"],\\"claims\\":[{\\"name\ +\\":\\"claimname1\\",\\"value\\":\\"claimvalue1\\"},{\\"name\\":\\"claimname2\\",\\"value\\":\\"claimvalue2\\"}],\\"iss\ +uers\\":[\\"issuer1\\",\\"issuer2\\"],\\"keys\\":[{\\"@type\\":\\"#Microsoft.VideoAnalyzer.RsaTokenKey\\",\\"alg\\":\\"\ +RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"},{\\"@type\\":\\"#Microsoft.VideoAna\ +lyzer.EccTokenKey\\",\\"alg\\":\\"ES256\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\\"YY==\\"}]}" \ +--resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--access-policy-name**|string|The name of the access policy to create or update.|access_policy_name|accessPolicyName| +|**--jwt-authentication**|object|Properties for access validation based on JSON Web Tokens (JWT).|jwt_authentication|JwtAuthentication| + +#### Command `az videoanalyzer access-policy update` + +##### Example +``` +az videoanalyzer access-policy update --name "accessPolicyName1" --account-name "testaccount2" --authentication \ +"{\\"@type\\":\\"#Microsoft.VideoAnalyzer.JwtAuthentication\\",\\"keys\\":[{\\"@type\\":\\"#Microsoft.VideoAnalyzer.Rsa\ +TokenKey\\",\\"alg\\":\\"RS256\\",\\"e\\":\\"ZLFzZTY0IQ==\\",\\"kid\\":\\"123\\",\\"n\\":\\"YmFzZTY0IQ==\\"},{\\"@type\ +\\":\\"#Microsoft.VideoAnalyzer.EccTokenKey\\",\\"alg\\":\\"Updated\\",\\"kid\\":\\"124\\",\\"x\\":\\"XX==\\",\\"y\\":\ +\\"YY==\\"}]}" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--access-policy-name**|string|The name of the access policy to update.|access_policy_name|accessPolicyName| +|**--jwt-authentication**|object|Properties for access validation based on JSON Web Tokens (JWT).|jwt_authentication|JwtAuthentication| + +#### Command `az videoanalyzer access-policy delete` + +##### Example +``` +az videoanalyzer access-policy delete --name "accessPolicyName1" --account-name "testaccount2" --resource-group \ +"testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--access-policy-name**|string|The name of the access policy to delete.|access_policy_name|accessPolicyName| + +### group `az videoanalyzer edge-module` +#### Command `az videoanalyzer edge-module list` + +##### Example +``` +az videoanalyzer edge-module list --account-name "testaccount2" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--filter**|string|Restricts the set of items returned.|filter|$filter| +|**--top**|integer|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.|top|$top| +|**--orderby**|string|Specifies the key by which the result collection should be ordered.|orderby|$orderby| + +#### Command `az videoanalyzer edge-module show` + +##### Example +``` +az videoanalyzer edge-module show --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--edge-module-name**|string|The name of the edge module to retrieve.|edge_module_name|edgeModuleName| + +#### Command `az videoanalyzer edge-module create` + +##### Example +``` +az videoanalyzer edge-module create --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--edge-module-name**|string|The name of the edge module to create or update.|edge_module_name|edgeModuleName| + +#### Command `az videoanalyzer edge-module update` + +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--edge-module-name**|string|The name of the edge module to create or update.|edge_module_name|edgeModuleName| + +#### Command `az videoanalyzer edge-module delete` + +##### Example +``` +az videoanalyzer edge-module delete --account-name "testaccount2" --name "edgeModule1" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--edge-module-name**|string|The name of the edge module to be deleted.|edge_module_name|edgeModuleName| + +#### Command `az videoanalyzer edge-module list-provisioning-token` + +##### Example +``` +az videoanalyzer edge-module list-provisioning-token --account-name "testaccount2" --name "edgeModule1" \ +--expiration-date "3021-01-23T11:04:49.0526841-08:00" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--edge-module-name**|string|The name of the edge module used to create a new provisioning token.|edge_module_name|edgeModuleName| +|**--expiration-date**|date-time|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.|expiration_date|expirationDate| + +### group `az videoanalyzer video` +#### Command `az videoanalyzer video list` + +##### Example +``` +az videoanalyzer video list --top "2" --account-name "testaccount2" --resource-group "testrg" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--top**|integer|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.|top|$top| + +#### Command `az videoanalyzer video show` + +##### Example +``` +az videoanalyzer video show --account-name "testaccount2" --resource-group "testrg" --name "video1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--video-name**|string|The name of the video to retrieve.|video_name|videoName| + +#### Command `az videoanalyzer video create` + +##### Example +``` +az videoanalyzer video create --account-name "testaccount2" --description "Sample Description 1" --title "Sample Title \ +1" --resource-group "testrg" --name "video1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--video-name**|string|The name of the video to create or update.|video_name|videoName| +|**--title**|string|Optional video title provided by the user. Value can be up to 256 characters long.|title|title| +|**--description**|string|Optional video description provided by the user. Value can be up to 2048 characters long.|description|description| + +#### Command `az videoanalyzer video update` + +##### Example +``` +az videoanalyzer video update --account-name "testaccount2" --description "Parking Lot East Entrance" --resource-group \ +"testrg" --name "video1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--video-name**|string|The name of the video to update.|video_name|videoName| +|**--title**|string|Optional video title provided by the user. Value can be up to 256 characters long.|title|title| +|**--description**|string|Optional video description provided by the user. Value can be up to 2048 characters long.|description|description| + +#### Command `az videoanalyzer video delete` + +##### Example +``` +az videoanalyzer video delete --account-name "testaccount2" --resource-group "testrg" --name "video1" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--video-name**|string|The name of the video to delete.|video_name|videoName| + +#### Command `az videoanalyzer video list-streaming-token` + +##### Example +``` +az videoanalyzer video list-streaming-token --account-name "testaccount2" --resource-group "testrg" --name "video3" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Azure Video Analyzer account name.|account_name|accountName| +|**--video-name**|string|The name of the video to generate a token for playback.|video_name|videoName| + +### group `az videoanalyzer video-analyzer` +#### Command `az videoanalyzer video-analyzer list` + +##### Example +``` +az videoanalyzer video-analyzer list --resource-group "contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| + +#### Command `az videoanalyzer video-analyzer list` + +##### Example +``` +az videoanalyzer video-analyzer list +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +#### Command `az videoanalyzer video-analyzer show` + +##### Example +``` +az videoanalyzer video-analyzer show --account-name "contosotv" --resource-group "contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Video Analyzer account name.|account_name|accountName| + +#### Command `az videoanalyzer video-analyzer create` + +##### Example +``` +az videoanalyzer video-analyzer create --account-name "contosotv" --video-analyzer-identity-type "UserAssigned" \ +--user-assigned-identities "{\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microso\ +ft.ManagedIdentity/userAssignedIdentities/id1\\":{},\\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGrou\ +ps/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2\\":{},\\"/subscriptions/00000000-0000-0000-0000-00\ +0000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id3\\":{}}" --location "South \ +Central US" --type "SystemKey" --storage-accounts id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroup\ +s/rg/providers/Microsoft.Storage/storageAccounts/storage1" user-assigned-identity="/subscriptions/00000000-0000-0000-00\ +00-000000000000/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2" --tags tag1="value1" \ +tag2="value2" --resource-group "contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Video Analyzer account name.|account_name|accountName| +|**--location**|string|The geo-location where the resource lives|location|location| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--storage-accounts**|array|The storage accounts for this resource.|storage_accounts|storageAccounts| +|**--type**|choice|The type of key used to encrypt the Account Key.|type|type| +|**--user-assigned-identity**|string|The user assigned managed identity's resource identifier to use when accessing a resource.|user_assigned_identity|userAssignedIdentity| +|**--key-identifier**|string|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).|key_identifier|keyIdentifier| +|**--video-analyzer-identity-type**|string|The identity type.|video_analyzer_identity_type|type| +|**--user-assigned-identities**|dictionary|The User Assigned Managed Identities.|user_assigned_identities|userAssignedIdentities| + +#### Command `az videoanalyzer video-analyzer update` + +##### Example +``` +az videoanalyzer video-analyzer update --account-name "contosotv" --tags key1="value3" --resource-group "contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Video Analyzer account name.|account_name|accountName| +|**--tags**|dictionary|Resource tags.|tags|tags| +|**--storage-accounts**|array|The storage accounts for this resource.|storage_accounts|storageAccounts| +|**--type**|choice|The type of key used to encrypt the Account Key.|type|type| +|**--user-assigned-identity**|string|The user assigned managed identity's resource identifier to use when accessing a resource.|user_assigned_identity|userAssignedIdentity| +|**--key-identifier**|string|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).|key_identifier|keyIdentifier| +|**--video-analyzer-identity-type**|string|The identity type.|video_analyzer_identity_type|type| +|**--user-assigned-identities**|dictionary|The User Assigned Managed Identities.|user_assigned_identities|userAssignedIdentities| + +#### Command `az videoanalyzer video-analyzer delete` + +##### Example +``` +az videoanalyzer video-analyzer delete --account-name "contosotv" --resource-group "contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Video Analyzer account name.|account_name|accountName| + +#### Command `az videoanalyzer video-analyzer sync-storage-key` + +##### Example +``` +az videoanalyzer video-analyzer sync-storage-key --account-name "contosotv" --id "/subscriptions/00000000-0000-0000-000\ +0-000000000000/resourceGroups/contoso/providers/Microsoft.Storage/storageAccounts/contosotvstore" --resource-group \ +"contoso" +``` +##### Parameters +|Option|Type|Description|Path (SDK)|Swagger name| +|------|----|-----------|----------|------------| +|**--resource-group-name**|string|The name of the resource group. The name is case insensitive.|resource_group_name|resourceGroupName| +|**--account-name**|string|The Video Analyzer account name.|account_name|accountName| +|**--id**|string|The ID of the storage account resource.|id|id| diff --git a/src/videoanalyzer/setup.cfg b/src/videoanalyzer/setup.cfg new file mode 100644 index 00000000000..2fdd96e5d39 --- /dev/null +++ b/src/videoanalyzer/setup.cfg @@ -0,0 +1 @@ +#setup.cfg \ No newline at end of file diff --git a/src/videoanalyzer/setup.py b/src/videoanalyzer/setup.py new file mode 100644 index 00000000000..6f854423607 --- /dev/null +++ b/src/videoanalyzer/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages + +# HISTORY.rst entry. +VERSION = '0.1.0' +try: + from azext_videoanalyzer.manual.version import VERSION +except ImportError: + pass + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +DEPENDENCIES = [] + +try: + from azext_videoanalyzer.manual.dependency import DEPENDENCIES +except ImportError: + pass + +with open('README.md', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='videoanalyzer', + version=VERSION, + description='Microsoft Azure Command-Line Tools AzureVideoAnalyzer Extension', + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/videoanalyzer', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_videoanalyzer': ['azext_metadata.json']}, +)