From 99043864d8add7bd92bb58477b8bc86e6499d3a0 Mon Sep 17 00:00:00 2001 From: kai ru <69238381+kairu-ms@users.noreply.github.com> Date: Sat, 28 Jan 2023 15:54:35 +0800 Subject: [PATCH] [application-insights] `az monitor app-insights web-test`: Fix issue for header property display (#5809) * az monitor app-insights web-test: Fix issue for header property create and display. * clean code --- src/application-insights/HISTORY.rst | 8 +- .../azext_metadata.json | 2 +- .../test_appinsights_webtest_crud.yaml | 330 ++- .../test_applicationinsights_commands.py | 7 + .../latest/test_applicationinsights_mgmt.py | 18 + .../mgmt_applicationinsights/aio/__init__.py | 10 - ..._application_insights_management_client.py | 475 ---- .../aio/_configuration.py | 67 - .../v2015_05_01/aio/__init__.py | 10 - ..._application_insights_management_client.py | 142 -- .../v2015_05_01/aio/_configuration.py | 66 - .../v2015_05_01/aio/operations/__init__.py | 45 - .../operations/_analytics_items_operations.py | 340 --- .../aio/operations/_annotations_operations.py | 316 --- .../aio/operations/_api_keys_operations.py | 307 --- ...component_available_features_operations.py | 99 - ...ent_current_billing_features_operations.py | 166 -- ...mponent_feature_capabilities_operations.py | 99 - .../_component_quota_status_operations.py | 99 - .../aio/operations/_components_operations.py | 559 ---- .../_export_configurations_operations.py | 364 --- .../aio/operations/_favorites_operations.py | 386 --- .../operations/_my_workbooks_operations.py | 465 ---- .../v2015_05_01/aio/operations/_operations.py | 105 - ...ive_detection_configurations_operations.py | 234 -- .../_web_test_locations_operations.py | 116 - .../aio/operations/_web_tests_operations.py | 496 ---- .../_work_item_configurations_operations.py | 435 ---- .../aio/operations/_workbooks_operations.py | 381 --- .../v2015_05_01/models/__init__.py | 168 +- .../v2015_05_01/models/_models.py | 2272 ----------------- .../v2017_10_01/aio/__init__.py | 10 - ..._application_insights_management_client.py | 77 - .../v2017_10_01/aio/_configuration.py | 66 - .../v2017_10_01/aio/operations/__init__.py | 19 - ...mponent_current_pricing_plan_operations.py | 233 -- ...cription_list_migration_date_operations.py | 91 - ...migrate_to_new_pricing_model_operations.py | 88 - ...back_to_legacy_pricing_model_operations.py | 88 - .../v2017_10_01/models/__init__.py | 14 +- .../v2017_10_01/models/_models.py | 165 -- .../v2018_05_01_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 67 - .../v2018_05_01_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 15 - .../aio/operations/_components_operations.py | 567 ---- ...ive_detection_configurations_operations.py | 234 -- .../v2018_05_01_preview/models/__init__.py | 53 +- .../v2018_05_01_preview/models/_models.py | 523 ---- .../v2018_06_17_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2018_06_17_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../aio/operations/_workbooks_operations.py | 397 --- .../v2018_06_17_preview/models/__init__.py | 20 +- .../v2018_06_17_preview/models/_models.py | 262 -- .../v2019_10_17_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2019_10_17_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../_workbook_templates_operations.py | 371 --- .../v2019_10_17_preview/models/__init__.py | 26 +- .../v2019_10_17_preview/models/_models.py | 298 --- .../v2020_02_02_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2020_02_02_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - .../aio/operations/_components_operations.py | 569 ----- .../v2020_02_02_preview/models/__init__.py | 38 +- .../v2020_02_02_preview/models/_models.py | 525 ---- .../v2020_03_01_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 62 - .../v2020_03_01_preview/aio/_configuration.py | 66 - .../aio/operations/__init__.py | 13 - ...nent_linked_storage_accounts_operations.py | 312 --- .../v2020_03_01_preview/models/__init__.py | 17 +- .../v2020_03_01_preview/models/_models.py | 161 -- .../v2020_06_02_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 64 - .../v2020_06_02_preview/aio/_configuration.py | 60 - .../aio/operations/__init__.py | 15 - .../aio/operations/_live_token_operations.py | 95 - .../aio/operations/_operations.py | 106 - .../v2020_06_02_preview/models/__init__.py | 17 +- .../v2020_06_02_preview/models/_models.py | 143 -- src/application-insights/setup.py | 8 +- 86 files changed, 440 insertions(+), 14651 deletions(-) delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py delete mode 100644 src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py diff --git a/src/application-insights/HISTORY.rst b/src/application-insights/HISTORY.rst index 2443e7fb2e7..04029203757 100644 --- a/src/application-insights/HISTORY.rst +++ b/src/application-insights/HISTORY.rst @@ -2,10 +2,14 @@ Release History =============== +0.1.18 +++++++++++++++++++ +* `az monitor app-insights web-test`: Fix issue for header property create and display. + 0.1.17 ++++++++++++++++++ -* `az monitor app-insights component connect-webapp`: Support cross resource groups. -* `az monitor app-insights component connect-function`: Support cross resource groups. +* `az monitor app-insights component connect-webapp`: Support cross resource groups. +* `az monitor app-insights component connect-function`: Support cross resource groups. 0.1.16 ++++++++++++++++++ diff --git a/src/application-insights/azext_applicationinsights/azext_metadata.json b/src/application-insights/azext_applicationinsights/azext_metadata.json index 590c5dc010c..7c0ae468ba3 100644 --- a/src/application-insights/azext_applicationinsights/azext_metadata.json +++ b/src/application-insights/azext_applicationinsights/azext_metadata.json @@ -1,4 +1,4 @@ { - "azext.minCliCoreVersion": "2.0.79", + "azext.minCliCoreVersion": "2.38.0", "azext.isPreview": true } \ No newline at end of file diff --git a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml index 8f29d61d4c1..b23ff5b96b8 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml +++ b/src/application-insights/azext_applicationinsights/tests/latest/recordings/test_appinsights_webtest_crud.yaml @@ -19,30 +19,43 @@ interactions: ParameterSetName: - -a -l -g --kind --application-type User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app","name":"test-app","type":"microsoft.insights/components","location":"westus","tags":{},"kind":"web","etag":"\"2d009f1d-0000-0200-0000-620f10290000\"","properties":{"Ver":"v2","ApplicationId":"test-app","AppId":"53447ca9-6571-461d-ade8-aed18e245412","Application_Type":"web","Flow_Type":"Bluefield","Request_Source":"rest","InstrumentationKey":"0946128b-612f-4a8d-af29-31bcbb20af7b","ConnectionString":"InstrumentationKey=0946128b-612f-4a8d-af29-31bcbb20af7b;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/","Name":"test-app","CreationDate":"2022-02-18T03:19:05.484466+00:00","TenantId":"0b1f6471-1bf0-4dda-aec3-cb9272f09590","provisioningState":"Succeeded","SamplingPercentage":null,"RetentionInDays":90,"IngestionMode":"ApplicationInsights","publicNetworkAccessForIngestion":"Enabled","publicNetworkAccessForQuery":"Enabled"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\",\r\n + \ \"name\": \"test-app\",\r\n \"type\": \"microsoft.insights/components\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {},\r\n \"kind\": \"web\",\r\n + \ \"etag\": \"\\\"08026602-0000-0200-0000-63d4c9e20000\\\"\",\r\n \"properties\": + {\r\n \"ApplicationId\": \"test-app\",\r\n \"AppId\": \"4e09e726-6732-4db9-ac8a-35b3361949e5\",\r\n + \ \"Application_Type\": \"web\",\r\n \"Flow_Type\": \"Bluefield\",\r\n + \ \"Request_Source\": \"rest\",\r\n \"InstrumentationKey\": \"6c01950c-9b2e-470c-bea2-a731a164fb4b\",\r\n + \ \"ConnectionString\": \"InstrumentationKey=6c01950c-9b2e-470c-bea2-a731a164fb4b;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/;LiveEndpoint=https://westus.livediagnostics.monitor.azure.com/\",\r\n + \ \"Name\": \"test-app\",\r\n \"CreationDate\": \"2023-01-28T07:08:17.8879721+00:00\",\r\n + \ \"TenantId\": \"0b1f6471-1bf0-4dda-aec3-cb9272f09590\",\r\n \"provisioningState\": + \"Succeeded\",\r\n \"SamplingPercentage\": null,\r\n \"RetentionInDays\": + 90,\r\n \"IngestionMode\": \"ApplicationInsights\",\r\n \"publicNetworkAccessForIngestion\": + \"Enabled\",\r\n \"publicNetworkAccessForQuery\": \"Enabled\",\r\n \"Ver\": + \"v2\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1000' + - '1229' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:07 GMT + - Sat, 28 Jan 2023 07:08:20 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -54,7 +67,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' x-powered-by: - ASP.NET status: @@ -85,30 +98,45 @@ interactions: --http-verb --request-body --request-url --retry-enabled --synthetic-monitor-id --timeout --ssl-lifetime-check --ssl-check --tags User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1063' + - '1355' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:18 GMT + - Sat, 28 Jan 2023 07:08:32 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -140,30 +168,47 @@ interactions: ParameterSetName: - -g --component-name User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app/webtests?api-version=2018-05-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}],"nextLink":null}' + string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n + \ \"Name\": \"test-webtest\",\r\n \"Description\": null,\r\n + \ \"Enabled\": true,\r\n \"Frequency\": 900,\r\n \"Timeout\": + 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n + \ \"Locations\": [\r\n {\r\n \"Id\": \"us-fl-mia-edge\"\r\n + \ }\r\n ],\r\n \"Configuration\": null,\r\n \"Request\": + {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n \"Headers\": + null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n + \ \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n + \ }\r\n ],\r\n \"nextLink\": null\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1091' + - '1573' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:19 GMT + - Sat, 28 Jan 2023 07:08:34 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -193,30 +238,45 @@ interactions: ParameterSetName: - -n -l -g --locations User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00f81d-0000-0200-0000-620f10340000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"us-fl-mia-edge"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08027b02-0000-0200-0000-63d4c9ee0000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1063' + - '1355' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:20 GMT + - Sat, 28 Jan 2023 07:08:35 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -256,30 +316,45 @@ interactions: ParameterSetName: - -n -l -g --locations User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00161e-0000-0200-0000-620f103a0000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"apac-hk-hkn-azr"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08029102-0000-0200-0000-63d4c9f60000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"apac-hk-hkn-azr\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1064' + - '1356' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:23 GMT + - Sat, 28 Jan 2023 07:08:38 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -291,7 +366,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1198' x-powered-by: - ASP.NET status: @@ -311,30 +386,45 @@ interactions: ParameterSetName: - -n -g User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest","name":"test-webtest","type":"microsoft.insights/webtests","location":"westus","tags":{"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app":"Resource"},"kind":"ping","etag":"\"2d00161e-0000-0200-0000-620f103a0000\"","properties":{"SyntheticMonitorId":"test-webtest","Name":"test-webtest","Description":null,"Enabled":true,"Frequency":900,"Timeout":120,"Kind":"standard","RetryEnabled":true,"Locations":[{"Id":"apac-hk-hkn-azr"}],"Configuration":null,"Request":{"RequestUrl":"https://www.bing.com","Headers":null,"HttpVerb":"POST","RequestBody":"SGVsbG8gd29ybGQ=","ParseDependentRequests":null,"FollowRedirects":null},"ValidationRules":{"ExpectedHttpStatusCode":null,"IgnoreHttpStatusCode":null,"ContentValidation":null,"SSLCheck":true,"SSLCertRemainingLifetimeCheck":100},"provisioningState":"Succeeded"}}' + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"08029102-0000-0200-0000-63d4c9f60000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"apac-hk-hkn-azr\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": null,\r\n \"HttpVerb\": \"POST\",\r\n \"RequestBody\": + \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": null,\r\n \"FollowRedirects\": + null\r\n },\r\n \"ValidationRules\": {\r\n \"ExpectedHttpStatusCode\": + null,\r\n \"IgnoreHttpStatusCode\": null,\r\n \"ContentValidation\": + null,\r\n \"SSLCheck\": true,\r\n \"SSLCertRemainingLifetimeCheck\": + 100\r\n },\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}" headers: access-control-expose-headers: - Request-Context cache-control: - no-cache content-length: - - '1064' + - '1356' content-type: - application/json; charset=utf-8 date: - - Fri, 18 Feb 2022 03:19:23 GMT + - Sat, 28 Jan 2023 07:08:40 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -366,8 +456,8 @@ interactions: ParameterSetName: - -n -g --yes User-Agent: - - AZURECLI/2.33.0 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 - (Windows-10-10.0.19044-SP0) + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview response: @@ -381,13 +471,13 @@ interactions: content-length: - '0' date: - - Fri, 18 Feb 2022 03:19:28 GMT + - Sat, 28 Jan 2023 07:08:48 GMT expires: - '-1' pragma: - no-cache request-context: - - appId=cid-v1:920e14b1-13f3-461a-a4bb-b4fe6f1a4525 + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed server: - Microsoft-IIS/10.0 strict-transport-security: @@ -401,4 +491,160 @@ interactions: status: code: 200 message: OK +- request: + body: '{"location": "westus", "tags": {"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app": + "Resource"}, "kind": "ping", "properties": {"SyntheticMonitorId": "test-webtest", + "Name": "test-webtest", "Enabled": true, "Frequency": 900, "Timeout": 120, "Kind": + "standard", "RetryEnabled": true, "Locations": [{"Id": "us-fl-mia-edge"}], "Request": + {"RequestUrl": "https://www.bing.com", "Headers": [{"key": "x-ms-test", "value": + "123"}], "HttpVerb": "POST", "RequestBody": "SGVsbG8gd29ybGQ="}, "ValidationRules": + {"SSLCheck": true, "SSLCertRemainingLifetimeCheck": 100}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights web-test create + Connection: + - keep-alive + Content-Length: + - '665' + Content-Type: + - application/json + ParameterSetName: + - -n -l -g --enabled --frequency --web-test-kind --locations --defined-web-test-name + --http-verb --request-body --request-url --retry-enabled --synthetic-monitor-id + --timeout --ssl-lifetime-check --ssl-check --headers --tags + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/webtests/test-webtest?api-version=2018-05-01-preview + response: + body: + string: "{\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"0802b802-0000-0200-0000-63d4ca090000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n \"Name\": + \"test-webtest\",\r\n \"Description\": null,\r\n \"Enabled\": true,\r\n + \ \"Frequency\": 900,\r\n \"Timeout\": 120,\r\n \"Kind\": \"standard\",\r\n + \ \"RetryEnabled\": true,\r\n \"Locations\": [\r\n {\r\n \"Id\": + \"us-fl-mia-edge\"\r\n }\r\n ],\r\n \"Configuration\": null,\r\n + \ \"Request\": {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n + \ \"Headers\": [\r\n {\r\n \"Key\": \"x-ms-test\",\r\n + \ \"Value\": \"123\"\r\n }\r\n ],\r\n \"HttpVerb\": + \"POST\",\r\n \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": + null,\r\n \"FollowRedirects\": null\r\n },\r\n \"ValidationRules\": + {\r\n \"ExpectedHttpStatusCode\": null,\r\n \"IgnoreHttpStatusCode\": + null,\r\n \"ContentValidation\": null,\r\n \"SSLCheck\": true,\r\n + \ \"SSLCertRemainingLifetimeCheck\": 100\r\n },\r\n \"provisioningState\": + \"Succeeded\"\r\n }\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1440' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 28 Jan 2023 07:09:00 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - monitor app-insights web-test list + Connection: + - keep-alive + ParameterSetName: + - -g --component-name + User-Agent: + - AZURECLI/2.44.1 azsdk-python-azure-mgmt-applicationinsights/1.0.0 Python/3.8.10 + (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/Microsoft.Insights/components/test-app/webtests?api-version=2018-05-01-preview + response: + body: + string: "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/webtests/test-webtest\",\r\n + \ \"name\": \"test-webtest\",\r\n \"type\": \"microsoft.insights/webtests\",\r\n + \ \"location\": \"westus\",\r\n \"tags\": {\r\n \"hidden-link:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_appinsights_000001/providers/microsoft.insights/components/test-app\": + \"Resource\"\r\n },\r\n \"kind\": \"ping\",\r\n \"etag\": \"\\\"0802b802-0000-0200-0000-63d4ca090000\\\"\",\r\n + \ \"properties\": {\r\n \"SyntheticMonitorId\": \"test-webtest\",\r\n + \ \"Name\": \"test-webtest\",\r\n \"Description\": null,\r\n + \ \"Enabled\": true,\r\n \"Frequency\": 900,\r\n \"Timeout\": + 120,\r\n \"Kind\": \"standard\",\r\n \"RetryEnabled\": true,\r\n + \ \"Locations\": [\r\n {\r\n \"Id\": \"us-fl-mia-edge\"\r\n + \ }\r\n ],\r\n \"Configuration\": null,\r\n \"Request\": + {\r\n \"RequestUrl\": \"https://www.bing.com\",\r\n \"Headers\": + [\r\n {\r\n \"Key\": \"x-ms-test\",\r\n \"Value\": + \"123\"\r\n }\r\n ],\r\n \"HttpVerb\": \"POST\",\r\n + \ \"RequestBody\": \"SGVsbG8gd29ybGQ=\",\r\n \"ParseDependentRequests\": + null,\r\n \"FollowRedirects\": null\r\n },\r\n \"ValidationRules\": + {\r\n \"ExpectedHttpStatusCode\": null,\r\n \"IgnoreHttpStatusCode\": + null,\r\n \"ContentValidation\": null,\r\n \"SSLCheck\": + true,\r\n \"SSLCertRemainingLifetimeCheck\": 100\r\n },\r\n + \ \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n ],\r\n + \ \"nextLink\": null\r\n}" + headers: + access-control-expose-headers: + - Request-Context + cache-control: + - no-cache + content-length: + - '1678' + content-type: + - application/json; charset=utf-8 + date: + - Sat, 28 Jan 2023 07:09:00 GMT + expires: + - '-1' + pragma: + - no-cache + request-context: + - appId=cid-v1:7f83c1fe-8c94-4d55-9337-4ddc696f61ed + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK version: 1 diff --git a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py index 812606006d8..3934d60fee3 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py +++ b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_commands.py @@ -4,11 +4,14 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long +import unittest + from azure.cli.testsdk import ScenarioTest class ApplicationInsightsDataClientTests(ScenarioTest): """Test class for Application Insights data client.""" + @unittest.skip("ResourceNotAvailable") def test_query_execute(self): """Tests data plane query capabilities for Application Insights.""" self.cmd('az monitor app-insights query --apps 578f0e27-12e9-4631-bc02-50b965da2633 f4963800-c77d-40a3-8b0b-448678904c33 --analytics-query "availabilityResults | distinct name | order by name asc"', checks=[ @@ -23,11 +26,13 @@ def test_query_execute(self): assert len(query_guid['tables'][0]['rows']) == 37 assert isinstance(query_guid['tables'][0]['rows'][0][1], (int, float, complex)) + @unittest.skip("ResourceNotAvailable") def test_query_execute_with_different_offset(self): """Tests data plane query capabilities for Application Insights.""" self.cmd('az monitor app-insights query --apps db709f0e-cb4e-4f43-ba80-05e10d6a4447 --analytics-query "availabilityResults | distinct name | order by name asc" --offset P3DT12H') self.cmd('az monitor app-insights query --apps db709f0e-cb4e-4f43-ba80-05e10d6a4447 --analytics-query "availabilityResults | distinct name | order by name asc" --offset 3d12h1m') + @unittest.skip("ResourceNotAvailable") def test_metrics_show(self): self.cmd('az monitor app-insights metrics show --app 578f0e27-12e9-4631-bc02-50b965da2633 --metrics requests/duration --aggregation count sum --start-time 2019-03-06 00:31 +00:00 --end-time 2019-03-06 01:31 +00:00', checks=[ self.check('value."requests/duration".count', 0), @@ -38,6 +43,7 @@ def test_metrics_show(self): assert isinstance(result["value"]["availabilityResults/count"]['sum'], (int, float, complex)) assert result["value"]["availabilityResults/count"]['sum'] == azure_result["value"]["availabilityResults/count"]['sum'] + @unittest.skip("ResourceNotAvailable") def test_metrics_get_metadata(self): self.cmd('az monitor app-insights metrics get-metadata --app 578f0e27-12e9-4631-bc02-50b965da2633', checks=[ self.check('dimensions."availabilityResult/location".displayName', 'Run location'), @@ -46,6 +52,7 @@ def test_metrics_get_metadata(self): self.check('metrics."users/count".supportedGroupBy.all[0]', 'trace/severityLevel') ]) + @unittest.skip("ResourceNotAvailable") def test_events_show(self): self.cmd('az monitor app-insights events show --app 578f0e27-12e9-4631-bc02-50b965da2633 --type availabilityResults --event 792aeac4-3f9a-11e9-bbeb-376e4a601afa --start-time 2019-03-05 23:00:00 +00:00 --end-time 2019-03-05 23:05:00 +00:00', checks=[ self.check('value[0].ai.appId', '578f0e27-12e9-4631-bc02-50b965da2633'), diff --git a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py index 6f3c89c1917..1663d74fd0b 100644 --- a/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py +++ b/src/application-insights/azext_applicationinsights/tests/latest/test_applicationinsights_mgmt.py @@ -540,3 +540,21 @@ def test_appinsights_webtest_crud(self, resource_group_location): ] ) self.cmd("monitor app-insights web-test delete -n {name} -g {rg} --yes") + + self.cmd( + "monitor app-insights web-test create -n {name} -l {loc} -g {rg} " + "--enabled true --frequency 900 --web-test-kind {kind} --locations Id={location_id1} --defined-web-test-name {name} " + "--http-verb {http_verb} --request-body {request_body} --request-url {request_url} --retry-enabled true --synthetic-monitor-id {name} --timeout 120 " + "--ssl-lifetime-check 100 --ssl-check true --headers key=x-ms-test value=123 --tags {tag}=Resource", + checks=[ + self.check("webTestName", "{name}"), + self.check("type", "microsoft.insights/webtests") + ] + ) + self.cmd( + "monitor app-insights web-test list -g {rg} --component-name {app_name}", + checks=[ + self.check("length(@)", 1), + self.check("@[0].webTestName", "{name}") + ] + ) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py deleted file mode 100644 index 4b8f7acf0f2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_application_insights_management_client.py +++ /dev/null @@ -1,475 +0,0 @@ -# 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.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." - Will be removed in final version of multiapi azure-core based client - """ - pass - -class ApplicationInsightsManagementClient(MultiApiClientMixin, _SDKClient): - """Composite Swagger for Application Insights Management Client. - - This ready contains multiple API versions, to help you deal with all of the Azure clouds - (Azure Stack, Azure Government, Azure China, etc.). - By default, it uses the latest API version available on public Azure. - For production, you should stick to a particular api-version and/or profile. - The profile sets a mapping between an operation group and its API version. - The api-version parameter sets the default API version if the operation - group is not described in the profile. - - :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 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' - _PROFILE_TAG = "azure.mgmt.applicationinsights.ApplicationInsightsManagementClient" - LATEST_PROFILE = ProfileDefinition({ - _PROFILE_TAG: { - None: DEFAULT_API_VERSION, - 'analytics_items': '2015-05-01', - 'annotations': '2015-05-01', - 'api_keys': '2015-05-01', - 'component_available_features': '2015-05-01', - 'component_current_billing_features': '2015-05-01', - 'component_feature_capabilities': '2015-05-01', - 'component_quota_status': '2015-05-01', - 'components': '2015-05-01', - 'export_configurations': '2015-05-01', - 'favorites': '2015-05-01', - 'my_workbooks': '2015-05-01', - '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', - }}, - _PROFILE_TAG + " latest" - ) - - def __init__( - self, - 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: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - super(ApplicationInsightsManagementClient, self).__init__( - api_version=api_version, - profile=profile - ) - - @classmethod - def _models_dict(cls, api_version): - return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)} - - @classmethod - def models(cls, api_version=DEFAULT_API_VERSION): - """Module depends on the API version: - - * 2015-05-01: :mod:`v2015_05_01.models` - * 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-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` - """ - if api_version == '2015-05-01': - from ..v2015_05_01 import models - return models - elif api_version == '2017-10-01': - from ..v2017_10_01 import models - return models - elif api_version == '2018-05-01-preview': - from ..v2018_05_01_preview import models - return models - elif api_version == '2018-06-17-preview': - from ..v2018_06_17_preview import models - return models - elif api_version == '2019-10-17-preview': - from ..v2019_10_17_preview import models - return models - elif api_version == '2020-02-02-preview': - from ..v2020_02_02_preview import models - return models - elif api_version == '2020-03-01-preview': - from ..v2020_03_01_preview import models - return models - elif api_version == '2020-06-02-preview': - from ..v2020_06_02_preview import models - return models - raise ValueError("API version {} is not available".format(api_version)) - - @property - def analytics_items(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`AnalyticsItemsOperations` - """ - api_version = self._get_api_version('analytics_items') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import AnalyticsItemsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'analytics_items'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def annotations(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`AnnotationsOperations` - """ - api_version = self._get_api_version('annotations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import AnnotationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'annotations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def api_keys(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`APIKeysOperations` - """ - api_version = self._get_api_version('api_keys') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import APIKeysOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'api_keys'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_available_features(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ComponentAvailableFeaturesOperations` - """ - api_version = self._get_api_version('component_available_features') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ComponentAvailableFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_available_features'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_current_billing_features(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ComponentCurrentBillingFeaturesOperations` - """ - api_version = self._get_api_version('component_current_billing_features') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ComponentCurrentBillingFeaturesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_current_billing_features'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_current_pricing_plan(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`ComponentCurrentPricingPlanOperations` - """ - api_version = self._get_api_version('component_current_pricing_plan') - if api_version == '2017-10-01': - from ..v2017_10_01.aio.operations import ComponentCurrentPricingPlanOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_current_pricing_plan'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_feature_capabilities(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ComponentFeatureCapabilitiesOperations` - """ - api_version = self._get_api_version('component_feature_capabilities') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ComponentFeatureCapabilitiesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_feature_capabilities'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_linked_storage_accounts(self): - """Instance depends on the API version: - - * 2020-03-01-preview: :class:`ComponentLinkedStorageAccountsOperations` - """ - api_version = self._get_api_version('component_linked_storage_accounts') - if api_version == '2020-03-01-preview': - from ..v2020_03_01_preview.aio.operations import ComponentLinkedStorageAccountsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_linked_storage_accounts'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def component_quota_status(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ComponentQuotaStatusOperations` - """ - api_version = self._get_api_version('component_quota_status') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ComponentQuotaStatusOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'component_quota_status'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def components(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ComponentsOperations` - * 2018-05-01-preview: :class:`ComponentsOperations` - * 2020-02-02-preview: :class:`ComponentsOperations` - """ - api_version = self._get_api_version('components') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ComponentsOperations as OperationClass - elif api_version == '2018-05-01-preview': - from ..v2018_05_01_preview.aio.operations import ComponentsOperations as OperationClass - elif api_version == '2020-02-02-preview': - from ..v2020_02_02_preview.aio.operations import ComponentsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'components'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ea_subscription_list_migration_date(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`EASubscriptionListMigrationDateOperations` - """ - api_version = self._get_api_version('ea_subscription_list_migration_date') - if api_version == '2017-10-01': - from ..v2017_10_01.aio.operations import EASubscriptionListMigrationDateOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_list_migration_date'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ea_subscription_migrate_to_new_pricing_model(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`EASubscriptionMigrateToNewPricingModelOperations` - """ - api_version = self._get_api_version('ea_subscription_migrate_to_new_pricing_model') - if api_version == '2017-10-01': - from ..v2017_10_01.aio.operations import EASubscriptionMigrateToNewPricingModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_migrate_to_new_pricing_model'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def ea_subscription_rollback_to_legacy_pricing_model(self): - """Instance depends on the API version: - - * 2017-10-01: :class:`EASubscriptionRollbackToLegacyPricingModelOperations` - """ - api_version = self._get_api_version('ea_subscription_rollback_to_legacy_pricing_model') - if api_version == '2017-10-01': - from ..v2017_10_01.aio.operations import EASubscriptionRollbackToLegacyPricingModelOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'ea_subscription_rollback_to_legacy_pricing_model'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def export_configurations(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ExportConfigurationsOperations` - """ - api_version = self._get_api_version('export_configurations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ExportConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'export_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def favorites(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`FavoritesOperations` - """ - api_version = self._get_api_version('favorites') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import FavoritesOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'favorites'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def live_token(self): - """Instance depends on the API version: - - * 2020-06-02-preview: :class:`LiveTokenOperations` - """ - api_version = self._get_api_version('live_token') - if api_version == '2020-06-02-preview': - from ..v2020_06_02_preview.aio.operations import LiveTokenOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'live_token'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def my_workbooks(self): - """Instance depends on the API version: - - * 2015-05-01: :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 - 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))) - - @property - def operations(self): - """Instance depends on the API version: - - * 2015-05-01: :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 == '2020-06-02-preview': - from ..v2020_06_02_preview.aio.operations import Operations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'operations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def proactive_detection_configurations(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`ProactiveDetectionConfigurationsOperations` - * 2018-05-01-preview: :class:`ProactiveDetectionConfigurationsOperations` - """ - api_version = self._get_api_version('proactive_detection_configurations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass - elif api_version == '2018-05-01-preview': - from ..v2018_05_01_preview.aio.operations import ProactiveDetectionConfigurationsOperations as OperationClass - else: - 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 web_test_locations(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`WebTestLocationsOperations` - """ - api_version = self._get_api_version('web_test_locations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import WebTestLocationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_test_locations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def web_tests(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`WebTestsOperations` - """ - api_version = self._get_api_version('web_tests') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import WebTestsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'web_tests'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def work_item_configurations(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`WorkItemConfigurationsOperations` - """ - api_version = self._get_api_version('work_item_configurations') - if api_version == '2015-05-01': - from ..v2015_05_01.aio.operations import WorkItemConfigurationsOperations as OperationClass - else: - raise ValueError("API version {} does not have operation group 'work_item_configurations'".format(api_version)) - return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) - - @property - def workbook_templates(self): - """Instance depends on the API version: - - * 2019-10-17-preview: :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 - 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))) - - @property - def workbooks(self): - """Instance depends on the API version: - - * 2015-05-01: :class:`WorkbooksOperations` - * 2018-06-17-preview: :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 - 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))) - - async def close(self): - await self._client.close() - async def __aenter__(self): - await self._client.__aenter__() - return self - async def __aexit__(self, *exc_details): - await self._client.__aexit__(*exc_details) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py deleted file mode 100644 index 8fe81a741e6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/aio/_configuration.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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 # type: 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.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'azure-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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py deleted file mode 100644 index 416f313eb50..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_application_insights_management_client.py +++ /dev/null @@ -1,142 +0,0 @@ -# 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.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 Operations -from .operations import AnnotationsOperations -from .operations import APIKeysOperations -from .operations import ExportConfigurationsOperations -from .operations import ComponentCurrentBillingFeaturesOperations -from .operations import ComponentQuotaStatusOperations -from .operations import ComponentFeatureCapabilitiesOperations -from .operations import ComponentAvailableFeaturesOperations -from .operations import ProactiveDetectionConfigurationsOperations -from .operations import ComponentsOperations -from .operations import WorkItemConfigurationsOperations -from .operations import FavoritesOperations -from .operations import WebTestLocationsOperations -from .operations import WebTestsOperations -from .operations import AnalyticsItemsOperations -from .operations import WorkbooksOperations -from .operations import MyWorkbooksOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.Operations - :ivar annotations: AnnotationsOperations operations - :vartype annotations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnnotationsOperations - :ivar api_keys: APIKeysOperations operations - :vartype api_keys: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.APIKeysOperations - :ivar export_configurations: ExportConfigurationsOperations operations - :vartype export_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ExportConfigurationsOperations - :ivar component_current_billing_features: ComponentCurrentBillingFeaturesOperations operations - :vartype component_current_billing_features: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentCurrentBillingFeaturesOperations - :ivar component_quota_status: ComponentQuotaStatusOperations operations - :vartype component_quota_status: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentQuotaStatusOperations - :ivar component_feature_capabilities: ComponentFeatureCapabilitiesOperations operations - :vartype component_feature_capabilities: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentFeatureCapabilitiesOperations - :ivar component_available_features: ComponentAvailableFeaturesOperations operations - :vartype component_available_features: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentAvailableFeaturesOperations - :ivar proactive_detection_configurations: ProactiveDetectionConfigurationsOperations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ProactiveDetectionConfigurationsOperations - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.ComponentsOperations - :ivar work_item_configurations: WorkItemConfigurationsOperations operations - :vartype work_item_configurations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkItemConfigurationsOperations - :ivar favorites: FavoritesOperations operations - :vartype favorites: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.FavoritesOperations - :ivar web_test_locations: WebTestLocationsOperations operations - :vartype web_test_locations: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestLocationsOperations - :ivar web_tests: WebTestsOperations operations - :vartype web_tests: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WebTestsOperations - :ivar analytics_items: AnalyticsItemsOperations operations - :vartype analytics_items: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.AnalyticsItemsOperations - :ivar workbooks: WorkbooksOperations operations - :vartype workbooks: azure.mgmt.applicationinsights.v2015_05_01.aio.operations.WorkbooksOperations - :ivar my_workbooks: MyWorkbooksOperations operations - :vartype my_workbooks: azure.mgmt.applicationinsights.v2015_05_01.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._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.annotations = AnnotationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.api_keys = APIKeysOperations( - self._client, self._config, self._serialize, self._deserialize) - self.export_configurations = ExportConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.component_current_billing_features = ComponentCurrentBillingFeaturesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.component_quota_status = ComponentQuotaStatusOperations( - self._client, self._config, self._serialize, self._deserialize) - self.component_feature_capabilities = ComponentFeatureCapabilitiesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.component_available_features = ComponentAvailableFeaturesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.components = ComponentsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.work_item_configurations = WorkItemConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.favorites = FavoritesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.web_test_locations = WebTestLocationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.web_tests = WebTestsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.analytics_items = AnalyticsItemsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.workbooks = WorkbooksOperations( - self._client, self._config, self._serialize, self._deserialize) - self.my_workbooks = MyWorkbooksOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py deleted file mode 100644 index 1c485cf9254..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 = "2015-05-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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py deleted file mode 100644 index f33db0d9970..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._annotations_operations import AnnotationsOperations -from ._api_keys_operations import APIKeysOperations -from ._export_configurations_operations import ExportConfigurationsOperations -from ._component_current_billing_features_operations import ComponentCurrentBillingFeaturesOperations -from ._component_quota_status_operations import ComponentQuotaStatusOperations -from ._component_feature_capabilities_operations import ComponentFeatureCapabilitiesOperations -from ._component_available_features_operations import ComponentAvailableFeaturesOperations -from ._proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations -from ._components_operations import ComponentsOperations -from ._work_item_configurations_operations import WorkItemConfigurationsOperations -from ._favorites_operations import FavoritesOperations -from ._web_test_locations_operations import WebTestLocationsOperations -from ._web_tests_operations import WebTestsOperations -from ._analytics_items_operations import AnalyticsItemsOperations -from ._workbooks_operations import WorkbooksOperations -from ._my_workbooks_operations import MyWorkbooksOperations - -__all__ = [ - 'Operations', - 'AnnotationsOperations', - 'APIKeysOperations', - 'ExportConfigurationsOperations', - 'ComponentCurrentBillingFeaturesOperations', - 'ComponentQuotaStatusOperations', - 'ComponentFeatureCapabilitiesOperations', - 'ComponentAvailableFeaturesOperations', - 'ProactiveDetectionConfigurationsOperations', - 'ComponentsOperations', - 'WorkItemConfigurationsOperations', - 'FavoritesOperations', - 'WebTestLocationsOperations', - 'WebTestsOperations', - 'AnalyticsItemsOperations', - 'WorkbooksOperations', - 'MyWorkbooksOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py deleted file mode 100644 index e53abb3ec5e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_analytics_items_operations.py +++ /dev/null @@ -1,340 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class AnalyticsItemsOperations: - """AnalyticsItemsOperations 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.v2015_05_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 - - async def list( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - scope: Optional[Union[str, "_models.ItemScope"]] = None, - type: Optional[Union[str, "_models.ItemTypeParameter"]] = "none", - include_content: Optional[bool] = None, - **kwargs - ) -> List["_models.ApplicationInsightsComponentAnalyticsItem"]: - """Gets a list of Analytics Items defined within an Application Insights component. - - :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 scope_path: Enum indicating if this item definition is owned by a specific user or is - shared between all users with access to the Application Insights component. - :type scope_path: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath - :param scope: Enum indicating if this item definition is owned by a specific user or is shared - between all users with access to the Application Insights component. - :type scope: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope - :param type: Enum indicating the type of the Analytics item. - :type type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemTypeParameter - :param include_content: Flag indicating whether or not to return the content of each applicable - item. If false, only return the item information. - :type include_content: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentAnalyticsItem"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if scope is not None: - query_parameters['scope'] = self._serialize.query("scope", scope, 'str') - if type is not None: - query_parameters['type'] = self._serialize.query("type", type, 'str') - if include_content is not None: - query_parameters['includeContent'] = self._serialize.query("include_content", include_content, 'bool') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentAnalyticsItem]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - id: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ) -> "_models.ApplicationInsightsComponentAnalyticsItem": - """Gets a specific Analytics Items defined within an Application Insights component. - - :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 scope_path: Enum indicating if this item definition is owned by a specific user or is - shared between all users with access to the Application Insights component. - :type scope_path: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath - :param id: The Id of a specific item defined in the Application Insights component. - :type id: str - :param name: The name of a specific item defined in the Application Insights component. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAnalyticsItem"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if id is not None: - query_parameters['id'] = self._serialize.query("id", id, 'str') - if name is not None: - query_parameters['name'] = self._serialize.query("name", name, '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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore - - async def put( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - item_properties: "_models.ApplicationInsightsComponentAnalyticsItem", - override_item: Optional[bool] = None, - **kwargs - ) -> "_models.ApplicationInsightsComponentAnalyticsItem": - """Adds or Updates a specific Analytics Item within an Application Insights component. - - :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 scope_path: Enum indicating if this item definition is owned by a specific user or is - shared between all users with access to the Application Insights component. - :type scope_path: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath - :param item_properties: Properties that need to be specified to create a new item and add it to - an Application Insights component. - :type item_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem - :param override_item: Flag indicating whether or not to force save an item. This allows - overriding an item if it already exists. - :type override_item: bool - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAnalyticsItem, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItem - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAnalyticsItem"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - 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\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if override_item is not None: - query_parameters['overrideItem'] = self._serialize.query("override_item", override_item, 'bool') - - # 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(item_properties, 'ApplicationInsightsComponentAnalyticsItem') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAnalyticsItem', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - scope_path: Union[str, "_models.ItemScopePath"], - id: Optional[str] = None, - name: Optional[str] = None, - **kwargs - ) -> None: - """Deletes a specific Analytics Items defined within an Application Insights component. - - :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 scope_path: Enum indicating if this item definition is owned by a specific user or is - shared between all users with access to the Application Insights component. - :type scope_path: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScopePath - :param id: The Id of a specific item defined in the Application Insights component. - :type id: str - :param name: The name of a specific item defined in the Application Insights component. - :type name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: None, or the result of cls(response) - :rtype: None - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), - 'scopePath': self._serialize.url("scope_path", scope_path, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if id is not None: - query_parameters['id'] = self._serialize.query("id", id, 'str') - if name is not None: - query_parameters['name'] = self._serialize.query("name", name, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/{scopePath}/item'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py deleted file mode 100644 index 0156ac0ca50..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_annotations_operations.py +++ /dev/null @@ -1,316 +0,0 @@ -# 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 -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 AnnotationsOperations: - """AnnotationsOperations 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.v2015_05_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( - self, - resource_group_name: str, - resource_name: str, - start: str, - end: str, - **kwargs - ) -> AsyncIterable["_models.AnnotationsListResult"]: - """Gets the list of annotations for a component for given time range. - - :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 start: The start time to query from for annotations, cannot be older than 90 days from - current date. - :type start: str - :param end: The end time to query for annotations. - :type end: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either AnnotationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.AnnotationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AnnotationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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') - query_parameters['start'] = self._serialize.query("start", start, 'str') - query_parameters['end'] = self._serialize.query("end", end, '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('AnnotationsListResult', 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.AnnotationError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - annotation_properties: "_models.Annotation", - **kwargs - ) -> List["_models.Annotation"]: - """Create an Annotation of an Application Insights component. - - :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 annotation_properties: Properties that need to be specified to create an annotation of a - Application Insights component. - :type annotation_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Annotation, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Annotation"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(annotation_properties, 'Annotation') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.AnnotationError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[Annotation]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - annotation_id: str, - **kwargs - ) -> None: - """Delete an Annotation of an Application Insights component. - - :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 annotation_id: The unique annotation ID. This is unique within a Application Insights - component. - :type annotation_id: 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 = "2015-05-01" - - # 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\._\(\)]+$'), - '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'), - } - 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] - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - annotation_id: str, - **kwargs - ) -> List["_models.Annotation"]: - """Get the annotation for given id. - - :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 annotation_id: The unique annotation ID. This is unique within a Application Insights - component. - :type annotation_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of Annotation, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.Annotation"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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.AnnotationError, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[Annotation]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/Annotations/{annotationId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py deleted file mode 100644 index 9d8bd8d7429..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_api_keys_operations.py +++ /dev/null @@ -1,307 +0,0 @@ -# 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 APIKeysOperations: - """APIKeysOperations 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.v2015_05_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( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentAPIKeyListResult"]: - """Gets a list of API keys of an Application Insights component. - - :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 ApplicationInsightsComponentAPIKeyListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKeyListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKeyListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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('ApplicationInsightsComponentAPIKeyListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - api_key_properties: "_models.APIKeyRequest", - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Create an API Key of an Application Insights component. - - :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 api_key_properties: Properties that need to be specified to create an API key of a - Application Insights component. - :type api_key_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.APIKeyRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(api_key_properties, 'APIKeyRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ApiKeys'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - key_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Delete an API Key of an Application Insights component. - - :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 key_id: The API Key ID. This is unique within a Application Insights component. - :type key_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - key_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAPIKey": - """Get the API Key for this key id. - - :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 key_id: The API Key ID. This is unique within a Application Insights component. - :type key_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentAPIKey, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAPIKey"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAPIKey', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/APIKeys/{keyId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py deleted file mode 100644 index 409e871607e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_available_features_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentAvailableFeaturesOperations: - """ComponentAvailableFeaturesOperations 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.v2015_05_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentAvailableFeatures": - """Returns all available features of the application insights component. - - :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: ApplicationInsightsComponentAvailableFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAvailableFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentAvailableFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentAvailableFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/getavailablebillingfeatures'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py deleted file mode 100644 index e0fb950ab45..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_current_billing_features_operations.py +++ /dev/null @@ -1,166 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentCurrentBillingFeaturesOperations: - """ComponentCurrentBillingFeaturesOperations 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.v2015_05_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentBillingFeatures": - """Returns current billing features for an Application Insights component. - - :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: ApplicationInsightsComponentBillingFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentBillingFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - billing_features_properties: "_models.ApplicationInsightsComponentBillingFeatures", - **kwargs - ) -> "_models.ApplicationInsightsComponentBillingFeatures": - """Update current billing features for an Application Insights component. - - :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 billing_features_properties: Properties that need to be specified to update billing - features for an Application Insights component. - :type billing_features_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentBillingFeatures, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentBillingFeatures - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentBillingFeatures"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(billing_features_properties, 'ApplicationInsightsComponentBillingFeatures') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentBillingFeatures', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/currentbillingfeatures'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py deleted file mode 100644 index a51235dcd42..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_feature_capabilities_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentFeatureCapabilitiesOperations: - """ComponentFeatureCapabilitiesOperations 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.v2015_05_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentFeatureCapabilities": - """Returns feature capabilities of the application insights component. - - :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: ApplicationInsightsComponentFeatureCapabilities, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapabilities - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFeatureCapabilities"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFeatureCapabilities', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/featurecapabilities'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py deleted file mode 100644 index 7b0048d0b31..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_component_quota_status_operations.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentQuotaStatusOperations: - """ComponentQuotaStatusOperations 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.v2015_05_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentQuotaStatus": - """Returns daily data volume cap (quota) status for an Application Insights component. - - :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: ApplicationInsightsComponentQuotaStatus, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentQuotaStatus - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentQuotaStatus"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentQuotaStatus', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/quotastatus'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py deleted file mode 100644 index 9dabc1de51f..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_components_operations.py +++ /dev/null @@ -1,559 +0,0 @@ -# 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 ComponentsOperations: - """ComponentsOperations 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.v2015_05_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( - self, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('ApplicationInsightsComponentListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of Application Insights components within a 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 ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('ApplicationInsightsComponentListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, 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/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """Deletes an Application Insights component. - - :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 = "2015-05-01" - - # 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\._\(\)]+$'), - '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'), - } - 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] - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Returns an Application Insights component. - - :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: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Creates (or updates) an Application Insights component. Note: You cannot specify a different - value for InstrumentationKey nor AppId in the Put operation. - - :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 insight_properties: Properties that need to be specified to create an Application - Insights component. - :type insight_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(insight_properties, 'ApplicationInsightsComponent') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. - - :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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2015_05_01.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(component_tags, 'TagsResource') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """Purges data in an Application Insights component by a set of user-defined filters. - - In order to manage system resources, purge requests are throttled at 50 requests per hour. You - should batch the execution of purge requests by sending a single command whose predicate - includes all user identities that require purging. Use the in operator to specify multiple - identities. You should run the query prior to using for a purge request to verify that the - results are expected. - - :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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(body, 'ComponentPurgeBody') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """Get status for an ongoing purge operation. - - :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 purge_id: In a purge status request, this is the Id of the operation the status of which - is returned. - :type purge_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py deleted file mode 100644 index ee9530a7ac4..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_export_configurations_operations.py +++ /dev/null @@ -1,364 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ExportConfigurationsOperations: - """ExportConfigurationsOperations 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.v2015_05_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 - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: - """Gets a list of Continuous Export configuration of an Application Insights component. - - :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: list of ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentExportConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentExportConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs - ) -> List["_models.ApplicationInsightsComponentExportConfiguration"]: - """Create a Continuous Export configuration of an Application Insights component. - - :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 export_properties: Properties that need to be specified to create a Continuous Export - configuration of a Application Insights component. - :type export_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentExportConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(export_properties, 'ApplicationInsightsComponentExportRequest') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentExportConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Delete a Continuous Export configuration of an Application Insights component. - - :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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Get the Continuous Export configuration for this export id. - - :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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - export_id: str, - export_properties: "_models.ApplicationInsightsComponentExportRequest", - **kwargs - ) -> "_models.ApplicationInsightsComponentExportConfiguration": - """Update the Continuous Export configuration for this export id. - - :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 export_id: The Continuous Export configuration ID. This is unique within a Application - Insights component. - :type export_id: str - :param export_properties: Properties that need to be specified to update the Continuous Export - configuration. - :type export_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportRequest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentExportConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentExportConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentExportConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(export_properties, 'ApplicationInsightsComponentExportRequest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentExportConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/exportconfiguration/{exportId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py deleted file mode 100644 index a93f5105370..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_favorites_operations.py +++ /dev/null @@ -1,386 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class FavoritesOperations: - """FavoritesOperations 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.v2015_05_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 - - async def list( - self, - resource_group_name: str, - resource_name: str, - favorite_type: Optional[Union[str, "_models.FavoriteType"]] = None, - source_type: Optional[Union[str, "_models.FavoriteSourceType"]] = None, - can_fetch_content: Optional[bool] = None, - tags: Optional[List[str]] = None, - **kwargs - ) -> List["_models.ApplicationInsightsComponentFavorite"]: - """Gets a list of favorites defined within an Application Insights component. - - :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 favorite_type: The type of favorite. Value can be either shared or user. - :type favorite_type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteType - :param source_type: Source type of favorite to return. When left out, the source type defaults - to 'other' (not present in this enum). - :type source_type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteSourceType - :param can_fetch_content: Flag indicating whether or not to return the full content for each - applicable favorite. If false, only return summary content for favorites. - :type can_fetch_content: bool - :param tags: Tags that must be present on each favorite returned. - :type tags: list[str] - :keyword callable cls: A custom type or function that will be passed the direct response - :return: list of ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentFavorite"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if favorite_type is not None: - query_parameters['favoriteType'] = self._serialize.query("favorite_type", favorite_type, 'str') - if source_type is not None: - query_parameters['sourceType'] = self._serialize.query("source_type", source_type, 'str') - if can_fetch_content is not None: - query_parameters['canFetchContent'] = self._serialize.query("can_fetch_content", can_fetch_content, 'bool') - if tags is not None: - query_parameters['tags'] = self._serialize.query("tags", tags, '[str]', div=',') - - # 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentFavorite]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """Get a single favorite by its FavoriteId, defined within an Application Insights component. - - :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 favorite_id: The Id of a specific favorite defined in the Application Insights - component. - :type favorite_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def add( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """Adds a new favorites to an Application Insights component. - - :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 favorite_id: The Id of a specific favorite defined in the Application Insights - component. - :type favorite_id: str - :param favorite_properties: Properties that need to be specified to create a new favorite and - add it to an Application Insights component. - :type favorite_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(favorite_properties, 'ApplicationInsightsComponentFavorite') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - add.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - favorite_properties: "_models.ApplicationInsightsComponentFavorite", - **kwargs - ) -> "_models.ApplicationInsightsComponentFavorite": - """Updates a favorite that has already been added to an Application Insights component. - - :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 favorite_id: The Id of a specific favorite defined in the Application Insights - component. - :type favorite_id: str - :param favorite_properties: Properties that need to be specified to update the existing - favorite. - :type favorite_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentFavorite, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFavorite - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentFavorite"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(favorite_properties, 'ApplicationInsightsComponentFavorite') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentFavorite', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - favorite_id: str, - **kwargs - ) -> None: - """Remove a favorite that is associated to an Application Insights component. - - :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 favorite_id: The Id of a specific favorite defined in the Application Insights - component. - :type favorite_id: 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 = "2015-05-01" - - # 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\._\(\)]+$'), - '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'), - } - 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] - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/favorites/{favoriteId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py deleted file mode 100644 index cad355f060e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_my_workbooks_operations.py +++ /dev/null @@ -1,465 +0,0 @@ -# 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.v2015_05_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_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> 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.v2015_05_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 MyWorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - } - 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 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 - ) -> 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.v2015_05_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 MyWorkbooksListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.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 = "2015-05-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('MyWorkbooksListResult', 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.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 - ) -> "_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.v2015_05_01.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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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 - ) -> 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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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 [201, 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", - **kwargs - ) -> "_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.v2015_05_01.models.MyWorkbook - :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.v2015_05_01.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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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_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", - **kwargs - ) -> "_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.v2015_05_01.models.MyWorkbook - :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.v2015_05_01.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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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_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 [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 - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/myWorkbooks/{resourceName}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py deleted file mode 100644 index 93d936187d5..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_operations.py +++ /dev/null @@ -1,105 +0,0 @@ -# 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.v2015_05_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( - self, - **kwargs - ) -> 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.v2015_05_01.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 = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py deleted file mode 100644 index aa7a99a5f1b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_proactive_detection_configurations_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProactiveDetectionConfigurationsOperations: - """ProactiveDetectionConfigurationsOperations 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.v2015_05_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 - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]: - """Gets a list of ProactiveDetection configurations of an Application Insights component. - - :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: list of ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """Get the ProactiveDetection configuration for this configuration id. - - :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 configuration_id: The ProactiveDetection configuration ID. This is unique within a - Application Insights component. - :type configuration_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - proactive_detection_properties: "_models.ApplicationInsightsComponentProactiveDetectionConfiguration", - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """Update the ProactiveDetection configuration for this configuration id. - - :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 configuration_id: The ProactiveDetection configuration ID. This is unique within a - Application Insights component. - :type configuration_id: str - :param proactive_detection_properties: Properties that need to be specified to update the - ProactiveDetection configuration. - :type proactive_detection_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py deleted file mode 100644 index 3a6e8b12c20..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_test_locations_operations.py +++ /dev/null @@ -1,116 +0,0 @@ -# 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 WebTestLocationsOperations: - """WebTestLocationsOperations 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.v2015_05_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( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsWebTestLocationsListResult"]: - """Gets a list of web test locations available to this Application Insights component. - - :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 ApplicationInsightsWebTestLocationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsWebTestLocationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsWebTestLocationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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('ApplicationInsightsWebTestLocationsListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/syntheticmonitorlocations'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py deleted file mode 100644 index 8bb274e4e9c..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_web_tests_operations.py +++ /dev/null @@ -1,496 +0,0 @@ -# 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 WebTestsOperations: - """WebTestsOperations 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.v2015_05_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_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """Get all Application Insights web tests 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 WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('WebTestListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, 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/webtests'} # type: ignore - - async def get( - self, - resource_group_name: str, - web_test_name: str, - **kwargs - ) -> "_models.WebTest": - """Get a specific Application Insights web test definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param web_test_name: The name of the Application Insights webtest resource. - :type web_test_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - web_test_name: str, - web_test_definition: "_models.WebTest", - **kwargs - ) -> "_models.WebTest": - """Creates or updates an Application Insights web test definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param web_test_name: The name of the Application Insights webtest resource. - :type web_test_name: str - :param web_test_definition: Properties that need to be specified to create or update an - Application Insights web test definition. - :type web_test_definition: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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 = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(web_test_definition, 'WebTest') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - web_test_name: str, - web_test_tags: "_models.TagsResource", - **kwargs - ) -> "_models.WebTest": - """Creates or updates an Application Insights web test definition. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param web_test_name: The name of the Application Insights webtest resource. - :type web_test_name: str - :param web_test_tags: Updated tag information to set into the web test instance. - :type web_test_tags: ~azure.mgmt.applicationinsights.v2015_05_01.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WebTest, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(web_test_tags, 'TagsResource') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WebTest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - web_test_name: str, - **kwargs - ) -> None: - """Deletes an Application Insights web test. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param web_test_name: The name of the Application Insights webtest resource. - :type web_test_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 = "2015-05-01" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'webTestName': self._serialize.url("web_test_name", web_test_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] - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}'} # type: ignore - - def list( - self, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """Get all Application Insights web test alerts definitions within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('WebTestListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/webtests'} # type: ignore - - def list_by_component( - self, - component_name: str, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.WebTestListResult"]: - """Get all Application Insights web tests defined for the specified component. - - :param component_name: The name of the Application Insights component resource. - :type component_name: str - :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 WebTestListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WebTestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-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_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\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('WebTestListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_component.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{componentName}/webtests'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py deleted file mode 100644 index bb8e5c33bf9..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_work_item_configurations_operations.py +++ /dev/null @@ -1,435 +0,0 @@ -# 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 WorkItemConfigurationsOperations: - """WorkItemConfigurationsOperations 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.v2015_05_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( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> AsyncIterable["_models.WorkItemConfigurationsListResult"]: - """Gets the list work item configurations that exist for the application. - - :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 WorkItemConfigurationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfigurationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfigurationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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('WorkItemConfigurationsListResult', 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.WorkItemConfigurationError, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} # type: ignore - - async def create( - self, - resource_group_name: str, - resource_name: str, - work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs - ) -> "_models.WorkItemConfiguration": - """Create a work item configuration for an Application Insights component. - - :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 work_item_configuration_properties: Properties that need to be specified to create a - work item configuration of a Application Insights component. - :type work_item_configuration_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemCreateConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(work_item_configuration_properties, 'WorkItemCreateConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs'} # type: ignore - - async def get_default( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.WorkItemConfiguration": - """Gets default work item configurations that exist for the application. - - :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: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_default.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/DefaultWorkItemConfig'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - **kwargs - ) -> None: - """Delete a work item configuration of an Application Insights component. - - :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 work_item_config_id: The unique work item configuration Id. This can be either friendly - name of connector as defined in connector configuration. - :type work_item_config_id: 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 = "2015-05-01" - - # 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\._\(\)]+$'), - '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'), - } - 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] - - 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore - - async def get_item( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - **kwargs - ) -> "_models.WorkItemConfiguration": - """Gets specified work item configuration for an Application Insights component. - - :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 work_item_config_id: The unique work item configuration Id. This can be either friendly - name of connector as defined in connector configuration. - :type work_item_config_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore - - async def update_item( - self, - resource_group_name: str, - resource_name: str, - work_item_config_id: str, - work_item_configuration_properties: "_models.WorkItemCreateConfiguration", - **kwargs - ) -> "_models.WorkItemConfiguration": - """Update a work item configuration for an Application Insights component. - - :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 work_item_config_id: The unique work item configuration Id. This can be either friendly - name of connector as defined in connector configuration. - :type work_item_config_id: str - :param work_item_configuration_properties: Properties that need to be specified to update a - work item configuration for this Application Insights component. - :type work_item_configuration_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemCreateConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: WorkItemConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.WorkItemConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2015-05-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(work_item_configuration_properties, 'WorkItemCreateConfiguration') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('WorkItemConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_item.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/WorkItemConfigs/{workItemConfigId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py deleted file mode 100644 index 6682c3cb4b7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/aio/operations/_workbooks_operations.py +++ /dev/null @@ -1,381 +0,0 @@ -# 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.v2015_05_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_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> 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.v2015_05_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.v2015_05_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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - } - 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 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 - ) -> "_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.v2015_05_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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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 - ) -> 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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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 [201, 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", - **kwargs - ) -> "_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.v2015_05_01.models.Workbook - :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.v2015_05_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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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_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, - workbook_properties: "_models.Workbook", - **kwargs - ) -> "_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 workbook_properties: Properties that need to be specified to create a new workbook. - :type workbook_properties: ~azure.mgmt.applicationinsights.v2015_05_01.models.Workbook - :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.v2015_05_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 = "2015-05-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, pattern=r'^[-\w\._\(\)]+$'), - '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_properties, 'Workbook') - 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.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 diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py index e060190841d..329547518ce 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/__init__.py @@ -6,118 +6,62 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import APIKeyRequest - from ._models_py3 import Annotation - from ._models_py3 import AnnotationError - from ._models_py3 import AnnotationsListResult - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentAPIKey - from ._models_py3 import ApplicationInsightsComponentAPIKeyListResult - from ._models_py3 import ApplicationInsightsComponentAnalyticsItem - from ._models_py3 import ApplicationInsightsComponentAnalyticsItemProperties - from ._models_py3 import ApplicationInsightsComponentAvailableFeatures - from ._models_py3 import ApplicationInsightsComponentBillingFeatures - from ._models_py3 import ApplicationInsightsComponentDataVolumeCap - from ._models_py3 import ApplicationInsightsComponentExportConfiguration - from ._models_py3 import ApplicationInsightsComponentExportRequest - from ._models_py3 import ApplicationInsightsComponentFavorite - from ._models_py3 import ApplicationInsightsComponentFeature - from ._models_py3 import ApplicationInsightsComponentFeatureCapabilities - from ._models_py3 import ApplicationInsightsComponentFeatureCapability - from ._models_py3 import ApplicationInsightsComponentListResult - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions - from ._models_py3 import ApplicationInsightsComponentQuotaStatus - from ._models_py3 import ApplicationInsightsComponentWebTestLocation - from ._models_py3 import ApplicationInsightsWebTestLocationsListResult - from ._models_py3 import ComponentPurgeBody - from ._models_py3 import ComponentPurgeBodyFilters - from ._models_py3 import ComponentPurgeResponse - from ._models_py3 import ComponentPurgeStatusResponse - from ._models_py3 import ComponentsResource - from ._models_py3 import ErrorFieldContract - from ._models_py3 import ErrorResponse - from ._models_py3 import InnerError - from ._models_py3 import LinkProperties - from ._models_py3 import MyWorkbook - from ._models_py3 import MyWorkbookError - from ._models_py3 import MyWorkbookResource - from ._models_py3 import MyWorkbooksListResult - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import PrivateLinkScopedResource - from ._models_py3 import TagsResource - from ._models_py3 import WebTest - from ._models_py3 import WebTestGeolocation - from ._models_py3 import WebTestListResult - from ._models_py3 import WebTestPropertiesConfiguration - from ._models_py3 import WebtestsResource - from ._models_py3 import WorkItemConfiguration - from ._models_py3 import WorkItemConfigurationError - from ._models_py3 import WorkItemConfigurationsListResult - from ._models_py3 import WorkItemCreateConfiguration - from ._models_py3 import Workbook - from ._models_py3 import WorkbookError - from ._models_py3 import WorkbookResource - from ._models_py3 import WorkbooksListResult -except (SyntaxError, ImportError): - from ._models import APIKeyRequest # type: ignore - from ._models import Annotation # type: ignore - from ._models import AnnotationError # type: ignore - from ._models import AnnotationsListResult # type: ignore - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentAPIKey # type: ignore - from ._models import ApplicationInsightsComponentAPIKeyListResult # type: ignore - from ._models import ApplicationInsightsComponentAnalyticsItem # type: ignore - from ._models import ApplicationInsightsComponentAnalyticsItemProperties # type: ignore - from ._models import ApplicationInsightsComponentAvailableFeatures # type: ignore - from ._models import ApplicationInsightsComponentBillingFeatures # type: ignore - from ._models import ApplicationInsightsComponentDataVolumeCap # type: ignore - from ._models import ApplicationInsightsComponentExportConfiguration # type: ignore - from ._models import ApplicationInsightsComponentExportRequest # type: ignore - from ._models import ApplicationInsightsComponentFavorite # type: ignore - from ._models import ApplicationInsightsComponentFeature # type: ignore - from ._models import ApplicationInsightsComponentFeatureCapabilities # type: ignore - from ._models import ApplicationInsightsComponentFeatureCapability # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions # type: ignore - from ._models import ApplicationInsightsComponentQuotaStatus # type: ignore - from ._models import ApplicationInsightsComponentWebTestLocation # type: ignore - from ._models import ApplicationInsightsWebTestLocationsListResult # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import ErrorFieldContract # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import InnerError # type: ignore - from ._models import LinkProperties # type: ignore - from ._models import MyWorkbook # type: ignore - from ._models import MyWorkbookError # type: ignore - from ._models import MyWorkbookResource # type: ignore - from ._models import MyWorkbooksListResult # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore - from ._models import WebTest # type: ignore - from ._models import WebTestGeolocation # type: ignore - from ._models import WebTestListResult # type: ignore - from ._models import WebTestPropertiesConfiguration # type: ignore - from ._models import WebtestsResource # type: ignore - from ._models import WorkItemConfiguration # type: ignore - from ._models import WorkItemConfigurationError # type: ignore - from ._models import WorkItemConfigurationsListResult # type: ignore - from ._models import WorkItemCreateConfiguration # type: ignore - from ._models import Workbook # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookResource # type: ignore - from ._models import WorkbooksListResult # type: ignore +from ._models_py3 import APIKeyRequest +from ._models_py3 import Annotation +from ._models_py3 import AnnotationError +from ._models_py3 import AnnotationsListResult +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentAPIKey +from ._models_py3 import ApplicationInsightsComponentAPIKeyListResult +from ._models_py3 import ApplicationInsightsComponentAnalyticsItem +from ._models_py3 import ApplicationInsightsComponentAnalyticsItemProperties +from ._models_py3 import ApplicationInsightsComponentAvailableFeatures +from ._models_py3 import ApplicationInsightsComponentBillingFeatures +from ._models_py3 import ApplicationInsightsComponentDataVolumeCap +from ._models_py3 import ApplicationInsightsComponentExportConfiguration +from ._models_py3 import ApplicationInsightsComponentExportRequest +from ._models_py3 import ApplicationInsightsComponentFavorite +from ._models_py3 import ApplicationInsightsComponentFeature +from ._models_py3 import ApplicationInsightsComponentFeatureCapabilities +from ._models_py3 import ApplicationInsightsComponentFeatureCapability +from ._models_py3 import ApplicationInsightsComponentListResult +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions +from ._models_py3 import ApplicationInsightsComponentQuotaStatus +from ._models_py3 import ApplicationInsightsComponentWebTestLocation +from ._models_py3 import ApplicationInsightsWebTestLocationsListResult +from ._models_py3 import ComponentPurgeBody +from ._models_py3 import ComponentPurgeBodyFilters +from ._models_py3 import ComponentPurgeResponse +from ._models_py3 import ComponentPurgeStatusResponse +from ._models_py3 import ComponentsResource +from ._models_py3 import ErrorFieldContract +from ._models_py3 import ErrorResponse +from ._models_py3 import InnerError +from ._models_py3 import LinkProperties +from ._models_py3 import MyWorkbook +from ._models_py3 import MyWorkbookError +from ._models_py3 import MyWorkbookResource +from ._models_py3 import MyWorkbooksListResult +from ._models_py3 import Operation +from ._models_py3 import OperationDisplay +from ._models_py3 import OperationListResult +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource +from ._models_py3 import WebTest +from ._models_py3 import WebTestGeolocation +from ._models_py3 import WebTestListResult +from ._models_py3 import WebTestPropertiesConfiguration +from ._models_py3 import WebtestsResource +from ._models_py3 import WorkItemConfiguration +from ._models_py3 import WorkItemConfigurationError +from ._models_py3 import WorkItemConfigurationsListResult +from ._models_py3 import WorkItemCreateConfiguration +from ._models_py3 import Workbook +from ._models_py3 import WorkbookError +from ._models_py3 import WorkbookResource +from ._models_py3 import WorkbooksListResult + from ._application_insights_management_client_enums import ( ApplicationType, diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py deleted file mode 100644 index b2a94cd871b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2015_05_01/models/_models.py +++ /dev/null @@ -1,2272 +0,0 @@ -# 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 Annotation(msrest.serialization.Model): - """Annotation associated with an application insights resource. - - :param annotation_name: Name of annotation. - :type annotation_name: str - :param category: Category of annotation, free form. - :type category: str - :param event_time: Time when event occurred. - :type event_time: ~datetime.datetime - :param id: Unique Id for annotation. - :type id: str - :param properties: Serialized JSON object for detailed properties. - :type properties: str - :param related_annotation: Related parent annotation if any. - :type related_annotation: str - """ - - _attribute_map = { - 'annotation_name': {'key': 'AnnotationName', 'type': 'str'}, - 'category': {'key': 'Category', 'type': 'str'}, - 'event_time': {'key': 'EventTime', 'type': 'iso-8601'}, - 'id': {'key': 'Id', 'type': 'str'}, - 'properties': {'key': 'Properties', 'type': 'str'}, - 'related_annotation': {'key': 'RelatedAnnotation', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Annotation, self).__init__(**kwargs) - self.annotation_name = kwargs.get('annotation_name', None) - self.category = kwargs.get('category', None) - self.event_time = kwargs.get('event_time', None) - self.id = kwargs.get('id', None) - self.properties = kwargs.get('properties', None) - self.related_annotation = kwargs.get('related_annotation', "null") - - -class AnnotationError(msrest.serialization.Model): - """Error associated with trying to create annotation with Id that already exist. - - :param code: Error detail code and explanation. - :type code: str - :param message: Error message. - :type message: str - :param innererror: Inner error. - :type innererror: ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - } - - def __init__( - self, - **kwargs - ): - super(AnnotationError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.innererror = kwargs.get('innererror', None) - - -class AnnotationsListResult(msrest.serialization.Model): - """Annotations list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of annotations. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.Annotation] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Annotation]'}, - } - - def __init__( - self, - **kwargs - ): - super(AnnotationsListResult, self).__init__(**kwargs) - self.value = None - - -class APIKeyRequest(msrest.serialization.Model): - """An Application Insights component API Key creation request definition. - - :param name: The name of the API Key. - :type name: str - :param linked_read_properties: The read access rights of this API Key. - :type linked_read_properties: list[str] - :param linked_write_properties: The write access rights of this API Key. - :type linked_write_properties: list[str] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, - 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(APIKeyRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.linked_read_properties = kwargs.get('linked_read_properties', None) - self.linked_write_properties = kwargs.get('linked_write_properties', None) - - -class ComponentsResource(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(ComponentsResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ApplicationInsightsComponent(ComponentsResource): - """An Application Insights component 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 kind: Required. The kind of application that this component refers to, used to customize - UI. This value is a freeform string, values should typically be one of the following: web, ios, - other, store, java, phone. - :type kind: str - :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field - and cannot be changed. - :vartype application_id: str - :ivar app_id: Application Insights Unique ID for your Application. - :vartype app_id: str - :param application_type: Type of application being monitored. Possible values include: "web", - "other". Default value: "web". - :type application_type: str or - ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationType - :param flow_type: Used by the Application Insights system to determine what kind of flow this - component was created by. This is to be set to 'Bluefield' when creating/updating a component - via the REST API. Possible values include: "Bluefield". Default value: "Bluefield". - :type flow_type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.FlowType - :param request_source: Describes what tool created this Application Insights component. - Customers using this API should set this to the default 'rest'. Possible values include: - "rest". Default value: "rest". - :type request_source: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.RequestSource - :ivar instrumentation_key: Application Insights Instrumentation key. A read-only value that - applications can use to identify the destination for all telemetry sent to Azure Application - Insights. This value will be supplied upon construction of each new Application Insights - component. - :vartype instrumentation_key: str - :ivar creation_date: Creation Date for the Application Insights component, in ISO 8601 format. - :vartype creation_date: ~datetime.datetime - :ivar tenant_id: Azure Tenant Id. - :vartype tenant_id: str - :param hockey_app_id: The unique application ID created when a new application is added to - HockeyApp, used for communications with HockeyApp. - :type hockey_app_id: str - :ivar hockey_app_token: Token used to authenticate communications with between Application - Insights and HockeyApp. - :vartype hockey_app_token: str - :ivar provisioning_state: Current state of this component: whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - :param sampling_percentage: Percentage of the data produced by the application being monitored - that is being sampled for Application Insights telemetry. - :type sampling_percentage: float - :ivar connection_string: Application Insights component connection string. - :vartype connection_string: str - :param retention_in_days: Retention period in days. - :type retention_in_days: int - :param disable_ip_masking: Disable IP masking. - :type disable_ip_masking: bool - :param immediate_purge_data_on30_days: Purge data immediately after 30 days. - :type immediate_purge_data_on30_days: bool - :ivar private_link_scoped_resources: List of linked private link scope resources. - :vartype private_link_scoped_resources: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.PrivateLinkScopedResource] - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "ApplicationInsights". - :type ingestion_mode: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': True}, - 'instrumentation_key': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'hockey_app_token': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'connection_string': {'readonly': True}, - 'private_link_scoped_resources': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, - 'app_id': {'key': 'properties.AppId', 'type': 'str'}, - 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, - 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, - 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, - 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, - 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, - 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, - 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, - 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, - 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, - 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, - 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, - 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, - 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, - 'ingestion_mode': {'key': 'properties.IngestionMode', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - self.application_id = None - self.app_id = None - self.application_type = kwargs.get('application_type', "web") - self.flow_type = kwargs.get('flow_type', "Bluefield") - self.request_source = kwargs.get('request_source', "rest") - self.instrumentation_key = None - self.creation_date = None - self.tenant_id = None - self.hockey_app_id = kwargs.get('hockey_app_id', None) - self.hockey_app_token = None - self.provisioning_state = None - self.sampling_percentage = kwargs.get('sampling_percentage', None) - self.connection_string = None - self.retention_in_days = kwargs.get('retention_in_days', 90) - self.disable_ip_masking = kwargs.get('disable_ip_masking', None) - self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) - self.private_link_scoped_resources = None - self.ingestion_mode = kwargs.get('ingestion_mode', "ApplicationInsights") - - -class ApplicationInsightsComponentAnalyticsItem(msrest.serialization.Model): - """Properties that define an Analytics item that is associated to an Application Insights component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param id: Internally assigned unique id of the item definition. - :type id: str - :param name: The user-defined name of the item. - :type name: str - :param content: The content of this item. - :type content: str - :ivar version: This instance's version of the data model. This can change as new features are - added. - :vartype version: str - :param scope: Enum indicating if this item definition is owned by a specific user or is shared - between all users with access to the Application Insights component. Possible values include: - "shared", "user". - :type scope: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemScope - :param type: Enum indicating the type of the Analytics item. Possible values include: "query", - "function", "folder", "recent". - :type type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.ItemType - :ivar time_created: Date and time in UTC when this item was created. - :vartype time_created: str - :ivar time_modified: Date and time in UTC of the last modification that was made to this item. - :vartype time_modified: str - :param properties: A set of properties that can be defined in the context of a specific item - type. Each type may have its own properties. - :type properties: - ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAnalyticsItemProperties - """ - - _validation = { - 'version': {'readonly': True}, - 'time_created': {'readonly': True}, - 'time_modified': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'Id', 'type': 'str'}, - 'name': {'key': 'Name', 'type': 'str'}, - 'content': {'key': 'Content', 'type': 'str'}, - 'version': {'key': 'Version', 'type': 'str'}, - 'scope': {'key': 'Scope', 'type': 'str'}, - 'type': {'key': 'Type', 'type': 'str'}, - 'time_created': {'key': 'TimeCreated', 'type': 'str'}, - 'time_modified': {'key': 'TimeModified', 'type': 'str'}, - 'properties': {'key': 'Properties', 'type': 'ApplicationInsightsComponentAnalyticsItemProperties'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAnalyticsItem, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - self.name = kwargs.get('name', None) - self.content = kwargs.get('content', None) - self.version = None - self.scope = kwargs.get('scope', None) - self.type = kwargs.get('type', None) - self.time_created = None - self.time_modified = None - self.properties = kwargs.get('properties', None) - - -class ApplicationInsightsComponentAnalyticsItemProperties(msrest.serialization.Model): - """A set of properties that can be defined in the context of a specific item type. Each type may have its own properties. - - :param function_alias: A function alias, used when the type of the item is Function. - :type function_alias: str - """ - - _attribute_map = { - 'function_alias': {'key': 'functionAlias', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAnalyticsItemProperties, self).__init__(**kwargs) - self.function_alias = kwargs.get('function_alias', None) - - -class ApplicationInsightsComponentAPIKey(msrest.serialization.Model): - """Properties that define an API key of an Application Insights Component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique ID of the API key inside an Application Insights component. It is auto - generated when the API key is created. - :vartype id: str - :ivar api_key: The API key value. It will be only return once when the API Key was created. - :vartype api_key: str - :param created_date: The create date of this API key. - :type created_date: str - :param name: The name of the API key. - :type name: str - :param linked_read_properties: The read access rights of this API Key. - :type linked_read_properties: list[str] - :param linked_write_properties: The write access rights of this API Key. - :type linked_write_properties: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'api_key': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'api_key': {'key': 'apiKey', 'type': 'str'}, - 'created_date': {'key': 'createdDate', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'linked_read_properties': {'key': 'linkedReadProperties', 'type': '[str]'}, - 'linked_write_properties': {'key': 'linkedWriteProperties', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAPIKey, self).__init__(**kwargs) - self.id = None - self.api_key = None - self.created_date = kwargs.get('created_date', None) - self.name = kwargs.get('name', None) - self.linked_read_properties = kwargs.get('linked_read_properties', None) - self.linked_write_properties = kwargs.get('linked_write_properties', None) - - -class ApplicationInsightsComponentAPIKeyListResult(msrest.serialization.Model): - """Describes the list of API Keys of an Application Insights Component. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of API Key definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentAPIKey] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponentAPIKey]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAPIKeyListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - -class ApplicationInsightsComponentAvailableFeatures(msrest.serialization.Model): - """An Application Insights component available features. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar result: A list of Application Insights component feature. - :vartype result: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeature] - """ - - _validation = { - 'result': {'readonly': True}, - } - - _attribute_map = { - 'result': {'key': 'Result', 'type': '[ApplicationInsightsComponentFeature]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentAvailableFeatures, self).__init__(**kwargs) - self.result = None - - -class ApplicationInsightsComponentBillingFeatures(msrest.serialization.Model): - """An Application Insights component billing features. - - :param data_volume_cap: An Application Insights component daily data volume cap. - :type data_volume_cap: - ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentDataVolumeCap - :param current_billing_features: Current enabled pricing plan. When the component is in the - Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'. - :type current_billing_features: list[str] - """ - - _attribute_map = { - 'data_volume_cap': {'key': 'DataVolumeCap', 'type': 'ApplicationInsightsComponentDataVolumeCap'}, - 'current_billing_features': {'key': 'CurrentBillingFeatures', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentBillingFeatures, self).__init__(**kwargs) - self.data_volume_cap = kwargs.get('data_volume_cap', None) - self.current_billing_features = kwargs.get('current_billing_features', None) - - -class ApplicationInsightsComponentDataVolumeCap(msrest.serialization.Model): - """An Application Insights component daily data volume cap. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param cap: Daily data volume cap in GB. - :type cap: float - :ivar reset_time: Daily data volume cap UTC reset hour. - :vartype reset_time: int - :param warning_threshold: Reserved, not used for now. - :type warning_threshold: int - :param stop_send_notification_when_hit_threshold: Reserved, not used for now. - :type stop_send_notification_when_hit_threshold: bool - :param stop_send_notification_when_hit_cap: Do not send a notification email when the daily - data volume cap is met. - :type stop_send_notification_when_hit_cap: bool - :ivar max_history_cap: Maximum daily data volume cap that the user can set for this component. - :vartype max_history_cap: float - """ - - _validation = { - 'reset_time': {'readonly': True}, - 'max_history_cap': {'readonly': True}, - } - - _attribute_map = { - 'cap': {'key': 'Cap', 'type': 'float'}, - 'reset_time': {'key': 'ResetTime', 'type': 'int'}, - 'warning_threshold': {'key': 'WarningThreshold', 'type': 'int'}, - 'stop_send_notification_when_hit_threshold': {'key': 'StopSendNotificationWhenHitThreshold', 'type': 'bool'}, - 'stop_send_notification_when_hit_cap': {'key': 'StopSendNotificationWhenHitCap', 'type': 'bool'}, - 'max_history_cap': {'key': 'MaxHistoryCap', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentDataVolumeCap, self).__init__(**kwargs) - self.cap = kwargs.get('cap', None) - self.reset_time = None - self.warning_threshold = kwargs.get('warning_threshold', None) - self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) - self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) - self.max_history_cap = None - - -class ApplicationInsightsComponentExportConfiguration(msrest.serialization.Model): - """Properties that define a Continuous Export configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar export_id: The unique ID of the export configuration inside an Application Insights - component. It is auto generated when the Continuous Export configuration is created. - :vartype export_id: str - :ivar instrumentation_key: The instrumentation key of the Application Insights component. - :vartype instrumentation_key: str - :param record_types: This comma separated list of document types that will be exported. The - possible values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', - 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. - :type record_types: str - :ivar application_name: The name of the Application Insights component. - :vartype application_name: str - :ivar subscription_id: The subscription of the Application Insights component. - :vartype subscription_id: str - :ivar resource_group: The resource group of the Application Insights component. - :vartype resource_group: str - :ivar destination_storage_subscription_id: The destination storage account subscription ID. - :vartype destination_storage_subscription_id: str - :ivar destination_storage_location_id: The destination account location ID. - :vartype destination_storage_location_id: str - :ivar destination_account_id: The name of destination account. - :vartype destination_account_id: str - :ivar destination_type: The destination type. - :vartype destination_type: str - :ivar is_user_enabled: This will be 'true' if the Continuous Export configuration is enabled, - otherwise it will be 'false'. - :vartype is_user_enabled: str - :ivar last_user_update: Last time the Continuous Export configuration was updated. - :vartype last_user_update: str - :param notification_queue_enabled: Deprecated. - :type notification_queue_enabled: str - :ivar export_status: This indicates current Continuous Export configuration status. The - possible values are 'Preparing', 'Success', 'Failure'. - :vartype export_status: str - :ivar last_success_time: The last time data was successfully delivered to the destination - storage container for this Continuous Export configuration. - :vartype last_success_time: str - :ivar last_gap_time: The last time the Continuous Export configuration started failing. - :vartype last_gap_time: str - :ivar permanent_error_reason: This is the reason the Continuous Export configuration started - failing. It can be 'AzureStorageNotFound' or 'AzureStorageAccessDenied'. - :vartype permanent_error_reason: str - :ivar storage_name: The name of the destination storage account. - :vartype storage_name: str - :ivar container_name: The name of the destination storage container. - :vartype container_name: str - """ - - _validation = { - 'export_id': {'readonly': True}, - 'instrumentation_key': {'readonly': True}, - 'application_name': {'readonly': True}, - 'subscription_id': {'readonly': True}, - 'resource_group': {'readonly': True}, - 'destination_storage_subscription_id': {'readonly': True}, - 'destination_storage_location_id': {'readonly': True}, - 'destination_account_id': {'readonly': True}, - 'destination_type': {'readonly': True}, - 'is_user_enabled': {'readonly': True}, - 'last_user_update': {'readonly': True}, - 'export_status': {'readonly': True}, - 'last_success_time': {'readonly': True}, - 'last_gap_time': {'readonly': True}, - 'permanent_error_reason': {'readonly': True}, - 'storage_name': {'readonly': True}, - 'container_name': {'readonly': True}, - } - - _attribute_map = { - 'export_id': {'key': 'ExportId', 'type': 'str'}, - 'instrumentation_key': {'key': 'InstrumentationKey', 'type': 'str'}, - 'record_types': {'key': 'RecordTypes', 'type': 'str'}, - 'application_name': {'key': 'ApplicationName', 'type': 'str'}, - 'subscription_id': {'key': 'SubscriptionId', 'type': 'str'}, - 'resource_group': {'key': 'ResourceGroup', 'type': 'str'}, - 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, - 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, - 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, - 'destination_type': {'key': 'DestinationType', 'type': 'str'}, - 'is_user_enabled': {'key': 'IsUserEnabled', 'type': 'str'}, - 'last_user_update': {'key': 'LastUserUpdate', 'type': 'str'}, - 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, - 'export_status': {'key': 'ExportStatus', 'type': 'str'}, - 'last_success_time': {'key': 'LastSuccessTime', 'type': 'str'}, - 'last_gap_time': {'key': 'LastGapTime', 'type': 'str'}, - 'permanent_error_reason': {'key': 'PermanentErrorReason', 'type': 'str'}, - 'storage_name': {'key': 'StorageName', 'type': 'str'}, - 'container_name': {'key': 'ContainerName', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentExportConfiguration, self).__init__(**kwargs) - self.export_id = None - self.instrumentation_key = None - self.record_types = kwargs.get('record_types', None) - self.application_name = None - self.subscription_id = None - self.resource_group = None - self.destination_storage_subscription_id = None - self.destination_storage_location_id = None - self.destination_account_id = None - self.destination_type = None - self.is_user_enabled = None - self.last_user_update = None - self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) - self.export_status = None - self.last_success_time = None - self.last_gap_time = None - self.permanent_error_reason = None - self.storage_name = None - self.container_name = None - - -class ApplicationInsightsComponentExportRequest(msrest.serialization.Model): - """An Application Insights component Continuous Export configuration request definition. - - :param record_types: The document types to be exported, as comma separated values. Allowed - values include 'Requests', 'Event', 'Exceptions', 'Metrics', 'PageViews', - 'PageViewPerformance', 'Rdd', 'PerformanceCounters', 'Availability', 'Messages'. - :type record_types: str - :param destination_type: The Continuous Export destination type. This has to be 'Blob'. - :type destination_type: str - :param destination_address: The SAS URL for the destination storage container. It must grant - write permission. - :type destination_address: str - :param is_enabled: Set to 'true' to create a Continuous Export configuration as enabled, - otherwise set it to 'false'. - :type is_enabled: str - :param notification_queue_enabled: Deprecated. - :type notification_queue_enabled: str - :param notification_queue_uri: Deprecated. - :type notification_queue_uri: str - :param destination_storage_subscription_id: The subscription ID of the destination storage - container. - :type destination_storage_subscription_id: str - :param destination_storage_location_id: The location ID of the destination storage container. - :type destination_storage_location_id: str - :param destination_account_id: The name of destination storage account. - :type destination_account_id: str - """ - - _attribute_map = { - 'record_types': {'key': 'RecordTypes', 'type': 'str'}, - 'destination_type': {'key': 'DestinationType', 'type': 'str'}, - 'destination_address': {'key': 'DestinationAddress', 'type': 'str'}, - 'is_enabled': {'key': 'IsEnabled', 'type': 'str'}, - 'notification_queue_enabled': {'key': 'NotificationQueueEnabled', 'type': 'str'}, - 'notification_queue_uri': {'key': 'NotificationQueueUri', 'type': 'str'}, - 'destination_storage_subscription_id': {'key': 'DestinationStorageSubscriptionId', 'type': 'str'}, - 'destination_storage_location_id': {'key': 'DestinationStorageLocationId', 'type': 'str'}, - 'destination_account_id': {'key': 'DestinationAccountId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentExportRequest, self).__init__(**kwargs) - self.record_types = kwargs.get('record_types', None) - self.destination_type = kwargs.get('destination_type', None) - self.destination_address = kwargs.get('destination_address', None) - self.is_enabled = kwargs.get('is_enabled', None) - self.notification_queue_enabled = kwargs.get('notification_queue_enabled', None) - self.notification_queue_uri = kwargs.get('notification_queue_uri', None) - self.destination_storage_subscription_id = kwargs.get('destination_storage_subscription_id', None) - self.destination_storage_location_id = kwargs.get('destination_storage_location_id', None) - self.destination_account_id = kwargs.get('destination_account_id', None) - - -class ApplicationInsightsComponentFavorite(msrest.serialization.Model): - """Properties that define a favorite that is associated to an Application Insights component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :param name: The user-defined name of the favorite. - :type name: str - :param config: Configuration of this particular favorite, which are driven by the Azure portal - UX. Configuration data is a string containing valid JSON. - :type config: str - :param version: This instance's version of the data model. This can change as new features are - added that can be marked favorite. Current examples include MetricsExplorer (ME) and Search. - :type version: str - :ivar favorite_id: Internally assigned unique id of the favorite definition. - :vartype favorite_id: str - :param favorite_type: Enum indicating if this favorite definition is owned by a specific user - or is shared between all users with access to the Application Insights component. Possible - values include: "shared", "user". - :type favorite_type: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.FavoriteType - :param source_type: The source of the favorite definition. - :type source_type: str - :ivar time_modified: Date and time in UTC of the last modification that was made to this - favorite definition. - :vartype time_modified: str - :param tags: A set of tags. A list of 0 or more tags that are associated with this favorite - definition. - :type tags: list[str] - :param category: Favorite category, as defined by the user at creation time. - :type category: str - :param is_generated_from_template: Flag denoting wether or not this favorite was generated from - a template. - :type is_generated_from_template: bool - :ivar user_id: Unique user id of the specific user that owns this favorite. - :vartype user_id: str - """ - - _validation = { - 'favorite_id': {'readonly': True}, - 'time_modified': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'config': {'key': 'Config', 'type': 'str'}, - 'version': {'key': 'Version', 'type': 'str'}, - 'favorite_id': {'key': 'FavoriteId', 'type': 'str'}, - 'favorite_type': {'key': 'FavoriteType', 'type': 'str'}, - 'source_type': {'key': 'SourceType', 'type': 'str'}, - 'time_modified': {'key': 'TimeModified', 'type': 'str'}, - 'tags': {'key': 'Tags', 'type': '[str]'}, - 'category': {'key': 'Category', 'type': 'str'}, - 'is_generated_from_template': {'key': 'IsGeneratedFromTemplate', 'type': 'bool'}, - 'user_id': {'key': 'UserId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentFavorite, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.config = kwargs.get('config', None) - self.version = kwargs.get('version', None) - self.favorite_id = None - self.favorite_type = kwargs.get('favorite_type', None) - self.source_type = kwargs.get('source_type', None) - self.time_modified = None - self.tags = kwargs.get('tags', None) - self.category = kwargs.get('category', None) - self.is_generated_from_template = kwargs.get('is_generated_from_template', None) - self.user_id = None - - -class ApplicationInsightsComponentFeature(msrest.serialization.Model): - """An Application Insights component daily data volume cap status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar feature_name: The pricing feature name. - :vartype feature_name: str - :ivar meter_id: The meter id used for the feature. - :vartype meter_id: str - :ivar meter_rate_frequency: The meter rate for the feature's meter. - :vartype meter_rate_frequency: str - :ivar resouce_id: Reserved, not used now. - :vartype resouce_id: str - :ivar is_hidden: Reserved, not used now. - :vartype is_hidden: bool - :ivar capabilities: A list of Application Insights component feature capability. - :vartype capabilities: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentFeatureCapability] - :ivar title: Display name of the feature. - :vartype title: str - :ivar is_main_feature: Whether can apply addon feature on to it. - :vartype is_main_feature: bool - :ivar supported_addon_features: The add on features on main feature. - :vartype supported_addon_features: str - """ - - _validation = { - 'feature_name': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_rate_frequency': {'readonly': True}, - 'resouce_id': {'readonly': True}, - 'is_hidden': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'title': {'readonly': True}, - 'is_main_feature': {'readonly': True}, - 'supported_addon_features': {'readonly': True}, - } - - _attribute_map = { - 'feature_name': {'key': 'FeatureName', 'type': 'str'}, - 'meter_id': {'key': 'MeterId', 'type': 'str'}, - 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, - 'resouce_id': {'key': 'ResouceId', 'type': 'str'}, - 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, - 'capabilities': {'key': 'Capabilities', 'type': '[ApplicationInsightsComponentFeatureCapability]'}, - 'title': {'key': 'Title', 'type': 'str'}, - 'is_main_feature': {'key': 'IsMainFeature', 'type': 'bool'}, - 'supported_addon_features': {'key': 'SupportedAddonFeatures', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentFeature, self).__init__(**kwargs) - self.feature_name = None - self.meter_id = None - self.meter_rate_frequency = None - self.resouce_id = None - self.is_hidden = None - self.capabilities = None - self.title = None - self.is_main_feature = None - self.supported_addon_features = None - - -class ApplicationInsightsComponentFeatureCapabilities(msrest.serialization.Model): - """An Application Insights component feature capabilities. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar support_export_data: Whether allow to use continuous export feature. - :vartype support_export_data: bool - :ivar burst_throttle_policy: Reserved, not used now. - :vartype burst_throttle_policy: str - :ivar metadata_class: Reserved, not used now. - :vartype metadata_class: str - :ivar live_stream_metrics: Reserved, not used now. - :vartype live_stream_metrics: bool - :ivar application_map: Reserved, not used now. - :vartype application_map: bool - :ivar work_item_integration: Whether allow to use work item integration feature. - :vartype work_item_integration: bool - :ivar power_bi_integration: Reserved, not used now. - :vartype power_bi_integration: bool - :ivar open_schema: Reserved, not used now. - :vartype open_schema: bool - :ivar proactive_detection: Reserved, not used now. - :vartype proactive_detection: bool - :ivar analytics_integration: Reserved, not used now. - :vartype analytics_integration: bool - :ivar multiple_step_web_test: Whether allow to use multiple steps web test feature. - :vartype multiple_step_web_test: bool - :ivar api_access_level: Reserved, not used now. - :vartype api_access_level: str - :ivar tracking_type: The application insights component used tracking type. - :vartype tracking_type: str - :ivar daily_cap: Daily data volume cap in GB. - :vartype daily_cap: float - :ivar daily_cap_reset_time: Daily data volume cap UTC reset hour. - :vartype daily_cap_reset_time: float - :ivar throttle_rate: Reserved, not used now. - :vartype throttle_rate: float - """ - - _validation = { - 'support_export_data': {'readonly': True}, - 'burst_throttle_policy': {'readonly': True}, - 'metadata_class': {'readonly': True}, - 'live_stream_metrics': {'readonly': True}, - 'application_map': {'readonly': True}, - 'work_item_integration': {'readonly': True}, - 'power_bi_integration': {'readonly': True}, - 'open_schema': {'readonly': True}, - 'proactive_detection': {'readonly': True}, - 'analytics_integration': {'readonly': True}, - 'multiple_step_web_test': {'readonly': True}, - 'api_access_level': {'readonly': True}, - 'tracking_type': {'readonly': True}, - 'daily_cap': {'readonly': True}, - 'daily_cap_reset_time': {'readonly': True}, - 'throttle_rate': {'readonly': True}, - } - - _attribute_map = { - 'support_export_data': {'key': 'SupportExportData', 'type': 'bool'}, - 'burst_throttle_policy': {'key': 'BurstThrottlePolicy', 'type': 'str'}, - 'metadata_class': {'key': 'MetadataClass', 'type': 'str'}, - 'live_stream_metrics': {'key': 'LiveStreamMetrics', 'type': 'bool'}, - 'application_map': {'key': 'ApplicationMap', 'type': 'bool'}, - 'work_item_integration': {'key': 'WorkItemIntegration', 'type': 'bool'}, - 'power_bi_integration': {'key': 'PowerBIIntegration', 'type': 'bool'}, - 'open_schema': {'key': 'OpenSchema', 'type': 'bool'}, - 'proactive_detection': {'key': 'ProactiveDetection', 'type': 'bool'}, - 'analytics_integration': {'key': 'AnalyticsIntegration', 'type': 'bool'}, - 'multiple_step_web_test': {'key': 'MultipleStepWebTest', 'type': 'bool'}, - 'api_access_level': {'key': 'ApiAccessLevel', 'type': 'str'}, - 'tracking_type': {'key': 'TrackingType', 'type': 'str'}, - 'daily_cap': {'key': 'DailyCap', 'type': 'float'}, - 'daily_cap_reset_time': {'key': 'DailyCapResetTime', 'type': 'float'}, - 'throttle_rate': {'key': 'ThrottleRate', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentFeatureCapabilities, self).__init__(**kwargs) - self.support_export_data = None - self.burst_throttle_policy = None - self.metadata_class = None - self.live_stream_metrics = None - self.application_map = None - self.work_item_integration = None - self.power_bi_integration = None - self.open_schema = None - self.proactive_detection = None - self.analytics_integration = None - self.multiple_step_web_test = None - self.api_access_level = None - self.tracking_type = None - self.daily_cap = None - self.daily_cap_reset_time = None - self.throttle_rate = None - - -class ApplicationInsightsComponentFeatureCapability(msrest.serialization.Model): - """An Application Insights component feature capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the capability. - :vartype name: str - :ivar description: The description of the capability. - :vartype description: str - :ivar value: The value of the capability. - :vartype value: str - :ivar unit: The unit of the capability. - :vartype unit: str - :ivar meter_id: The meter used for the capability. - :vartype meter_id: str - :ivar meter_rate_frequency: The meter rate of the meter. - :vartype meter_rate_frequency: str - """ - - _validation = { - 'name': {'readonly': True}, - 'description': {'readonly': True}, - 'value': {'readonly': True}, - 'unit': {'readonly': True}, - 'meter_id': {'readonly': True}, - 'meter_rate_frequency': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'description': {'key': 'Description', 'type': 'str'}, - 'value': {'key': 'Value', 'type': 'str'}, - 'unit': {'key': 'Unit', 'type': 'str'}, - 'meter_id': {'key': 'MeterId', 'type': 'str'}, - 'meter_rate_frequency': {'key': 'MeterRateFrequency', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentFeatureCapability, self).__init__(**kwargs) - self.name = None - self.description = None - self.value = None - self.unit = None - self.meter_id = None - self.meter_rate_frequency = None - - -class ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ApplicationInsightsComponentProactiveDetectionConfiguration(msrest.serialization.Model): - """Properties that define a ProactiveDetection configuration. - - :param name: The rule name. - :type name: str - :param enabled: A flag that indicates whether this rule is enabled by the user. - :type enabled: bool - :param send_emails_to_subscription_owners: A flag that indicated whether notifications on this - rule should be sent to subscription owners. - :type send_emails_to_subscription_owners: bool - :param custom_emails: Custom email addresses for this rule notifications. - :type custom_emails: list[str] - :param last_updated_time: The last time this rule was updated. - :type last_updated_time: str - :param rule_definitions: Static definitions of the ProactiveDetection configuration rule (same - values for all components). - :type rule_definitions: - ~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions - """ - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'enabled': {'key': 'Enabled', 'type': 'bool'}, - 'send_emails_to_subscription_owners': {'key': 'SendEmailsToSubscriptionOwners', 'type': 'bool'}, - 'custom_emails': {'key': 'CustomEmails', 'type': '[str]'}, - 'last_updated_time': {'key': 'LastUpdatedTime', 'type': 'str'}, - 'rule_definitions': {'key': 'RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.enabled = kwargs.get('enabled', None) - self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) - self.custom_emails = kwargs.get('custom_emails', None) - self.last_updated_time = kwargs.get('last_updated_time', None) - self.rule_definitions = kwargs.get('rule_definitions', None) - - -class ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions(msrest.serialization.Model): - """Static definitions of the ProactiveDetection configuration rule (same values for all components). - - :param name: The rule name. - :type name: str - :param display_name: The rule name as it is displayed in UI. - :type display_name: str - :param description: The rule description. - :type description: str - :param help_url: URL which displays additional info about the proactive detection rule. - :type help_url: str - :param is_hidden: A flag indicating whether the rule is hidden (from the UI). - :type is_hidden: bool - :param is_enabled_by_default: A flag indicating whether the rule is enabled by default. - :type is_enabled_by_default: bool - :param is_in_preview: A flag indicating whether the rule is in preview. - :type is_in_preview: bool - :param supports_email_notifications: A flag indicating whether email notifications are - supported for detections for this rule. - :type supports_email_notifications: bool - """ - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'display_name': {'key': 'DisplayName', 'type': 'str'}, - 'description': {'key': 'Description', 'type': 'str'}, - 'help_url': {'key': 'HelpUrl', 'type': 'str'}, - 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, - 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, - 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, - 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentProactiveDetectionConfigurationRuleDefinitions, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - self.help_url = kwargs.get('help_url', None) - self.is_hidden = kwargs.get('is_hidden', None) - self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) - self.is_in_preview = kwargs.get('is_in_preview', None) - self.supports_email_notifications = kwargs.get('supports_email_notifications', None) - - -class ApplicationInsightsComponentQuotaStatus(msrest.serialization.Model): - """An Application Insights component daily data volume cap status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar app_id: The Application ID for the Application Insights component. - :vartype app_id: str - :ivar should_be_throttled: The daily data volume cap is met, and data ingestion will be - stopped. - :vartype should_be_throttled: bool - :ivar expiration_time: Date and time when the daily data volume cap will be reset, and data - ingestion will resume. - :vartype expiration_time: str - """ - - _validation = { - 'app_id': {'readonly': True}, - 'should_be_throttled': {'readonly': True}, - 'expiration_time': {'readonly': True}, - } - - _attribute_map = { - 'app_id': {'key': 'AppId', 'type': 'str'}, - 'should_be_throttled': {'key': 'ShouldBeThrottled', 'type': 'bool'}, - 'expiration_time': {'key': 'ExpirationTime', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentQuotaStatus, self).__init__(**kwargs) - self.app_id = None - self.should_be_throttled = None - self.expiration_time = None - - -class ApplicationInsightsComponentWebTestLocation(msrest.serialization.Model): - """Properties that define a web test location available to an Application Insights Component. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar display_name: The display name of the web test location. - :vartype display_name: str - :ivar tag: Internally defined geographic location tag. - :vartype tag: str - """ - - _validation = { - 'display_name': {'readonly': True}, - 'tag': {'readonly': True}, - } - - _attribute_map = { - 'display_name': {'key': 'DisplayName', 'type': 'str'}, - 'tag': {'key': 'Tag', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentWebTestLocation, self).__init__(**kwargs) - self.display_name = None - self.tag = None - - -class ApplicationInsightsWebTestLocationsListResult(msrest.serialization.Model): - """Describes the list of web test locations available to an Application Insights Component. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of web test locations. - :type value: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ApplicationInsightsComponentWebTestLocation] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponentWebTestLocation]'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsWebTestLocationsListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - -class ComponentPurgeBody(msrest.serialization.Model): - """Describes the body of a purge request for an App Insights component. - - All required parameters must be populated in order to send to Azure. - - :param table: Required. Table from which to purge data. - :type table: str - :param filters: Required. The set of columns and filters (queries) to run over them to purge - the resulting data. - :type filters: - list[~azure.mgmt.applicationinsights.v2015_05_01.models.ComponentPurgeBodyFilters] - """ - - _validation = { - 'table': {'required': True}, - 'filters': {'required': True}, - } - - _attribute_map = { - 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBody, self).__init__(**kwargs) - self.table = kwargs['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.Model): - """User-defined filters to return data which will be purged from the table. - - :param column: The column of the table over which the given query should run. - :type column: str - :param operator: A query operator to evaluate over the provided column and value(s). Supported - operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would - in a KQL query. - :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 - :param key: When filtering over custom dimensions, this key will be used as the name of the - custom dimension. - :type key: str - """ - - _attribute_map = { - 'column': {'key': 'column', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBodyFilters, self).__init__(**kwargs) - self.column = kwargs.get('column', None) - self.operator = kwargs.get('operator', None) - self.value = kwargs.get('value', None) - self.key = kwargs.get('key', None) - - -class ComponentPurgeResponse(msrest.serialization.Model): - """Response containing operationId for a specific purge action. - - All required parameters must be populated in order to send to Azure. - - :param operation_id: Required. Id to use when querying for status for a particular purge - operation. - :type operation_id: str - """ - - _validation = { - 'operation_id': {'required': True}, - } - - _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeResponse, self).__init__(**kwargs) - self.operation_id = kwargs['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.Model): - """Response containing status for a specific purge operation. - - All required parameters must be populated in order to send to Azure. - - :param status: Required. Status of the operation represented by the requested Id. Possible - values include: "pending", "completed". - :type status: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.PurgeState - """ - - _validation = { - 'status': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeStatusResponse, self).__init__(**kwargs) - self.status = kwargs['status'] - - -class ErrorFieldContract(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(ErrorFieldContract, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - 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 InnerError(msrest.serialization.Model): - """Inner error. - - :param diagnosticcontext: Provides correlation for request. - :type diagnosticcontext: str - :param time: Request time. - :type time: ~datetime.datetime - """ - - _attribute_map = { - 'diagnosticcontext': {'key': 'diagnosticcontext', 'type': 'str'}, - 'time': {'key': 'time', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(InnerError, self).__init__(**kwargs) - self.diagnosticcontext = kwargs.get('diagnosticcontext', None) - self.time = kwargs.get('time', None) - - -class LinkProperties(msrest.serialization.Model): - """Contains a sourceId and workbook resource id to link two resources. - - :param source_id: The source Azure resource id. - :type source_id: str - :param target_id: The workbook Azure resource id. - :type target_id: str - :param category: The category of workbook. - :type category: str - """ - - _attribute_map = { - 'source_id': {'key': 'sourceId', 'type': 'str'}, - 'target_id': {'key': 'targetId', 'type': 'str'}, - 'category': {'key': 'category', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LinkProperties, self).__init__(**kwargs) - self.source_id = kwargs.get('source_id', None) - self.target_id = kwargs.get('target_id', None) - self.category = kwargs.get('category', None) - - -class MyWorkbookResource(msrest.serialization.Model): - """An azure resource object. - - :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] - """ - - _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(MyWorkbookResource, self).__init__(**kwargs) - 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) - - -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 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 kind: The kind of workbook. Choices are user and shared. Possible values include: - "user", "shared". - :type kind: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind - :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 - """ - - _validation = { - 'time_modified': {'readonly': True}, - 'user_id': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - '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'}, - } - - def __init__( - self, - **kwargs - ): - super(MyWorkbook, self).__init__(**kwargs) - self.kind = kwargs.get('kind', 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) - - -class MyWorkbookError(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.v2015_05_01.models.ErrorFieldContract] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, - } - - def __init__( - self, - **kwargs - ): - super(MyWorkbookError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', 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.v2015_05_01.models.MyWorkbook] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[MyWorkbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(MyWorkbooksListResult, self).__init__(**kwargs) - self.value = 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.v2015_05_01.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.v2015_05_01.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 PrivateLinkScopedResource(msrest.serialization.Model): - """The private link scope resource reference. - - :param resource_id: The full resource Id of the private link scope resource. - :type resource_id: str - :param scope_id: The private link scope unique Identifier. - :type scope_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'ResourceId', 'type': 'str'}, - 'scope_id': {'key': 'ScopeId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkScopedResource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.scope_id = kwargs.get('scope_id', None) - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class WebtestsResource(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(WebtestsResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class WebTest(WebtestsResource): - """An Application Insights web test 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 kind: The kind of web test that this web test watches. Choices are ping and multistep. - Possible values include: "ping", "multistep". - :type kind: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind - :param synthetic_monitor_id: Unique ID of this WebTest. This is typically the same value as the - Name field. - :type synthetic_monitor_id: str - :param web_test_name: User defined name if this WebTest. - :type web_test_name: str - :param description: Purpose/user defined descriptive test for this WebTest. - :type description: str - :param enabled: Is the test actively being monitored. - :type enabled: bool - :param frequency: Interval in seconds between test runs for this WebTest. Default value is 300. - :type frequency: int - :param timeout: Seconds until this WebTest will timeout and fail. Default value is 30. - :type timeout: int - :param web_test_kind: The kind of web test this is, valid choices are ping and multistep. - Possible values include: "ping", "multistep". - :type web_test_kind: str or ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestKind - :param retry_enabled: Allow for retries should this WebTest fail. - :type retry_enabled: bool - :param locations: A list of where to physically run the tests from to give global coverage for - accessibility of your application. - :type locations: list[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestGeolocation] - :param configuration: An XML configuration specification for a WebTest. - :type configuration: - ~azure.mgmt.applicationinsights.v2015_05_01.models.WebTestPropertiesConfiguration - :ivar provisioning_state: Current state of this component, whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'synthetic_monitor_id': {'key': 'properties.SyntheticMonitorId', 'type': 'str'}, - 'web_test_name': {'key': 'properties.Name', 'type': 'str'}, - 'description': {'key': 'properties.Description', 'type': 'str'}, - 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, - 'frequency': {'key': 'properties.Frequency', 'type': 'int'}, - 'timeout': {'key': 'properties.Timeout', 'type': 'int'}, - 'web_test_kind': {'key': 'properties.Kind', 'type': 'str'}, - 'retry_enabled': {'key': 'properties.RetryEnabled', 'type': 'bool'}, - 'locations': {'key': 'properties.Locations', 'type': '[WebTestGeolocation]'}, - 'configuration': {'key': 'properties.Configuration', 'type': 'WebTestPropertiesConfiguration'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WebTest, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.synthetic_monitor_id = kwargs.get('synthetic_monitor_id', None) - self.web_test_name = kwargs.get('web_test_name', None) - self.description = kwargs.get('description', None) - self.enabled = kwargs.get('enabled', None) - self.frequency = kwargs.get('frequency', 300) - self.timeout = kwargs.get('timeout', 30) - self.web_test_kind = kwargs.get('web_test_kind', None) - self.retry_enabled = kwargs.get('retry_enabled', None) - self.locations = kwargs.get('locations', None) - self.configuration = kwargs.get('configuration', None) - self.provisioning_state = None - - -class WebTestGeolocation(msrest.serialization.Model): - """Geo-physical location to run a web test from. You must specify one or more locations for the test to run from. - - :param location: Location ID for the webtest to run from. - :type location: str - """ - - _attribute_map = { - 'location': {'key': 'Id', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WebTestGeolocation, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - - -class WebTestListResult(msrest.serialization.Model): - """A list of 0 or more Application Insights web test definitions. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. Set of Application Insights web test definitions. - :type value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.WebTest] - :param next_link: The link to get the next part of the returned list of web tests, should the - return set be too large for a single request. May be null. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WebTest]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WebTestListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class WebTestPropertiesConfiguration(msrest.serialization.Model): - """An XML configuration specification for a WebTest. - - :param web_test: The XML specification of a WebTest to run against an application. - :type web_test: str - """ - - _attribute_map = { - 'web_test': {'key': 'WebTest', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WebTestPropertiesConfiguration, self).__init__(**kwargs) - self.web_test = kwargs.get('web_test', None) - - -class WorkbookResource(msrest.serialization.Model): - """An azure resource object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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: 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}, - } - - _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(WorkbookResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class Workbook(WorkbookResource): - """An Application Insights workbook definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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: Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: 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.v2015_05_01.models.SharedTypeKind - :param name_properties_name: The user-defined name of the workbook. - :type name_properties_name: str - :param serialized_data: Configuration of this particular 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 workbook. - :type version: str - :param workbook_id: Internally assigned unique id of the workbook definition. - :type workbook_id: str - :param shared_type_kind: Enum indicating if this workbook definition is owned by a specific - user or is shared between all users with access to the Application Insights component. Possible - values include: "user", "shared". - :type shared_type_kind: str or - ~azure.mgmt.applicationinsights.v2015_05_01.models.SharedTypeKind - :ivar time_modified: Date and time in UTC of the last modification that was made to this - 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 workbook - definition. - :type tags_properties_tags: list[str] - :param user_id: Unique user id of the specific user that owns this workbook. - :type user_id: str - :param source_resource_id: Optional resourceId for a source resource. - :type source_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'time_modified': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.name', 'type': 'str'}, - 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'workbook_id': {'key': 'properties.workbookId', 'type': 'str'}, - 'shared_type_kind': {'key': 'properties.kind', '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_resource_id': {'key': 'properties.sourceResourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Workbook, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.name_properties_name = kwargs.get('name_properties_name', None) - self.serialized_data = kwargs.get('serialized_data', None) - self.version = kwargs.get('version', None) - self.workbook_id = kwargs.get('workbook_id', None) - self.shared_type_kind = kwargs.get('shared_type_kind', None) - self.time_modified = None - self.category = kwargs.get('category', None) - self.tags_properties_tags = kwargs.get('tags_properties_tags', None) - self.user_id = kwargs.get('user_id', None) - self.source_resource_id = kwargs.get('source_resource_id', None) - - -class WorkbookError(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.v2015_05_01.models.ErrorFieldContract] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbookError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - - -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.v2015_05_01.models.Workbook] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbooksListResult, self).__init__(**kwargs) - self.value = None - - -class WorkItemConfiguration(msrest.serialization.Model): - """Work item configuration associated with an application insights resource. - - :param connector_id: Connector identifier where work item is created. - :type connector_id: str - :param config_display_name: Configuration friendly name. - :type config_display_name: str - :param is_default: Boolean value indicating whether configuration is default. - :type is_default: bool - :param id: Unique Id for work item. - :type id: str - :param config_properties: Serialized JSON object for detailed properties. - :type config_properties: str - """ - - _attribute_map = { - 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, - 'config_display_name': {'key': 'ConfigDisplayName', 'type': 'str'}, - 'is_default': {'key': 'IsDefault', 'type': 'bool'}, - 'id': {'key': 'Id', 'type': 'str'}, - 'config_properties': {'key': 'ConfigProperties', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkItemConfiguration, self).__init__(**kwargs) - self.connector_id = kwargs.get('connector_id', None) - self.config_display_name = kwargs.get('config_display_name', None) - self.is_default = kwargs.get('is_default', None) - self.id = kwargs.get('id', None) - self.config_properties = kwargs.get('config_properties', None) - - -class WorkItemConfigurationError(msrest.serialization.Model): - """Error associated with trying to get work item configuration or configurations. - - :param code: Error detail code and explanation. - :type code: str - :param message: Error message. - :type message: str - :param innererror: Inner error. - :type innererror: ~azure.mgmt.applicationinsights.v2015_05_01.models.InnerError - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'innererror': {'key': 'innererror', 'type': 'InnerError'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkItemConfigurationError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.innererror = kwargs.get('innererror', None) - - -class WorkItemConfigurationsListResult(msrest.serialization.Model): - """Work item configuration list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: An array of work item configurations. - :vartype value: list[~azure.mgmt.applicationinsights.v2015_05_01.models.WorkItemConfiguration] - """ - - _validation = { - 'value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[WorkItemConfiguration]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkItemConfigurationsListResult, self).__init__(**kwargs) - self.value = None - - -class WorkItemCreateConfiguration(msrest.serialization.Model): - """Work item configuration creation payload. - - :param connector_id: Unique connector id. - :type connector_id: str - :param connector_data_configuration: Serialized JSON object for detailed properties. - :type connector_data_configuration: str - :param validate_only: Boolean indicating validate only. - :type validate_only: bool - :param work_item_properties: Custom work item properties. - :type work_item_properties: dict[str, str] - """ - - _attribute_map = { - 'connector_id': {'key': 'ConnectorId', 'type': 'str'}, - 'connector_data_configuration': {'key': 'ConnectorDataConfiguration', 'type': 'str'}, - 'validate_only': {'key': 'ValidateOnly', 'type': 'bool'}, - 'work_item_properties': {'key': 'WorkItemProperties', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkItemCreateConfiguration, self).__init__(**kwargs) - self.connector_id = kwargs.get('connector_id', None) - self.connector_data_configuration = kwargs.get('connector_data_configuration', None) - self.validate_only = kwargs.get('validate_only', None) - self.work_item_properties = kwargs.get('work_item_properties', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py deleted file mode 100644 index 7e1fe352b48..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_application_insights_management_client.py +++ /dev/null @@ -1,77 +0,0 @@ -# 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.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 EASubscriptionMigrateToNewPricingModelOperations -from .operations import EASubscriptionRollbackToLegacyPricingModelOperations -from .operations import EASubscriptionListMigrationDateOperations -from .operations import ComponentCurrentPricingPlanOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar ea_subscription_migrate_to_new_pricing_model: EASubscriptionMigrateToNewPricingModelOperations operations - :vartype ea_subscription_migrate_to_new_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionMigrateToNewPricingModelOperations - :ivar ea_subscription_rollback_to_legacy_pricing_model: EASubscriptionRollbackToLegacyPricingModelOperations operations - :vartype ea_subscription_rollback_to_legacy_pricing_model: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionRollbackToLegacyPricingModelOperations - :ivar ea_subscription_list_migration_date: EASubscriptionListMigrationDateOperations operations - :vartype ea_subscription_list_migration_date: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.EASubscriptionListMigrationDateOperations - :ivar component_current_pricing_plan: ComponentCurrentPricingPlanOperations operations - :vartype component_current_pricing_plan: azure.mgmt.applicationinsights.v2017_10_01.aio.operations.ComponentCurrentPricingPlanOperations - :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._deserialize = Deserializer(client_models) - - self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( - self._client, self._config, self._serialize, self._deserialize) - self.ea_subscription_rollback_to_legacy_pricing_model = EASubscriptionRollbackToLegacyPricingModelOperations( - self._client, self._config, self._serialize, self._deserialize) - self.ea_subscription_list_migration_date = EASubscriptionListMigrationDateOperations( - self._client, self._config, self._serialize, self._deserialize) - self.component_current_pricing_plan = ComponentCurrentPricingPlanOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py deleted file mode 100644 index 415c3151087..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 = "2017-10-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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py deleted file mode 100644 index 93d02090bcd..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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 ._ea_subscription_migrate_to_new_pricing_model_operations import EASubscriptionMigrateToNewPricingModelOperations -from ._ea_subscription_rollback_to_legacy_pricing_model_operations import EASubscriptionRollbackToLegacyPricingModelOperations -from ._ea_subscription_list_migration_date_operations import EASubscriptionListMigrationDateOperations -from ._component_current_pricing_plan_operations import ComponentCurrentPricingPlanOperations - -__all__ = [ - 'EASubscriptionMigrateToNewPricingModelOperations', - 'EASubscriptionRollbackToLegacyPricingModelOperations', - 'EASubscriptionListMigrationDateOperations', - 'ComponentCurrentPricingPlanOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py deleted file mode 100644 index 51323fdbf2a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_component_current_pricing_plan_operations.py +++ /dev/null @@ -1,233 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentCurrentPricingPlanOperations: - """ComponentCurrentPricingPlanOperations 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.v2017_10_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """Returns the current pricing plan setting for an Application Insights component. - - :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: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore - - async def create_and_update( - self, - resource_group_name: str, - resource_name: str, - pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """Replace current pricing plan for an Application Insights component. - - :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 pricing_plan_properties: Properties that need to be specified to update current pricing - plan for an Application Insights component. - :type pricing_plan_properties: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - pricing_plan_properties: "_models.ApplicationInsightsComponentPricingPlan", - **kwargs - ) -> "_models.ApplicationInsightsComponentPricingPlan": - """Update current pricing plan for an Application Insights component. - - :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 pricing_plan_properties: Properties that need to be specified to update current pricing - plan for an Application Insights component. - :type pricing_plan_properties: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentPricingPlan, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.ApplicationInsightsComponentPricingPlan - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentPricingPlan"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(pricing_plan_properties, 'ApplicationInsightsComponentPricingPlan') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentPricingPlan', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/pricingPlans/current'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py deleted file mode 100644 index 1024415f875..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_list_migration_date_operations.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionListMigrationDateOperations: - """EASubscriptionListMigrationDateOperations 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.v2017_10_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 - - async def post( - self, - **kwargs - ) -> "_models.EASubscriptionMigrationDate": - """list date to migrate to new pricing model. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: EASubscriptionMigrationDate, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2017_10_01.models.EASubscriptionMigrationDate - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.EASubscriptionMigrationDate"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('EASubscriptionMigrationDate', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/listMigrationdate'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py deleted file mode 100644 index adfc0b7587c..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_migrate_to_new_pricing_model_operations.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionMigrateToNewPricingModelOperations: - """EASubscriptionMigrateToNewPricingModelOperations 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.v2017_10_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 - - async def post( - self, - **kwargs - ) -> None: - """Enterprise Agreement Customer opted to use new pricing model. - - :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 = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/migrateToNewPricingModel'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py deleted file mode 100644 index a0e31a1d087..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/aio/operations/_ea_subscription_rollback_to_legacy_pricing_model_operations.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class EASubscriptionRollbackToLegacyPricingModelOperations: - """EASubscriptionRollbackToLegacyPricingModelOperations 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.v2017_10_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 - - async def post( - self, - **kwargs - ) -> None: - """Enterprise Agreement Customer roll back to use legacy pricing model. - - :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 = "2017-10-01" - accept = "application/json" - - # Construct URL - url = self.post.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - post.metadata = {'url': '/subscriptions/{subscriptionId}/providers/microsoft.insights/rollbackToLegacyPricingModel'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py index 5bc25d104c4..d4e859c232a 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/__init__.py @@ -6,16 +6,10 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponentPricingPlan - from ._models_py3 import CloudErrorBody - from ._models_py3 import EASubscriptionMigrationDate - from ._models_py3 import Resource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponentPricingPlan # type: ignore - from ._models import CloudErrorBody # type: ignore - from ._models import EASubscriptionMigrationDate # type: ignore - from ._models import Resource # type: ignore +from ._models_py3 import ApplicationInsightsComponentPricingPlan +from ._models_py3 import CloudErrorBody +from ._models_py3 import EASubscriptionMigrationDate +from ._models_py3 import Resource __all__ = [ 'ApplicationInsightsComponentPricingPlan', diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py deleted file mode 100644 index a0425e0ae33..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2017_10_01/models/_models.py +++ /dev/null @@ -1,165 +0,0 @@ -# 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 msrest.serialization - - -class Resource(msrest.serialization.Model): - """An Azure resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :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 ApplicationInsightsComponentPricingPlan(Resource): - """An Application Insights component pricing plan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :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 plan_type: Pricing Plan Type Name. - :type plan_type: str - :param cap: Daily data volume cap in GB. - :type cap: float - :ivar reset_hour: Daily data volume cap UTC reset hour. - :vartype reset_hour: int - :param warning_threshold: Reserved, not used for now. - :type warning_threshold: int - :param stop_send_notification_when_hit_threshold: Reserved, not used for now. - :type stop_send_notification_when_hit_threshold: bool - :param stop_send_notification_when_hit_cap: Do not send a notification email when the daily - data volume cap is met. - :type stop_send_notification_when_hit_cap: bool - :ivar max_history_cap: Maximum daily data volume cap that the user can set for this component. - :vartype max_history_cap: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'reset_hour': {'readonly': True}, - 'max_history_cap': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'plan_type': {'key': 'properties.planType', 'type': 'str'}, - 'cap': {'key': 'properties.cap', 'type': 'float'}, - 'reset_hour': {'key': 'properties.resetHour', 'type': 'int'}, - 'warning_threshold': {'key': 'properties.warningThreshold', 'type': 'int'}, - 'stop_send_notification_when_hit_threshold': {'key': 'properties.stopSendNotificationWhenHitThreshold', 'type': 'bool'}, - 'stop_send_notification_when_hit_cap': {'key': 'properties.stopSendNotificationWhenHitCap', 'type': 'bool'}, - 'max_history_cap': {'key': 'properties.maxHistoryCap', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentPricingPlan, self).__init__(**kwargs) - self.plan_type = kwargs.get('plan_type', None) - self.cap = kwargs.get('cap', None) - self.reset_hour = None - self.warning_threshold = kwargs.get('warning_threshold', None) - self.stop_send_notification_when_hit_threshold = kwargs.get('stop_send_notification_when_hit_threshold', None) - self.stop_send_notification_when_hit_cap = kwargs.get('stop_send_notification_when_hit_cap', None) - self.max_history_cap = None - - -class CloudErrorBody(msrest.serialization.Model): - """An error response from the Batch service. - - :param code: An identifier for the error. Codes are invariant and are intended to be consumed - programmatically. - :type code: str - :param message: A message describing the error, intended to be suitable for display in a user - interface. - :type message: str - :param target: The target of the particular error. For example, the name of the property in - error. - :type target: str - :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.applicationinsights.v2017_10_01.models.CloudErrorBody] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, - } - - def __init__( - self, - **kwargs - ): - super(CloudErrorBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - self.details = kwargs.get('details', None) - - -class EASubscriptionMigrationDate(msrest.serialization.Model): - """Subscription migrate date information properties. - - :param is_grand_fatherable_subscription: Is subscription in the grand fatherable subscription - list. - :type is_grand_fatherable_subscription: bool - :param opted_in_date: Time to start using new pricing model. - :type opted_in_date: ~datetime.datetime - """ - - _attribute_map = { - 'is_grand_fatherable_subscription': {'key': 'isGrandFatherableSubscription', 'type': 'bool'}, - 'opted_in_date': {'key': 'optedInDate', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(EASubscriptionMigrationDate, self).__init__(**kwargs) - self.is_grand_fatherable_subscription = kwargs.get('is_grand_fatherable_subscription', None) - self.opted_in_date = kwargs.get('opted_in_date', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py deleted file mode 100644 index d78d676a1f5..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,67 +0,0 @@ -# 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.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 ProactiveDetectionConfigurationsOperations -from .operations import ComponentsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar proactive_detection_configurations: ProactiveDetectionConfigurationsOperations operations - :vartype proactive_detection_configurations: azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ProactiveDetectionConfigurationsOperations - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2018_05_01_preview.aio.operations.ComponentsOperations - :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._deserialize = Deserializer(client_models) - - self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.components = ComponentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py deleted file mode 100644 index d41af1aee08..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 = "2018-05-01-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py deleted file mode 100644 index 3f58d6dbbd8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# 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 ._proactive_detection_configurations_operations import ProactiveDetectionConfigurationsOperations -from ._components_operations import ComponentsOperations - -__all__ = [ - 'ProactiveDetectionConfigurationsOperations', - 'ComponentsOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py deleted file mode 100644 index fbf65dcae7b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_components_operations.py +++ /dev/null @@ -1,567 +0,0 @@ -# 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 ComponentsOperations: - """ComponentsOperations 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_05_01_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 - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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('ApplicationInsightsComponentListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of Application Insights components within a 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 ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_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\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('ApplicationInsightsComponentListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, 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/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """Deletes an Application Insights component. - - :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 = "2018-05-01-preview" - - # 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\._\(\)]+$'), - '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'), - } - 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] - - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Returns an Application Insights component. - - :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: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Creates (or updates) an Application Insights component. Note: You cannot specify a different - value for InstrumentationKey nor AppId in the Put operation. - - :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 insight_properties: Properties that need to be specified to create an Application - Insights component. - :type insight_properties: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(insight_properties, 'ApplicationInsightsComponent') - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. - - :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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(component_tags, 'TagsResource') - 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, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """Purges data in an Application Insights component by a set of user-defined filters. - - In order to manage system resources, purge requests are throttled at 50 requests per hour. You - should batch the execution of purge requests by sending a single command whose predicate - includes all user identities that require purging. Use the in operator to specify multiple - identities. You should run the query prior to using for a purge request to verify that the - results are expected. - - :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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(body, 'ComponentPurgeBody') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """Get status for an ongoing purge operation. - - :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 purge_id: In a purge status request, this is the Id of the operation the status of which - is returned. - :type purge_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py deleted file mode 100644 index bed519fe029..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/aio/operations/_proactive_detection_configurations_operations.py +++ /dev/null @@ -1,234 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProactiveDetectionConfigurationsOperations: - """ProactiveDetectionConfigurationsOperations 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_05_01_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 - - async def list( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]: - """Gets a list of ProactiveDetection configurations of an Application Insights component. - - :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: list of ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType[List["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('[ApplicationInsightsComponentProactiveDetectionConfiguration]', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """Get the ProactiveDetection configuration for this configuration id. - - :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 configuration_id: The ProactiveDetection configuration ID. This is unique within a - Application Insights component. - :type configuration_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - configuration_id: str, - proactive_detection_properties: "_models.ApplicationInsightsComponentProactiveDetectionConfiguration", - **kwargs - ) -> "_models.ApplicationInsightsComponentProactiveDetectionConfiguration": - """Update the ProactiveDetection configuration for this configuration id. - - :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 configuration_id: The ProactiveDetection configuration ID. This is unique within a - Application Insights component. - :type configuration_id: str - :param proactive_detection_properties: Properties that need to be specified to update the - ProactiveDetection configuration. - :type proactive_detection_properties: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponentProactiveDetectionConfiguration, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfiguration - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentProactiveDetectionConfiguration"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2018-05-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(proactive_detection_properties, 'ApplicationInsightsComponentProactiveDetectionConfiguration') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponentProactiveDetectionConfiguration', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/ProactiveDetectionConfigs/{ConfigurationId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py index 5413abf8666..4f3d7920ace 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/__init__.py @@ -6,38 +6,26 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentListResult - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration - from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions - from ._models_py3 import ComponentPurgeBody - from ._models_py3 import ComponentPurgeBodyFilters - from ._models_py3 import ComponentPurgeResponse - from ._models_py3 import ComponentPurgeStatusResponse - from ._models_py3 import ComponentsResource - from ._models_py3 import PrivateLinkScopedResource - from ._models_py3 import TagsResource - from ._models_py3 import WebTest - from ._models_py3 import WebTestGeolocation - from ._models_py3 import WebTestListResult - from ._models_py3 import WebTestPropertiesConfiguration - from ._models_py3 import WebTestPropertiesRequest - from ._models_py3 import WebTestPropertiesValidationRules - from ._models_py3 import WebTestPropertiesValidationRulesContentValidation - from ._models_py3 import WebTestsResource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfiguration # type: ignore - from ._models import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentListResult +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfiguration +from ._models_py3 import ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions +from ._models_py3 import ComponentPurgeBody +from ._models_py3 import ComponentPurgeBodyFilters +from ._models_py3 import ComponentPurgeResponse +from ._models_py3 import ComponentPurgeStatusResponse +from ._models_py3 import ComponentsResource +from ._models_py3 import HeaderField +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource +from ._models_py3 import WebTest +from ._models_py3 import WebTestGeolocation +from ._models_py3 import WebTestListResult +from ._models_py3 import WebTestPropertiesConfiguration +from ._models_py3 import WebTestPropertiesRequest +from ._models_py3 import WebTestPropertiesValidationRules +from ._models_py3 import WebTestPropertiesValidationRulesContentValidation +from ._models_py3 import WebTestsResource from ._application_insights_management_client_enums import ( ApplicationType, @@ -60,6 +48,7 @@ 'ComponentPurgeResponse', 'ComponentPurgeStatusResponse', 'ComponentsResource', + 'HeaderField', 'PrivateLinkScopedResource', 'TagsResource', 'WebTest', diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py deleted file mode 100644 index 8bc1d8610ce..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_05_01_preview/models/_models.py +++ /dev/null @@ -1,523 +0,0 @@ -# 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 msrest.serialization - - -class ComponentsResource(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(ComponentsResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ApplicationInsightsComponent(ComponentsResource): - """An Application Insights component 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 kind: Required. The kind of application that this component refers to, used to customize - UI. This value is a freeform string, values should typically be one of the following: web, ios, - other, store, java, phone. - :type kind: str - :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field - and cannot be changed. - :vartype application_id: str - :ivar app_id: Application Insights Unique ID for your Application. - :vartype app_id: str - :param application_type: Type of application being monitored. Possible values include: "web", - "other". Default value: "web". - :type application_type: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationType - :param flow_type: Used by the Application Insights system to determine what kind of flow this - component was created by. This is to be set to 'Bluefield' when creating/updating a component - via the REST API. Possible values include: "Bluefield". Default value: "Bluefield". - :type flow_type: str or ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.FlowType - :param request_source: Describes what tool created this Application Insights component. - Customers using this API should set this to the default 'rest'. Possible values include: - "rest". Default value: "rest". - :type request_source: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.RequestSource - :ivar instrumentation_key: Application Insights Instrumentation key. A read-only value that - applications can use to identify the destination for all telemetry sent to Azure Application - Insights. This value will be supplied upon construction of each new Application Insights - component. - :vartype instrumentation_key: str - :ivar creation_date: Creation Date for the Application Insights component, in ISO 8601 format. - :vartype creation_date: ~datetime.datetime - :ivar tenant_id: Azure Tenant Id. - :vartype tenant_id: str - :param hockey_app_id: The unique application ID created when a new application is added to - HockeyApp, used for communications with HockeyApp. - :type hockey_app_id: str - :ivar hockey_app_token: Token used to authenticate communications with between Application - Insights and HockeyApp. - :vartype hockey_app_token: str - :ivar provisioning_state: Current state of this component: whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - :param sampling_percentage: Percentage of the data produced by the application being monitored - that is being sampled for Application Insights telemetry. - :type sampling_percentage: float - :ivar connection_string: Application Insights component connection string. - :vartype connection_string: str - :param retention_in_days: Retention period in days. - :type retention_in_days: int - :param disable_ip_masking: Disable IP masking. - :type disable_ip_masking: bool - :param immediate_purge_data_on30_days: Purge data immediately after 30 days. - :type immediate_purge_data_on30_days: bool - :ivar private_link_scoped_resources: List of linked private link scope resources. - :vartype private_link_scoped_resources: - list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PrivateLinkScopedResource] - :param public_network_access_for_ingestion: The network access type for accessing Application - Insights ingestion. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :type public_network_access_for_ingestion: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType - :param public_network_access_for_query: The network access type for accessing Application - Insights query. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :type public_network_access_for_query: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PublicNetworkAccessType - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "ApplicationInsights". - :type ingestion_mode: str or - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': True}, - 'instrumentation_key': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'hockey_app_token': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'connection_string': {'readonly': True}, - 'private_link_scoped_resources': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, - 'app_id': {'key': 'properties.AppId', 'type': 'str'}, - 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, - 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, - 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, - 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, - 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, - 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, - 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, - 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, - 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, - 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, - 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, - 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, - 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, - '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'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - self.application_id = None - self.app_id = None - self.application_type = kwargs.get('application_type', "web") - self.flow_type = kwargs.get('flow_type', "Bluefield") - self.request_source = kwargs.get('request_source', "rest") - self.instrumentation_key = None - self.creation_date = None - self.tenant_id = None - self.hockey_app_id = kwargs.get('hockey_app_id', None) - self.hockey_app_token = None - self.provisioning_state = None - self.sampling_percentage = kwargs.get('sampling_percentage', None) - self.connection_string = None - self.retention_in_days = kwargs.get('retention_in_days', 90) - self.disable_ip_masking = kwargs.get('disable_ip_masking', None) - self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) - self.private_link_scoped_resources = None - 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', "ApplicationInsights") - - -class ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ApplicationInsightsComponentProactiveDetectionConfiguration(msrest.serialization.Model): - """A ProactiveDetection configuration definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Azure resource Id. - :vartype id: str - :param name: Azure resource name. - :type name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Resource location. - :type location: str - :ivar name_properties_name: The rule name. - :vartype name_properties_name: str - :param enabled: A flag that indicates whether this rule is enabled by the user. - :type enabled: bool - :param send_emails_to_subscription_owners: A flag that indicated whether notifications on this - rule should be sent to subscription owners. - :type send_emails_to_subscription_owners: bool - :param custom_emails: Custom email addresses for this rule notifications. - :type custom_emails: list[str] - :ivar last_updated_time: The last time this rule was updated. - :vartype last_updated_time: str - :param rule_definitions: Static definitions of the ProactiveDetection configuration rule (same - values for all components). - :type rule_definitions: - ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions - """ - - _validation = { - 'id': {'readonly': True}, - 'type': {'readonly': True}, - 'name_properties_name': {'readonly': True}, - 'last_updated_time': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.Name', 'type': 'str'}, - 'enabled': {'key': 'properties.Enabled', 'type': 'bool'}, - 'send_emails_to_subscription_owners': {'key': 'properties.SendEmailsToSubscriptionOwners', 'type': 'bool'}, - 'custom_emails': {'key': 'properties.CustomEmails', 'type': '[str]'}, - 'last_updated_time': {'key': 'properties.LastUpdatedTime', 'type': 'str'}, - 'rule_definitions': {'key': 'properties.RuleDefinitions', 'type': 'ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentProactiveDetectionConfiguration, self).__init__(**kwargs) - self.id = None - self.name = kwargs.get('name', None) - self.type = None - self.location = kwargs.get('location', None) - self.name_properties_name = None - self.enabled = kwargs.get('enabled', None) - self.send_emails_to_subscription_owners = kwargs.get('send_emails_to_subscription_owners', None) - self.custom_emails = kwargs.get('custom_emails', None) - self.last_updated_time = None - self.rule_definitions = kwargs.get('rule_definitions', None) - - -class ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions(msrest.serialization.Model): - """Static definitions of the ProactiveDetection configuration rule (same values for all components). - - :param name: The rule name. - :type name: str - :param display_name: The rule name as it is displayed in UI. - :type display_name: str - :param description: The rule description. - :type description: str - :param help_url: URL which displays additional info about the proactive detection rule. - :type help_url: str - :param is_hidden: A flag indicating whether the rule is hidden (from the UI). - :type is_hidden: bool - :param is_enabled_by_default: A flag indicating whether the rule is enabled by default. - :type is_enabled_by_default: bool - :param is_in_preview: A flag indicating whether the rule is in preview. - :type is_in_preview: bool - :param supports_email_notifications: A flag indicating whether email notifications are - supported for detections for this rule. - :type supports_email_notifications: bool - """ - - _attribute_map = { - 'name': {'key': 'Name', 'type': 'str'}, - 'display_name': {'key': 'DisplayName', 'type': 'str'}, - 'description': {'key': 'Description', 'type': 'str'}, - 'help_url': {'key': 'HelpUrl', 'type': 'str'}, - 'is_hidden': {'key': 'IsHidden', 'type': 'bool'}, - 'is_enabled_by_default': {'key': 'IsEnabledByDefault', 'type': 'bool'}, - 'is_in_preview': {'key': 'IsInPreview', 'type': 'bool'}, - 'supports_email_notifications': {'key': 'SupportsEmailNotifications', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentProactiveDetectionConfigurationPropertiesRuleDefinitions, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display_name = kwargs.get('display_name', None) - self.description = kwargs.get('description', None) - self.help_url = kwargs.get('help_url', None) - self.is_hidden = kwargs.get('is_hidden', None) - self.is_enabled_by_default = kwargs.get('is_enabled_by_default', None) - self.is_in_preview = kwargs.get('is_in_preview', None) - self.supports_email_notifications = kwargs.get('supports_email_notifications', None) - - -class ComponentPurgeBody(msrest.serialization.Model): - """Describes the body of a purge request for an App Insights component. - - All required parameters must be populated in order to send to Azure. - - :param table: Required. Table from which to purge data. - :type table: str - :param filters: Required. The set of columns and filters (queries) to run over them to purge - the resulting data. - :type filters: - list[~azure.mgmt.applicationinsights.v2018_05_01_preview.models.ComponentPurgeBodyFilters] - """ - - _validation = { - 'table': {'required': True}, - 'filters': {'required': True}, - } - - _attribute_map = { - 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBody, self).__init__(**kwargs) - self.table = kwargs['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.Model): - """User-defined filters to return data which will be purged from the table. - - :param column: The column of the table over which the given query should run. - :type column: str - :param operator: A query operator to evaluate over the provided column and value(s). Supported - operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would - in a KQL query. - :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 - :param key: When filtering over custom dimensions, this key will be used as the name of the - custom dimension. - :type key: str - """ - - _attribute_map = { - 'column': {'key': 'column', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBodyFilters, self).__init__(**kwargs) - self.column = kwargs.get('column', None) - self.operator = kwargs.get('operator', None) - self.value = kwargs.get('value', None) - self.key = kwargs.get('key', None) - - -class ComponentPurgeResponse(msrest.serialization.Model): - """Response containing operationId for a specific purge action. - - All required parameters must be populated in order to send to Azure. - - :param operation_id: Required. Id to use when querying for status for a particular purge - operation. - :type operation_id: str - """ - - _validation = { - 'operation_id': {'required': True}, - } - - _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeResponse, self).__init__(**kwargs) - self.operation_id = kwargs['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.Model): - """Response containing status for a specific purge operation. - - All required parameters must be populated in order to send to Azure. - - :param status: Required. Status of the operation represented by the requested Id. Possible - values include: "pending", "completed". - :type status: str or ~azure.mgmt.applicationinsights.v2018_05_01_preview.models.PurgeState - """ - - _validation = { - 'status': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeStatusResponse, self).__init__(**kwargs) - self.status = kwargs['status'] - - -class PrivateLinkScopedResource(msrest.serialization.Model): - """The private link scope resource reference. - - :param resource_id: The full resource Id of the private link scope resource. - :type resource_id: str - :param scope_id: The private link scope unique Identifier. - :type scope_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'ResourceId', 'type': 'str'}, - 'scope_id': {'key': 'ScopeId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkScopedResource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.scope_id = kwargs.get('scope_id', None) - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py deleted file mode 100644 index c967abd5ee8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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.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.v2018_06_17_preview.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._deserialize = Deserializer(client_models) - - self.workbooks = WorkbooksOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py deleted file mode 100644 index 8c916252b09..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 = "2018-06-17-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py deleted file mode 100644 index 39e879c6ea3..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py deleted file mode 100644 index 15193e949f1..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/aio/operations/_workbooks_operations.py +++ /dev/null @@ -1,397 +0,0 @@ -# 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.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_by_resource_group( - self, - resource_group_name: str, - category: Union[str, "_models.CategoryType"], - source_id: str, - tags: Optional[List[str]] = None, - can_fetch_content: Optional[bool] = None, - **kwargs - ) -> 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.v2018_06_17_preview.models.CategoryType - :param source_id: Azure Resource Id that will fetch all related workbooks. - :type source_id: str - :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.v2018_06_17_preview.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 = "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_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\._\(\)]+$'), - } - 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=',') - 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 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 - ) -> "_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.v2018_06_17_preview.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 = "2018-06-17-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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 - ) -> 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 = "2018-06-17-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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 [201, 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, - source_id: str, - workbook_properties: "_models.Workbook", - **kwargs - ) -> "_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 source_id: Azure Resource Id that will fetch all related workbooks. - :type source_id: str - :param workbook_properties: Properties that need to be specified to create a new workbook. - :type workbook_properties: ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook - :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.v2018_06_17_preview.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 = "2018-06-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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['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: str, - workbook_update_parameters: Optional["_models.WorkbookUpdateParameters"] = None, - **kwargs - ) -> "_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 related 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.v2018_06_17_preview.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.v2018_06_17_preview.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 = "2018-06-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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['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 [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 - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/workbooks/{resourceName}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py index a60769881b5..58cdd8f7e08 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/__init__.py @@ -6,20 +6,12 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ErrorFieldContract - from ._models_py3 import Resource - from ._models_py3 import Workbook - from ._models_py3 import WorkbookError - from ._models_py3 import WorkbookUpdateParameters - from ._models_py3 import WorkbooksListResult -except (SyntaxError, ImportError): - from ._models import ErrorFieldContract # type: ignore - from ._models import Resource # type: ignore - from ._models import Workbook # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookUpdateParameters # type: ignore - from ._models import WorkbooksListResult # type: ignore +from ._models_py3 import ErrorFieldContract +from ._models_py3 import Resource +from ._models_py3 import Workbook +from ._models_py3 import WorkbookError +from ._models_py3 import WorkbookUpdateParameters +from ._models_py3 import WorkbooksListResult from ._application_insights_management_client_enums import ( CategoryType, diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py deleted file mode 100644 index c939e1e6545..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2018_06_17_preview/models/_models.py +++ /dev/null @@ -1,262 +0,0 @@ -# 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 ErrorFieldContract(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(ErrorFieldContract, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - - -class Resource(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. This is GUID value. The display name should be assigned within - properties field. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param kind: The kind of workbook. Choices are user and shared. Possible values include: - "user", "shared". - :type kind: str or ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind - :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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.kind = kwargs.get('kind', None) - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class Workbook(Resource): - """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: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. This is GUID value. The display name should be assigned within - properties field. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param kind: The kind of workbook. Choices are user and shared. Possible values include: - "user", "shared". - :type kind: str or ~azure.mgmt.applicationinsights.v2018_06_17_preview.models.SharedTypeKind - :param location: Required. Resource location. - :type location: str - :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 - :ivar time_modified: Date and time in UTC of the last modification that was made to this - workbook definition. - :vartype time_modified: str - :param category: Workbook category, as defined by the user at creation time. - :type category: str - :param version: Workbook version. - :type version: 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] - :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 - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'time_modified': {'readonly': True}, - 'user_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'serialized_data': {'key': 'properties.serializedData', 'type': 'str'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'str'}, - 'category': {'key': 'properties.category', 'type': 'str'}, - 'version': {'key': 'properties.version', 'type': 'str'}, - 'tags_properties_tags': {'key': 'properties.tags', 'type': '[str]'}, - 'user_id': {'key': 'properties.userId', 'type': 'str'}, - 'source_id': {'key': 'properties.sourceId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Workbook, self).__init__(**kwargs) - self.display_name = kwargs.get('display_name', None) - self.serialized_data = kwargs.get('serialized_data', None) - self.time_modified = None - self.category = kwargs.get('category', None) - self.version = kwargs.get('version', None) - self.tags_properties_tags = kwargs.get('tags_properties_tags', None) - self.user_id = None - self.source_id = kwargs.get('source_id', None) - - -class WorkbookError(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.v2018_06_17_preview.models.ErrorFieldContract] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbookError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - - -class WorkbooksListResult(msrest.serialization.Model): - """Workbook list result. - - :param value: An array of workbooks. - :type value: list[~azure.mgmt.applicationinsights.v2018_06_17_preview.models.Workbook] - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Workbook]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbooksListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', 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.v2018_06_17_preview.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] - """ - - _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]'}, - } - - 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) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py deleted file mode 100644 index 9ebe51052e6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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.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.v2019_10_17_preview.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._deserialize = Deserializer(client_models) - - self.workbook_templates = WorkbookTemplatesOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py deleted file mode 100644 index 2d21e7e4eb2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 = "2019-10-17-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py deleted file mode 100644 index b456b5421cc..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py deleted file mode 100644 index 8272ba6cd09..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/aio/operations/_workbook_templates_operations.py +++ /dev/null @@ -1,371 +0,0 @@ -# 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.v2019_10_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_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> 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.v2019_10_17_preview.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 = "2019-10-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_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\._\(\)]+$'), - } - 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.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/workbooktemplates'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_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.v2019_10_17_preview.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 = "2019-10-17-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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('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 - ) -> 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 = "2019-10-17-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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/workbooktemplates/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - workbook_template_properties: "_models.WorkbookTemplate", - **kwargs - ) -> "_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.v2019_10_17_preview.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.v2019_10_17_preview.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 = "2019-10-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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.WorkbookError, 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 - ) -> "_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.v2019_10_17_preview.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.v2019_10_17_preview.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 = "2019-10-17-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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.WorkbookError, 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py index b3b5566499a..51d8f690313 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/__init__.py @@ -6,24 +6,14 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ErrorFieldContract - from ._models_py3 import WorkbookError - from ._models_py3 import WorkbookTemplate - 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 ErrorFieldContract # type: ignore - from ._models import WorkbookError # type: ignore - from ._models import WorkbookTemplate # 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 +from ._models_py3 import ErrorFieldContract +from ._models_py3 import WorkbookError +from ._models_py3 import WorkbookTemplate +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 __all__ = [ 'ErrorFieldContract', diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py deleted file mode 100644 index eaaf4ac8eb7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2019_10_17_preview/models/_models.py +++ /dev/null @@ -1,298 +0,0 @@ -# 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 ErrorFieldContract(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(ErrorFieldContract, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.target = kwargs.get('target', None) - - -class WorkbookError(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.v2019_10_17_preview.models.ErrorFieldContract] - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, - } - - def __init__( - self, - **kwargs - ): - super(WorkbookError, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) - - -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: object - :param galleries: Workbook galleries supported by the template. - :type galleries: - list[~azure.mgmt.applicationinsights.v2019_10_17_preview.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.v2019_10_17_preview.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 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: object - :param galleries: Workbook galleries supported by the template. - :type galleries: - list[~azure.mgmt.applicationinsights.v2019_10_17_preview.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.v2019_10_17_preview.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: object - :param galleries: Workbook galleries supported by the template. - :type galleries: - list[~azure.mgmt.applicationinsights.v2019_10_17_preview.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.v2019_10_17_preview.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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py deleted file mode 100644 index a1265ffd1e4..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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.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 ComponentsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar components: ComponentsOperations operations - :vartype components: azure.mgmt.applicationinsights.v2020_02_02_preview.aio.operations.ComponentsOperations - :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._deserialize = Deserializer(client_models) - - self.components = ComponentsOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py deleted file mode 100644 index 95031190304..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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-02-02-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py deleted file mode 100644 index fe05c3b452b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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 ._components_operations import ComponentsOperations - -__all__ = [ - 'ComponentsOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py deleted file mode 100644 index bf7af5e92c7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py +++ /dev/null @@ -1,569 +0,0 @@ -# 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 ComponentsOperations: - """ComponentsOperations 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_02_02_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 - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of all Application Insights components within a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - 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('ApplicationInsightsComponentListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/components'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.ApplicationInsightsComponentListResult"]: - """Gets a list of Application Insights components within a 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 ApplicationInsightsComponentListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-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_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\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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('ApplicationInsightsComponentListResult', 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_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> None: - """Deletes an Application Insights component. - - :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-02-02-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - resource_name: str, - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Returns an Application Insights component. - - :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: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - resource_name: str, - insight_properties: "_models.ApplicationInsightsComponent", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Creates (or updates) an Application Insights component. Note: You cannot specify a different - value for InstrumentationKey nor AppId in the Put operation. - - :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 insight_properties: Properties that need to be specified to create an Application - Insights component. - :type insight_properties: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(insight_properties, 'ApplicationInsightsComponent') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - resource_name: str, - component_tags: "_models.TagsResource", - **kwargs - ) -> "_models.ApplicationInsightsComponent": - """Updates an existing component's tags. To update other fields use the CreateOrUpdate method. - - :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 component_tags: Updated tag information to set into the component instance. - :type component_tags: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ApplicationInsightsComponent, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ApplicationInsightsComponent"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(component_tags, 'TagsResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}'} # type: ignore - - async def purge( - self, - resource_group_name: str, - resource_name: str, - body: "_models.ComponentPurgeBody", - **kwargs - ) -> "_models.ComponentPurgeResponse": - """Purges data in an Application Insights component by a set of user-defined filters. - - In order to manage system resources, purge requests are throttled at 50 requests per hour. You - should batch the execution of purge requests by sending a single command whose predicate - includes all user identities that require purging. Use the in operator to specify multiple - identities. You should run the query prior to using for a purge request to verify that the - results are expected. - - :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 body: Describes the body of a request to purge data in a single table of an Application - Insights component. - :type body: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBody - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(body, 'ComponentPurgeBody') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/purge'} # type: ignore - - async def get_purge_status( - self, - resource_group_name: str, - resource_name: str, - purge_id: str, - **kwargs - ) -> "_models.ComponentPurgeStatusResponse": - """Get status for an ongoing purge operation. - - :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 purge_id: In a purge status request, this is the Id of the operation the status of which - is returned. - :type purge_id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentPurgeStatusResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeStatusResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentPurgeStatusResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-02-02-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get_purge_status.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/components/{resourceName}/operations/{purgeId}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py index 9d810722c16..1e69edf5645 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/__init__.py @@ -6,32 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ApplicationInsightsComponent - from ._models_py3 import ApplicationInsightsComponentListResult - from ._models_py3 import ComponentPurgeBody - from ._models_py3 import ComponentPurgeBodyFilters - from ._models_py3 import ComponentPurgeResponse - from ._models_py3 import ComponentPurgeStatusResponse - from ._models_py3 import ComponentsResource - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import PrivateLinkScopedResource - from ._models_py3 import TagsResource -except (SyntaxError, ImportError): - from ._models import ApplicationInsightsComponent # type: ignore - from ._models import ApplicationInsightsComponentListResult # type: ignore - from ._models import ComponentPurgeBody # type: ignore - from ._models import ComponentPurgeBodyFilters # type: ignore - from ._models import ComponentPurgeResponse # type: ignore - from ._models import ComponentPurgeStatusResponse # type: ignore - from ._models import ComponentsResource # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import PrivateLinkScopedResource # type: ignore - from ._models import TagsResource # type: ignore +from ._models_py3 import ApplicationInsightsComponent +from ._models_py3 import ApplicationInsightsComponentListResult +from ._models_py3 import ComponentPurgeBody +from ._models_py3 import ComponentPurgeBodyFilters +from ._models_py3 import ComponentPurgeResponse +from ._models_py3 import ComponentPurgeStatusResponse +from ._models_py3 import ComponentsResource +from ._models_py3 import ErrorAdditionalInfo +from ._models_py3 import ErrorDetail +from ._models_py3 import ErrorResponse +from ._models_py3 import PrivateLinkScopedResource +from ._models_py3 import TagsResource from ._application_insights_management_client_enums import ( ApplicationType, diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py deleted file mode 100644 index 82c36e2e084..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_02_02_preview/models/_models.py +++ /dev/null @@ -1,525 +0,0 @@ -# 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 ComponentsResource(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(ComponentsResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class ApplicationInsightsComponent(ComponentsResource): - """An Application Insights component 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 kind: Required. The kind of application that this component refers to, used to customize - UI. This value is a freeform string, values should typically be one of the following: web, ios, - other, store, java, phone. - :type kind: str - :param etag: Resource etag. - :type etag: str - :ivar application_id: The unique ID of your application. This field mirrors the 'Name' field - and cannot be changed. - :vartype application_id: str - :ivar app_id: Application Insights Unique ID for your Application. - :vartype app_id: str - :ivar name_properties_name: Application name. - :vartype name_properties_name: str - :param application_type: Type of application being monitored. Possible values include: "web", - "other". Default value: "web". - :type application_type: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationType - :param flow_type: Used by the Application Insights system to determine what kind of flow this - component was created by. This is to be set to 'Bluefield' when creating/updating a component - via the REST API. Possible values include: "Bluefield". Default value: "Bluefield". - :type flow_type: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.FlowType - :param request_source: Describes what tool created this Application Insights component. - Customers using this API should set this to the default 'rest'. Possible values include: - "rest". Default value: "rest". - :type request_source: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.RequestSource - :ivar instrumentation_key: Application Insights Instrumentation key. A read-only value that - applications can use to identify the destination for all telemetry sent to Azure Application - Insights. This value will be supplied upon construction of each new Application Insights - component. - :vartype instrumentation_key: str - :ivar creation_date: Creation Date for the Application Insights component, in ISO 8601 format. - :vartype creation_date: ~datetime.datetime - :ivar tenant_id: Azure Tenant Id. - :vartype tenant_id: str - :param hockey_app_id: The unique application ID created when a new application is added to - HockeyApp, used for communications with HockeyApp. - :type hockey_app_id: str - :ivar hockey_app_token: Token used to authenticate communications with between Application - Insights and HockeyApp. - :vartype hockey_app_token: str - :ivar provisioning_state: Current state of this component: whether or not is has been - provisioned within the resource group it is defined. Users cannot change this value but are - able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - :vartype provisioning_state: str - :param sampling_percentage: Percentage of the data produced by the application being monitored - that is being sampled for Application Insights telemetry. - :type sampling_percentage: float - :ivar connection_string: Application Insights component connection string. - :vartype connection_string: str - :ivar retention_in_days: Retention period in days. - :vartype retention_in_days: int - :param disable_ip_masking: Disable IP masking. - :type disable_ip_masking: bool - :param immediate_purge_data_on30_days: Purge data immediately after 30 days. - :type immediate_purge_data_on30_days: bool - :param workspace_resource_id: Resource Id of the log analytics workspace which the data will be - ingested to. This property is required to create an application with this API version. - Applications from older versions will not have this property. - :type workspace_resource_id: str - :ivar la_migration_date: The date which the component got migrated to LA, in ISO 8601 format. - :vartype la_migration_date: ~datetime.datetime - :ivar private_link_scoped_resources: List of linked private link scope resources. - :vartype private_link_scoped_resources: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PrivateLinkScopedResource] - :param public_network_access_for_ingestion: The network access type for accessing Application - Insights ingestion. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :type public_network_access_for_ingestion: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType - :param public_network_access_for_query: The network access type for accessing Application - Insights query. Possible values include: "Enabled", "Disabled". Default value: "Enabled". - :type public_network_access_for_query: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PublicNetworkAccessType - :param ingestion_mode: Indicates the flow of the ingestion. Possible values include: - "ApplicationInsights", "ApplicationInsightsWithDiagnosticSettings", "LogAnalytics". Default - value: "LogAnalytics". - :type ingestion_mode: str or - ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.IngestionMode - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'required': True}, - 'application_id': {'readonly': True}, - 'app_id': {'readonly': True}, - 'name_properties_name': {'readonly': True}, - 'instrumentation_key': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'hockey_app_token': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'connection_string': {'readonly': True}, - 'retention_in_days': {'readonly': True}, - 'la_migration_date': {'readonly': True}, - 'private_link_scoped_resources': {'readonly': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'application_id': {'key': 'properties.ApplicationId', 'type': 'str'}, - 'app_id': {'key': 'properties.AppId', 'type': 'str'}, - 'name_properties_name': {'key': 'properties.Name', 'type': 'str'}, - 'application_type': {'key': 'properties.Application_Type', 'type': 'str'}, - 'flow_type': {'key': 'properties.Flow_Type', 'type': 'str'}, - 'request_source': {'key': 'properties.Request_Source', 'type': 'str'}, - 'instrumentation_key': {'key': 'properties.InstrumentationKey', 'type': 'str'}, - 'creation_date': {'key': 'properties.CreationDate', 'type': 'iso-8601'}, - 'tenant_id': {'key': 'properties.TenantId', 'type': 'str'}, - 'hockey_app_id': {'key': 'properties.HockeyAppId', 'type': 'str'}, - 'hockey_app_token': {'key': 'properties.HockeyAppToken', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'sampling_percentage': {'key': 'properties.SamplingPercentage', 'type': 'float'}, - 'connection_string': {'key': 'properties.ConnectionString', 'type': 'str'}, - 'retention_in_days': {'key': 'properties.RetentionInDays', 'type': 'int'}, - 'disable_ip_masking': {'key': 'properties.DisableIpMasking', 'type': 'bool'}, - 'immediate_purge_data_on30_days': {'key': 'properties.ImmediatePurgeDataOn30Days', 'type': 'bool'}, - 'workspace_resource_id': {'key': 'properties.WorkspaceResourceId', 'type': 'str'}, - 'la_migration_date': {'key': 'properties.LaMigrationDate', 'type': 'iso-8601'}, - 'private_link_scoped_resources': {'key': 'properties.PrivateLinkScopedResources', 'type': '[PrivateLinkScopedResource]'}, - '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'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponent, self).__init__(**kwargs) - self.kind = kwargs['kind'] - self.etag = kwargs.get('etag', None) - self.application_id = None - self.app_id = None - self.name_properties_name = None - self.application_type = kwargs.get('application_type', "web") - self.flow_type = kwargs.get('flow_type', "Bluefield") - self.request_source = kwargs.get('request_source', "rest") - self.instrumentation_key = None - self.creation_date = None - self.tenant_id = None - self.hockey_app_id = kwargs.get('hockey_app_id', None) - self.hockey_app_token = None - self.provisioning_state = None - self.sampling_percentage = kwargs.get('sampling_percentage', None) - self.connection_string = None - self.retention_in_days = None - self.disable_ip_masking = kwargs.get('disable_ip_masking', None) - self.immediate_purge_data_on30_days = kwargs.get('immediate_purge_data_on30_days', None) - self.workspace_resource_id = kwargs.get('workspace_resource_id', None) - self.la_migration_date = None - self.private_link_scoped_resources = None - 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") - - -class ApplicationInsightsComponentListResult(msrest.serialization.Model): - """Describes the list of Application Insights Resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Application Insights component definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ApplicationInsightsComponent] - :param next_link: The URI to get the next set of Application Insights component definitions if - too many components where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ApplicationInsightsComponent]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ApplicationInsightsComponentListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class ComponentPurgeBody(msrest.serialization.Model): - """Describes the body of a purge request for an App Insights component. - - All required parameters must be populated in order to send to Azure. - - :param table: Required. Table from which to purge data. - :type table: str - :param filters: Required. The set of columns and filters (queries) to run over them to purge - the resulting data. - :type filters: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ComponentPurgeBodyFilters] - """ - - _validation = { - 'table': {'required': True}, - 'filters': {'required': True}, - } - - _attribute_map = { - 'table': {'key': 'table', 'type': 'str'}, - 'filters': {'key': 'filters', 'type': '[ComponentPurgeBodyFilters]'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBody, self).__init__(**kwargs) - self.table = kwargs['table'] - self.filters = kwargs['filters'] - - -class ComponentPurgeBodyFilters(msrest.serialization.Model): - """User-defined filters to return data which will be purged from the table. - - :param column: The column of the table over which the given query should run. - :type column: str - :param operator: A query operator to evaluate over the provided column and value(s). Supported - operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would - in a KQL query. - :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 - :param key: When filtering over custom dimensions, this key will be used as the name of the - custom dimension. - :type key: str - """ - - _attribute_map = { - 'column': {'key': 'column', 'type': 'str'}, - 'operator': {'key': 'operator', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'object'}, - 'key': {'key': 'key', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeBodyFilters, self).__init__(**kwargs) - self.column = kwargs.get('column', None) - self.operator = kwargs.get('operator', None) - self.value = kwargs.get('value', None) - self.key = kwargs.get('key', None) - - -class ComponentPurgeResponse(msrest.serialization.Model): - """Response containing operationId for a specific purge action. - - All required parameters must be populated in order to send to Azure. - - :param operation_id: Required. Id to use when querying for status for a particular purge - operation. - :type operation_id: str - """ - - _validation = { - 'operation_id': {'required': True}, - } - - _attribute_map = { - 'operation_id': {'key': 'operationId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeResponse, self).__init__(**kwargs) - self.operation_id = kwargs['operation_id'] - - -class ComponentPurgeStatusResponse(msrest.serialization.Model): - """Response containing status for a specific purge operation. - - All required parameters must be populated in order to send to Azure. - - :param status: Required. Status of the operation represented by the requested Id. Possible - values include: "pending", "completed". - :type status: str or ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.PurgeState - """ - - _validation = { - 'status': {'required': True}, - } - - _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentPurgeStatusResponse, self).__init__(**kwargs) - self.status = kwargs['status'] - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: object - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: - list[~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :param error: The error object. - :type error: ~azure.mgmt.applicationinsights.v2020_02_02_preview.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class PrivateLinkScopedResource(msrest.serialization.Model): - """The private link scope resource reference. - - :param resource_id: The full resource Id of the private link scope resource. - :type resource_id: str - :param scope_id: The private link scope unique Identifier. - :type scope_id: str - """ - - _attribute_map = { - 'resource_id': {'key': 'ResourceId', 'type': 'str'}, - 'scope_id': {'key': 'ScopeId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(PrivateLinkScopedResource, self).__init__(**kwargs) - self.resource_id = kwargs.get('resource_id', None) - self.scope_id = kwargs.get('scope_id', None) - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a WebTest instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py deleted file mode 100644 index a25e66a7aa2..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,62 +0,0 @@ -# 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.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 ComponentLinkedStorageAccountsOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar component_linked_storage_accounts: ComponentLinkedStorageAccountsOperations operations - :vartype component_linked_storage_accounts: azure.mgmt.applicationinsights.v2020_03_01_preview.aio.operations.ComponentLinkedStorageAccountsOperations - :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._deserialize = Deserializer(client_models) - - self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py deleted file mode 100644 index 001acfd30f6..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/_configuration.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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-03-01-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py deleted file mode 100644 index 76752d736cf..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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 ._component_linked_storage_accounts_operations import ComponentLinkedStorageAccountsOperations - -__all__ = [ - 'ComponentLinkedStorageAccountsOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py deleted file mode 100644 index 13409253313..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/aio/operations/_component_linked_storage_accounts_operations.py +++ /dev/null @@ -1,312 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentLinkedStorageAccountsOperations: - """ComponentLinkedStorageAccountsOperations 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_03_01_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 - - async def get( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """Returns the current linked storage settings for an Application Insights component. - - :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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def create_and_update( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccounts", - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """Replace current linked storage account for an Application Insights component. - - :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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :param linked_storage_accounts_properties: Properties that need to be specified to update - linked storage accounts for an Application Insights component. - :type linked_storage_accounts_properties: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - 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(linked_storage_accounts_properties, 'ComponentLinkedStorageAccounts') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_and_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def update( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - linked_storage_accounts_properties: "_models.ComponentLinkedStorageAccountsPatch", - **kwargs - ) -> "_models.ComponentLinkedStorageAccounts": - """Update linked storage accounts for an Application Insights component. - - :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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :param linked_storage_accounts_properties: Properties that need to be specified to update a - linked storage accounts for an Application Insights component. - :type linked_storage_accounts_properties: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccountsPatch - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ComponentLinkedStorageAccounts, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.ComponentLinkedStorageAccounts - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentLinkedStorageAccounts"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - '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'), - } - 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(linked_storage_accounts_properties, 'ComponentLinkedStorageAccountsPatch') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ComponentLinkedStorageAccounts', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - resource_name: str, - storage_type: Union[str, "_models.StorageType"], - **kwargs - ) -> None: - """Delete linked storage accounts for an Application Insights component. - - :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 storage_type: The type of the Application Insights component data source for the linked - storage account. - :type storage_type: str or ~azure.mgmt.applicationinsights.v2020_03_01_preview.models.StorageType - :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-03-01-preview" - accept = "application/json" - - # 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\._\(\)]+$'), - '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'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/components/{resourceName}/linkedStorageAccounts/{storageType}'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py index 7177ea6248e..2f039257527 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/__init__.py @@ -6,18 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ComponentLinkedStorageAccounts - from ._models_py3 import ComponentLinkedStorageAccountsPatch - from ._models_py3 import ErrorResponse - 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 ProxyResource # type: ignore - from ._models import Resource # type: ignore +from ._models_py3 import ComponentLinkedStorageAccounts +from ._models_py3 import ComponentLinkedStorageAccountsPatch +from ._models_py3 import ErrorResponse +from ._models_py3 import ProxyResource +from ._models_py3 import Resource from ._application_insights_management_client_enums import ( StorageType, diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py deleted file mode 100644 index b954ae2a0c8..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_03_01_preview/models/_models.py +++ /dev/null @@ -1,161 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class 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. - - :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 linked_storage_account: Linked storage account resource ID. - :type linked_storage_account: 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'}, - 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentLinkedStorageAccounts, self).__init__(**kwargs) - self.linked_storage_account = kwargs.get('linked_storage_account', None) - - -class ComponentLinkedStorageAccountsPatch(msrest.serialization.Model): - """An Application Insights component linked storage accounts patch. - - :param linked_storage_account: Linked storage account resource ID. - :type linked_storage_account: str - """ - - _attribute_map = { - 'linked_storage_account': {'key': 'properties.linkedStorageAccount', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ComponentLinkedStorageAccountsPatch, self).__init__(**kwargs) - 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. - - :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) diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -# 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py deleted file mode 100644 index 8d679cb987b..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,64 +0,0 @@ -# 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.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 Operations -from .operations import LiveTokenOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.Operations - :ivar live_token: LiveTokenOperations operations - :vartype live_token: azure.mgmt.applicationinsights.v2020_06_02_preview.aio.operations.LiveTokenOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param str base_url: Service URL - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) - - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.live_token = LiveTokenOperations( - self._client, self._config, self._serialize, self._deserialize) - - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py deleted file mode 100644 index ddbefbad664..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/_configuration.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from typing import Any, TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from azure.core.credentials_async import AsyncTokenCredential - -VERSION = "unknown" - -class 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 - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - **kwargs: Any - ) -> None: - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.api_version = "2020-06-02-preview" - 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/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py deleted file mode 100644 index de4575d9afa..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from ._operations import Operations -from ._live_token_operations import LiveTokenOperations - -__all__ = [ - 'Operations', - 'LiveTokenOperations', -] diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py deleted file mode 100644 index 21ab9344ff7..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_live_token_operations.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class LiveTokenOperations: - """LiveTokenOperations 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_06_02_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 - - async def get( - self, - resource_uri: str, - **kwargs - ) -> "_models.LiveTokenResponse": - """**Gets an access token for live metrics stream data.**. - - :param resource_uri: The identifier of the resource. - :type resource_uri: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LiveTokenResponse, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.LiveTokenResponse - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LiveTokenResponse"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str', skip_quote=True), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LiveTokenResponse', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/{resourceUri}/providers/microsoft.insights/generatelivetoken'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py deleted file mode 100644 index cbbedbeb90e..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/aio/operations/_operations.py +++ /dev/null @@ -1,106 +0,0 @@ -# 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.v2020_06_02_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 - ) -> AsyncIterable["_models.OperationsListResult"]: - """List available operations. - - List the available operations supported by the resource provider. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationsListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationsListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationsListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02-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('OperationsListResult', 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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/microsoft.insights/operations'} # type: ignore diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py index eab81c1fd8f..0a24847e917 100644 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py +++ b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/__init__.py @@ -6,18 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ErrorResponse - 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 LiveTokenResponse # type: ignore - from ._models import OperationInfo # type: ignore - from ._models import OperationLive # type: ignore - from ._models import OperationsListResult # type: ignore +from ._models_py3 import ErrorResponse +from ._models_py3 import LiveTokenResponse +from ._models_py3 import OperationInfo +from ._models_py3 import OperationLive +from ._models_py3 import OperationsListResult __all__ = [ 'ErrorResponse', diff --git a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py b/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py deleted file mode 100644 index e69445bff0a..00000000000 --- a/src/application-insights/azext_applicationinsights/vendored_sdks/mgmt_applicationinsights/v2020_06_02_preview/models/_models.py +++ /dev/null @@ -1,143 +0,0 @@ -# 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 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 LiveTokenResponse(msrest.serialization.Model): - """The response to a live token query. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar live_token: JWT token for accessing live metrics stream data. - :vartype live_token: str - """ - - _validation = { - 'live_token': {'readonly': True}, - } - - _attribute_map = { - 'live_token': {'key': 'liveToken', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LiveTokenResponse, self).__init__(**kwargs) - self.live_token = None - - -class OperationInfo(msrest.serialization.Model): - """Information about an operation. - - :param provider: Name of the provider. - :type provider: str - :param resource: Name of the resource type. - :type resource: str - :param operation: Name of the operation. - :type operation: str - :param description: Description of the operation. - :type description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationInfo, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class OperationLive(msrest.serialization.Model): - """Represents an operation returned by the GetOperations request. - - :param name: Name of the operation. - :type name: str - :param display: Display name of the operation. - :type display: ~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationInfo - :param origin: Origin of the operation. - :type origin: str - :param properties: Properties of the operation. - :type properties: object - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationInfo'}, - 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationLive, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - self.properties = kwargs.get('properties', None) - - -class OperationsListResult(msrest.serialization.Model): - """Result of the List Operations operation. - - :param value: A collection of operations. - :type value: list[~azure.mgmt.applicationinsights.v2020_06_02_preview.models.OperationLive] - :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': '[OperationLive]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationsListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) diff --git a/src/application-insights/setup.py b/src/application-insights/setup.py index ad0484bab74..fca251a3a37 100644 --- a/src/application-insights/setup.py +++ b/src/application-insights/setup.py @@ -8,19 +8,17 @@ from codecs import open from setuptools import setup, find_packages -VERSION = "0.1.17" +VERSION = "0.1.18" CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'License :: OSI Approved :: MIT License', ]