From 7896cdfb9dfa09085ccfa47b7741a7d4fe05e2cd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 18 Nov 2021 03:20:03 +0000 Subject: [PATCH] CodeGen from PR 16799 in Azure/azure-rest-api-specs Merge 9fd28cf3afe3e2898048dbb6621813a380959184 into fd48d49a4b9c62f3d955e7da23ec5187c59be40f --- .../MANIFEST.in | 1 + .../azure-mgmt-applicationinsights/_meta.json | 11 + ..._application_insights_management_client.py | 95 +-- .../applicationinsights/_configuration.py | 7 +- ..._application_insights_management_client.py | 97 +-- .../applicationinsights/aio/_configuration.py | 9 +- .../azure/mgmt/applicationinsights/models.py | 5 + .../v2015_05_01/__init__.py | 3 + ..._application_insights_management_client.py | 20 + .../v2015_05_01/_configuration.py | 3 +- .../v2015_05_01/_metadata.json | 62 +- .../v2015_05_01/_version.py | 9 + ..._application_insights_management_client.py | 19 + .../v2015_05_01/aio/_configuration.py | 3 +- .../operations/_analytics_items_operations.py | 16 +- .../aio/operations/_annotations_operations.py | 22 +- .../aio/operations/_api_keys_operations.py | 16 +- ...component_available_features_operations.py | 4 +- ...ent_current_billing_features_operations.py | 8 +- ...mponent_feature_capabilities_operations.py | 4 +- .../_component_quota_status_operations.py | 4 +- .../aio/operations/_components_operations.py | 30 +- .../_export_configurations_operations.py | 20 +- .../aio/operations/_favorites_operations.py | 20 +- .../operations/_my_workbooks_operations.py | 34 +- .../v2015_05_01/aio/operations/_operations.py | 4 +- ...ive_detection_configurations_operations.py | 12 +- .../_web_test_locations_operations.py | 4 +- .../aio/operations/_web_tests_operations.py | 26 +- .../_work_item_configurations_operations.py | 26 +- .../aio/operations/_workbooks_operations.py | 30 +- .../v2015_05_01/models/_models.py | 2 +- .../v2015_05_01/models/_models_py3.py | 6 +- .../operations/_analytics_items_operations.py | 8 +- .../operations/_annotations_operations.py | 14 +- .../operations/_api_keys_operations.py | 8 +- ...component_available_features_operations.py | 2 +- ...ent_current_billing_features_operations.py | 4 +- ...mponent_feature_capabilities_operations.py | 2 +- .../_component_quota_status_operations.py | 2 +- .../operations/_components_operations.py | 14 +- .../_export_configurations_operations.py | 10 +- .../operations/_favorites_operations.py | 10 +- .../operations/_my_workbooks_operations.py | 22 +- .../v2015_05_01/operations/_operations.py | 2 +- ...ive_detection_configurations_operations.py | 6 +- .../_web_test_locations_operations.py | 2 +- .../operations/_web_tests_operations.py | 12 +- .../_work_item_configurations_operations.py | 14 +- .../operations/_workbooks_operations.py | 20 +- .../v2017_10_01/__init__.py | 3 + ..._application_insights_management_client.py | 20 + .../v2017_10_01/_configuration.py | 3 +- .../v2017_10_01/_metadata.json | 62 +- .../v2017_10_01/_version.py | 9 + ..._application_insights_management_client.py | 19 + .../v2017_10_01/aio/_configuration.py | 3 +- ...mponent_current_pricing_plan_operations.py | 12 +- ...cription_list_migration_date_operations.py | 2 +- ...migrate_to_new_pricing_model_operations.py | 2 +- ...back_to_legacy_pricing_model_operations.py | 2 +- ...mponent_current_pricing_plan_operations.py | 6 +- .../v2018_06_17_preview/__init__.py | 3 + ..._application_insights_management_client.py | 25 + .../v2018_06_17_preview/_configuration.py | 3 +- .../v2018_06_17_preview/_metadata.json | 65 +- .../v2018_06_17_preview/_version.py | 9 + ..._application_insights_management_client.py | 24 + .../v2018_06_17_preview/aio/_configuration.py | 3 +- .../aio/operations/__init__.py | 2 + .../aio/operations/_operations.py | 105 +++ .../aio/operations/_workbooks_operations.py | 30 +- .../v2018_06_17_preview/models/__init__.py | 12 + .../v2018_06_17_preview/models/_models.py | 96 +++ .../v2018_06_17_preview/models/_models_py3.py | 109 +++ .../operations/__init__.py | 2 + .../operations/_operations.py | 110 +++ .../operations/_workbooks_operations.py | 20 +- .../v2019_10_17_preview/__init__.py | 3 + ..._application_insights_management_client.py | 20 + .../v2019_10_17_preview/_configuration.py | 3 +- .../v2019_10_17_preview/_metadata.json | 62 +- .../v2019_10_17_preview/_version.py | 9 + ..._application_insights_management_client.py | 19 + .../v2019_10_17_preview/aio/_configuration.py | 3 +- .../_workbook_templates_operations.py | 30 +- .../v2019_10_17_preview/models/_models.py | 6 +- .../v2019_10_17_preview/models/_models_py3.py | 14 +- .../_workbook_templates_operations.py | 20 +- .../v2020_02_02_preview/__init__.py | 3 + ..._application_insights_management_client.py | 20 + .../v2020_02_02_preview/_configuration.py | 3 +- .../v2020_02_02_preview/_metadata.json | 62 +- .../v2020_02_02_preview/_version.py | 9 + ..._application_insights_management_client.py | 19 + .../v2020_02_02_preview/aio/_configuration.py | 3 +- .../aio/operations/_components_operations.py | 46 +- ...cation_insights_management_client_enums.py | 6 +- .../v2020_02_02_preview/models/_models.py | 13 +- .../v2020_02_02_preview/models/_models_py3.py | 19 +- .../operations/_components_operations.py | 30 +- .../v2020_03_01_preview/__init__.py | 3 + ..._application_insights_management_client.py | 20 + .../v2020_03_01_preview/_configuration.py | 3 +- .../v2020_03_01_preview/_metadata.json | 62 +- .../v2020_03_01_preview/_version.py | 9 + ..._application_insights_management_client.py | 19 + .../v2020_03_01_preview/aio/_configuration.py | 3 +- ...nent_linked_storage_accounts_operations.py | 24 +- .../v2020_03_01_preview/models/__init__.py | 9 +- .../v2020_03_01_preview/models/_models.py | 86 ++- .../v2020_03_01_preview/models/_models_py3.py | 89 ++- ...nent_linked_storage_accounts_operations.py | 16 +- .../v2020_06_02_preview/__init__.py | 3 + ..._application_insights_management_client.py | 17 + .../v2020_06_02_preview/_configuration.py | 3 +- .../v2020_06_02_preview/_metadata.json | 60 +- .../v2020_06_02_preview/_version.py | 9 + ..._application_insights_management_client.py | 16 + .../v2020_06_02_preview/aio/_configuration.py | 3 +- .../aio/operations/_live_token_operations.py | 4 +- .../aio/operations/_operations.py | 2 +- .../v2020_06_02_preview/models/__init__.py | 9 +- .../v2020_06_02_preview/models/_models.py | 46 +- .../v2020_06_02_preview/models/_models_py3.py | 55 +- .../operations/_live_token_operations.py | 2 +- .../v2020_11_20/__init__.py | 19 + ..._application_insights_management_client.py | 88 +++ .../v2020_11_20/_configuration.py | 71 ++ .../v2020_11_20/_metadata.json | 103 +++ .../v2020_11_20/_version.py | 9 + .../v2020_11_20/aio/__init__.py | 10 + ..._application_insights_management_client.py | 81 +++ .../v2020_11_20/aio/_configuration.py | 67 ++ .../v2020_11_20/aio/operations/__init__.py | 13 + .../_workbook_templates_operations.py | 371 ++++++++++ .../v2020_11_20/models/__init__.py | 40 ++ .../v2020_11_20/models/_models.py | 317 +++++++++ .../v2020_11_20/models/_models_py3.py | 358 ++++++++++ .../v2020_11_20/operations/__init__.py | 13 + .../_workbook_templates_operations.py | 380 +++++++++++ .../applicationinsights/v2020_11_20/py.typed | 1 + .../v2021_03_08/__init__.py | 19 + ..._application_insights_management_client.py | 88 +++ .../v2021_03_08/_configuration.py | 71 ++ .../v2021_03_08/_metadata.json | 103 +++ .../v2021_03_08/_version.py | 9 + .../v2021_03_08/aio/__init__.py | 10 + ..._application_insights_management_client.py | 81 +++ .../v2021_03_08/aio/_configuration.py | 67 ++ .../v2021_03_08/aio/operations/__init__.py | 13 + .../operations/_my_workbooks_operations.py | 480 +++++++++++++ .../v2021_03_08/models/__init__.py | 51 ++ ...cation_insights_management_client_enums.py | 57 ++ .../v2021_03_08/models/_models.py | 351 ++++++++++ .../v2021_03_08/models/_models_py3.py | 394 +++++++++++ .../v2021_03_08/operations/__init__.py | 13 + .../operations/_my_workbooks_operations.py | 490 ++++++++++++++ .../applicationinsights/v2021_03_08/py.typed | 1 + .../v2021_08_01/__init__.py | 19 + ..._application_insights_management_client.py | 88 +++ .../v2021_08_01/_configuration.py | 71 ++ .../v2021_08_01/_metadata.json | 103 +++ .../v2021_08_01/_version.py | 9 + .../v2021_08_01/aio/__init__.py | 10 + ..._application_insights_management_client.py | 81 +++ .../v2021_08_01/aio/_configuration.py | 67 ++ .../v2021_08_01/aio/operations/__init__.py | 13 + .../aio/operations/_workbooks_operations.py | 620 +++++++++++++++++ .../v2021_08_01/models/__init__.py | 65 ++ ...cation_insights_management_client_enums.py | 67 ++ .../v2021_08_01/models/_models.py | 582 ++++++++++++++++ .../v2021_08_01/models/_models_py3.py | 636 ++++++++++++++++++ .../v2021_08_01/operations/__init__.py | 13 + .../operations/_workbooks_operations.py | 632 +++++++++++++++++ .../applicationinsights/v2021_08_01/py.typed | 1 + 176 files changed, 9226 insertions(+), 629 deletions(-) create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/_meta.json create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_metadata.json create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/_workbook_templates_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models_py3.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/_workbook_templates_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/py.typed create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_metadata.json create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/_my_workbooks_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_application_insights_management_client_enums.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models_py3.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/_my_workbooks_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/py.typed create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_metadata.json create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_version.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_application_insights_management_client.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_configuration.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/_workbooks_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_application_insights_management_client_enums.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models_py3.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/__init__.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/_workbooks_operations.py create mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/py.typed diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/MANIFEST.in b/sdk/applicationinsights/azure-mgmt-applicationinsights/MANIFEST.in index a3cb07df87658..3a9b6517412bc 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/MANIFEST.in +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/_meta.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/_meta.json new file mode 100644 index 0000000000000..55866812da625 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "85087b9fe3f8d12bcd250fc169a500dbeba1cea5", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/applicationinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/applicationinsights/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py index fc19f6bb5d5c1..156c747425db3 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_application_insights_management_client.py @@ -9,13 +9,22 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import ARMPipelineClient -from msrest import Serializer, Deserializer +from typing import TYPE_CHECKING +from azure.mgmt.core import ARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import ApplicationInsightsManagementClientConfiguration +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -38,14 +47,15 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2017-10-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -55,18 +65,24 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): 'api_keys': '2015-05-01', 'component_available_features': '2015-05-01', 'component_current_billing_features': '2015-05-01', + 'component_current_pricing_plan': '2017-10-01', 'component_feature_capabilities': '2015-05-01', + 'component_linked_storage_accounts': '2020-03-01-preview', 'component_quota_status': '2015-05-01', 'components': '2015-05-01', + 'ea_subscription_list_migration_date': '2017-10-01', + 'ea_subscription_migrate_to_new_pricing_model': '2017-10-01', + 'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01', 'export_configurations': '2015-05-01', 'favorites': '2015-05-01', - 'my_workbooks': '2015-05-01', + 'live_token': '2020-06-02-preview', + 'my_workbooks': '2021-03-08', 'operations': '2015-05-01', 'proactive_detection_configurations': '2015-05-01', 'web_test_locations': '2015-05-01', 'web_tests': '2015-05-01', 'work_item_configurations': '2015-05-01', - 'workbooks': '2015-05-01', + 'workbook_templates': '2020-11-20', }}, _PROFILE_TAG + " latest" ) @@ -75,9 +91,9 @@ def __init__( self, credential, # type: "TokenCredential" subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + api_version=None, # type: Optional[str] + base_url=None, # type: Optional[str] + profile=KnownProfiles.default, # type: KnownProfiles **kwargs # type: Any ): if not base_url: @@ -101,11 +117,13 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-10-01: :mod:`v2017_10_01.models` * 2018-05-01-preview: :mod:`v2018_05_01_preview.models` * 2018-06-17-preview: :mod:`v2018_06_17_preview.models` - * 2019-09-01-preview: :mod:`v2019_09_01_preview.models` * 2019-10-17-preview: :mod:`v2019_10_17_preview.models` * 2020-02-02-preview: :mod:`v2020_02_02_preview.models` * 2020-03-01-preview: :mod:`v2020_03_01_preview.models` * 2020-06-02-preview: :mod:`v2020_06_02_preview.models` + * 2020-11-20: :mod:`v2020_11_20.models` + * 2021-03-08: :mod:`v2021_03_08.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2015-05-01': from .v2015_05_01 import models @@ -119,9 +137,6 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-06-17-preview': from .v2018_06_17_preview import models return models - elif api_version == '2019-09-01-preview': - from .v2019_09_01_preview import models - return models elif api_version == '2019-10-17-preview': from .v2019_10_17_preview import models return models @@ -134,6 +149,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-02-preview': from .v2020_06_02_preview import models return models + elif api_version == '2020-11-20': + from .v2020_11_20 import models + return models + elif api_version == '2021-03-08': + from .v2021_03_08 import models + return models + elif api_version == '2021-08-01': + from .v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -355,10 +379,13 @@ def my_workbooks(self): """Instance depends on the API version: * 2015-05-01: :class:`MyWorkbooksOperations` + * 2021-03-08: :class:`MyWorkbooksOperations` """ api_version = self._get_api_version('my_workbooks') if api_version == '2015-05-01': from .v2015_05_01.operations import MyWorkbooksOperations as OperationClass + elif api_version == '2021-03-08': + from .v2021_03_08.operations import MyWorkbooksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'my_workbooks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -368,14 +395,14 @@ def operations(self): """Instance depends on the API version: * 2015-05-01: :class:`Operations` - * 2019-09-01-preview: :class:`Operations` + * 2018-06-17-preview: :class:`Operations` * 2020-06-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-05-01': from .v2015_05_01.operations import Operations as OperationClass - elif api_version == '2019-09-01-preview': - from .v2019_09_01_preview.operations import Operations as OperationClass + elif api_version == '2018-06-17-preview': + from .v2018_06_17_preview.operations import Operations as OperationClass elif api_version == '2020-06-02-preview': from .v2020_06_02_preview.operations import Operations as OperationClass else: @@ -398,32 +425,6 @@ def proactive_detection_configurations(self): raise ValueError("API version {} does not have operation group 'proactive_detection_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property - def queries(self): - """Instance depends on the API version: - - * 2019-09-01-preview: :class:`QueriesOperations` - """ - api_version = self._get_api_version('queries') - if api_version == '2019-09-01-preview': - from .v2019_09_01_preview.operations import QueriesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'queries'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def query_packs(self): - """Instance depends on the API version: - - * 2019-09-01-preview: :class:`QueryPacksOperations` - """ - api_version = self._get_api_version('query_packs') - if api_version == '2019-09-01-preview': - from .v2019_09_01_preview.operations import QueryPacksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'query_packs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property def web_test_locations(self): """Instance depends on the API version: @@ -468,10 +469,13 @@ def workbook_templates(self): """Instance depends on the API version: * 2019-10-17-preview: :class:`WorkbookTemplatesOperations` + * 2020-11-20: :class:`WorkbookTemplatesOperations` """ api_version = self._get_api_version('workbook_templates') if api_version == '2019-10-17-preview': from .v2019_10_17_preview.operations import WorkbookTemplatesOperations as OperationClass + elif api_version == '2020-11-20': + from .v2020_11_20.operations import WorkbookTemplatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workbook_templates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -482,12 +486,15 @@ def workbooks(self): * 2015-05-01: :class:`WorkbooksOperations` * 2018-06-17-preview: :class:`WorkbooksOperations` + * 2021-08-01: :class:`WorkbooksOperations` """ api_version = self._get_api_version('workbooks') if api_version == '2015-05-01': from .v2015_05_01.operations import WorkbooksOperations as OperationClass elif api_version == '2018-06-17-preview': from .v2018_06_17_preview.operations import WorkbooksOperations as OperationClass + elif api_version == '2021-08-01': + from .v2021_08_01.operations import WorkbooksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workbooks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_configuration.py index 7b66f3457dd53..b9fe819325a11 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_configuration.py @@ -8,7 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -16,6 +16,11 @@ from ._version import VERSION +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_application_insights_management_client.py index 8394c5fa54099..9eb5b73661e02 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_application_insights_management_client.py @@ -9,13 +9,20 @@ # regenerated. # -------------------------------------------------------------------------- -from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Serializer, Deserializer +from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient from azure.profiles import KnownProfiles, ProfileDefinition from azure.profiles.multiapiclient import MultiApiClientMixin +from msrest import Deserializer, Serializer + from ._configuration import ApplicationInsightsManagementClientConfiguration +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + class _SDKClient(object): def __init__(self, *args, **kwargs): """This is a fake class to support current implemetation of MultiApiClientMixin." @@ -38,14 +45,15 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :param str api_version: API version to use if no profile is provided, or if - missing in profile. - :param str base_url: Service URL + :param api_version: API version to use if no profile is provided, or if missing in profile. + :type api_version: str + :param base_url: Service URL + :type base_url: str :param profile: A profile definition, from KnownProfiles to dict. :type profile: azure.profiles.KnownProfiles """ - DEFAULT_API_VERSION = '2017-10-01' + DEFAULT_API_VERSION = '2021-08-01' _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient" LATEST_PROFILE = ProfileDefinition({ _PROFILE_TAG: { @@ -55,29 +63,35 @@ class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): 'api_keys': '2015-05-01', 'component_available_features': '2015-05-01', 'component_current_billing_features': '2015-05-01', + 'component_current_pricing_plan': '2017-10-01', 'component_feature_capabilities': '2015-05-01', + 'component_linked_storage_accounts': '2020-03-01-preview', 'component_quota_status': '2015-05-01', 'components': '2015-05-01', + 'ea_subscription_list_migration_date': '2017-10-01', + 'ea_subscription_migrate_to_new_pricing_model': '2017-10-01', + 'ea_subscription_rollback_to_legacy_pricing_model': '2017-10-01', 'export_configurations': '2015-05-01', 'favorites': '2015-05-01', - 'my_workbooks': '2015-05-01', + 'live_token': '2020-06-02-preview', + 'my_workbooks': '2021-03-08', 'operations': '2015-05-01', 'proactive_detection_configurations': '2015-05-01', 'web_test_locations': '2015-05-01', 'web_tests': '2015-05-01', 'work_item_configurations': '2015-05-01', - 'workbooks': '2015-05-01', + 'workbook_templates': '2020-11-20', }}, _PROFILE_TAG + " latest" ) def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str - api_version=None, - base_url=None, - profile=KnownProfiles.default, + credential: "AsyncTokenCredential", + subscription_id: str, + api_version: Optional[str] = None, + base_url: Optional[str] = None, + profile: KnownProfiles = KnownProfiles.default, **kwargs # type: Any ) -> None: if not base_url: @@ -101,11 +115,13 @@ def models(cls, api_version=DEFAULT_API_VERSION): * 2017-10-01: :mod:`v2017_10_01.models` * 2018-05-01-preview: :mod:`v2018_05_01_preview.models` * 2018-06-17-preview: :mod:`v2018_06_17_preview.models` - * 2019-09-01-preview: :mod:`v2019_09_01_preview.models` * 2019-10-17-preview: :mod:`v2019_10_17_preview.models` * 2020-02-02-preview: :mod:`v2020_02_02_preview.models` * 2020-03-01-preview: :mod:`v2020_03_01_preview.models` * 2020-06-02-preview: :mod:`v2020_06_02_preview.models` + * 2020-11-20: :mod:`v2020_11_20.models` + * 2021-03-08: :mod:`v2021_03_08.models` + * 2021-08-01: :mod:`v2021_08_01.models` """ if api_version == '2015-05-01': from ..v2015_05_01 import models @@ -119,9 +135,6 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2018-06-17-preview': from ..v2018_06_17_preview import models return models - elif api_version == '2019-09-01-preview': - from ..v2019_09_01_preview import models - return models elif api_version == '2019-10-17-preview': from ..v2019_10_17_preview import models return models @@ -134,6 +147,15 @@ def models(cls, api_version=DEFAULT_API_VERSION): elif api_version == '2020-06-02-preview': from ..v2020_06_02_preview import models return models + elif api_version == '2020-11-20': + from ..v2020_11_20 import models + return models + elif api_version == '2021-03-08': + from ..v2021_03_08 import models + return models + elif api_version == '2021-08-01': + from ..v2021_08_01 import models + return models raise ValueError("API version {} is not available".format(api_version)) @property @@ -355,10 +377,13 @@ def my_workbooks(self): """Instance depends on the API version: * 2015-05-01: :class:`MyWorkbooksOperations` + * 2021-03-08: :class:`MyWorkbooksOperations` """ api_version = self._get_api_version('my_workbooks') if api_version == '2015-05-01': from ..v2015_05_01.aio.operations import MyWorkbooksOperations as OperationClass + elif api_version == '2021-03-08': + from ..v2021_03_08.aio.operations import MyWorkbooksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'my_workbooks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -368,14 +393,14 @@ def operations(self): """Instance depends on the API version: * 2015-05-01: :class:`Operations` - * 2019-09-01-preview: :class:`Operations` + * 2018-06-17-preview: :class:`Operations` * 2020-06-02-preview: :class:`Operations` """ api_version = self._get_api_version('operations') if api_version == '2015-05-01': from ..v2015_05_01.aio.operations import Operations as OperationClass - elif api_version == '2019-09-01-preview': - from ..v2019_09_01_preview.aio.operations import Operations as OperationClass + elif api_version == '2018-06-17-preview': + from ..v2018_06_17_preview.aio.operations import Operations as OperationClass elif api_version == '2020-06-02-preview': from ..v2020_06_02_preview.aio.operations import Operations as OperationClass else: @@ -398,32 +423,6 @@ def proactive_detection_configurations(self): raise ValueError("API version {} does not have operation group 'proactive_detection_configurations'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property - def queries(self): - """Instance depends on the API version: - - * 2019-09-01-preview: :class:`QueriesOperations` - """ - api_version = self._get_api_version('queries') - if api_version == '2019-09-01-preview': - from ..v2019_09_01_preview.aio.operations import QueriesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'queries'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def query_packs(self): - """Instance depends on the API version: - - * 2019-09-01-preview: :class:`QueryPacksOperations` - """ - api_version = self._get_api_version('query_packs') - if api_version == '2019-09-01-preview': - from ..v2019_09_01_preview.aio.operations import QueryPacksOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'query_packs'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - @property def web_test_locations(self): """Instance depends on the API version: @@ -468,10 +467,13 @@ def workbook_templates(self): """Instance depends on the API version: * 2019-10-17-preview: :class:`WorkbookTemplatesOperations` + * 2020-11-20: :class:`WorkbookTemplatesOperations` """ api_version = self._get_api_version('workbook_templates') if api_version == '2019-10-17-preview': from ..v2019_10_17_preview.aio.operations import WorkbookTemplatesOperations as OperationClass + elif api_version == '2020-11-20': + from ..v2020_11_20.aio.operations import WorkbookTemplatesOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workbook_templates'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) @@ -482,12 +484,15 @@ def workbooks(self): * 2015-05-01: :class:`WorkbooksOperations` * 2018-06-17-preview: :class:`WorkbooksOperations` + * 2021-08-01: :class:`WorkbooksOperations` """ api_version = self._get_api_version('workbooks') if api_version == '2015-05-01': from ..v2015_05_01.aio.operations import WorkbooksOperations as OperationClass elif api_version == '2018-06-17-preview': from ..v2018_06_17_preview.aio.operations import WorkbooksOperations as OperationClass + elif api_version == '2021-08-01': + from ..v2021_08_01.aio.operations import WorkbooksOperations as OperationClass else: raise ValueError("API version {} does not have operation group 'workbooks'".format(api_version)) return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_configuration.py index a3a1617b650de..8fe81a741e697 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/aio/_configuration.py @@ -8,7 +8,7 @@ # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies @@ -16,6 +16,9 @@ from .._version import VERSION +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. @@ -31,8 +34,8 @@ class ApplicationInsightsManagementClientConfiguration(Configuration): def __init__( self, - credential, # type: "AsyncTokenCredential" - subscription_id, # type: str + credential: "AsyncTokenCredential", + subscription_id: str, **kwargs # type: Any ) -> None: if credential is None: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models.py index 4a1ac981747dd..50a9b74e07cd5 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models.py @@ -6,3 +6,8 @@ # -------------------------------------------------------------------------- from .v2015_05_01.models import * from .v2017_10_01.models import * +from .v2020_03_01_preview.models import * +from .v2020_06_02_preview.models import * +from .v2020_11_20.models import * +from .v2021_03_08.models import * +from .v2021_08_01.models import * diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py index 010e6d6281488..f5d149778b32f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import Operations @@ -97,6 +98,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( @@ -134,6 +136,24 @@ def __init__( self.my_workbooks = MyWorkbooksOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_configuration.py index b6a6440064c1c..ade9b236d3617 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json index 89e012f2eb44b..f261f1f3e347f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,14 +44,58 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", @@ -69,9 +115,5 @@ "analytics_items": "AnalyticsItemsOperations", "workbooks": "WorkbooksOperations", "my_workbooks": "MyWorkbooksOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py index 416f313eb50fa..8f9350eeeb7c9 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -94,6 +95,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( @@ -131,6 +133,23 @@ def __init__( self.my_workbooks = MyWorkbooksOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_configuration.py index 1c485cf9254ae..c18bcdbd24251 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py index e53abb3ec5ec3..b21b3f4fa4cc2 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py @@ -48,7 +48,7 @@ async def list( scope: Optional[Union[str, "_models.ItemScope"]] = None, type: Optional[Union[str, "_models.ItemTypeParameter"]] = "none", include_content: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> List["_models.ApplicationInsightsComponentAnalyticsItem"]: """Gets a list of Analytics Items defined within an Application Insights component. @@ -84,7 +84,7 @@ async def list( url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -127,7 +127,7 @@ async def get( scope_path: Union[str, "_models.ItemScopePath"], id: Optional[str] = None, name: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAnalyticsItem": """Gets a specific Analytics Items defined within an Application Insights component. @@ -159,7 +159,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -200,7 +200,7 @@ async def put( scope_path: Union[str, "_models.ItemScopePath"], item_properties: "_models.ApplicationInsightsComponentAnalyticsItem", override_item: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAnalyticsItem": """Adds or Updates a specific Analytics Item within an Application Insights component. @@ -235,7 +235,7 @@ async def put( url = self.put.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -278,7 +278,7 @@ async def delete( scope_path: Union[str, "_models.ItemScopePath"], id: Optional[str] = None, name: Optional[str] = None, - **kwargs + **kwargs: Any ) -> None: """Deletes a specific Analytics Items defined within an Application Insights component. @@ -309,7 +309,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py index 89522a18bc219..600ce0ee0f11b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py @@ -47,7 +47,7 @@ def list( resource_name: str, start: str, end: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AnnotationsListResult"]: """Gets the list of annotations for a component for given time range. @@ -82,7 +82,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -114,7 +114,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -130,7 +130,7 @@ async def create( resource_group_name: str, resource_name: str, annotation_properties: "_models.Annotation", - **kwargs + **kwargs: Any ) -> List["_models.Annotation"]: """Create an Annotation of an Application Insights component. @@ -158,7 +158,7 @@ async def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -182,7 +182,7 @@ async def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[Annotation]', pipeline_response) @@ -198,7 +198,7 @@ async def delete( resource_group_name: str, resource_name: str, annotation_id: str, - **kwargs + **kwargs: Any ) -> None: """Delete an Annotation of an Application Insights component. @@ -224,7 +224,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str'), @@ -256,7 +256,7 @@ async def get( resource_group_name: str, resource_name: str, annotation_id: str, - **kwargs + **kwargs: Any ) -> List["_models.Annotation"]: """Get the annotation for given id. @@ -283,7 +283,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str'), @@ -304,7 +304,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[Annotation]', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py index 9d8bd8d7429a8..a807fbf878cf7 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsComponentAPIKeyListResult"]: """Gets a list of API keys of an Application Insights component. @@ -75,7 +75,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -120,7 +120,7 @@ async def create( resource_group_name: str, resource_name: str, api_key_properties: "_models.APIKeyRequest", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAPIKey": """Create an API Key of an Application Insights component. @@ -148,7 +148,7 @@ async def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -187,7 +187,7 @@ async def delete( resource_group_name: str, resource_name: str, key_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAPIKey": """Delete an API Key of an Application Insights component. @@ -213,7 +213,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str'), @@ -249,7 +249,7 @@ async def get( resource_group_name: str, resource_name: str, key_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAPIKey": """Get the API Key for this key id. @@ -275,7 +275,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py index 409e871607e7e..2fbd6e862c6b1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentAvailableFeatures": """Returns all available features of the application insights component. @@ -68,7 +68,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py index e0fb950ab451b..2a50226aa6bab 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentBillingFeatures": """Returns current billing features for an Application Insights component. @@ -68,7 +68,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -103,7 +103,7 @@ async def update( resource_group_name: str, resource_name: str, billing_features_properties: "_models.ApplicationInsightsComponentBillingFeatures", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentBillingFeatures": """Update current billing features for an Application Insights component. @@ -131,7 +131,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py index a51235dcd4253..4775c19811472 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentFeatureCapabilities": """Returns feature capabilities of the application insights component. @@ -68,7 +68,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py index 7b0048d0b3134..f4edc267c8833 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentQuotaStatus": """Returns daily data volume cap (quota) status for an Application Insights component. @@ -68,7 +68,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_components_operations.py index 9dabc1de51ff1..44467264da9db 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_components_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: """Gets a list of all Application Insights components within a subscription. @@ -110,7 +110,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: """Gets a list of Application Insights components within a resource group. @@ -138,7 +138,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -181,7 +181,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes an Application Insights component. @@ -204,7 +204,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -234,7 +234,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Returns an Application Insights component. @@ -258,7 +258,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -293,7 +293,7 @@ async def create_or_update( resource_group_name: str, resource_name: str, insight_properties: "_models.ApplicationInsightsComponent", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. @@ -322,7 +322,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -361,7 +361,7 @@ async def update_tags( resource_group_name: str, resource_name: str, component_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. @@ -388,7 +388,7 @@ async def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -427,7 +427,7 @@ async def purge( resource_group_name: str, resource_name: str, body: "_models.ComponentPurgeBody", - **kwargs + **kwargs: Any ) -> "_models.ComponentPurgeResponse": """Purges data in an Application Insights component by a set of user-defined filters. @@ -461,7 +461,7 @@ async def purge( # Construct URL url = self.purge.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -500,7 +500,7 @@ async def get_purge_status( resource_group_name: str, resource_name: str, purge_id: str, - **kwargs + **kwargs: Any ) -> "_models.ComponentPurgeStatusResponse": """Get status for an ongoing purge operation. @@ -527,7 +527,7 @@ async def get_purge_status( # Construct URL url = self.get_purge_status.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'purgeId': self._serialize.url("purge_id", purge_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py index ee9530a7ac403..cef95a38f88d7 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: """Gets a list of Continuous Export configuration of an Application Insights component. @@ -68,7 +68,7 @@ async def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -103,7 +103,7 @@ async def create( resource_group_name: str, resource_name: str, export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs + **kwargs: Any ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: """Create a Continuous Export configuration of an Application Insights component. @@ -131,7 +131,7 @@ async def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -170,7 +170,7 @@ async def delete( resource_group_name: str, resource_name: str, export_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentExportConfiguration": """Delete a Continuous Export configuration of an Application Insights component. @@ -197,7 +197,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), @@ -233,7 +233,7 @@ async def get( resource_group_name: str, resource_name: str, export_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentExportConfiguration": """Get the Continuous Export configuration for this export id. @@ -260,7 +260,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), @@ -297,7 +297,7 @@ async def update( resource_name: str, export_id: str, export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentExportConfiguration": """Update the Continuous Export configuration for this export id. @@ -328,7 +328,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py index a93f510537061..63f2ebdf032d2 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py @@ -48,7 +48,7 @@ async def list( source_type: Optional[Union[str, "_models.FavoriteSourceType"]] = None, can_fetch_content: Optional[bool] = None, tags: Optional[List[str]] = None, - **kwargs + **kwargs: Any ) -> List["_models.ApplicationInsightsComponentFavorite"]: """Gets a list of favorites defined within an Application Insights component. @@ -82,7 +82,7 @@ async def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -125,7 +125,7 @@ async def get( resource_group_name: str, resource_name: str, favorite_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentFavorite": """Get a single favorite by its FavoriteId, defined within an Application Insights component. @@ -152,7 +152,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -189,7 +189,7 @@ async def add( resource_name: str, favorite_id: str, favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentFavorite": """Adds a new favorites to an Application Insights component. @@ -220,7 +220,7 @@ async def add( # Construct URL url = self.add.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -261,7 +261,7 @@ async def update( resource_name: str, favorite_id: str, favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentFavorite": """Updates a favorite that has already been added to an Application Insights component. @@ -292,7 +292,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -332,7 +332,7 @@ async def delete( resource_group_name: str, resource_name: str, favorite_id: str, - **kwargs + **kwargs: Any ) -> None: """Remove a favorite that is associated to an Application Insights component. @@ -358,7 +358,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py index ba5ac952175c7..2b966e97d8a4b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py @@ -47,7 +47,7 @@ def list_by_resource_group( category: Union[str, "_models.CategoryType"], tags: Optional[List[str]] = None, can_fetch_content: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MyWorkbooksListResult"]: """Get all private workbooks defined within a specified resource group and category. @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -116,7 +116,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -132,7 +132,7 @@ def list_by_subscription( category: Union[str, "_models.CategoryType"], tags: Optional[List[str]] = None, can_fetch_content: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.MyWorkbooksListResult"]: """Get all private workbooks defined within a specified subscription and category. @@ -198,7 +198,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -213,7 +213,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.MyWorkbook": """Get a single private workbook by its resourceName. @@ -238,7 +238,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -257,7 +257,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MyWorkbook', pipeline_response) @@ -272,7 +272,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a private workbook. @@ -297,7 +297,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -316,7 +316,7 @@ async def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -329,7 +329,7 @@ async def create_or_update( resource_group_name: str, resource_name: str, workbook_properties: "_models.MyWorkbook", - **kwargs + **kwargs: Any ) -> "_models.MyWorkbook": """Create a new private workbook. @@ -358,7 +358,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -381,7 +381,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -401,7 +401,7 @@ async def update( resource_group_name: str, resource_name: str, workbook_properties: "_models.MyWorkbook", - **kwargs + **kwargs: Any ) -> "_models.MyWorkbook": """Updates a private workbook that has already been added. @@ -430,7 +430,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -453,7 +453,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MyWorkbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_operations.py index 0c75eaaa1852c..e79372b34e456 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """Lists all of the available insights REST API operations. @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py index aa7a99a5f1b4e..b97a430c70a38 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py @@ -44,7 +44,7 @@ async def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]: """Gets a list of ProactiveDetection configurations of an Application Insights component. @@ -68,7 +68,7 @@ async def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -103,7 +103,7 @@ async def get( resource_group_name: str, resource_name: str, configuration_id: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": """Get the ProactiveDetection configuration for this configuration id. @@ -130,7 +130,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str'), @@ -167,7 +167,7 @@ async def update( resource_name: str, configuration_id: str, proactive_detection_properties: "_models.ApplicationInsightsComponentProactiveDetectionConfiguration", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": """Update the ProactiveDetection configuration for this configuration id. @@ -198,7 +198,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py index 3a6e8b12c200a..5f8de9dca7876 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsWebTestLocationsListResult"]: """Gets a list of web test locations available to this Application Insights component. @@ -75,7 +75,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py index 8bb274e4e9cf8..2895a1137f5b4 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WebTestListResult"]: """Get all Application Insights web tests defined within a specified resource group. @@ -72,7 +72,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -115,7 +115,7 @@ async def get( self, resource_group_name: str, web_test_name: str, - **kwargs + **kwargs: Any ) -> "_models.WebTest": """Get a specific Application Insights web test definition. @@ -139,7 +139,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -174,7 +174,7 @@ async def create_or_update( resource_group_name: str, web_test_name: str, web_test_definition: "_models.WebTest", - **kwargs + **kwargs: Any ) -> "_models.WebTest": """Creates or updates an Application Insights web test definition. @@ -202,7 +202,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -241,7 +241,7 @@ async def update_tags( resource_group_name: str, web_test_name: str, web_test_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.WebTest": """Creates or updates an Application Insights web test definition. @@ -268,7 +268,7 @@ async def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -306,7 +306,7 @@ async def delete( self, resource_group_name: str, web_test_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes an Application Insights web test. @@ -330,7 +330,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -357,7 +357,7 @@ async def delete( def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WebTestListResult"]: """Get all Application Insights web test alerts definitions within a subscription. @@ -425,7 +425,7 @@ def list_by_component( self, component_name: str, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WebTestListResult"]: """Get all Application Insights web tests defined for the specified component. @@ -456,7 +456,7 @@ def prepare_request(next_link=None): url = self.list_by_component.metadata['url'] # type: ignore path_format_arguments = { 'componentName': self._serialize.url("component_name", component_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py index c1b310b6d4f33..4bc9135d3f7f6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py @@ -45,7 +45,7 @@ def list( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WorkItemConfigurationsListResult"]: """Gets the list work item configurations that exist for the application. @@ -75,7 +75,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -105,7 +105,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkItemConfigurationError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkItemConfigurationError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -121,7 +121,7 @@ async def create( resource_group_name: str, resource_name: str, work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs + **kwargs: Any ) -> "_models.WorkItemConfiguration": """Create a work item configuration for an Application Insights component. @@ -149,7 +149,7 @@ async def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -187,7 +187,7 @@ async def get_default( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.WorkItemConfiguration": """Gets default work item configurations that exist for the application. @@ -211,7 +211,7 @@ async def get_default( # Construct URL url = self.get_default.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -246,7 +246,7 @@ async def delete( resource_group_name: str, resource_name: str, work_item_config_id: str, - **kwargs + **kwargs: Any ) -> None: """Delete a work item configuration of an Application Insights component. @@ -272,7 +272,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), @@ -304,7 +304,7 @@ async def get_item( resource_group_name: str, resource_name: str, work_item_config_id: str, - **kwargs + **kwargs: Any ) -> "_models.WorkItemConfiguration": """Gets specified work item configuration for an Application Insights component. @@ -331,7 +331,7 @@ async def get_item( # Construct URL url = self.get_item.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), @@ -368,7 +368,7 @@ async def update_item( resource_name: str, work_item_config_id: str, work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs + **kwargs: Any ) -> "_models.WorkItemConfiguration": """Update a work item configuration for an Application Insights component. @@ -399,7 +399,7 @@ async def update_item( # Construct URL url = self.update_item.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py index ba3e9ee21cb09..6772949a08e42 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py @@ -47,7 +47,7 @@ def list_by_resource_group( category: Union[str, "_models.CategoryType"], tags: Optional[List[str]] = None, can_fetch_content: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WorkbooksListResult"]: """Get all Workbooks defined within a specified resource group and category. @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -116,7 +116,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -131,7 +131,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Get a single workbook by its resourceName. @@ -156,7 +156,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -175,7 +175,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) @@ -190,7 +190,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a workbook. @@ -215,7 +215,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -234,7 +234,7 @@ async def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -247,7 +247,7 @@ async def create_or_update( resource_group_name: str, resource_name: str, workbook_properties: "_models.Workbook", - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Create a new workbook. @@ -275,7 +275,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -298,7 +298,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -318,7 +318,7 @@ async def update( resource_group_name: str, resource_name: str, workbook_properties: "_models.Workbook", - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Updates a workbook that has already been added. @@ -346,7 +346,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -369,7 +369,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py index b2a94cd871b43..351649c9980ca 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models.py @@ -1299,7 +1299,7 @@ class ComponentPurgeBodyFilters(msrest.serialization.Model): :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. - :type value: object + :type value: any :param key: When filtering over custom dimensions, this key will be used as the name of the custom dimension. :type key: str diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py index cf692276cd0ba..ebc8764aab1ac 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -1405,7 +1405,7 @@ class ComponentPurgeBodyFilters(msrest.serialization.Model): :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. - :type value: object + :type value: any :param key: When filtering over custom dimensions, this key will be used as the name of the custom dimension. :type key: str @@ -1423,7 +1423,7 @@ def __init__( *, column: Optional[str] = None, operator: Optional[str] = None, - value: Optional[object] = None, + value: Optional[Any] = None, key: Optional[str] = None, **kwargs ): diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_analytics_items_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_analytics_items_operations.py index 529011a53a2f2..f885efdf5e900 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_analytics_items_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_analytics_items_operations.py @@ -89,7 +89,7 @@ def list( url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -165,7 +165,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -242,7 +242,7 @@ def put( url = self.put.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } @@ -317,7 +317,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_annotations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_annotations_operations.py index d59288fd2d278..e6d5ed805c33c 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_annotations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_annotations_operations.py @@ -87,7 +87,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -119,7 +119,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -164,7 +164,7 @@ def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -188,7 +188,7 @@ def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[Annotation]', pipeline_response) @@ -231,7 +231,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str'), @@ -291,7 +291,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'annotationId': self._serialize.url("annotation_id", annotation_id, 'str'), @@ -312,7 +312,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.AnnotationError, response) + error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('[Annotation]', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_api_keys_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_api_keys_operations.py index 50e3669f59f5a..1d6c60b82622c 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_api_keys_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_api_keys_operations.py @@ -80,7 +80,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -154,7 +154,7 @@ def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -220,7 +220,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str'), @@ -283,7 +283,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'keyId': self._serialize.url("key_id", key_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_available_features_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_available_features_operations.py index f1b787c9aa39d..068e9c8fd6041 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_available_features_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_available_features_operations.py @@ -73,7 +73,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py index 5b42f70592bff..33b17cc0674b2 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_current_billing_features_operations.py @@ -73,7 +73,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -137,7 +137,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py index ae98f894ddf3c..1f06bad635135 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_feature_capabilities_operations.py @@ -73,7 +73,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py index 10cc88ef92237..db9ecbc632460 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_component_quota_status_operations.py @@ -73,7 +73,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_components_operations.py index 49514ac98dece..80c1549bb1c37 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_components_operations.py @@ -144,7 +144,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -211,7 +211,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -266,7 +266,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -331,7 +331,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -398,7 +398,7 @@ def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -472,7 +472,7 @@ def purge( # Construct URL url = self.purge.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -539,7 +539,7 @@ def get_purge_status( # Construct URL url = self.get_purge_status.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'purgeId': self._serialize.url("purge_id", purge_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_export_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_export_configurations_operations.py index 3206fac9c4324..463f6cfaba239 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_export_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_export_configurations_operations.py @@ -73,7 +73,7 @@ def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -137,7 +137,7 @@ def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -204,7 +204,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), @@ -268,7 +268,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), @@ -337,7 +337,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'exportId': self._serialize.url("export_id", export_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_favorites_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_favorites_operations.py index 7ea8c9e69a75a..ad99e33a5e51e 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_favorites_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_favorites_operations.py @@ -87,7 +87,7 @@ def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -158,7 +158,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -227,7 +227,7 @@ def add( # Construct URL url = self.add.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -300,7 +300,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), @@ -367,7 +367,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'favoriteId': self._serialize.url("favorite_id", favorite_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py index d734d0865ec92..d61a71d29ae31 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_my_workbooks_operations.py @@ -88,7 +88,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -121,7 +121,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -204,7 +204,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -245,7 +245,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -264,7 +264,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MyWorkbook', pipeline_response) @@ -305,7 +305,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -324,7 +324,7 @@ def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -367,7 +367,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -390,7 +390,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -440,7 +440,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -463,7 +463,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.MyWorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('MyWorkbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py index 73ace2c5abc92..ed34026606b67 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_operations.py @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py index ade32f73b242e..d30c0b941547b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_proactive_detection_configurations_operations.py @@ -73,7 +73,7 @@ def list( # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -136,7 +136,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str'), @@ -205,7 +205,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'ConfigurationId': self._serialize.url("configuration_id", configuration_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py index a80f41d31619e..bac3c23591877 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_test_locations_operations.py @@ -80,7 +80,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_tests_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_tests_operations.py index cc78e550c61f4..f88f73058afa6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_tests_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_web_tests_operations.py @@ -77,7 +77,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -145,7 +145,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -209,7 +209,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -276,7 +276,7 @@ def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } @@ -339,7 +339,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'webTestName': self._serialize.url("web_test_name", web_test_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -467,7 +467,7 @@ def prepare_request(next_link=None): url = self.list_by_component.metadata['url'] # type: ignore path_format_arguments = { 'componentName': self._serialize.url("component_name", component_name, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py index 1407cbf08102c..a79db07583efd 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_work_item_configurations_operations.py @@ -80,7 +80,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -110,7 +110,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkItemConfigurationError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkItemConfigurationError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -155,7 +155,7 @@ def create( # Construct URL url = self.create.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -218,7 +218,7 @@ def get_default( # Construct URL url = self.get_default.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -280,7 +280,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), @@ -340,7 +340,7 @@ def get_item( # Construct URL url = self.get_item.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), @@ -409,7 +409,7 @@ def update_item( # Construct URL url = self.update_item.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'workItemConfigId': self._serialize.url("work_item_config_id", work_item_config_id, 'str'), diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py index 84ffc8bd9df0b..a13da447802df 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/operations/_workbooks_operations.py @@ -88,7 +88,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -121,7 +121,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -162,7 +162,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -181,7 +181,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) @@ -222,7 +222,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -241,7 +241,7 @@ def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -283,7 +283,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -306,7 +306,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -355,7 +355,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -378,7 +378,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py index 7140bacc6a026..2cae71912a6c6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import EASubscriptionMigrateToNewPricingModelOperations @@ -58,6 +59,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( @@ -69,6 +71,24 @@ def __init__( self.component_current_pricing_plan = ComponentCurrentPricingPlanOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_configuration.py index 03777368d5c80..2a0a773687c74 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json index 8772b35b85d1a..3373a5eaaf0a5 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,23 +44,63 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "ea_subscription_migrate_to_new_pricing_model": "EASubscriptionMigrateToNewPricingModelOperations", "ea_subscription_rollback_to_legacy_pricing_model": "EASubscriptionRollbackToLegacyPricingModelOperations", "ea_subscription_list_migration_date": "EASubscriptionListMigrationDateOperations", "component_current_pricing_plan": "ComponentCurrentPricingPlanOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py index 7e1fe352b48d4..92f4064007fee 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -55,6 +56,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( @@ -66,6 +68,23 @@ def __init__( self.component_current_pricing_plan = ComponentCurrentPricingPlanOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_configuration.py index 415c31510871c..6e105e28c8b0e 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py index 51323fdbf2a9f..fbbd9494a0d66 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py @@ -44,7 +44,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentPricingPlan": """Returns the current pricing plan setting for an Application Insights component. @@ -68,7 +68,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -103,7 +103,7 @@ async def create_and_update( resource_group_name: str, resource_name: str, pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentPricingPlan": """Replace current pricing plan for an Application Insights component. @@ -131,7 +131,7 @@ async def create_and_update( # Construct URL url = self.create_and_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -170,7 +170,7 @@ async def update( resource_group_name: str, resource_name: str, pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponentPricingPlan": """Update current pricing plan for an Application Insights component. @@ -198,7 +198,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py index 1024415f875a8..3d53810148919 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def post( self, - **kwargs + **kwargs: Any ) -> "_models.EASubscriptionMigrationDate": """list date to migrate to new pricing model. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py index adfc0b7587cb3..d2fa1313d8a3d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def post( self, - **kwargs + **kwargs: Any ) -> None: """Enterprise Agreement Customer opted to use new pricing model. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py index a0e31a1d087c0..a73be76e67c9a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py @@ -42,7 +42,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def post( self, - **kwargs + **kwargs: Any ) -> None: """Enterprise Agreement Customer roll back to use legacy pricing model. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py index fe122feffca09..2b6c4f078d85d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/operations/_component_current_pricing_plan_operations.py @@ -73,7 +73,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -137,7 +137,7 @@ def create_and_update( # Construct URL url = self.create_and_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -205,7 +205,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py index cdaba46eeb022..2b2f90ed5e23b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py @@ -16,9 +16,11 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import WorkbooksOperations +from .operations import Operations from . import models @@ -27,6 +29,8 @@ class ApplicationInsightsManagementClient(object): :ivar workbooks: WorkbooksOperations operations :vartype workbooks: azure.mgmt.applicationinsights.v2018_06_17_preview.operations.WorkbooksOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.applicationinsights.v2018_06_17_preview.operations.Operations :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. @@ -49,10 +53,31 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbooks = WorkbooksOperations( self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response def close(self): # type: () -> None diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_configuration.py index 68377b420cd72..7c84b057f86a8 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json index 11436c328a466..454b45d1c3210 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,20 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { - "workbooks": "WorkbooksOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + "workbooks": "WorkbooksOperations", + "operations": "Operations" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py index c967abd5ee8af..083f370d2cc44 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -17,6 +18,7 @@ from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import WorkbooksOperations +from .operations import Operations from .. import models @@ -25,6 +27,8 @@ class ApplicationInsightsManagementClient(object): :ivar workbooks: WorkbooksOperations operations :vartype workbooks: azure.mgmt.applicationinsights.v2018_06_17_preview.aio.operations.WorkbooksOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.applicationinsights.v2018_06_17_preview.aio.operations.Operations :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. @@ -46,10 +50,30 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbooks = WorkbooksOperations( self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_configuration.py index 8c916252b096e..1cbd3ee24f102 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/__init__.py index 39e879c6ea32e..83c07c81af5c0 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/__init__.py @@ -7,7 +7,9 @@ # -------------------------------------------------------------------------- from ._workbooks_operations import WorkbooksOperations +from ._operations import Operations __all__ = [ 'WorkbooksOperations', + 'Operations', ] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_operations.py new file mode 100644 index 0000000000000..e6e947d27eec8 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_operations.py @@ -0,0 +1,105 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class 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.mgmt.applicationinsights.v2018_06_17_preview.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, + **kwargs: Any + ) -> AsyncIterable["_models.OperationListResult"]: + """Lists all of the available insights REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-17-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 + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Insights/operations'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py index 6d717922530de..d319acc43cad6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py @@ -48,7 +48,7 @@ def list_by_resource_group( source_id: str, tags: Optional[List[str]] = None, can_fetch_content: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WorkbooksListResult"]: """Get all Workbooks defined within a specified resource group and category. @@ -86,7 +86,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -120,7 +120,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -135,7 +135,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Get a single workbook by its resourceName. @@ -160,7 +160,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -179,7 +179,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) @@ -194,7 +194,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a workbook. @@ -219,7 +219,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -238,7 +238,7 @@ async def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -252,7 +252,7 @@ async def create_or_update( resource_name: str, source_id: str, workbook_properties: "_models.Workbook", - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Create a new workbook. @@ -282,7 +282,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -306,7 +306,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -327,7 +327,7 @@ async def update( resource_name: str, source_id: str, workbook_update_parameters: Optional["_models.WorkbookUpdateParameters"] = None, - **kwargs + **kwargs: Any ) -> "_models.Workbook": """Updates a workbook that has already been added. @@ -358,7 +358,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -385,7 +385,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/__init__.py index a60769881b550..bd981aaaa1436 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/__init__.py @@ -8,6 +8,10 @@ try: from ._models_py3 import ErrorFieldContract + from ._models_py3 import ErrorResponse + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationListResult from ._models_py3 import Resource from ._models_py3 import Workbook from ._models_py3 import WorkbookError @@ -15,6 +19,10 @@ from ._models_py3 import WorkbooksListResult except (SyntaxError, ImportError): from ._models import ErrorFieldContract # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationListResult # type: ignore from ._models import Resource # type: ignore from ._models import Workbook # type: ignore from ._models import WorkbookError # type: ignore @@ -28,6 +36,10 @@ __all__ = [ 'ErrorFieldContract', + 'ErrorResponse', + 'Operation', + 'OperationDisplay', + 'OperationListResult', 'Resource', 'Workbook', 'WorkbookError', diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py index c939e1e654577..94fe5bfcfd841 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models.py @@ -37,6 +37,102 @@ def __init__( self.target = kwargs.get('target', None) +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class Operation(msrest.serialization.Model): + """CDN REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn. + :type provider: str + :param resource: Resource on which the operation is performed: Profile, endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', '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) + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of CDN operations supported by the CDN resource provider. + :type value: list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + class Resource(msrest.serialization.Model): """An azure resource object. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py index a4452a41a337d..1fc733b3d5ef2 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/models/_models_py3.py @@ -45,6 +45,115 @@ def __init__( self.target = target +class ErrorResponse(msrest.serialization.Model): + """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class Operation(msrest.serialization.Model): + """CDN REST API operation. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The object that represents the operation. + :type display: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.OperationDisplay + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + display: Optional["OperationDisplay"] = None, + **kwargs + ): + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :param provider: Service provider: Microsoft.Cdn. + :type provider: str + :param resource: Resource on which the operation is performed: Profile, endpoint, etc. + :type resource: str + :param operation: Operation type: Read, write, delete, etc. + :type operation: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + **kwargs + ): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + + +class OperationListResult(msrest.serialization.Model): + """Result of the request to list CDN operations. It contains a list of operations and a URL link to get the next set of results. + + :param value: List of CDN operations supported by the CDN resource provider. + :type value: list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Operation] + :param next_link: URL to get the next set of operation list results if there are any. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Operation"]] = None, + next_link: Optional[str] = None, + **kwargs + ): + super(OperationListResult, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class Resource(msrest.serialization.Model): """An azure resource object. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/__init__.py index 39e879c6ea32e..83c07c81af5c0 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/__init__.py @@ -7,7 +7,9 @@ # -------------------------------------------------------------------------- from ._workbooks_operations import WorkbooksOperations +from ._operations import Operations __all__ = [ 'WorkbooksOperations', + 'Operations', ] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_operations.py new file mode 100644 index 0000000000000..b1c5f912d86df --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_operations.py @@ -0,0 +1,110 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class 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.mgmt.applicationinsights.v2018_06_17_preview.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: (...) -> Iterable["_models.OperationListResult"] + """Lists all of the available insights REST API operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.OperationListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2018-06-17-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 + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('OperationListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/providers/Microsoft.Insights/operations'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py index 7c039f0aef856..b97e87e8fe77a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/operations/_workbooks_operations.py @@ -91,7 +91,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -125,7 +125,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -166,7 +166,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -185,7 +185,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) @@ -226,7 +226,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -245,7 +245,7 @@ def delete( if response.status_code not in [201, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -290,7 +290,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -314,7 +314,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -367,7 +367,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -394,7 +394,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Workbook', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py index 7fa4b47aaa858..ff2c8bf675cd8 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import WorkbookTemplatesOperations @@ -49,11 +50,30 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbook_templates = WorkbookTemplatesOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_configuration.py index 1072086e77c0a..cbde4101bb273 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json index 678c6ee6d7a2c..fbdf6105e05f1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,20 +44,60 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "workbook_templates": "WorkbookTemplatesOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py index 9ebe51052e673..dc3c181c4e720 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -46,11 +47,29 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbook_templates = WorkbookTemplatesOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_configuration.py index 2d21e7e4eb274..8c397863cc0e1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py index 5d2cedad9fee2..00a55e8b0c017 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.WorkbookTemplatesListResult"]: """Get all Workbook templates defined within a specified resource group. @@ -73,7 +73,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -101,7 +101,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -116,7 +116,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.WorkbookTemplate": """Get a single workbook template by its resourceName. @@ -141,7 +141,7 @@ async def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -160,7 +160,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WorkbookTemplate', pipeline_response) @@ -175,7 +175,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete a workbook template. @@ -200,7 +200,7 @@ async def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -219,7 +219,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -232,7 +232,7 @@ async def create_or_update( resource_group_name: str, resource_name: str, workbook_template_properties: "_models.WorkbookTemplate", - **kwargs + **kwargs: Any ) -> "_models.WorkbookTemplate": """Create a new workbook template. @@ -261,7 +261,7 @@ async def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -284,7 +284,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -304,7 +304,7 @@ async def update( resource_group_name: str, resource_name: str, workbook_template_update_parameters: Optional["_models.WorkbookTemplateUpdateParameters"] = None, - **kwargs + **kwargs: Any ) -> "_models.WorkbookTemplate": """Updates a workbook template that has already been added. @@ -333,7 +333,7 @@ async def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -359,7 +359,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WorkbookTemplate', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models.py index eaaf4ac8eb7be..d7474711cdd95 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models.py @@ -135,7 +135,7 @@ class WorkbookTemplate(WorkbookTemplateResource): :param author: Information about the author of the workbook template. :type author: str :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] @@ -216,7 +216,7 @@ class WorkbookTemplateLocalizedGallery(msrest.serialization.Model): """Localized template data and gallery information. :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] @@ -266,7 +266,7 @@ class WorkbookTemplateUpdateParameters(msrest.serialization.Model): :param author: Information about the author of the workbook template. :type author: str :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models_py3.py index 363f4e912dac1..8dbba4f14bc83 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/models/_models_py3.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional +from typing import Any, Dict, List, Optional from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -148,7 +148,7 @@ class WorkbookTemplate(WorkbookTemplateResource): :param author: Information about the author of the workbook template. :type author: str :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] @@ -185,7 +185,7 @@ def __init__( tags: Optional[Dict[str, str]] = None, priority: Optional[int] = None, author: Optional[str] = None, - template_data: Optional[object] = None, + template_data: Optional[Any] = None, galleries: Optional[List["WorkbookTemplateGallery"]] = None, localized: Optional[Dict[str, List["WorkbookTemplateLocalizedGallery"]]] = None, **kwargs @@ -243,7 +243,7 @@ class WorkbookTemplateLocalizedGallery(msrest.serialization.Model): """Localized template data and gallery information. :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] @@ -257,7 +257,7 @@ class WorkbookTemplateLocalizedGallery(msrest.serialization.Model): def __init__( self, *, - template_data: Optional[object] = None, + template_data: Optional[Any] = None, galleries: Optional[List["WorkbookTemplateGallery"]] = None, **kwargs ): @@ -298,7 +298,7 @@ class WorkbookTemplateUpdateParameters(msrest.serialization.Model): :param author: Information about the author of the workbook template. :type author: str :param template_data: Valid JSON object containing workbook template payload. - :type template_data: object + :type template_data: any :param galleries: Workbook galleries supported by the template. :type galleries: list[~azure.mgmt.applicationinsights.v2019_10_17_preview.models.WorkbookTemplateGallery] @@ -323,7 +323,7 @@ def __init__( tags: Optional[Dict[str, str]] = None, priority: Optional[int] = None, author: Optional[str] = None, - template_data: Optional[object] = None, + template_data: Optional[Any] = None, galleries: Optional[List["WorkbookTemplateGallery"]] = None, localized: Optional[Dict[str, List["WorkbookTemplateLocalizedGallery"]]] = None, **kwargs diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py index df484c821a57d..e606999cb323e 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/operations/_workbook_templates_operations.py @@ -78,7 +78,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -106,7 +106,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -147,7 +147,7 @@ def get( url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -166,7 +166,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WorkbookTemplate', pipeline_response) @@ -207,7 +207,7 @@ def delete( url = self.delete.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -226,7 +226,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -269,7 +269,7 @@ def create_or_update( url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -292,7 +292,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -342,7 +342,7 @@ def update( url = self.update.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -368,7 +368,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.WorkbookError, response) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('WorkbookTemplate', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py index 7d560c41e33fd..c8af7cbbfdae4 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import ComponentsOperations @@ -49,11 +50,30 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.components = ComponentsOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_configuration.py index 1614457d4b610..ebb837b275501 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json index 8a903dd7055b9..1a591cd50bb18 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,20 +44,60 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "components": "ComponentsOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py index a1265ffd1e45e..c3ba0355c5805 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -46,11 +47,29 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.components = ComponentsOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_configuration.py index 9503119030455..321996a019dd1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py index 701cec417081e..29e7c25d41e97 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: """Gets a list of all Application Insights components within a subscription. @@ -97,7 +97,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -111,7 +111,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: """Gets a list of Application Insights components within a resource group. @@ -139,7 +139,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -168,7 +168,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -183,7 +183,7 @@ async def delete( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> None: """Deletes an Application Insights component. @@ -207,7 +207,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -227,7 +227,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -239,7 +239,7 @@ async def get( self, resource_group_name: str, resource_name: str, - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Returns an Application Insights component. @@ -263,7 +263,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -283,7 +283,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -299,7 +299,7 @@ async def create_or_update( resource_group_name: str, resource_name: str, insight_properties: "_models.ApplicationInsightsComponent", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Creates (or updates) an Application Insights component. Note: You cannot specify a different value for InstrumentationKey nor AppId in the Put operation. @@ -328,7 +328,7 @@ async def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -352,7 +352,7 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -368,7 +368,7 @@ async def update_tags( resource_group_name: str, resource_name: str, component_tags: "_models.TagsResource", - **kwargs + **kwargs: Any ) -> "_models.ApplicationInsightsComponent": """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. @@ -395,7 +395,7 @@ async def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -419,7 +419,7 @@ async def update_tags( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -435,7 +435,7 @@ async def purge( resource_group_name: str, resource_name: str, body: "_models.ComponentPurgeBody", - **kwargs + **kwargs: Any ) -> "_models.ComponentPurgeResponse": """Purges data in an Application Insights component by a set of user-defined filters. @@ -469,7 +469,7 @@ async def purge( # Construct URL url = self.purge.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -493,7 +493,7 @@ async def purge( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) @@ -509,7 +509,7 @@ async def get_purge_status( resource_group_name: str, resource_name: str, purge_id: str, - **kwargs + **kwargs: Any ) -> "_models.ComponentPurgeStatusResponse": """Get status for an ongoing purge operation. @@ -536,7 +536,7 @@ async def get_purge_status( # Construct URL url = self.get_purge_status.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'purgeId': self._serialize.url("purge_id", purge_id, 'str'), @@ -557,7 +557,7 @@ async def get_purge_status( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py index 51d2c8b1c0f52..520c2acfc8241 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_application_insights_management_client_enums.py @@ -54,8 +54,10 @@ class PublicNetworkAccessType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum Enabled """ - ENABLED = "Enabled" #: Enables connectivity to Application Insights through public DNS. - DISABLED = "Disabled" #: Disables public connectivity to Application Insights through public DNS. + #: Enables connectivity to Application Insights through public DNS. + ENABLED = "Enabled" + #: Disables public connectivity to Application Insights through public DNS. + DISABLED = "Disabled" class PurgeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Status of the operation represented by the requested Id. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py index 82c36e2e0846d..02e7e8b9db936 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py @@ -151,6 +151,11 @@ class ApplicationInsightsComponent(ComponentsResource): value: "LogAnalytics". :type ingestion_mode: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode + :param disable_local_auth: Disable Non-AAD based Auth. + :type disable_local_auth: bool + :param force_customer_storage_for_profiler: Force users to create their own storage account for + profiler and debugger. + :type force_customer_storage_for_profiler: bool """ _validation = { @@ -204,6 +209,8 @@ class ApplicationInsightsComponent(ComponentsResource): 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.DisableLocalAuth', 'type': 'bool'}, + 'force_customer_storage_for_profiler': {'key': 'properties.ForceCustomerStorageForProfiler', 'type': 'bool'}, } def __init__( @@ -236,6 +243,8 @@ def __init__( self.public_network_access_for_ingestion = kwargs.get('public_network_access_for_ingestion', "Enabled") self.public_network_access_for_query = kwargs.get('public_network_access_for_query', "Enabled") self.ingestion_mode = kwargs.get('ingestion_mode', "LogAnalytics") + self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.force_customer_storage_for_profiler = kwargs.get('force_customer_storage_for_profiler', None) class ApplicationInsightsComponentListResult(msrest.serialization.Model): @@ -312,7 +321,7 @@ class ComponentPurgeBodyFilters(msrest.serialization.Model): :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. - :type value: object + :type value: any :param key: When filtering over custom dimensions, this key will be used as the name of the custom dimension. :type key: str @@ -396,7 +405,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py index 4b3f94acf0b08..ea61fc745e58e 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py @@ -6,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -158,6 +158,11 @@ class ApplicationInsightsComponent(ComponentsResource): value: "LogAnalytics". :type ingestion_mode: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode + :param disable_local_auth: Disable Non-AAD based Auth. + :type disable_local_auth: bool + :param force_customer_storage_for_profiler: Force users to create their own storage account for + profiler and debugger. + :type force_customer_storage_for_profiler: bool """ _validation = { @@ -211,6 +216,8 @@ class ApplicationInsightsComponent(ComponentsResource): 'public_network_access_for_ingestion': {'key': 'properties.publicNetworkAccessForIngestion', 'type': 'str'}, 'public_network_access_for_query': {'key': 'properties.publicNetworkAccessForQuery', 'type': 'str'}, 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, + 'disable_local_auth': {'key': 'properties.DisableLocalAuth', 'type': 'bool'}, + 'force_customer_storage_for_profiler': {'key': 'properties.ForceCustomerStorageForProfiler', 'type': 'bool'}, } def __init__( @@ -231,6 +238,8 @@ def __init__( public_network_access_for_ingestion: Optional[Union[str, "PublicNetworkAccessType"]] = "Enabled", public_network_access_for_query: Optional[Union[str, "PublicNetworkAccessType"]] = "Enabled", ingestion_mode: Optional[Union[str, "IngestionMode"]] = "LogAnalytics", + disable_local_auth: Optional[bool] = None, + force_customer_storage_for_profiler: Optional[bool] = None, **kwargs ): super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) @@ -259,6 +268,8 @@ def __init__( self.public_network_access_for_ingestion = public_network_access_for_ingestion self.public_network_access_for_query = public_network_access_for_query self.ingestion_mode = ingestion_mode + self.disable_local_auth = disable_local_auth + self.force_customer_storage_for_profiler = force_customer_storage_for_profiler class ApplicationInsightsComponentListResult(msrest.serialization.Model): @@ -341,7 +352,7 @@ class ComponentPurgeBodyFilters(msrest.serialization.Model): :type operator: str :param value: the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. - :type value: object + :type value: any :param key: When filtering over custom dimensions, this key will be used as the name of the custom dimension. :type key: str @@ -359,7 +370,7 @@ def __init__( *, column: Optional[str] = None, operator: Optional[str] = None, - value: Optional[object] = None, + value: Optional[Any] = None, key: Optional[str] = None, **kwargs ): @@ -434,7 +445,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py index 6b26f906a7233..1bb47d83b1001 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py @@ -102,7 +102,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -145,7 +145,7 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), '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) @@ -174,7 +174,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -214,7 +214,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -234,7 +234,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -271,7 +271,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -291,7 +291,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -337,7 +337,7 @@ def create_or_update( # Construct URL url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -361,7 +361,7 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -405,7 +405,7 @@ def update_tags( # Construct URL url = self.update_tags.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -429,7 +429,7 @@ def update_tags( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -480,7 +480,7 @@ def purge( # Construct URL url = self.purge.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), } @@ -504,7 +504,7 @@ def purge( if response.status_code not in [202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) @@ -548,7 +548,7 @@ def get_purge_status( # Construct URL url = self.get_purge_status.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'purgeId': self._serialize.url("purge_id", purge_id, 'str'), @@ -569,7 +569,7 @@ def get_purge_status( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py index 65986d8992e46..48ef506c72497 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import ComponentLinkedStorageAccountsOperations @@ -49,11 +50,30 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_configuration.py index 2ef327058b984..b7e04d1ad26d4 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json index b8716d7ab6c8a..e49b2173b2b6a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "The ID of the target subscription.", "docstring_type": "str", "required": true @@ -42,20 +44,60 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "component_linked_storage_accounts": "ComponentLinkedStorageAccountsOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py index a25e66a7aa2a4..8b31a683d074f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -46,11 +47,29 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_configuration.py index 001acfd30f6da..fe02d18ebfa95 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py index 5706791d2def0..222ff5f85c550 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py @@ -45,7 +45,7 @@ async def get( resource_group_name: str, resource_name: str, storage_type: Union[str, "_models.StorageType"], - **kwargs + **kwargs: Any ) -> "_models.ComponentLinkedStorageAccounts": """Returns the current linked storage settings for an Application Insights component. @@ -72,7 +72,7 @@ async def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -93,7 +93,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -110,7 +110,7 @@ async def create_and_update( resource_name: str, storage_type: Union[str, "_models.StorageType"], linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccounts", - **kwargs + **kwargs: Any ) -> "_models.ComponentLinkedStorageAccounts": """Replace current linked storage account for an Application Insights component. @@ -141,7 +141,7 @@ async def create_and_update( # Construct URL url = self.create_and_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -166,7 +166,7 @@ async def create_and_update( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -183,7 +183,7 @@ async def update( resource_name: str, storage_type: Union[str, "_models.StorageType"], linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccountsPatch", - **kwargs + **kwargs: Any ) -> "_models.ComponentLinkedStorageAccounts": """Update linked storage accounts for an Application Insights component. @@ -214,7 +214,7 @@ async def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -239,7 +239,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -255,7 +255,7 @@ async def delete( resource_group_name: str, resource_name: str, storage_type: Union[str, "_models.StorageType"], - **kwargs + **kwargs: Any ) -> None: """Delete linked storage accounts for an Application Insights component. @@ -282,7 +282,7 @@ async def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -303,7 +303,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py index 7177ea6248e54..5ddf539119e58 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/__init__.py @@ -9,13 +9,15 @@ try: from ._models_py3 import ComponentLinkedStorageAccounts from ._models_py3 import ComponentLinkedStorageAccountsPatch - from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseLinkedStorage + from ._models_py3 import ErrorResponseLinkedStorageError from ._models_py3 import ProxyResource from ._models_py3 import Resource except (SyntaxError, ImportError): from ._models import ComponentLinkedStorageAccounts # type: ignore from ._models import ComponentLinkedStorageAccountsPatch # type: ignore - from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseLinkedStorage # type: ignore + from ._models import ErrorResponseLinkedStorageError # type: ignore from ._models import ProxyResource # type: ignore from ._models import Resource # type: ignore @@ -26,7 +28,8 @@ __all__ = [ 'ComponentLinkedStorageAccounts', 'ComponentLinkedStorageAccountsPatch', - 'ErrorResponse', + 'ErrorResponseLinkedStorage', + 'ErrorResponseLinkedStorageError', 'ProxyResource', 'Resource', 'StorageType', diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py index 62050f8e8adb0..b05bb6de3022d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models.py @@ -47,7 +47,41 @@ def __init__( self.type = None -class ComponentLinkedStorageAccounts(Resource): +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 ComponentLinkedStorageAccounts(ProxyResource): """An Application Insights component linked storage accounts. Variables are only populated by the server, and will be ignored when sending a request. @@ -104,58 +138,52 @@ def __init__( self.linked_storage_account = kwargs.get('linked_storage_account', None) -class ErrorResponse(msrest.serialization.Model): - """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. +class ErrorResponseLinkedStorage(msrest.serialization.Model): + """ErrorResponseLinkedStorage. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: Error response indicates Insights service is not able to process the incoming + request. The reason is provided in the error message. + :type error: + ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ErrorResponseLinkedStorageError """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponseLinkedStorageError'}, } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(ErrorResponseLinkedStorage, self).__init__(**kwargs) + self.error = kwargs.get('error', None) -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. +class ErrorResponseLinkedStorageError(msrest.serialization.Model): + """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. 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 code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ProxyResource, self).__init__(**kwargs) + super(ErrorResponseLinkedStorageError, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py index 5e69cad0ce8f2..2e7eaa0fcba80 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/models/_models_py3.py @@ -49,7 +49,41 @@ def __init__( self.type = None -class ComponentLinkedStorageAccounts(Resource): +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 ComponentLinkedStorageAccounts(ProxyResource): """An Application Insights component linked storage accounts. Variables are only populated by the server, and will be ignored when sending a request. @@ -110,61 +144,54 @@ def __init__( self.linked_storage_account = linked_storage_account -class ErrorResponse(msrest.serialization.Model): - """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. +class ErrorResponseLinkedStorage(msrest.serialization.Model): + """ErrorResponseLinkedStorage. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param error: Error response indicates Insights service is not able to process the incoming + request. The reason is provided in the error message. + :type error: + ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ErrorResponseLinkedStorageError """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'ErrorResponseLinkedStorageError'}, } def __init__( self, *, - code: Optional[str] = None, - message: Optional[str] = None, + error: Optional["ErrorResponseLinkedStorageError"] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message + super(ErrorResponseLinkedStorage, self).__init__(**kwargs) + self.error = error -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. +class ErrorResponseLinkedStorageError(msrest.serialization.Model): + """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. 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 code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, + 'code': {'readonly': True}, + 'message': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ProxyResource, self).__init__(**kwargs) + super(ErrorResponseLinkedStorageError, self).__init__(**kwargs) + self.code = None + self.message = None diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py index 185df20a05f9d..3db060fc7081a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/operations/_component_linked_storage_accounts_operations.py @@ -77,7 +77,7 @@ def get( # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -98,7 +98,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -147,7 +147,7 @@ def create_and_update( # Construct URL url = self.create_and_update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -172,7 +172,7 @@ def create_and_update( 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) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -221,7 +221,7 @@ def update( # Construct URL url = self.update.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -246,7 +246,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) @@ -290,7 +290,7 @@ def delete( # Construct URL url = self.delete.metadata['url'] # type: ignore path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), 'storageType': self._serialize.url("storage_type", storage_type, 'str'), @@ -311,7 +311,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/__init__.py index 7a2772ea1db58..112bf3dc8852f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/__init__.py @@ -7,6 +7,9 @@ # -------------------------------------------------------------------------- from ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION __all__ = ['ApplicationInsightsManagementClient'] try: diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py index bdd0baf2e938e..9fec118a8b5c8 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ApplicationInsightsManagementClientConfiguration from .operations import Operations @@ -49,6 +50,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( @@ -56,6 +58,21 @@ def __init__( self.live_token = LiveTokenOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_configuration.py index 3f703207870ad..17c69526535ff 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_configuration.py @@ -12,13 +12,14 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from ._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any from azure.core.credentials import TokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json index ab19be683b5b6..721a11115abfc 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -22,7 +24,7 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true @@ -30,21 +32,61 @@ }, "constant": { }, - "call": "credential" + "call": "credential", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "operations": "Operations", "live_token": "LiveTokenOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py index 8d679cb987b63..f41dd2f4be1ec 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -46,6 +47,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( @@ -53,6 +55,20 @@ def __init__( self.live_token = LiveTokenOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + http_request.url = self._client.format_url(http_request.url) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_configuration.py index ddbefbad6648b..a91950e540b89 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_configuration.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_configuration.py @@ -12,11 +12,12 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy +from .._version import VERSION + if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -VERSION = "unknown" class ApplicationInsightsManagementClientConfiguration(Configuration): """Configuration for ApplicationInsightsManagementClient. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py index c07cff97538a0..b37a339c25233 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def get( self, resource_uri: str, - **kwargs + **kwargs: Any ) -> "_models.LiveTokenResponse": """**Gets an access token for live metrics stream data.**. @@ -83,7 +83,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LiveTokenResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_operations.py index cbbedbeb90e1c..30d9d767fc61b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationsListResult"]: """List available operations. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/__init__.py index eab81c1fd8fcc..98bce08b972dd 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/__init__.py @@ -7,20 +7,23 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import ErrorResponse + from ._models_py3 import ErrorResponseLinkedStorage + from ._models_py3 import ErrorResponseLinkedStorageError from ._models_py3 import LiveTokenResponse from ._models_py3 import OperationInfo from ._models_py3 import OperationLive from ._models_py3 import OperationsListResult except (SyntaxError, ImportError): - from ._models import ErrorResponse # type: ignore + from ._models import ErrorResponseLinkedStorage # type: ignore + from ._models import ErrorResponseLinkedStorageError # type: ignore from ._models import LiveTokenResponse # type: ignore from ._models import OperationInfo # type: ignore from ._models import OperationLive # type: ignore from ._models import OperationsListResult # type: ignore __all__ = [ - 'ErrorResponse', + 'ErrorResponseLinkedStorage', + 'ErrorResponseLinkedStorageError', 'LiveTokenResponse', 'OperationInfo', 'OperationLive', diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models.py index e69445bff0abc..cec4eaba97575 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models.py @@ -10,15 +10,43 @@ import msrest.serialization -class ErrorResponse(msrest.serialization.Model): +class ErrorResponseLinkedStorage(msrest.serialization.Model): + """ErrorResponseLinkedStorage. + + :param error: Error response indicates Insights service is not able to process the incoming + request. The reason is provided in the error message. + :type error: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.ErrorResponseLinkedStorageError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseLinkedStorageError'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseLinkedStorage, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ErrorResponseLinkedStorageError(msrest.serialization.Model): """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str """ + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, @@ -28,9 +56,9 @@ def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(ErrorResponseLinkedStorageError, self).__init__(**kwargs) + self.code = None + self.message = None class LiveTokenResponse(msrest.serialization.Model): @@ -99,7 +127,7 @@ class OperationLive(msrest.serialization.Model): :param origin: Origin of the operation. :type origin: str :param properties: Properties of the operation. - :type properties: object + :type properties: any """ _attribute_map = { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models_py3.py index 6412c54228798..dc72f43a22d30 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/models/_models_py3.py @@ -6,21 +6,51 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, Optional +from typing import Any, List, Optional from azure.core.exceptions import HttpResponseError import msrest.serialization -class ErrorResponse(msrest.serialization.Model): +class ErrorResponseLinkedStorage(msrest.serialization.Model): + """ErrorResponseLinkedStorage. + + :param error: Error response indicates Insights service is not able to process the incoming + request. The reason is provided in the error message. + :type error: + ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.ErrorResponseLinkedStorageError + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorResponseLinkedStorageError'}, + } + + def __init__( + self, + *, + error: Optional["ErrorResponseLinkedStorageError"] = None, + **kwargs + ): + super(ErrorResponseLinkedStorage, self).__init__(**kwargs) + self.error = error + + +class ErrorResponseLinkedStorageError(msrest.serialization.Model): """Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error message. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Error code. + :vartype code: str + :ivar message: Error message indicating why the operation failed. + :vartype message: str """ + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + } + _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, @@ -28,14 +58,11 @@ class ErrorResponse(msrest.serialization.Model): def __init__( self, - *, - code: Optional[str] = None, - message: Optional[str] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message + super(ErrorResponseLinkedStorageError, self).__init__(**kwargs) + self.code = None + self.message = None class LiveTokenResponse(msrest.serialization.Model): @@ -109,7 +136,7 @@ class OperationLive(msrest.serialization.Model): :param origin: Origin of the operation. :type origin: str :param properties: Properties of the operation. - :type properties: object + :type properties: any """ _attribute_map = { @@ -125,7 +152,7 @@ def __init__( name: Optional[str] = None, display: Optional["OperationInfo"] = None, origin: Optional[str] = None, - properties: Optional[object] = None, + properties: Optional[Any] = None, **kwargs ): super(OperationLive, self).__init__(**kwargs) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/operations/_live_token_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/operations/_live_token_operations.py index 83f434a266ce7..0bf84aaec4214 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/operations/_live_token_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/operations/_live_token_operations.py @@ -88,7 +88,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseLinkedStorage, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('LiveTokenResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/__init__.py new file mode 100644 index 0000000000000..112bf3dc8852f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/__init__.py @@ -0,0 +1,19 @@ +# 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 ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['ApplicationInsightsManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_application_insights_management_client.py new file mode 100644 index 0000000000000..1a10819f3baf2 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_application_insights_management_client.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 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, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import ApplicationInsightsManagementClientConfiguration +from .operations import WorkbookTemplatesOperations +from . import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar workbook_templates: WorkbookTemplatesOperations operations + :vartype workbook_templates: azure.mgmt.applicationinsights.v2020_11_20.operations.WorkbookTemplatesOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.workbook_templates = WorkbookTemplatesOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ApplicationInsightsManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_configuration.py new file mode 100644 index 0000000000000..21f3a189fd679 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_configuration.py @@ -0,0 +1,71 @@ +# 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 + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # 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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-20" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_metadata.json new file mode 100644 index 0000000000000..99d580710f824 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_metadata.json @@ -0,0 +1,103 @@ +{ + "chosen_version": "2020-11-20", + "total_api_version_list": ["2020-11-20"], + "client": { + "name": "ApplicationInsightsManagementClient", + "filename": "_application_insights_management_client", + "description": "Composite Swagger for Application Insights Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "workbook_templates": "WorkbookTemplatesOperations" + } +} \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/__init__.py new file mode 100644 index 0000000000000..71e898dd88afa --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/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 ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient'] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_application_insights_management_client.py new file mode 100644 index 0000000000000..267ba5a3700e6 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_application_insights_management_client.py @@ -0,0 +1,81 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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 ApplicationInsightsManagementClientConfiguration +from .operations import WorkbookTemplatesOperations +from .. import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar workbook_templates: WorkbookTemplatesOperations operations + :vartype workbook_templates: azure.mgmt.applicationinsights.v2020_11_20.aio.operations.WorkbookTemplatesOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.workbook_templates = WorkbookTemplatesOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ApplicationInsightsManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_configuration.py new file mode 100644 index 0000000000000..56da0baeab867 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2020-11-20" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/__init__.py new file mode 100644 index 0000000000000..b456b5421cc6a --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._workbook_templates_operations import WorkbookTemplatesOperations + +__all__ = [ + 'WorkbookTemplatesOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/_workbook_templates_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/_workbook_templates_operations.py new file mode 100644 index 0000000000000..25b44f5dbe31c --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/aio/operations/_workbook_templates_operations.py @@ -0,0 +1,371 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkbookTemplatesOperations: + """WorkbookTemplatesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2020_11_20.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_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WorkbookTemplatesListResult"]: + """Get all Workbook templates defined within a 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: An iterator like instance of either WorkbookTemplatesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplatesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplatesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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_by_resource_group.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), + } + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbookTemplatesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.WorkbookTemplate": + """Get a single workbook template by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Delete a workbook template. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, 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.Insights/workbooktemplates/{resourceName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + workbook_template_properties: "_models.WorkbookTemplate", + **kwargs: Any + ) -> "_models.WorkbookTemplate": + """Create a new workbook template. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_template_properties: Properties that need to be specified to create a new + workbook. + :type workbook_template_properties: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_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(workbook_template_properties, 'WorkbookTemplate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + resource_name: str, + workbook_template_update_parameters: Optional["_models.WorkbookTemplateUpdateParameters"] = None, + **kwargs: Any + ) -> "_models.WorkbookTemplate": + """Updates a workbook template that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_template_update_parameters: Properties that need to be specified to patch a + workbook template. + :type workbook_template_update_parameters: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_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] + if workbook_template_update_parameters is not None: + body_content = self._serialize.body(workbook_template_update_parameters, 'WorkbookTemplateUpdateParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/__init__.py new file mode 100644 index 0000000000000..69a12ceea24b0 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/__init__.py @@ -0,0 +1,40 @@ +# 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 WorkbookTemplate + from ._models_py3 import WorkbookTemplateError + from ._models_py3 import WorkbookTemplateErrorBody + from ._models_py3 import WorkbookTemplateErrorFieldContract + from ._models_py3 import WorkbookTemplateGallery + from ._models_py3 import WorkbookTemplateLocalizedGallery + from ._models_py3 import WorkbookTemplateResource + from ._models_py3 import WorkbookTemplateUpdateParameters + from ._models_py3 import WorkbookTemplatesListResult +except (SyntaxError, ImportError): + from ._models import WorkbookTemplate # type: ignore + from ._models import WorkbookTemplateError # type: ignore + from ._models import WorkbookTemplateErrorBody # type: ignore + from ._models import WorkbookTemplateErrorFieldContract # type: ignore + from ._models import WorkbookTemplateGallery # type: ignore + from ._models import WorkbookTemplateLocalizedGallery # type: ignore + from ._models import WorkbookTemplateResource # type: ignore + from ._models import WorkbookTemplateUpdateParameters # type: ignore + from ._models import WorkbookTemplatesListResult # type: ignore + +__all__ = [ + 'WorkbookTemplate', + 'WorkbookTemplateError', + 'WorkbookTemplateErrorBody', + 'WorkbookTemplateErrorFieldContract', + 'WorkbookTemplateGallery', + 'WorkbookTemplateLocalizedGallery', + 'WorkbookTemplateResource', + 'WorkbookTemplateUpdateParameters', + 'WorkbookTemplatesListResult', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models.py new file mode 100644 index 0000000000000..a1c0bf77dbf52 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models.py @@ -0,0 +1,317 @@ +# 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 WorkbookTemplateResource(msrest.serialization.Model): + """An azure resource object. + + 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs['location'] + self.tags = kwargs.get('tags', None) + + +class WorkbookTemplate(WorkbookTemplateResource): + """An Application Insights workbook template definition. + + 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to open when a workbook + gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the locale code of languages + supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateLocalizedGallery]] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplate, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.author = kwargs.get('author', None) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + self.localized = kwargs.get('localized', None) + + +class WorkbookTemplateError(msrest.serialization.Model): + """Error message that will indicate why the operation failed. + + :param error: Error message object that will indicate why the operation failed. + :type error: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'WorkbookTemplateErrorBody'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class WorkbookTemplateErrorBody(msrest.serialization.Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status for the HTTP error + code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[WorkbookTemplateErrorFieldContract]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class WorkbookTemplateErrorFieldContract(msrest.serialization.Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateErrorFieldContract, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + + +class WorkbookTemplateGallery(msrest.serialization.Model): + """Gallery information for a workbook template. + + :param name: Name of the workbook template in the gallery. + :type name: str + :param category: Category for the gallery. + :type category: str + :param type: Type of workbook supported by the workbook template. + :type type: str + :param order: Order of the template within the gallery. + :type order: int + :param resource_type: Azure resource type supported by the gallery. + :type resource_type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateGallery, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.category = kwargs.get('category', None) + self.type = kwargs.get('type', None) + self.order = kwargs.get('order', None) + self.resource_type = kwargs.get('resource_type', None) + + +class WorkbookTemplateLocalizedGallery(msrest.serialization.Model): + """Localized template data and gallery information. + + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + """ + + _attribute_map = { + 'template_data': {'key': 'templateData', 'type': 'object'}, + 'galleries': {'key': 'galleries', 'type': '[WorkbookTemplateGallery]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateLocalizedGallery, self).__init__(**kwargs) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + + +class WorkbookTemplatesListResult(msrest.serialization.Model): + """WorkbookTemplate list result. + + :param value: An array of workbook templates. + :type value: list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkbookTemplate]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplatesListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class WorkbookTemplateUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating workbook template. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to open when a workbook + gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the locale code of languages + supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateLocalizedGallery]] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookTemplateUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.priority = kwargs.get('priority', None) + self.author = kwargs.get('author', None) + self.template_data = kwargs.get('template_data', None) + self.galleries = kwargs.get('galleries', None) + self.localized = kwargs.get('localized', None) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models_py3.py new file mode 100644 index 0000000000000..e454306856771 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/models/_models_py3.py @@ -0,0 +1,358 @@ +# 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, Dict, List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class WorkbookTemplateResource(msrest.serialization.Model): + """An azure resource object. + + 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, 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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + super(WorkbookTemplateResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + + +class WorkbookTemplate(WorkbookTemplateResource): + """An Application Insights workbook template definition. + + 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: Azure resource Id. + :vartype id: str + :ivar name: Azure resource name. + :vartype name: str + :ivar type: Azure resource type. + :vartype type: str + :param location: Required. Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to open when a workbook + gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the locale code of languages + supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateLocalizedGallery]] + """ + + _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'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + priority: Optional[int] = None, + author: Optional[str] = None, + template_data: Optional[Any] = None, + galleries: Optional[List["WorkbookTemplateGallery"]] = None, + localized: Optional[Dict[str, List["WorkbookTemplateLocalizedGallery"]]] = None, + **kwargs + ): + super(WorkbookTemplate, self).__init__(location=location, tags=tags, **kwargs) + self.priority = priority + self.author = author + self.template_data = template_data + self.galleries = galleries + self.localized = localized + + +class WorkbookTemplateError(msrest.serialization.Model): + """Error message that will indicate why the operation failed. + + :param error: Error message object that will indicate why the operation failed. + :type error: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'WorkbookTemplateErrorBody'}, + } + + def __init__( + self, + *, + error: Optional["WorkbookTemplateErrorBody"] = None, + **kwargs + ): + super(WorkbookTemplateError, self).__init__(**kwargs) + self.error = error + + +class WorkbookTemplateErrorBody(msrest.serialization.Model): + """Error message body that will indicate why the operation failed. + + :param code: Service-defined error code. This code serves as a sub-status for the HTTP error + code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of validation error. + :type details: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[WorkbookTemplateErrorFieldContract]'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + details: Optional[List["WorkbookTemplateErrorFieldContract"]] = None, + **kwargs + ): + super(WorkbookTemplateErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class WorkbookTemplateErrorFieldContract(msrest.serialization.Model): + """Error Field contract. + + :param code: Property level error code. + :type code: str + :param message: Human-readable representation of property-level error. + :type message: str + :param target: Property name. + :type target: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + target: Optional[str] = None, + **kwargs + ): + super(WorkbookTemplateErrorFieldContract, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + + +class WorkbookTemplateGallery(msrest.serialization.Model): + """Gallery information for a workbook template. + + :param name: Name of the workbook template in the gallery. + :type name: str + :param category: Category for the gallery. + :type category: str + :param type: Type of workbook supported by the workbook template. + :type type: str + :param order: Order of the template within the gallery. + :type order: int + :param resource_type: Azure resource type supported by the gallery. + :type resource_type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'category': {'key': 'category', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'int'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + category: Optional[str] = None, + type: Optional[str] = None, + order: Optional[int] = None, + resource_type: Optional[str] = None, + **kwargs + ): + super(WorkbookTemplateGallery, self).__init__(**kwargs) + self.name = name + self.category = category + self.type = type + self.order = order + self.resource_type = resource_type + + +class WorkbookTemplateLocalizedGallery(msrest.serialization.Model): + """Localized template data and gallery information. + + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + """ + + _attribute_map = { + 'template_data': {'key': 'templateData', 'type': 'object'}, + 'galleries': {'key': 'galleries', 'type': '[WorkbookTemplateGallery]'}, + } + + def __init__( + self, + *, + template_data: Optional[Any] = None, + galleries: Optional[List["WorkbookTemplateGallery"]] = None, + **kwargs + ): + super(WorkbookTemplateLocalizedGallery, self).__init__(**kwargs) + self.template_data = template_data + self.galleries = galleries + + +class WorkbookTemplatesListResult(msrest.serialization.Model): + """WorkbookTemplate list result. + + :param value: An array of workbook templates. + :type value: list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[WorkbookTemplate]'}, + } + + def __init__( + self, + *, + value: Optional[List["WorkbookTemplate"]] = None, + **kwargs + ): + super(WorkbookTemplatesListResult, self).__init__(**kwargs) + self.value = value + + +class WorkbookTemplateUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating workbook template. + + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param priority: Priority of the template. Determines which template to open when a workbook + gallery is opened in viewer mode. + :type priority: int + :param author: Information about the author of the workbook template. + :type author: str + :param template_data: Valid JSON object containing workbook template payload. + :type template_data: any + :param galleries: Workbook galleries supported by the template. + :type galleries: + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateGallery] + :param localized: Key value pair of localized gallery. Each key is the locale code of languages + supported by the Azure portal. + :type localized: dict[str, + list[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateLocalizedGallery]] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'author': {'key': 'properties.author', 'type': 'str'}, + 'template_data': {'key': 'properties.templateData', 'type': 'object'}, + 'galleries': {'key': 'properties.galleries', 'type': '[WorkbookTemplateGallery]'}, + 'localized': {'key': 'properties.localized', 'type': '{[WorkbookTemplateLocalizedGallery]}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + priority: Optional[int] = None, + author: Optional[str] = None, + template_data: Optional[Any] = None, + galleries: Optional[List["WorkbookTemplateGallery"]] = None, + localized: Optional[Dict[str, List["WorkbookTemplateLocalizedGallery"]]] = None, + **kwargs + ): + super(WorkbookTemplateUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.priority = priority + self.author = author + self.template_data = template_data + self.galleries = galleries + self.localized = localized diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/__init__.py new file mode 100644 index 0000000000000..b456b5421cc6a --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._workbook_templates_operations import WorkbookTemplatesOperations + +__all__ = [ + 'WorkbookTemplatesOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/_workbook_templates_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/_workbook_templates_operations.py new file mode 100644 index 0000000000000..7ff11b8ebf561 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/operations/_workbook_templates_operations.py @@ -0,0 +1,380 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkbookTemplatesOperations(object): + """WorkbookTemplatesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2020_11_20.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_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkbookTemplatesListResult"] + """Get all Workbook templates defined within a 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: An iterator like instance of either WorkbookTemplatesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplatesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplatesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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_by_resource_group.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), + } + 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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbookTemplatesListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkbookTemplate" + """Get a single workbook template by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a workbook template. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, 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.Insights/workbooktemplates/{resourceName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + workbook_template_properties, # type: "_models.WorkbookTemplate" + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkbookTemplate" + """Create a new workbook template. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_template_properties: Properties that need to be specified to create a new + workbook. + :type workbook_template_properties: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_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(workbook_template_properties, 'WorkbookTemplate') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + workbook_template_update_parameters=None, # type: Optional["_models.WorkbookTemplateUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "_models.WorkbookTemplate" + """Updates a workbook template that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_template_update_parameters: Properties that need to be specified to patch a + workbook template. + :type workbook_template_update_parameters: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: WorkbookTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2020_11_20.models.WorkbookTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbookTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-11-20" + 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), + 'resourceName': self._serialize.url("resource_name", resource_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] + if workbook_template_update_parameters is not None: + body_content = self._serialize.body(workbook_template_update_parameters, 'WorkbookTemplateUpdateParameters') + else: + body_content = None + body_content_kwargs['content'] = body_content + request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookTemplateError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('WorkbookTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooktemplates/{resourceName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/py.typed b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_11_20/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/__init__.py new file mode 100644 index 0000000000000..112bf3dc8852f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/__init__.py @@ -0,0 +1,19 @@ +# 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 ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['ApplicationInsightsManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.py new file mode 100644 index 0000000000000..e2ad0ee92d27e --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_application_insights_management_client.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 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, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import ApplicationInsightsManagementClientConfiguration +from .operations import MyWorkbooksOperations +from . import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar my_workbooks: MyWorkbooksOperations operations + :vartype my_workbooks: azure.mgmt.applicationinsights.v2021_03_08.operations.MyWorkbooksOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.my_workbooks = MyWorkbooksOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ApplicationInsightsManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_configuration.py new file mode 100644 index 0000000000000..0d3b9b21c6353 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_configuration.py @@ -0,0 +1,71 @@ +# 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 + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # 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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-03-08" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_metadata.json new file mode 100644 index 0000000000000..6c2647f0772c2 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_metadata.json @@ -0,0 +1,103 @@ +{ + "chosen_version": "2021-03-08", + "total_api_version_list": ["2021-03-08"], + "client": { + "name": "ApplicationInsightsManagementClient", + "filename": "_application_insights_management_client", + "description": "Composite Swagger for Application Insights Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "my_workbooks": "MyWorkbooksOperations" + } +} \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/__init__.py new file mode 100644 index 0000000000000..71e898dd88afa --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/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 ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient'] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_application_insights_management_client.py new file mode 100644 index 0000000000000..612648ce33c6d --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_application_insights_management_client.py @@ -0,0 +1,81 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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 ApplicationInsightsManagementClientConfiguration +from .operations import MyWorkbooksOperations +from .. import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar my_workbooks: MyWorkbooksOperations operations + :vartype my_workbooks: azure.mgmt.applicationinsights.v2021_03_08.aio.operations.MyWorkbooksOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.my_workbooks = MyWorkbooksOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ApplicationInsightsManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_configuration.py new file mode 100644 index 0000000000000..b7fd0e64fdafc --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-03-08" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/__init__.py new file mode 100644 index 0000000000000..66b07a867b0fd --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._my_workbooks_operations import MyWorkbooksOperations + +__all__ = [ + 'MyWorkbooksOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/_my_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/_my_workbooks_operations.py new file mode 100644 index 0000000000000..dae2c123f360c --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/aio/operations/_my_workbooks_operations.py @@ -0,0 +1,480 @@ +# 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, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class MyWorkbooksOperations: + """MyWorkbooksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2021_03_08.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_by_resource_group( + self, + resource_group_name: str, + category: Union[str, "_models.CategoryType"], + tags: Optional[List[str]] = None, + source_id: Optional[str] = None, + can_fetch_content: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.MyWorkbooksListResult"]: + """Get all private workbooks defined within a specified resource group and category. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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_by_resource_group.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), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MyWorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore + + def list_by_subscription( + self, + category: Union[str, "_models.CategoryType"], + tags: Optional[List[str]] = None, + can_fetch_content: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.MyWorkbooksListResult"]: + """Get all private workbooks defined within a specified subscription and category. + + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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_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['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('MyWorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.MyWorkbook": + """Get a single private workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Delete a private workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_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-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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.Insights/myWorkbooks/{resourceName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + workbook_properties: "_models.MyWorkbook", + source_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.MyWorkbook": + """Create a new private workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new private + workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'MyWorkbook') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + resource_name: str, + workbook_properties: "_models.MyWorkbook", + source_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.MyWorkbook": + """Updates a private workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new private + workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'MyWorkbook') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/__init__.py new file mode 100644 index 0000000000000..07b825a48b935 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/__init__.py @@ -0,0 +1,51 @@ +# 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 ErrorDefinition + from ._models_py3 import InnerErrorTrace + from ._models_py3 import MyWorkbook + from ._models_py3 import MyWorkbookError + from ._models_py3 import MyWorkbookManagedIdentity + from ._models_py3 import MyWorkbookResource + from ._models_py3 import MyWorkbookUserAssignedIdentities + from ._models_py3 import MyWorkbooksListResult + from ._models_py3 import SystemData +except (SyntaxError, ImportError): + from ._models import ErrorDefinition # type: ignore + from ._models import InnerErrorTrace # type: ignore + from ._models import MyWorkbook # type: ignore + from ._models import MyWorkbookError # type: ignore + from ._models import MyWorkbookManagedIdentity # type: ignore + from ._models import MyWorkbookResource # type: ignore + from ._models import MyWorkbookUserAssignedIdentities # type: ignore + from ._models import MyWorkbooksListResult # type: ignore + from ._models import SystemData # type: ignore + +from ._application_insights_management_client_enums import ( + CategoryType, + CreatedByType, + Kind, + MyWorkbookManagedIdentityType, +) + +__all__ = [ + 'ErrorDefinition', + 'InnerErrorTrace', + 'MyWorkbook', + 'MyWorkbookError', + 'MyWorkbookManagedIdentity', + 'MyWorkbookResource', + 'MyWorkbookUserAssignedIdentities', + 'MyWorkbooksListResult', + 'SystemData', + 'CategoryType', + 'CreatedByType', + 'Kind', + 'MyWorkbookManagedIdentityType', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_application_insights_management_client_enums.py new file mode 100644 index 0000000000000..be6863e0b0ba1 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_application_insights_management_client_enums.py @@ -0,0 +1,57 @@ +# 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 CategoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WORKBOOK = "workbook" + TSG = "TSG" + PERFORMANCE = "performance" + RETENTION = "retention" + +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 Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of workbook. Choices are user and shared. + """ + + USER = "user" + SHARED = "shared" + +class MyWorkbookManagedIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. + """ + + USER_ASSIGNED = "UserAssigned" + NONE = "None" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models.py new file mode 100644 index 0000000000000..a1c8f33a76f7d --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models.py @@ -0,0 +1,351 @@ +# 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 ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar innererror: Internal error details. + :vartype innererror: any + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.innererror = None + + +class InnerErrorTrace(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trace: detailed error trace. + :vartype trace: list[str] + """ + + _validation = { + 'trace': {'readonly': True}, + } + + _attribute_map = { + 'trace': {'key': 'trace', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(InnerErrorTrace, self).__init__(**kwargs) + self.trace = None + + +class MyWorkbookResource(msrest.serialization.Model): + """An azure resource object. + + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentity + :param id: Azure resource Id. + :type id: str + :param name: Azure resource name. + :type name: str + :param type: Azure resource type. + :type type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param etag: Resource etag. + :type etag: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'MyWorkbookManagedIdentity'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbookResource, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.id = kwargs.get('id', None) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.etag = kwargs.get('etag', None) + + +class MyWorkbook(MyWorkbookResource): + """An Application Insights private workbook definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentity + :param id: Azure resource Id. + :type id: str + :param name: Azure resource name. + :type name: str + :param type: Azure resource type. + :type type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param etag: Resource etag. + :type etag: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.Kind + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.applicationinsights.v2021_03_08.models.SystemData + :param display_name: The user-defined name of the private workbook. + :type display_name: str + :param serialized_data: Configuration of this particular private workbook. Configuration data + is a string containing valid JSON. + :type serialized_data: str + :param version: This instance's version of the data model. This can change as new features are + added that can be marked private workbook. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that was made to this + private workbook definition. + :vartype time_modified: str + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: A list of 0 or more tags that are associated with this private + workbook definition. + :type tags_properties_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this private workbook. + :vartype user_id: str + :param source_id: Optional resourceId for a source resource. + :type source_id: str + :param storage_uri: BYOS Storage Account URI. + :type storage_uri: str + """ + + _validation = { + 'system_data': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'MyWorkbookManagedIdentity'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbook, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.system_data = None + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.version = kwargs.get('version', None) + self.time_modified = None + self.category = kwargs.get('category', None) + self.tags_properties_tags = kwargs.get('tags_properties_tags', None) + self.user_id = None + self.source_id = kwargs.get('source_id', None) + self.storage_uri = kwargs.get('storage_uri', None) + + +class MyWorkbookError(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.applicationinsights.v2021_03_08.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbookError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class MyWorkbookManagedIdentity(msrest.serialization.Model): + """Customer Managed Identity. + + :param user_assigned_identities: Customer Managed Identity. + :type user_assigned_identities: + ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookUserAssignedIdentities + :param type: The identity type. Possible values include: "UserAssigned", "None". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentityType + """ + + _attribute_map = { + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': 'MyWorkbookUserAssignedIdentities'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbookManagedIdentity, self).__init__(**kwargs) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = kwargs.get('type', None) + + +class MyWorkbooksListResult(msrest.serialization.Model): + """Workbook list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of private workbooks. + :vartype value: list[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook] + :param next_link: + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MyWorkbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbooksListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class MyWorkbookUserAssignedIdentities(msrest.serialization.Model): + """Customer Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbookUserAssignedIdentities, self).__init__(**kwargs) + self.principal_id = None + self.tenant_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.mgmt.applicationinsights.v2021_03_08.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.mgmt.applicationinsights.v2021_03_08.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) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models_py3.py new file mode 100644 index 0000000000000..4b7673c5c7670 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/models/_models_py3.py @@ -0,0 +1,394 @@ +# 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 ._application_insights_management_client_enums import * + + +class ErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar innererror: Internal error details. + :vartype innererror: any + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'innererror': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.innererror = None + + +class InnerErrorTrace(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trace: detailed error trace. + :vartype trace: list[str] + """ + + _validation = { + 'trace': {'readonly': True}, + } + + _attribute_map = { + 'trace': {'key': 'trace', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(InnerErrorTrace, self).__init__(**kwargs) + self.trace = None + + +class MyWorkbookResource(msrest.serialization.Model): + """An azure resource object. + + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentity + :param id: Azure resource Id. + :type id: str + :param name: Azure resource name. + :type name: str + :param type: Azure resource type. + :type type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param etag: Resource etag. + :type etag: dict[str, str] + """ + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'MyWorkbookManagedIdentity'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': '{str}'}, + } + + def __init__( + self, + *, + identity: Optional["MyWorkbookManagedIdentity"] = None, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + etag: Optional[Dict[str, str]] = None, + **kwargs + ): + super(MyWorkbookResource, self).__init__(**kwargs) + self.identity = identity + self.id = id + self.name = name + self.type = type + self.location = location + self.tags = tags + self.etag = etag + + +class MyWorkbook(MyWorkbookResource): + """An Application Insights private workbook definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentity + :param id: Azure resource Id. + :type id: str + :param name: Azure resource name. + :type name: str + :param type: Azure resource type. + :type type: str + :param location: Resource location. + :type location: str + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param etag: Resource etag. + :type etag: dict[str, str] + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.Kind + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.applicationinsights.v2021_03_08.models.SystemData + :param display_name: The user-defined name of the private workbook. + :type display_name: str + :param serialized_data: Configuration of this particular private workbook. Configuration data + is a string containing valid JSON. + :type serialized_data: str + :param version: This instance's version of the data model. This can change as new features are + added that can be marked private workbook. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that was made to this + private workbook definition. + :vartype time_modified: str + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: A list of 0 or more tags that are associated with this private + workbook definition. + :type tags_properties_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this private workbook. + :vartype user_id: str + :param source_id: Optional resourceId for a source resource. + :type source_id: str + :param storage_uri: BYOS Storage Account URI. + :type storage_uri: str + """ + + _validation = { + 'system_data': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + } + + _attribute_map = { + 'identity': {'key': 'identity', 'type': 'MyWorkbookManagedIdentity'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'etag': {'key': 'etag', 'type': '{str}'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + identity: Optional["MyWorkbookManagedIdentity"] = None, + id: Optional[str] = None, + name: Optional[str] = None, + type: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + etag: Optional[Dict[str, str]] = None, + kind: Optional[Union[str, "Kind"]] = None, + display_name: Optional[str] = None, + serialized_data: Optional[str] = None, + version: Optional[str] = None, + category: Optional[str] = None, + tags_properties_tags: Optional[List[str]] = None, + source_id: Optional[str] = None, + storage_uri: Optional[str] = None, + **kwargs + ): + super(MyWorkbook, self).__init__(identity=identity, id=id, name=name, type=type, location=location, tags=tags, etag=etag, **kwargs) + self.kind = kind + self.system_data = None + self.display_name = display_name + self.serialized_data = serialized_data + self.version = version + self.time_modified = None + self.category = category + self.tags_properties_tags = tags_properties_tags + self.user_id = None + self.source_id = source_id + self.storage_uri = storage_uri + + +class MyWorkbookError(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.applicationinsights.v2021_03_08.models.ErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDefinition'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDefinition"] = None, + **kwargs + ): + super(MyWorkbookError, self).__init__(**kwargs) + self.error = error + + +class MyWorkbookManagedIdentity(msrest.serialization.Model): + """Customer Managed Identity. + + :param user_assigned_identities: Customer Managed Identity. + :type user_assigned_identities: + ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookUserAssignedIdentities + :param type: The identity type. Possible values include: "UserAssigned", "None". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbookManagedIdentityType + """ + + _attribute_map = { + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': 'MyWorkbookUserAssignedIdentities'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + user_assigned_identities: Optional["MyWorkbookUserAssignedIdentities"] = None, + type: Optional[Union[str, "MyWorkbookManagedIdentityType"]] = None, + **kwargs + ): + super(MyWorkbookManagedIdentity, self).__init__(**kwargs) + self.user_assigned_identities = user_assigned_identities + self.type = type + + +class MyWorkbooksListResult(msrest.serialization.Model): + """Workbook list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of private workbooks. + :vartype value: list[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook] + :param next_link: + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[MyWorkbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(MyWorkbooksListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class MyWorkbookUserAssignedIdentities(msrest.serialization.Model): + """Customer Managed Identity. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. + :vartype tenant_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(MyWorkbookUserAssignedIdentities, self).__init__(**kwargs) + self.principal_id = None + self.tenant_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.mgmt.applicationinsights.v2021_03_08.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.mgmt.applicationinsights.v2021_03_08.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 diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/__init__.py new file mode 100644 index 0000000000000..66b07a867b0fd --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._my_workbooks_operations import MyWorkbooksOperations + +__all__ = [ + 'MyWorkbooksOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/_my_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/_my_workbooks_operations.py new file mode 100644 index 0000000000000..1dc7ef58ce164 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/operations/_my_workbooks_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.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class MyWorkbooksOperations(object): + """MyWorkbooksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2021_03_08.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_by_resource_group( + self, + resource_group_name, # type: str + category, # type: Union[str, "_models.CategoryType"] + tags=None, # type: Optional[List[str]] + source_id=None, # type: Optional[str] + can_fetch_content=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MyWorkbooksListResult"] + """Get all private workbooks defined within a specified resource group and category. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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_by_resource_group.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), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MyWorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore + + def list_by_subscription( + self, + category, # type: Union[str, "_models.CategoryType"] + tags=None, # type: Optional[List[str]] + can_fetch_content=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.MyWorkbooksListResult"] + """Get all private workbooks defined within a specified subscription and category. + + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_03_08.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either MyWorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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_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['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('MyWorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/myWorkbooks'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.MyWorkbook" + """Get a single private workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a private workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_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-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, 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.Insights/myWorkbooks/{resourceName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + workbook_properties, # type: "_models.MyWorkbook" + source_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.MyWorkbook" + """Create a new private workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new private + workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'MyWorkbook') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + workbook_properties, # type: "_models.MyWorkbook" + source_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.MyWorkbook" + """Updates a private workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new private + workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: MyWorkbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_03_08.models.MyWorkbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.MyWorkbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-08" + 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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'MyWorkbook') + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.MyWorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('MyWorkbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/py.typed b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_03_08/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/__init__.py new file mode 100644 index 0000000000000..112bf3dc8852f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/__init__.py @@ -0,0 +1,19 @@ +# 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 ._application_insights_management_client import ApplicationInsightsManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['ApplicationInsightsManagementClient'] + +try: + from ._patch import patch_sdk # type: ignore + patch_sdk() +except ImportError: + pass diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_application_insights_management_client.py new file mode 100644 index 0000000000000..4d18cef3f44cf --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_application_insights_management_client.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 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, Optional + + from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse + +from ._configuration import ApplicationInsightsManagementClientConfiguration +from .operations import WorkbooksOperations +from . import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar workbooks: WorkbooksOperations operations + :vartype workbooks: azure.mgmt.applicationinsights.v2021_08_01.operations.WorkbooksOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> None + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.workbooks = WorkbooksOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> ApplicationInsightsManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_configuration.py new file mode 100644 index 0000000000000..8ff63f18b4ad8 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_configuration.py @@ -0,0 +1,71 @@ +# 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 + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # 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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_metadata.json new file mode 100644 index 0000000000000..4c9ffd52c4b26 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_metadata.json @@ -0,0 +1,103 @@ +{ + "chosen_version": "2021-08-01", + "total_api_version_list": ["2021-08-01"], + "client": { + "name": "ApplicationInsightsManagementClient", + "filename": "_application_insights_management_client", + "description": "Composite Swagger for Application Insights Management Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApplicationInsightsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "workbooks": "WorkbooksOperations" + } +} \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_version.py new file mode 100644 index 0000000000000..e5754a47ce68f --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/_version.py @@ -0,0 +1,9 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/__init__.py new file mode 100644 index 0000000000000..71e898dd88afa --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/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 ._application_insights_management_client import ApplicationInsightsManagementClient +__all__ = ['ApplicationInsightsManagementClient'] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_application_insights_management_client.py new file mode 100644 index 0000000000000..e00ff2fbe96cd --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_application_insights_management_client.py @@ -0,0 +1,81 @@ +# 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, Optional, TYPE_CHECKING + +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +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 ApplicationInsightsManagementClientConfiguration +from .operations import WorkbooksOperations +from .. import models + + +class ApplicationInsightsManagementClient(object): + """Composite Swagger for Application Insights Management Client. + + :ivar workbooks: WorkbooksOperations operations + :vartype workbooks: azure.mgmt.applicationinsights.v2021_08_01.aio.operations.WorkbooksOperations + :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 str base_url: Service URL + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: Optional[str] = None, + **kwargs: Any + ) -> None: + if not base_url: + base_url = 'https://management.azure.com' + self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **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._serialize.client_side_validation = False + self._deserialize = Deserializer(client_models) + + self.workbooks = WorkbooksOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "ApplicationInsightsManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_configuration.py new file mode 100644 index 0000000000000..4dd9be4678f19 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/_configuration.py @@ -0,0 +1,67 @@ +# 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 + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class ApplicationInsightsManagementClientConfiguration(Configuration): + """Configuration for ApplicationInsightsManagementClient. + + 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 + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **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.") + super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = "2021-08-01" + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-applicationinsights/{}'.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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/__init__.py new file mode 100644 index 0000000000000..39e879c6ea32e --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._workbooks_operations import WorkbooksOperations + +__all__ = [ + 'WorkbooksOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/_workbooks_operations.py new file mode 100644 index 0000000000000..82964dd6c844d --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/aio/operations/_workbooks_operations.py @@ -0,0 +1,620 @@ +# 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, List, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class WorkbooksOperations: + """WorkbooksOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2021_08_01.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_by_subscription( + self, + category: Union[str, "_models.CategoryType"], + tags: Optional[List[str]] = None, + can_fetch_content: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WorkbooksListResult"]: + """Get all private workbooks defined within a specified subscription and category. + + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_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['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/workbooks'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name: str, + category: Union[str, "_models.CategoryType"], + tags: Optional[List[str]] = None, + source_id: Optional[str] = None, + can_fetch_content: Optional[bool] = None, + **kwargs: Any + ) -> AsyncIterable["_models.WorkbooksListResult"]: + """Get all Workbooks defined within a specified resource group and category. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.Workbook": + """Get a single workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> None: + """Delete a workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_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-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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.Insights/workbooks/{resourceName}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + resource_name: str, + workbook_properties: "_models.Workbook", + source_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.Workbook": + """Create a new workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'Workbook') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Workbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + async def update( + self, + resource_group_name: str, + resource_name: str, + source_id: Optional[str] = None, + workbook_update_parameters: Optional["_models.WorkbookUpdateParameters"] = None, + **kwargs: Any + ) -> "_models.Workbook": + """Updates a workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param workbook_update_parameters: Properties that need to be specified to create a new + workbook. + :type workbook_update_parameters: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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] + if workbook_update_parameters is not None: + body_content = self._serialize.body(workbook_update_parameters, 'WorkbookUpdateParameters') + else: + body_content = None + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + def revisions_list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.WorkbooksListResult"]: + """Get the revisions for the workbook defined by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.revisions_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), + 'resourceName': self._serialize.url("resource_name", resource_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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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 + ) + revisions_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions'} # type: ignore + + async def revision_get( + self, + resource_group_name: str, + resource_name: str, + revision_id: str, + **kwargs: Any + ) -> "_models.Workbook": + """Get a single workbook revision defined by its revisionId. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param revision_id: The id of the workbook's revision. + :type revision_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.revision_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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'revisionId': self._serialize.url("revision_id", revision_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + revision_get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions/{revisionId}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/__init__.py new file mode 100644 index 0000000000000..d13e41e13d7d7 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/__init__.py @@ -0,0 +1,65 @@ +# 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 ManagedServiceIdentity + from ._models_py3 import Resource + from ._models_py3 import SystemData + from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import Workbook + from ._models_py3 import WorkbookError + from ._models_py3 import WorkbookErrorDefinition + from ._models_py3 import WorkbookInnerErrorTrace + from ._models_py3 import WorkbookResource + from ._models_py3 import WorkbookResourceIdentity + from ._models_py3 import WorkbookUpdateParameters + from ._models_py3 import WorkbooksListResult +except (SyntaxError, ImportError): + from ._models import ManagedServiceIdentity # type: ignore + from ._models import Resource # type: ignore + from ._models import SystemData # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import Workbook # type: ignore + from ._models import WorkbookError # type: ignore + from ._models import WorkbookErrorDefinition # type: ignore + from ._models import WorkbookInnerErrorTrace # type: ignore + from ._models import WorkbookResource # type: ignore + from ._models import WorkbookResourceIdentity # type: ignore + from ._models import WorkbookUpdateParameters # type: ignore + from ._models import WorkbooksListResult # type: ignore + +from ._application_insights_management_client_enums import ( + CategoryType, + CreatedByType, + Kind, + ManagedServiceIdentityType, + SharedTypeKind, +) + +__all__ = [ + 'ManagedServiceIdentity', + 'Resource', + 'SystemData', + 'TrackedResource', + 'UserAssignedIdentity', + 'Workbook', + 'WorkbookError', + 'WorkbookErrorDefinition', + 'WorkbookInnerErrorTrace', + 'WorkbookResource', + 'WorkbookResourceIdentity', + 'WorkbookUpdateParameters', + 'WorkbooksListResult', + 'CategoryType', + 'CreatedByType', + 'Kind', + 'ManagedServiceIdentityType', + 'SharedTypeKind', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_application_insights_management_client_enums.py new file mode 100644 index 0000000000000..e361043951148 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_application_insights_management_client_enums.py @@ -0,0 +1,67 @@ +# 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 CategoryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + WORKBOOK = "workbook" + TSG = "TSG" + PERFORMANCE = "performance" + RETENTION = "retention" + +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 Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of workbook. Choices are user and shared. + """ + + USER = "user" + SHARED = "shared" + +class ManagedServiceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + +class SharedTypeKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The kind of workbook. Choices are user and shared. + """ + + USER = "user" + SHARED = "shared" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models.py new file mode 100644 index 0000000000000..ed87c062ee6dd --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models.py @@ -0,0 +1,582 @@ +# 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 ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + + 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 principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_08_01.models.ManagedServiceIdentityType + :param user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :type user_assigned_identities: dict[str, + ~azure.mgmt.applicationinsights.v2021_08_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +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 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.mgmt.applicationinsights.v2021_08_01.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.mgmt.applicationinsights.v2021_08_01.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 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 UserAssignedIdentity(msrest.serialization.Model): + """User assigned identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class WorkbookResource(TrackedResource): + """An azure resource object. + + 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 + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookResourceIdentity + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.Kind + :param etag: Resource etag. + :type etag: 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'}, + 'identity': {'key': 'identity', 'type': 'WorkbookResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookResource, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.kind = kwargs.get('kind', None) + self.etag = kwargs.get('etag', None) + + +class Workbook(WorkbookResource): + """An Application Insights workbook definition. + + 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 + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookResourceIdentity + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.Kind + :param etag: Resource etag. + :type etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.applicationinsights.v2021_08_01.models.SystemData + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. Configuration data is a + string containing valid JSON. + :type serialized_data: str + :param version: Workbook schema version format, like 'Notebook/1.0', which should match the + workbook in serializedData. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that was made to this + workbook definition. + :vartype time_modified: ~datetime.datetime + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: Being deprecated, please use the other tags field. + :type tags_properties_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this workbook. + :vartype user_id: str + :param source_id: ResourceId for a source resource. + :type source_id: str + :param storage_uri: The resourceId to the storage account when bring your own storage is used. + :type storage_uri: str + :param description: The description of the workbook. + :type description: str + :ivar revision: The unique revision id for this workbook definition. + :vartype revision: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + 'revision': {'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'}, + 'identity': {'key': 'identity', 'type': 'WorkbookResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Workbook, self).__init__(**kwargs) + self.system_data = None + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.version = kwargs.get('version', None) + self.time_modified = None + self.category = kwargs.get('category', None) + self.tags_properties_tags = kwargs.get('tags_properties_tags', None) + self.user_id = None + self.source_id = kwargs.get('source_id', None) + self.storage_uri = kwargs.get('storage_uri', None) + self.description = kwargs.get('description', None) + self.revision = None + + +class WorkbookError(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'WorkbookErrorDefinition'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class WorkbookErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar inner_error: Internal error details. + :vartype inner_error: any + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None + + +class WorkbookInnerErrorTrace(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trace: detailed error trace. + :vartype trace: list[str] + """ + + _validation = { + 'trace': {'readonly': True}, + } + + _attribute_map = { + 'trace': {'key': 'trace', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookInnerErrorTrace, self).__init__(**kwargs) + self.trace = None + + +class WorkbookResourceIdentity(ManagedServiceIdentity): + """Identity used for BYOS. + + 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 principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_08_01.models.ManagedServiceIdentityType + :param user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :type user_assigned_identities: dict[str, + ~azure.mgmt.applicationinsights.v2021_08_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookResourceIdentity, self).__init__(**kwargs) + + +class WorkbooksListResult(msrest.serialization.Model): + """Workbook list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of workbooks. + :vartype value: list[~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook] + :param next_link: + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbooksListResult, self).__init__(**kwargs) + self.value = None + self.next_link = kwargs.get('next_link', None) + + +class WorkbookUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating workbook properties properties. + + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.SharedTypeKind + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. Configuration data is a + string containing valid JSON. + :type serialized_data: str + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook + definition. + :type tags_properties_tags: list[str] + :param description: The description of the workbook. + :type description: str + :param revision: The unique revision id for this workbook definition. + :type revision: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.tags = kwargs.get('tags', None) + self.display_name = kwargs.get('display_name', None) + self.serialized_data = kwargs.get('serialized_data', None) + self.category = kwargs.get('category', None) + self.tags_properties_tags = kwargs.get('tags_properties_tags', None) + self.description = kwargs.get('description', None) + self.revision = kwargs.get('revision', None) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models_py3.py new file mode 100644 index 0000000000000..e869566a108e7 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/models/_models_py3.py @@ -0,0 +1,636 @@ +# 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 ._application_insights_management_client_enums import * + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + + 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 principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_08_01.models.ManagedServiceIdentityType + :param user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :type user_assigned_identities: dict[str, + ~azure.mgmt.applicationinsights.v2021_08_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Union[str, "ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +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 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.mgmt.applicationinsights.v2021_08_01.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.mgmt.applicationinsights.v2021_08_01.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 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 UserAssignedIdentity(msrest.serialization.Model): + """User assigned identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class WorkbookResource(TrackedResource): + """An azure resource object. + + 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 + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookResourceIdentity + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.Kind + :param etag: Resource etag. + :type etag: 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'}, + 'identity': {'key': 'identity', 'type': 'WorkbookResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["WorkbookResourceIdentity"] = None, + kind: Optional[Union[str, "Kind"]] = None, + etag: Optional[str] = None, + **kwargs + ): + super(WorkbookResource, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.kind = kind + self.etag = etag + + +class Workbook(WorkbookResource): + """An Application Insights workbook definition. + + 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 + :param identity: Identity used for BYOS. + :type identity: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookResourceIdentity + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.Kind + :param etag: Resource etag. + :type etag: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.applicationinsights.v2021_08_01.models.SystemData + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. Configuration data is a + string containing valid JSON. + :type serialized_data: str + :param version: Workbook schema version format, like 'Notebook/1.0', which should match the + workbook in serializedData. + :type version: str + :ivar time_modified: Date and time in UTC of the last modification that was made to this + workbook definition. + :vartype time_modified: ~datetime.datetime + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: Being deprecated, please use the other tags field. + :type tags_properties_tags: list[str] + :ivar user_id: Unique user id of the specific user that owns this workbook. + :vartype user_id: str + :param source_id: ResourceId for a source resource. + :type source_id: str + :param storage_uri: The resourceId to the storage account when bring your own storage is used. + :type storage_uri: str + :param description: The description of the workbook. + :type description: str + :ivar revision: The unique revision id for this workbook definition. + :vartype revision: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'system_data': {'readonly': True}, + 'time_modified': {'readonly': True}, + 'user_id': {'readonly': True}, + 'revision': {'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'}, + 'identity': {'key': 'identity', 'type': 'WorkbookResourceIdentity'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'user_id': {'key': 'properties.userId', 'type': 'str'}, + 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["WorkbookResourceIdentity"] = None, + kind: Optional[Union[str, "Kind"]] = None, + etag: Optional[str] = None, + display_name: Optional[str] = None, + serialized_data: Optional[str] = None, + version: Optional[str] = None, + category: Optional[str] = None, + tags_properties_tags: Optional[List[str]] = None, + source_id: Optional[str] = None, + storage_uri: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + super(Workbook, self).__init__(tags=tags, location=location, identity=identity, kind=kind, etag=etag, **kwargs) + self.system_data = None + self.display_name = display_name + self.serialized_data = serialized_data + self.version = version + self.time_modified = None + self.category = category + self.tags_properties_tags = tags_properties_tags + self.user_id = None + self.source_id = source_id + self.storage_uri = storage_uri + self.description = description + self.revision = None + + +class WorkbookError(msrest.serialization.Model): + """Error response. + + :param error: The error details. + :type error: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookErrorDefinition + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'WorkbookErrorDefinition'}, + } + + def __init__( + self, + *, + error: Optional["WorkbookErrorDefinition"] = None, + **kwargs + ): + super(WorkbookError, self).__init__(**kwargs) + self.error = error + + +class WorkbookErrorDefinition(msrest.serialization.Model): + """Error definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: Service specific error code which serves as the substatus for the HTTP error code. + :vartype code: str + :ivar message: Description of the error. + :vartype message: str + :ivar inner_error: Internal error details. + :vartype inner_error: any + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innerError', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookErrorDefinition, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None + + +class WorkbookInnerErrorTrace(msrest.serialization.Model): + """Error details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar trace: detailed error trace. + :vartype trace: list[str] + """ + + _validation = { + 'trace': {'readonly': True}, + } + + _attribute_map = { + 'trace': {'key': 'trace', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(WorkbookInnerErrorTrace, self).__init__(**kwargs) + self.trace = None + + +class WorkbookResourceIdentity(ManagedServiceIdentity): + """Identity used for BYOS. + + 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 principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :param type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :type type: str or + ~azure.mgmt.applicationinsights.v2021_08_01.models.ManagedServiceIdentityType + :param user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :type user_assigned_identities: dict[str, + ~azure.mgmt.applicationinsights.v2021_08_01.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Union[str, "ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(WorkbookResourceIdentity, self).__init__(type=type, user_assigned_identities=user_assigned_identities, **kwargs) + + +class WorkbooksListResult(msrest.serialization.Model): + """Workbook list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: An array of workbooks. + :vartype value: list[~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook] + :param next_link: + :type next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Workbook]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + next_link: Optional[str] = None, + **kwargs + ): + super(WorkbooksListResult, self).__init__(**kwargs) + self.value = None + self.next_link = next_link + + +class WorkbookUpdateParameters(msrest.serialization.Model): + """The parameters that can be provided when updating workbook properties properties. + + :param kind: The kind of workbook. Choices are user and shared. Possible values include: + "user", "shared". + :type kind: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.SharedTypeKind + :param tags: A set of tags. Resource tags. + :type tags: dict[str, str] + :param display_name: The user-defined name (display name) of the workbook. + :type display_name: str + :param serialized_data: Configuration of this particular workbook. Configuration data is a + string containing valid JSON. + :type serialized_data: str + :param category: Workbook category, as defined by the user at creation time. + :type category: str + :param tags_properties_tags: A list of 0 or more tags that are associated with this workbook + definition. + :type tags_properties_tags: list[str] + :param description: The description of the workbook. + :type description: str + :param revision: The unique revision id for this workbook definition. + :type revision: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'revision': {'key': 'properties.revision', 'type': 'str'}, + } + + def __init__( + self, + *, + kind: Optional[Union[str, "SharedTypeKind"]] = None, + tags: Optional[Dict[str, str]] = None, + display_name: Optional[str] = None, + serialized_data: Optional[str] = None, + category: Optional[str] = None, + tags_properties_tags: Optional[List[str]] = None, + description: Optional[str] = None, + revision: Optional[str] = None, + **kwargs + ): + super(WorkbookUpdateParameters, self).__init__(**kwargs) + self.kind = kind + self.tags = tags + self.display_name = display_name + self.serialized_data = serialized_data + self.category = category + self.tags_properties_tags = tags_properties_tags + self.description = description + self.revision = revision diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/__init__.py new file mode 100644 index 0000000000000..39e879c6ea32e --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/__init__.py @@ -0,0 +1,13 @@ +# 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 ._workbooks_operations import WorkbooksOperations + +__all__ = [ + 'WorkbooksOperations', +] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/_workbooks_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/_workbooks_operations.py new file mode 100644 index 0000000000000..03ee629c6dbc3 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/operations/_workbooks_operations.py @@ -0,0 +1,632 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, List, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class WorkbooksOperations(object): + """WorkbooksOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.applicationinsights.v2021_08_01.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_by_subscription( + self, + category, # type: Union[str, "_models.CategoryType"] + tags=None, # type: Optional[List[str]] + can_fetch_content=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkbooksListResult"] + """Get all private workbooks defined within a specified subscription and category. + + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_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['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/workbooks'} # type: ignore + + def list_by_resource_group( + self, + resource_group_name, # type: str + category, # type: Union[str, "_models.CategoryType"] + tags=None, # type: Optional[List[str]] + source_id=None, # type: Optional[str] + can_fetch_content=None, # type: Optional[bool] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkbooksListResult"] + """Get all Workbooks defined within a specified resource group and category. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param category: Category of workbook to return. + :type category: str or ~azure.mgmt.applicationinsights.v2021_08_01.models.CategoryType + :param tags: Tags presents on each workbook returned. + :type tags: list[str] + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param can_fetch_content: Flag indicating whether or not to return the full content for each + applicable workbook. If false, only return summary content for workbooks. + :type can_fetch_content: bool + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['category'] = self._serialize.query("category", category, 'str') + if tags is not None: + query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + if can_fetch_content is not None: + query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Workbook" + """Get a single workbook by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_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-08-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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.Insights/workbooks/{resourceName}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + resource_name, # type: str + workbook_properties, # type: "_models.Workbook" + source_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.Workbook" + """Create a new workbook. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param workbook_properties: Properties that need to be specified to create a new workbook. + :type workbook_properties: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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(workbook_properties, 'Workbook') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Workbook', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + def update( + self, + resource_group_name, # type: str + resource_name, # type: str + source_id=None, # type: Optional[str] + workbook_update_parameters=None, # type: Optional["_models.WorkbookUpdateParameters"] + **kwargs # type: Any + ): + # type: (...) -> "_models.Workbook" + """Updates a workbook that has already been added. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param source_id: Azure Resource Id that will fetch all linked workbooks. + :type source_id: str + :param workbook_update_parameters: Properties that need to be specified to create a new + workbook. + :type workbook_update_parameters: ~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbookUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.update.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if source_id is not None: + query_parameters['sourceId'] = self._serialize.query("source_id", source_id, 'str') + 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] + if workbook_update_parameters is not None: + body_content = self._serialize.body(workbook_update_parameters, 'WorkbookUpdateParameters') + else: + body_content = None + 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 [201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}'} # type: ignore + + def revisions_list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.WorkbooksListResult"] + """Get the revisions for the workbook defined by its resourceName. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either WorkbooksListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2021_08_01.models.WorkbooksListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkbooksListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.revisions_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), + 'resourceName': self._serialize.url("resource_name", resource_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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('WorkbooksListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, 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 + ) + revisions_list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions'} # type: ignore + + def revision_get( + self, + resource_group_name, # type: str + resource_name, # type: str + revision_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Workbook" + """Get a single workbook revision defined by its revisionId. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param resource_name: The name of the Application Insights component resource. + :type resource_name: str + :param revision_id: The id of the workbook's revision. + :type revision_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Workbook, or the result of cls(response) + :rtype: ~azure.mgmt.applicationinsights.v2021_08_01.models.Workbook + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Workbook"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-08-01" + accept = "application/json" + + # Construct URL + url = self.revision_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), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'revisionId': self._serialize.url("revision_id", revision_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.WorkbookError, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Workbook', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + revision_get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/workbooks/{resourceName}/revisions/{revisionId}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/py.typed b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/py.typed new file mode 100644 index 0000000000000..e5aff4f83af86 --- /dev/null +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2021_08_01/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file