From 1f380dbea855cfaee49669fb20943ffe4b9a7d6f Mon Sep 17 00:00:00 2001 From: "Kaihui (Kerwin) Sun" Date: Thu, 4 Feb 2021 17:03:16 +0800 Subject: [PATCH] T2 applicationinsights 2021 02 04 (#16525) * CodeGen from PR 12833 in Azure/azure-rest-api-specs add python track2 for applicationinsights (#12833) * test,version,CHANGELOG * fix changelog and version Co-authored-by: SDKAuto --- .../CHANGELOG.md | 16 + .../azure-mgmt-applicationinsights/README.md | 8 +- .../mgmt/applicationinsights/_version.py | 2 +- ..._application_insights_management_client.py | 1 - .../v2015_05_01/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - ..._application_insights_management_client.py | 1 - .../v2017_10_01/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - ..._application_insights_management_client.py | 1 - .../v2018_05_01_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - ..._application_insights_management_client.py | 1 - .../v2018_06_17_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - .../v2019_09_01_preview/__init__.py | 16 - ..._application_insights_management_client.py | 79 -- .../v2019_09_01_preview/_configuration.py | 70 -- .../v2019_09_01_preview/_metadata.json | 63 -- .../v2019_09_01_preview/aio/__init__.py | 10 - ..._application_insights_management_client.py | 73 -- .../v2019_09_01_preview/aio/_configuration.py | 66 -- .../aio/operations/__init__.py | 17 - .../aio/operations/_operations.py | 105 --- .../aio/operations/_queries_operations.py | 504 ----------- .../aio/operations/_query_packs_operations.py | 431 ---------- .../v2019_09_01_preview/models/__init__.py | 75 -- ...cation_insights_management_client_enums.py | 36 - .../v2019_09_01_preview/models/_models.py | 699 ---------------- .../v2019_09_01_preview/models/_models_py3.py | 779 ------------------ .../operations/__init__.py | 17 - .../operations/_operations.py | 110 --- .../operations/_queries_operations.py | 514 ------------ .../operations/_query_packs_operations.py | 441 ---------- .../v2019_09_01_preview/py.typed | 1 - ..._application_insights_management_client.py | 1 - .../v2019_10_17_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - ..._application_insights_management_client.py | 1 - .../v2020_02_02_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - .../aio/operations/_components_operations.py | 26 +- .../v2020_02_02_preview/models/__init__.py | 9 + .../v2020_02_02_preview/models/_models.py | 110 ++- .../v2020_02_02_preview/models/_models_py3.py | 113 ++- .../operations/_components_operations.py | 26 +- ..._application_insights_management_client.py | 1 - .../v2020_03_01_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - ..._application_insights_management_client.py | 1 - .../v2020_06_02_preview/_metadata.json | 2 +- ..._application_insights_management_client.py | 1 - 52 files changed, 292 insertions(+), 4156 deletions(-) delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/__init__.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_application_insights_management_client.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_configuration.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_metadata.json delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/__init__.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_application_insights_management_client.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_configuration.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/__init__.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_queries_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_query_packs_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/__init__.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_application_insights_management_client_enums.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models_py3.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/__init__.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_queries_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py delete mode 100644 sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/py.typed diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/CHANGELOG.md b/sdk/applicationinsights/azure-mgmt-applicationinsights/CHANGELOG.md index 1227a94eab09..1452c99a0eb9 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/CHANGELOG.md +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/CHANGELOG.md @@ -1,5 +1,21 @@ # Release History +## 1.0.0 (2021-02-04) + +**Features** + + - Model ApplicationInsightsComponent has a new parameter etag + - Model ApplicationInsightsComponent has a new parameter name_properties_name + +**Breaking changes** + + - Model OperationDisplay no longer has parameter description + - Model Operation no longer has parameter is_data_action + - Model Operation no longer has parameter origin + - Model ErrorDetail has a new signature + - Removed operation group QueryPacksOperations + - Removed operation group QueriesOperations + ## 1.0.0b1 (2020-12-08) This is beta preview version. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/README.md b/sdk/applicationinsights/azure-mgmt-applicationinsights/README.md index 9e599998af74..27dc349c7b12 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/README.md +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/README.md @@ -15,18 +15,16 @@ library. For a more complete set of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). -## Usage +# Usage To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) - + For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) -Code samples for this package can be found at [Application Insights Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Code samples for this package can be found at [Applicationinsights Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) - - ## Provide Feedback If you encounter any bugs or have suggestions, please file an issue in diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_version.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_version.py index 515f51c112dd..6fbca6ef56c6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_version.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/_version.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "1.0.0" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py index d16035cb510e..010e6d628148 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_application_insights_management_client.py @@ -97,7 +97,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json index 0c3af654ebdd..89e012f2eb44 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py index 816bb1143470..416f313eb50f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2015_05_01/aio/_application_insights_management_client.py @@ -94,7 +94,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py index b5056e5d32c3..7140bacc6a02 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_application_insights_management_client.py @@ -58,7 +58,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json index 606c79a46368..8772b35b85d1 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py index 7324d9a81b4c..7e1fe352b48d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2017_10_01/aio/_application_insights_management_client.py @@ -55,7 +55,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.ea_subscription_migrate_to_new_pricing_model = EASubscriptionMigrateToNewPricingModelOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_application_insights_management_client.py index 474d1e7afbd8..db9491430691 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_application_insights_management_client.py @@ -52,7 +52,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_metadata.json index d87219046001..3ec60e047609 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py index 55cdbbb2397a..d78d676a1f5e 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_05_01_preview/aio/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.proactive_detection_configurations = ProactiveDetectionConfigurationsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py index e075818ea1dc..cdaba46eeb02 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbooks = WorkbooksOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json index 7ac952897e4a..11436c328a46 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py index 46e6d3f17710..c967abd5ee8a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2018_06_17_preview/aio/_application_insights_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbooks = WorkbooksOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/__init__.py deleted file mode 100644 index 7a2772ea1db5..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/__init__.py +++ /dev/null @@ -1,16 +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'] - -try: - from ._patch import patch_sdk # type: ignore - patch_sdk() -except ImportError: - pass diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_application_insights_management_client.py deleted file mode 100644 index fa8c526893f2..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_application_insights_management_client.py +++ /dev/null @@ -1,79 +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 TYPE_CHECKING - -from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Optional - - from azure.core.credentials import TokenCredential - -from ._configuration import ApplicationInsightsManagementClientConfiguration -from .operations import QueriesOperations -from .operations import Operations -from .operations import QueryPacksOperations -from . import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar queries: QueriesOperations operations - :vartype queries: azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2019_09_01_preview.operations.Operations - :ivar query_packs: QueryPacksOperations operations - :vartype query_packs: azure.mgmt.applicationinsights.v2019_09_01_preview.operations.QueryPacksOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> None - if not base_url: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.queries = QueriesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.query_packs = QueryPacksOperations( - self._client, self._config, self._serialize, self._deserialize) - - def close(self): - # type: () -> None - self._client.close() - - def __enter__(self): - # type: () -> ApplicationInsightsManagementClient - self._client.__enter__() - return self - - def __exit__(self, *exc_details): - # type: (Any) -> None - self._client.__exit__(*exc_details) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_configuration.py deleted file mode 100644 index 20b1d10b2eb8..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_configuration.py +++ /dev/null @@ -1,70 +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 TYPE_CHECKING - -from azure.core.configuration import Configuration -from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMHttpLoggingPolicy - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any - - from azure.core.credentials import TokenCredential - -VERSION = "unknown" - -class ApplicationInsightsManagementClientConfiguration(Configuration): - """Configuration for ApplicationInsightsManagementClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - """ - - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") - if subscription_id is None: - raise ValueError("Parameter 'subscription_id' must not be None.") - super(ApplicationInsightsManagementClientConfiguration, self).__init__(**kwargs) - - self.credential = credential - self.subscription_id = subscription_id - self.api_version = "2019-09-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 # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') - if self.credential and not self.authentication_policy: - self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_metadata.json deleted file mode 100644 index cd32035eaab0..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/_metadata.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "chosen_version": "2019-09-01-preview", - "total_api_version_list": ["2019-09-01-preview"], - "client": { - "name": "ApplicationInsightsManagementClient", - "filename": "_application_insights_management_client", - "description": "Composite Swagger for Application Insights Management Client.", - "base_url": "\u0027https://management.azure.com\u0027", - "custom_base_url": null, - "azure_arm": true, - "has_lro_operations": false, - "client_side_validation": false - }, - "global_parameters": { - "sync": { - "credential": { - "signature": "credential, # type: \"TokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials.TokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "async": { - "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", - "description": "Credential needed for the client to connect to Azure.", - "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", - "required": true - }, - "subscription_id": { - "signature": "subscription_id, # type: str", - "description": "The ID of the target subscription.", - "docstring_type": "str", - "required": true - } - }, - "constant": { - }, - "call": "credential, subscription_id" - }, - "config": { - "credential": true, - "credential_scopes": ["https://management.azure.com/.default"], - "credential_default_policy_type": "BearerTokenCredentialPolicy", - "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null - }, - "operation_groups": { - "queries": "QueriesOperations", - "operations": "Operations", - "query_packs": "QueryPacksOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" -} \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/__init__.py deleted file mode 100644 index 71e898dd88af..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_application_insights_management_client.py deleted file mode 100644 index e324020248a5..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_application_insights_management_client.py +++ /dev/null @@ -1,73 +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 QueriesOperations -from .operations import Operations -from .operations import QueryPacksOperations -from .. import models - - -class ApplicationInsightsManagementClient(object): - """Composite Swagger for Application Insights Management Client. - - :ivar queries: QueriesOperations operations - :vartype queries: azure.mgmt.applicationinsights.v2019_09_01_preview.aio.operations.QueriesOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.applicationinsights.v2019_09_01_preview.aio.operations.Operations - :ivar query_packs: QueryPacksOperations operations - :vartype query_packs: azure.mgmt.applicationinsights.v2019_09_01_preview.aio.operations.QueryPacksOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. - :type subscription_id: str - :param str base_url: Service URL - """ - - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - base_url: Optional[str] = None, - **kwargs: Any - ) -> None: - if not base_url: - base_url = 'https://management.azure.com' - self._config = ApplicationInsightsManagementClientConfiguration(credential, subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False - self._deserialize = Deserializer(client_models) - - self.queries = QueriesOperations( - self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations( - self._client, self._config, self._serialize, self._deserialize) - self.query_packs = QueryPacksOperations( - 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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_configuration.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/_configuration.py deleted file mode 100644 index f7354ccee8fb..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_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 = "2019-09-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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/__init__.py deleted file mode 100644 index d8196c05c608..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/__init__.py +++ /dev/null @@ -1,17 +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 ._queries_operations import QueriesOperations -from ._operations import Operations -from ._query_packs_operations import QueryPacksOperations - -__all__ = [ - 'QueriesOperations', - 'Operations', - 'QueryPacksOperations', -] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_operations.py deleted file mode 100644 index 387d5add5715..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/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.v2019_09_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.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.v2019_09_01_preview.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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 - # 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(_models.ErrorResponseAutoGenerated, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.Insights/operations'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_queries_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_queries_operations.py deleted file mode 100644 index a87a9c6bf136..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_queries_operations.py +++ /dev/null @@ -1,504 +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 QueriesOperations: - """QueriesOperations 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_09_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, - resource_group_name: str, - query_pack_name: str, - top: Optional[int] = None, - include_body: Optional[bool] = None, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.LogAnalyticsQueryPackQueryListResult"]: - """Gets a list of Queries defined within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param top: Maximum items returned in page. - :type top: int - :param include_body: Flag indicating whether or not to return the body of each applicable - query. If false, only return the query information. - :type include_body: bool - :param skip_token: Base64 encoded token used to fetch the next page of items. Default is null. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogAnalyticsQueryPackQueryListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQueryListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - if include_body is not None: - query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, '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('LogAnalyticsQueryPackQueryListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries'} # type: ignore - - def search( - self, - resource_group_name: str, - query_pack_name: str, - query_search_properties: "_models.LogAnalyticsQueryPackQuerySearchProperties", - top: Optional[int] = None, - include_body: Optional[bool] = None, - skip_token: Optional[str] = None, - **kwargs - ) -> AsyncIterable["_models.LogAnalyticsQueryPackQueryListResult"]: - """Search a list of Queries defined within a Log Analytics QueryPack according to given search - properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param query_search_properties: Properties by which to search queries in the given Log - Analytics QueryPack. - :type query_search_properties: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuerySearchProperties - :param top: Maximum items returned in page. - :type top: int - :param include_body: Flag indicating whether or not to return the body of each applicable - query. If false, only return the query information. - :type include_body: bool - :param skip_token: Base64 encoded token used to fetch the next page of items. Default is null. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogAnalyticsQueryPackQueryListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQueryListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - content_type = "application/json" - accept = "application/json" - - def prepare_request(next_link=None): - # 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') - - if not next_link: - # Construct URL - url = self.search.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._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\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - if include_body is not None: - query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(query_search_properties, 'LogAnalyticsQueryPackQuerySearchProperties') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(query_search_properties, 'LogAnalyticsQueryPackQuerySearchProperties') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('LogAnalyticsQueryPackQueryListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - search.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/search'} # type: ignore - - async def get( - self, - resource_group_name: str, - query_pack_name: str, - id: str, - **kwargs - ) -> "_models.LogAnalyticsQueryPackQuery": - """Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - async def put( - self, - resource_group_name: str, - query_pack_name: str, - id: str, - query_payload: "_models.LogAnalyticsQueryPackQuery", - **kwargs - ) -> "_models.LogAnalyticsQueryPackQuery": - """Adds or Updates a specific Query within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :param query_payload: Properties that need to be specified to create a new query and add it to - a Log Analytics QueryPack. - :type query_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - 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\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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(query_payload, 'LogAnalyticsQueryPackQuery') - 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - async def update( - self, - resource_group_name: str, - query_pack_name: str, - id: str, - query_payload: "_models.LogAnalyticsQueryPackQuery", - **kwargs - ) -> "_models.LogAnalyticsQueryPackQuery": - """Adds or Updates a specific Query within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :param query_payload: Properties that need to be specified to create a new query and add it to - a Log Analytics QueryPack. - :type query_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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(query_payload, 'LogAnalyticsQueryPackQuery') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - async def delete( - self, - resource_group_name: str, - query_pack_name: str, - id: str, - **kwargs - ) -> None: - """Deletes a specific Query defined within an Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type 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 = "2019-09-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_query_packs_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_query_packs_operations.py deleted file mode 100644 index 0340c9fa60bf..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/aio/operations/_query_packs_operations.py +++ /dev/null @@ -1,431 +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 QueryPacksOperations: - """QueryPacksOperations 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_09_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.LogAnalyticsQueryPackListResult"]: - """Gets a list of all Log Analytics QueryPacks 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 LogAnalyticsQueryPackListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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('LogAnalyticsQueryPackListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, 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/queryPacks'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs - ) -> AsyncIterable["_models.LogAnalyticsQueryPackListResult"]: - """Gets a list of Log Analytics QueryPacks 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 LogAnalyticsQueryPackListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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('LogAnalyticsQueryPackListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, 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/queryPacks'} # type: ignore - - async def delete( - self, - resource_group_name: str, - query_pack_name: str, - **kwargs - ) -> None: - """Deletes a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_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-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, 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/queryPacks/{queryPackName}'} # type: ignore - - async def get( - self, - resource_group_name: str, - query_pack_name: str, - **kwargs - ) -> "_models.LogAnalyticsQueryPack": - """Returns a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore - - async def create_or_update( - self, - resource_group_name: str, - query_pack_name: str, - log_analytics_query_pack_payload: "_models.LogAnalyticsQueryPack", - **kwargs - ) -> "_models.LogAnalyticsQueryPack": - """Creates (or updates) a Log Analytics QueryPack. 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 query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param log_analytics_query_pack_payload: Properties that need to be specified to create or - update a Log Analytics QueryPack. - :type log_analytics_query_pack_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_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(log_analytics_query_pack_payload, 'LogAnalyticsQueryPack') - 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(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore - - async def update_tags( - self, - resource_group_name: str, - query_pack_name: str, - query_pack_tags: "_models.TagsResource", - **kwargs - ) -> "_models.LogAnalyticsQueryPack": - """Updates an existing QueryPack'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 query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param query_pack_tags: Updated tag information to set into the QueryPack instance. - :type query_pack_tags: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_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(query_pack_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(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/__init__.py deleted file mode 100644 index 1324c2788658..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/__init__.py +++ /dev/null @@ -1,75 +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. -# -------------------------------------------------------------------------- - -try: - from ._models_py3 import AzureResourceProperties - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorInfo - from ._models_py3 import ErrorInfoAutoGenerated - from ._models_py3 import ErrorResponse - from ._models_py3 import ErrorResponseAutoGenerated - from ._models_py3 import LogAnalyticsQueryPack - from ._models_py3 import LogAnalyticsQueryPackListResult - from ._models_py3 import LogAnalyticsQueryPackQuery - from ._models_py3 import LogAnalyticsQueryPackQueryListResult - from ._models_py3 import LogAnalyticsQueryPackQueryPropertiesRelated - from ._models_py3 import LogAnalyticsQueryPackQuerySearchProperties - from ._models_py3 import LogAnalyticsQueryPackQuerySearchPropertiesRelated - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationListResult - from ._models_py3 import QueryPacksResource - from ._models_py3 import SystemData - from ._models_py3 import TagsResource -except (SyntaxError, ImportError): - from ._models import AzureResourceProperties # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorInfo # type: ignore - from ._models import ErrorInfoAutoGenerated # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import ErrorResponseAutoGenerated # type: ignore - from ._models import LogAnalyticsQueryPack # type: ignore - from ._models import LogAnalyticsQueryPackListResult # type: ignore - from ._models import LogAnalyticsQueryPackQuery # type: ignore - from ._models import LogAnalyticsQueryPackQueryListResult # type: ignore - from ._models import LogAnalyticsQueryPackQueryPropertiesRelated # type: ignore - from ._models import LogAnalyticsQueryPackQuerySearchProperties # type: ignore - from ._models import LogAnalyticsQueryPackQuerySearchPropertiesRelated # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationListResult # type: ignore - from ._models import QueryPacksResource # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsResource # type: ignore - -from ._application_insights_management_client_enums import ( - IdentityType, -) - -__all__ = [ - 'AzureResourceProperties', - 'ErrorDetail', - 'ErrorInfo', - 'ErrorInfoAutoGenerated', - 'ErrorResponse', - 'ErrorResponseAutoGenerated', - 'LogAnalyticsQueryPack', - 'LogAnalyticsQueryPackListResult', - 'LogAnalyticsQueryPackQuery', - 'LogAnalyticsQueryPackQueryListResult', - 'LogAnalyticsQueryPackQueryPropertiesRelated', - 'LogAnalyticsQueryPackQuerySearchProperties', - 'LogAnalyticsQueryPackQuerySearchPropertiesRelated', - 'Operation', - 'OperationDisplay', - 'OperationListResult', - 'QueryPacksResource', - 'SystemData', - 'TagsResource', - 'IdentityType', -] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_application_insights_management_client_enums.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_application_insights_management_client_enums.py deleted file mode 100644 index d3f70ed06454..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_application_insights_management_client_enums.py +++ /dev/null @@ -1,36 +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 enum import Enum, EnumMeta -from six import with_metaclass - -class _CaseInsensitiveEnumMeta(EnumMeta): - def __getitem__(self, name): - return super().__getitem__(name.upper()) - - def __getattr__(cls, name): - """Return the enum member matching `name` - We use __getattr__ instead of descriptors or inserting into the enum - class' __dict__ in order to support `name` and `value` being both - properties for enum members (which live in the class' __dict__) and - enum members themselves. - """ - try: - return cls._member_map_[name.upper()] - except KeyError: - raise AttributeError(name) - - -class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that creates/modifies resources - """ - - USER = "user" - APPLICATION = "application" - MANAGED_IDENTITY = "managedIdentity" - KEY = "key" diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models.py deleted file mode 100644 index f0444434f9a8..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models.py +++ /dev/null @@ -1,699 +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 AzureResourceProperties(msrest.serialization.Model): - """An Azure resource QueryPack-Query 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 - :ivar system_data: Read only system data. - :vartype system_data: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureResourceProperties, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ErrorDetail(msrest.serialization.Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for the error. - :type target: str - :param value: Indicates which value in 'target' is responsible for the error. - :type value: str - :param resources: Indicates resources which were responsible for the error. - :type resources: list[str] - :param additional_properties: Additional properties that can be provided on the error details - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': '[str]'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.target = kwargs.get('target', None) - self.value = kwargs.get('value', None) - self.resources = kwargs.get('resources', None) - self.additional_properties = kwargs.get('additional_properties', None) - - -class ErrorInfo(msrest.serialization.Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfo - :param additional_properties: Additional properties that can be provided on the error info - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'ErrorInfo'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorInfo, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.innererror = kwargs.get('innererror', None) - self.additional_properties = kwargs.get('additional_properties', None) - - -class ErrorInfoAutoGenerated(msrest.serialization.Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfoAutoGenerated - :param additional_properties: Additional properties that can be provided on the error info - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'ErrorInfoAutoGenerated'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorInfoAutoGenerated, self).__init__(**kwargs) - self.code = kwargs['code'] - self.message = kwargs['message'] - self.details = kwargs.get('details', None) - self.innererror = kwargs.get('innererror', None) - self.additional_properties = kwargs.get('additional_properties', None) - - -class ErrorResponse(msrest.serialization.Model): - """Describe the format of an Error response. - - :param error: The error details. - :type error: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfo - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfo'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class ErrorResponseAutoGenerated(msrest.serialization.Model): - """Describe the format of an Error response. - - :param error: The error details. - :type error: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfoAutoGenerated - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfoAutoGenerated'}, - } - - def __init__( - self, - **kwargs - ): - super(ErrorResponseAutoGenerated, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class QueryPacksResource(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(QueryPacksResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = kwargs['location'] - self.tags = kwargs.get('tags', None) - - -class LogAnalyticsQueryPack(QueryPacksResource): - """An Log Analytics QueryPack 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] - :ivar query_pack_id: The unique ID of your application. This field cannot be changed. - :vartype query_pack_id: str - :ivar time_created: Creation Date for the Log Analytics QueryPack, in ISO 8601 format. - :vartype time_created: ~datetime.datetime - :ivar time_modified: Last modified date of the Log Analytics QueryPack, in ISO 8601 format. - :vartype time_modified: ~datetime.datetime - :ivar provisioning_state: Current state of this QueryPack: 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}, - 'query_pack_id': {'readonly': True}, - 'time_created': {'readonly': True}, - 'time_modified': {'readonly': 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}'}, - 'query_pack_id': {'key': 'properties.queryPackId', 'type': 'str'}, - 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPack, self).__init__(**kwargs) - self.query_pack_id = None - self.time_created = None - self.time_modified = None - self.provisioning_state = None - - -class LogAnalyticsQueryPackListResult(msrest.serialization.Model): - """Describes the list of Log Analytics QueryPack resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Log Analytics QueryPack definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack] - :param next_link: The URI to get the next set of Log Analytics QueryPack definitions if too - many QueryPacks where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LogAnalyticsQueryPack]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class LogAnalyticsQueryPackQuery(AzureResourceProperties): - """A Log Analytics QueryPack-Query 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 - :ivar system_data: Read only system data. - :vartype system_data: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.SystemData - :ivar id_properties_id: The unique ID of your application. This field cannot be changed. - :vartype id_properties_id: str - :param display_name: Unique display name for your query within the Query Pack. - :type display_name: str - :ivar time_created: Creation Date for the Log Analytics Query, in ISO 8601 format. - :vartype time_created: ~datetime.datetime - :ivar time_modified: Last modified date of the Log Analytics Query, in ISO 8601 format. - :vartype time_modified: ~datetime.datetime - :ivar author: Object Id of user creating the query. - :vartype author: str - :param description: Description of the query. - :type description: str - :param body: Body of the query. - :type body: str - :param related: The related metadata items for the function. - :type related: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryPropertiesRelated - :param tags: A set of tags. Tags associated with the query. - :type tags: dict[str, list[str]] - :param properties: Additional properties that can be set for the query. - :type properties: object - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'id_properties_id': {'readonly': True}, - 'time_created': {'readonly': True}, - 'time_modified': {'readonly': True}, - 'author': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, - 'author': {'key': 'properties.author', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - 'related': {'key': 'properties.related', 'type': 'LogAnalyticsQueryPackQueryPropertiesRelated'}, - 'tags': {'key': 'properties.tags', 'type': '{[str]}'}, - 'properties': {'key': 'properties.properties', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackQuery, self).__init__(**kwargs) - self.id_properties_id = None - self.display_name = kwargs.get('display_name', None) - self.time_created = None - self.time_modified = None - self.author = None - self.description = kwargs.get('description', None) - self.body = kwargs.get('body', None) - self.related = kwargs.get('related', None) - self.tags = kwargs.get('tags', None) - self.properties = kwargs.get('properties', None) - - -class LogAnalyticsQueryPackQueryListResult(msrest.serialization.Model): - """Describes the list of Log Analytics QueryPack-Query resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Log Analytics QueryPack Query definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery] - :param next_link: The URI to get the next set of Log Analytics QueryPack definitions if too - many QueryPack-Queries where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LogAnalyticsQueryPackQuery]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackQueryListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - self.next_link = kwargs.get('next_link', None) - - -class LogAnalyticsQueryPackQueryPropertiesRelated(msrest.serialization.Model): - """The related metadata items for the function. - - :param categories: The related categories for the function. - :type categories: list[str] - :param resource_types: The related resource types for the function. - :type resource_types: list[str] - :param solutions: The related Log Analytics solutions for the function. - :type solutions: list[str] - """ - - _attribute_map = { - 'categories': {'key': 'categories', 'type': '[str]'}, - 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, - 'solutions': {'key': 'solutions', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackQueryPropertiesRelated, self).__init__(**kwargs) - self.categories = kwargs.get('categories', None) - self.resource_types = kwargs.get('resource_types', None) - self.solutions = kwargs.get('solutions', None) - - -class LogAnalyticsQueryPackQuerySearchProperties(msrest.serialization.Model): - """Properties that define an Log Analytics QueryPack-Query search properties. - - :param related: The related metadata items for the function. - :type related: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated - :param tags: A set of tags. Tags associated with the query. - :type tags: dict[str, list[str]] - """ - - _attribute_map = { - 'related': {'key': 'related', 'type': 'LogAnalyticsQueryPackQuerySearchPropertiesRelated'}, - 'tags': {'key': 'tags', 'type': '{[str]}'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackQuerySearchProperties, self).__init__(**kwargs) - self.related = kwargs.get('related', None) - self.tags = kwargs.get('tags', None) - - -class LogAnalyticsQueryPackQuerySearchPropertiesRelated(msrest.serialization.Model): - """The related metadata items for the function. - - :param categories: The related categories for the function. - :type categories: list[str] - :param resource_types: The related resource types for the function. - :type resource_types: list[str] - :param solutions: The related Log Analytics solutions for the function. - :type solutions: list[str] - """ - - _attribute_map = { - 'categories': {'key': 'categories', 'type': '[str]'}, - 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, - 'solutions': {'key': 'solutions', 'type': '[str]'}, - } - - def __init__( - self, - **kwargs - ): - super(LogAnalyticsQueryPackQuerySearchPropertiesRelated, self).__init__(**kwargs) - self.categories = kwargs.get('categories', None) - self.resource_types = kwargs.get('resource_types', None) - self.solutions = kwargs.get('solutions', None) - - -class Operation(msrest.serialization.Model): - """CDN REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Display of the operation. - :type display: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.is_data_action = kwargs.get('is_data_action', None) - self.display = kwargs.get('display', None) - self.origin = kwargs.get('origin', None) - - -class OperationDisplay(msrest.serialization.Model): - """Operation display payload. - - :param provider: Resource provider of the operation. - :type provider: str - :param resource: Resource of the operation. - :type resource: str - :param operation: Localized friendly name for the operation. - :type operation: str - :param description: Localized friendly description for 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(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) - - -class 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.v2019_09_01_preview.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = kwargs.get('next_link', None) - - -class SystemData(msrest.serialization.Model): - """Read only system data. - - :param created_by: An identifier for the identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "user", "application", "managedIdentity", "key". - :type created_by_type: str or - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.IdentityType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: An identifier for the identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "user", "application", "managedIdentity", "key". - :type last_modified_by_type: str or - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.IdentityType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a QueryPack 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/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models_py3.py deleted file mode 100644 index 0d0a0943be29..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/models/_models_py3.py +++ /dev/null @@ -1,779 +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 datetime -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._application_insights_management_client_enums import * - - -class AzureResourceProperties(msrest.serialization.Model): - """An Azure resource QueryPack-Query 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 - :ivar system_data: Read only system data. - :vartype system_data: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - super(AzureResourceProperties, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class ErrorDetail(msrest.serialization.Model): - """Error details. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. The error's code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param target: Indicates which property in the request is responsible for the error. - :type target: str - :param value: Indicates which value in 'target' is responsible for the error. - :type value: str - :param resources: Indicates resources which were responsible for the error. - :type resources: list[str] - :param additional_properties: Additional properties that can be provided on the error details - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'str'}, - 'resources': {'key': 'resources', 'type': '[str]'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - *, - code: str, - message: str, - target: Optional[str] = None, - value: Optional[str] = None, - resources: Optional[List[str]] = None, - additional_properties: Optional[object] = None, - **kwargs - ): - super(ErrorDetail, self).__init__(**kwargs) - self.code = code - self.message = message - self.target = target - self.value = value - self.resources = resources - self.additional_properties = additional_properties - - -class ErrorInfo(msrest.serialization.Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfo - :param additional_properties: Additional properties that can be provided on the error info - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'ErrorInfo'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - *, - code: str, - message: str, - details: Optional[List["ErrorDetail"]] = None, - innererror: Optional["ErrorInfo"] = None, - additional_properties: Optional[object] = None, - **kwargs - ): - super(ErrorInfo, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.innererror = innererror - self.additional_properties = additional_properties - - -class ErrorInfoAutoGenerated(msrest.serialization.Model): - """The code and message for an error. - - All required parameters must be populated in order to send to Azure. - - :param code: Required. A machine readable error code. - :type code: str - :param message: Required. A human readable error message. - :type message: str - :param details: error details. - :type details: list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorDetail] - :param innererror: Inner error details if they exist. - :type innererror: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfoAutoGenerated - :param additional_properties: Additional properties that can be provided on the error info - object. - :type additional_properties: object - """ - - _validation = { - 'code': {'required': True}, - 'message': {'required': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'innererror': {'key': 'innererror', 'type': 'ErrorInfoAutoGenerated'}, - 'additional_properties': {'key': 'additionalProperties', 'type': 'object'}, - } - - def __init__( - self, - *, - code: str, - message: str, - details: Optional[List["ErrorDetail"]] = None, - innererror: Optional["ErrorInfoAutoGenerated"] = None, - additional_properties: Optional[object] = None, - **kwargs - ): - super(ErrorInfoAutoGenerated, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details - self.innererror = innererror - self.additional_properties = additional_properties - - -class ErrorResponse(msrest.serialization.Model): - """Describe the format of an Error response. - - :param error: The error details. - :type error: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfo - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfo'}, - } - - def __init__( - self, - *, - error: Optional["ErrorInfo"] = None, - **kwargs - ): - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ErrorResponseAutoGenerated(msrest.serialization.Model): - """Describe the format of an Error response. - - :param error: The error details. - :type error: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.ErrorInfoAutoGenerated - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorInfoAutoGenerated'}, - } - - def __init__( - self, - *, - error: Optional["ErrorInfoAutoGenerated"] = None, - **kwargs - ): - super(ErrorResponseAutoGenerated, self).__init__(**kwargs) - self.error = error - - -class QueryPacksResource(msrest.serialization.Model): - """An azure resource object. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Azure resource Id. - :vartype id: str - :ivar name: Azure resource name. - :vartype name: str - :ivar type: Azure resource type. - :vartype type: str - :param location: Required. Resource location. - :type location: str - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(QueryPacksResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - - -class LogAnalyticsQueryPack(QueryPacksResource): - """An Log Analytics QueryPack 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] - :ivar query_pack_id: The unique ID of your application. This field cannot be changed. - :vartype query_pack_id: str - :ivar time_created: Creation Date for the Log Analytics QueryPack, in ISO 8601 format. - :vartype time_created: ~datetime.datetime - :ivar time_modified: Last modified date of the Log Analytics QueryPack, in ISO 8601 format. - :vartype time_modified: ~datetime.datetime - :ivar provisioning_state: Current state of this QueryPack: 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}, - 'query_pack_id': {'readonly': True}, - 'time_created': {'readonly': True}, - 'time_modified': {'readonly': 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}'}, - 'query_pack_id': {'key': 'properties.queryPackId', 'type': 'str'}, - 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(LogAnalyticsQueryPack, self).__init__(location=location, tags=tags, **kwargs) - self.query_pack_id = None - self.time_created = None - self.time_modified = None - self.provisioning_state = None - - -class LogAnalyticsQueryPackListResult(msrest.serialization.Model): - """Describes the list of Log Analytics QueryPack resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Log Analytics QueryPack definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack] - :param next_link: The URI to get the next set of Log Analytics QueryPack definitions if too - many QueryPacks where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LogAnalyticsQueryPack]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: List["LogAnalyticsQueryPack"], - next_link: Optional[str] = None, - **kwargs - ): - super(LogAnalyticsQueryPackListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class LogAnalyticsQueryPackQuery(AzureResourceProperties): - """A Log Analytics QueryPack-Query 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 - :ivar system_data: Read only system data. - :vartype system_data: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.SystemData - :ivar id_properties_id: The unique ID of your application. This field cannot be changed. - :vartype id_properties_id: str - :param display_name: Unique display name for your query within the Query Pack. - :type display_name: str - :ivar time_created: Creation Date for the Log Analytics Query, in ISO 8601 format. - :vartype time_created: ~datetime.datetime - :ivar time_modified: Last modified date of the Log Analytics Query, in ISO 8601 format. - :vartype time_modified: ~datetime.datetime - :ivar author: Object Id of user creating the query. - :vartype author: str - :param description: Description of the query. - :type description: str - :param body: Body of the query. - :type body: str - :param related: The related metadata items for the function. - :type related: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryPropertiesRelated - :param tags: A set of tags. Tags associated with the query. - :type tags: dict[str, list[str]] - :param properties: Additional properties that can be set for the query. - :type properties: object - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'id_properties_id': {'readonly': True}, - 'time_created': {'readonly': True}, - 'time_modified': {'readonly': True}, - 'author': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, - 'display_name': {'key': 'properties.displayName', 'type': 'str'}, - 'time_created': {'key': 'properties.timeCreated', 'type': 'iso-8601'}, - 'time_modified': {'key': 'properties.timeModified', 'type': 'iso-8601'}, - 'author': {'key': 'properties.author', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'body': {'key': 'properties.body', 'type': 'str'}, - 'related': {'key': 'properties.related', 'type': 'LogAnalyticsQueryPackQueryPropertiesRelated'}, - 'tags': {'key': 'properties.tags', 'type': '{[str]}'}, - 'properties': {'key': 'properties.properties', 'type': 'object'}, - } - - def __init__( - self, - *, - display_name: Optional[str] = None, - description: Optional[str] = None, - body: Optional[str] = None, - related: Optional["LogAnalyticsQueryPackQueryPropertiesRelated"] = None, - tags: Optional[Dict[str, List[str]]] = None, - properties: Optional[object] = None, - **kwargs - ): - super(LogAnalyticsQueryPackQuery, self).__init__(**kwargs) - self.id_properties_id = None - self.display_name = display_name - self.time_created = None - self.time_modified = None - self.author = None - self.description = description - self.body = body - self.related = related - self.tags = tags - self.properties = properties - - -class LogAnalyticsQueryPackQueryListResult(msrest.serialization.Model): - """Describes the list of Log Analytics QueryPack-Query resources. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. List of Log Analytics QueryPack Query definitions. - :type value: - list[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery] - :param next_link: The URI to get the next set of Log Analytics QueryPack definitions if too - many QueryPack-Queries where returned in the result set. - :type next_link: str - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[LogAnalyticsQueryPackQuery]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: List["LogAnalyticsQueryPackQuery"], - next_link: Optional[str] = None, - **kwargs - ): - super(LogAnalyticsQueryPackQueryListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class LogAnalyticsQueryPackQueryPropertiesRelated(msrest.serialization.Model): - """The related metadata items for the function. - - :param categories: The related categories for the function. - :type categories: list[str] - :param resource_types: The related resource types for the function. - :type resource_types: list[str] - :param solutions: The related Log Analytics solutions for the function. - :type solutions: list[str] - """ - - _attribute_map = { - 'categories': {'key': 'categories', 'type': '[str]'}, - 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, - 'solutions': {'key': 'solutions', 'type': '[str]'}, - } - - def __init__( - self, - *, - categories: Optional[List[str]] = None, - resource_types: Optional[List[str]] = None, - solutions: Optional[List[str]] = None, - **kwargs - ): - super(LogAnalyticsQueryPackQueryPropertiesRelated, self).__init__(**kwargs) - self.categories = categories - self.resource_types = resource_types - self.solutions = solutions - - -class LogAnalyticsQueryPackQuerySearchProperties(msrest.serialization.Model): - """Properties that define an Log Analytics QueryPack-Query search properties. - - :param related: The related metadata items for the function. - :type related: - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuerySearchPropertiesRelated - :param tags: A set of tags. Tags associated with the query. - :type tags: dict[str, list[str]] - """ - - _attribute_map = { - 'related': {'key': 'related', 'type': 'LogAnalyticsQueryPackQuerySearchPropertiesRelated'}, - 'tags': {'key': 'tags', 'type': '{[str]}'}, - } - - def __init__( - self, - *, - related: Optional["LogAnalyticsQueryPackQuerySearchPropertiesRelated"] = None, - tags: Optional[Dict[str, List[str]]] = None, - **kwargs - ): - super(LogAnalyticsQueryPackQuerySearchProperties, self).__init__(**kwargs) - self.related = related - self.tags = tags - - -class LogAnalyticsQueryPackQuerySearchPropertiesRelated(msrest.serialization.Model): - """The related metadata items for the function. - - :param categories: The related categories for the function. - :type categories: list[str] - :param resource_types: The related resource types for the function. - :type resource_types: list[str] - :param solutions: The related Log Analytics solutions for the function. - :type solutions: list[str] - """ - - _attribute_map = { - 'categories': {'key': 'categories', 'type': '[str]'}, - 'resource_types': {'key': 'resourceTypes', 'type': '[str]'}, - 'solutions': {'key': 'solutions', 'type': '[str]'}, - } - - def __init__( - self, - *, - categories: Optional[List[str]] = None, - resource_types: Optional[List[str]] = None, - solutions: Optional[List[str]] = None, - **kwargs - ): - super(LogAnalyticsQueryPackQuerySearchPropertiesRelated, self).__init__(**kwargs) - self.categories = categories - self.resource_types = resource_types - self.solutions = solutions - - -class Operation(msrest.serialization.Model): - """CDN REST API operation. - - :param name: Operation name: {provider}/{resource}/{operation}. - :type name: str - :param is_data_action: Indicates whether the operation is a data action. - :type is_data_action: bool - :param display: Display of the operation. - :type display: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.OperationDisplay - :param origin: Origin of the operation. - :type origin: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - 'origin': {'key': 'origin', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - is_data_action: Optional[bool] = None, - display: Optional["OperationDisplay"] = None, - origin: Optional[str] = None, - **kwargs - ): - super(Operation, self).__init__(**kwargs) - self.name = name - self.is_data_action = is_data_action - self.display = display - self.origin = origin - - -class OperationDisplay(msrest.serialization.Model): - """Operation display payload. - - :param provider: Resource provider of the operation. - :type provider: str - :param resource: Resource of the operation. - :type resource: str - :param operation: Localized friendly name for the operation. - :type operation: str - :param description: Localized friendly description for 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, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class 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.v2019_09_01_preview.models.Operation] - :param next_link: URL to get the next set of operation list results if there are any. - :type next_link: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Operation"]] = None, - next_link: Optional[str] = None, - **kwargs - ): - super(OperationListResult, self).__init__(**kwargs) - self.value = value - self.next_link = next_link - - -class SystemData(msrest.serialization.Model): - """Read only system data. - - :param created_by: An identifier for the identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. Possible values - include: "user", "application", "managedIdentity", "key". - :type created_by_type: str or - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.IdentityType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: ~datetime.datetime - :param last_modified_by: An identifier for the identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "user", "application", "managedIdentity", "key". - :type last_modified_by_type: str or - ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.IdentityType - :param last_modified_at: The timestamp of resource last modification (UTC). - :type last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "IdentityType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "IdentityType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TagsResource(msrest.serialization.Model): - """A container holding only the Tags for a resource, allowing the user to update the tags on a QueryPack instance. - - :param tags: A set of tags. Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(TagsResource, self).__init__(**kwargs) - self.tags = tags diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/__init__.py deleted file mode 100644 index d8196c05c608..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/__init__.py +++ /dev/null @@ -1,17 +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 ._queries_operations import QueriesOperations -from ._operations import Operations -from ._query_packs_operations import QueryPacksOperations - -__all__ = [ - 'QueriesOperations', - 'Operations', - 'QueryPacksOperations', -] diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_operations.py deleted file mode 100644 index 6e533a979227..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_operations.py +++ /dev/null @@ -1,110 +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 TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class Operations(object): - """Operations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.applicationinsights.v2019_09_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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationListResult"] - """Lists all of the available insights REST API operations. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.OperationListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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 - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('OperationListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/providers/Microsoft.Insights/operations'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_queries_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_queries_operations.py deleted file mode 100644 index 1d26cfb4fee5..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_queries_operations.py +++ /dev/null @@ -1,514 +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 TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class QueriesOperations(object): - """QueriesOperations 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_09_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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - resource_group_name, # type: str - query_pack_name, # type: str - top=None, # type: Optional[int] - include_body=None, # type: Optional[bool] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LogAnalyticsQueryPackQueryListResult"] - """Gets a list of Queries defined within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param top: Maximum items returned in page. - :type top: int - :param include_body: Flag indicating whether or not to return the body of each applicable - query. If false, only return the query information. - :type include_body: bool - :param skip_token: Base64 encoded token used to fetch the next page of items. Default is null. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogAnalyticsQueryPackQueryListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQueryListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - if include_body is not None: - query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LogAnalyticsQueryPackQueryListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries'} # type: ignore - - def search( - self, - resource_group_name, # type: str - query_pack_name, # type: str - query_search_properties, # type: "_models.LogAnalyticsQueryPackQuerySearchProperties" - top=None, # type: Optional[int] - include_body=None, # type: Optional[bool] - skip_token=None, # type: Optional[str] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LogAnalyticsQueryPackQueryListResult"] - """Search a list of Queries defined within a Log Analytics QueryPack according to given search - properties. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param query_search_properties: Properties by which to search queries in the given Log - Analytics QueryPack. - :type query_search_properties: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuerySearchProperties - :param top: Maximum items returned in page. - :type top: int - :param include_body: Flag indicating whether or not to return the body of each applicable - query. If false, only return the query information. - :type include_body: bool - :param skip_token: Base64 encoded token used to fetch the next page of items. Default is null. - :type skip_token: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either LogAnalyticsQueryPackQueryListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQueryListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQueryListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - content_type = "application/json" - accept = "application/json" - - def prepare_request(next_link=None): - # 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') - - if not next_link: - # Construct URL - url = self.search.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._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\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') - if include_body is not None: - query_parameters['includeBody'] = self._serialize.query("include_body", include_body, 'bool') - if skip_token is not None: - query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') - - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(query_search_properties, 'LogAnalyticsQueryPackQuerySearchProperties') - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(query_search_properties, 'LogAnalyticsQueryPackQuerySearchProperties') - body_content_kwargs['content'] = body_content - request = self._client.get(url, query_parameters, header_parameters, **body_content_kwargs) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('LogAnalyticsQueryPackQueryListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - search.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/search'} # type: ignore - - def get( - self, - resource_group_name, # type: str - query_pack_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPackQuery" - """Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", id, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - def put( - self, - resource_group_name, # type: str - query_pack_name, # type: str - id, # type: str - query_payload, # type: "_models.LogAnalyticsQueryPackQuery" - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPackQuery" - """Adds or Updates a specific Query within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :param query_payload: Properties that need to be specified to create a new query and add it to - a Log Analytics QueryPack. - :type query_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - 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\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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(query_payload, 'LogAnalyticsQueryPackQuery') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - put.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - def update( - self, - resource_group_name, # type: str - query_pack_name, # type: str - id, # type: str - query_payload, # type: "_models.LogAnalyticsQueryPackQuery" - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPackQuery" - """Adds or Updates a specific Query within a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type id: str - :param query_payload: Properties that need to be specified to create a new query and add it to - a Log Analytics QueryPack. - :type query_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPackQuery, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackQuery - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackQuery"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.update.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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(query_payload, 'LogAnalyticsQueryPackQuery') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPackQuery', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - query_pack_name, # type: str - id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a specific Query defined within an Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param id: The id of a specific query defined in the Log Analytics QueryPack. - :type 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 = "2019-09-01-preview" - accept = "application/json" - - # Construct URL - url = self.delete.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - 'id': self._serialize.url("id", 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 = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}/queries/{id}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py deleted file mode 100644 index 4dd93c47ea3f..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/operations/_query_packs_operations.py +++ /dev/null @@ -1,441 +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 TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class QueryPacksOperations(object): - """QueryPacksOperations 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_09_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): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LogAnalyticsQueryPackListResult"] - """Gets a list of all Log Analytics QueryPacks 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 LogAnalyticsQueryPackListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('LogAnalyticsQueryPackListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Insights/queryPacks'} # type: ignore - - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.LogAnalyticsQueryPackListResult"] - """Gets a list of Log Analytics QueryPacks 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 LogAnalyticsQueryPackListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPackListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPackListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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 - - def extract_data(pipeline_response): - deserialized = self._deserialize('LogAnalyticsQueryPackListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks'} # type: ignore - - def delete( - self, - resource_group_name, # type: str - query_pack_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - """Deletes a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_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-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.delete(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, 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/queryPacks/{queryPackName}'} # type: ignore - - def get( - self, - resource_group_name, # type: str - query_pack_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPack" - """Returns a Log Analytics QueryPack. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore - - def create_or_update( - self, - resource_group_name, # type: str - query_pack_name, # type: str - log_analytics_query_pack_payload, # type: "_models.LogAnalyticsQueryPack" - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPack" - """Creates (or updates) a Log Analytics QueryPack. 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 query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param log_analytics_query_pack_payload: Properties that need to be specified to create or - update a Log Analytics QueryPack. - :type log_analytics_query_pack_payload: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_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(log_analytics_query_pack_payload, 'LogAnalyticsQueryPack') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore - - def update_tags( - self, - resource_group_name, # type: str - query_pack_name, # type: str - query_pack_tags, # type: "_models.TagsResource" - **kwargs # type: Any - ): - # type: (...) -> "_models.LogAnalyticsQueryPack" - """Updates an existing QueryPack'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 query_pack_name: The name of the Log Analytics QueryPack resource. - :type query_pack_name: str - :param query_pack_tags: Updated tag information to set into the QueryPack instance. - :type query_pack_tags: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.TagsResource - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LogAnalyticsQueryPack, or the result of cls(response) - :rtype: ~azure.mgmt.applicationinsights.v2019_09_01_preview.models.LogAnalyticsQueryPack - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.LogAnalyticsQueryPack"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2019-09-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), - 'queryPackName': self._serialize.url("query_pack_name", query_pack_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(query_pack_tags, 'TagsResource') - body_content_kwargs['content'] = body_content - request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('LogAnalyticsQueryPack', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/queryPacks/{queryPackName}'} # type: ignore diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/py.typed b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/py.typed deleted file mode 100644 index e5aff4f83af8..000000000000 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_09_01_preview/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py index 04df1b74be0b..7fa4b47aaa85 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbook_templates = WorkbookTemplatesOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json index 3afb65a33830..678c6ee6d7a2 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py index ba90f6aa8cb9..9ebe51052e67 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2019_10_17_preview/aio/_application_insights_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.workbook_templates = WorkbookTemplatesOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py index 61e8ad6eafae..7d560c41e33f 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.components = ComponentsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json index 6c76b6244b11..8a903dd7055b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py index 25af49dc9927..a1265ffd1e45 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/_application_insights_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.components = ComponentsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py index f8df9c9a76f7..701cec417081 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/aio/operations/_components_operations.py @@ -97,8 +97,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -167,8 +168,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -200,6 +202,7 @@ async def delete( } 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 @@ -216,6 +219,7 @@ async def delete( # 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) @@ -223,7 +227,8 @@ async def delete( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -278,7 +283,8 @@ async def get( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -346,7 +352,8 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -412,7 +419,8 @@ async def update_tags( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -485,7 +493,8 @@ async def purge( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) @@ -548,7 +557,8 @@ async def get_purge_status( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py index f240664578eb..9d810722c16d 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/__init__.py @@ -14,6 +14,9 @@ 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): @@ -24,6 +27,9 @@ 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 @@ -44,6 +50,9 @@ 'ComponentPurgeResponse', 'ComponentPurgeStatusResponse', 'ComponentsResource', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', 'PrivateLinkScopedResource', 'TagsResource', 'ApplicationType', diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py index b60a4ea3d851..82c36e2e0846 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -76,11 +77,15 @@ class ApplicationInsightsComponent(ComponentsResource): 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 @@ -124,8 +129,9 @@ class ApplicationInsightsComponent(ComponentsResource): :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: ResourceId of the log analytics workspace which the data will be - ingested to. + :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 @@ -155,6 +161,7 @@ class ApplicationInsightsComponent(ComponentsResource): '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}, @@ -173,8 +180,10 @@ class ApplicationInsightsComponent(ComponentsResource): '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'}, @@ -203,8 +212,10 @@ def __init__( ): 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") @@ -377,6 +388,101 @@ def __init__( 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. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py index 0344e2c9cc2a..4b3f94acf0b0 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/models/_models_py3.py @@ -8,6 +8,7 @@ from typing import Dict, List, Optional, Union +from azure.core.exceptions import HttpResponseError import msrest.serialization from ._application_insights_management_client_enums import * @@ -83,11 +84,15 @@ class ApplicationInsightsComponent(ComponentsResource): 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 @@ -131,8 +136,9 @@ class ApplicationInsightsComponent(ComponentsResource): :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: ResourceId of the log analytics workspace which the data will be - ingested to. + :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 @@ -162,6 +168,7 @@ class ApplicationInsightsComponent(ComponentsResource): '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}, @@ -180,8 +187,10 @@ class ApplicationInsightsComponent(ComponentsResource): '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'}, @@ -210,6 +219,7 @@ def __init__( location: str, kind: str, tags: Optional[Dict[str, str]] = None, + etag: Optional[str] = None, application_type: Optional[Union[str, "ApplicationType"]] = "web", flow_type: Optional[Union[str, "FlowType"]] = "Bluefield", request_source: Optional[Union[str, "RequestSource"]] = "rest", @@ -225,8 +235,10 @@ def __init__( ): super(ApplicationInsightsComponent, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind + self.etag = etag self.application_id = None self.app_id = None + self.name_properties_name = None self.application_type = application_type self.flow_type = flow_type self.request_source = request_source @@ -414,6 +426,103 @@ def __init__( self.status = 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, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + class PrivateLinkScopedResource(msrest.serialization.Model): """The private link scope resource reference. diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py index 05b6e71a036b..6b26f906a723 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_02_02_preview/operations/_components_operations.py @@ -102,8 +102,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -173,8 +174,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -207,6 +209,7 @@ def delete( } 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 @@ -223,6 +226,7 @@ def delete( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') request = self._client.delete(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -230,7 +234,8 @@ def delete( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) @@ -286,7 +291,8 @@ def get( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -355,7 +361,8 @@ def create_or_update( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -422,7 +429,8 @@ def update_tags( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ApplicationInsightsComponent', pipeline_response) @@ -496,7 +504,8 @@ def purge( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeResponse', pipeline_response) @@ -560,7 +569,8 @@ def get_purge_status( 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) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ComponentPurgeStatusResponse', pipeline_response) diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py index 5298be07f0bb..65986d8992e4 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json index 8e22cb5e3a0b..b8716d7ab6c8 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py index 16c97cbc3eb6..a25e66a7aa2a 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_03_01_preview/aio/_application_insights_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.component_linked_storage_accounts = ComponentLinkedStorageAccountsOperations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py index d4acfbfaede6..bdd0baf2e938 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_application_insights_management_client.py @@ -49,7 +49,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations( diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json index b3f3ca3f59e9..ab19be683b5b 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/_metadata.json @@ -9,7 +9,7 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": false, - "client_side_validation": false + "client_side_validation": true }, "global_parameters": { "sync": { diff --git a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py index 7fe22d890352..8d679cb987b6 100644 --- a/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py +++ b/sdk/applicationinsights/azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/v2020_06_02_preview/aio/_application_insights_management_client.py @@ -46,7 +46,6 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) - self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.operations = Operations(