From 557080613edef484917ee58e6eddbbaad3f2d512 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 23 Dec 2024 13:19:46 +0000 Subject: [PATCH] CodeGen from PR 31948 in Azure/azure-rest-api-specs Merge 091d57ea3bb2f6fed7b6c0c55cb30712ea3beec5 into 12492edbcf4c2d43d153da544ffbf1ffe7cbd20b --- .../azure-mgmt-loganalytics/_meta.json | 6 +- .../azure/mgmt/loganalytics/__init__.py | 12 +- .../azure/mgmt/loganalytics/_configuration.py | 7 +- .../_log_analytics_management_client.py | 72 +-- .../azure/mgmt/loganalytics/_serialization.py | 434 ++++++++++------ .../azure/mgmt/loganalytics/_version.py | 2 +- .../azure/mgmt/loganalytics/aio/__init__.py | 12 +- .../mgmt/loganalytics/aio/_configuration.py | 7 +- .../aio/_log_analytics_management_client.py | 72 +-- .../loganalytics/aio/operations/__init__.py | 74 +-- .../_available_service_tiers_operations.py | 9 +- .../aio/operations/_clusters_operations.py | 84 +++- .../operations/_data_exports_operations.py | 39 +- .../operations/_data_sources_operations.py | 39 +- .../_deleted_workspaces_operations.py | 40 +- .../aio/operations/_gateways_operations.py | 13 +- .../_intelligence_packs_operations.py | 21 +- .../operations/_linked_services_operations.py | 39 +- .../_linked_storage_accounts_operations.py | 37 +- .../_management_groups_operations.py | 23 +- .../_operation_statuses_operations.py | 9 +- .../aio/operations/_operations.py | 23 +- .../aio/operations/_queries_operations.py | 60 ++- .../aio/operations/_query_packs_operations.py | 64 ++- .../operations/_saved_searches_operations.py | 25 +- .../aio/operations/_schema_operations.py | 9 +- .../aio/operations/_shared_keys_operations.py | 13 +- .../_storage_insight_configs_operations.py | 37 +- .../aio/operations/_tables_operations.py | 68 ++- .../aio/operations/_usages_operations.py | 23 +- .../operations/_workspace_purge_operations.py | 13 +- .../aio/operations/_workspaces_operations.py | 60 ++- .../mgmt/loganalytics/models/__init__.py | 251 +++++----- .../_log_analytics_management_client_enums.py | 49 +- .../mgmt/loganalytics/models/_models_py3.py | 474 ++++++++++++------ .../mgmt/loganalytics/operations/__init__.py | 74 +-- .../_available_service_tiers_operations.py | 11 +- .../operations/_clusters_operations.py | 96 ++-- .../operations/_data_exports_operations.py | 43 +- .../operations/_data_sources_operations.py | 43 +- .../_deleted_workspaces_operations.py | 44 +- .../operations/_gateways_operations.py | 11 +- .../_intelligence_packs_operations.py | 23 +- .../operations/_linked_services_operations.py | 47 +- .../_linked_storage_accounts_operations.py | 43 +- .../_management_groups_operations.py | 25 +- .../_operation_statuses_operations.py | 11 +- .../loganalytics/operations/_operations.py | 25 +- .../operations/_queries_operations.py | 69 ++- .../operations/_query_packs_operations.py | 74 ++- .../operations/_saved_searches_operations.py | 29 +- .../operations/_schema_operations.py | 11 +- .../operations/_shared_keys_operations.py | 17 +- .../_storage_insight_configs_operations.py | 43 +- .../operations/_tables_operations.py | 101 ++-- .../operations/_usages_operations.py | 25 +- .../operations/_workspace_purge_operations.py | 17 +- .../operations/_workspaces_operations.py | 72 ++- .../generated_samples/clusters_create.py | 4 +- .../generated_samples/clusters_delete.py | 2 +- .../generated_samples/clusters_get.py | 2 +- .../clusters_list_by_resource_group.py | 2 +- .../clusters_subscription_list.py | 2 +- .../generated_samples/clusters_update.py | 2 +- .../data_export_create_or_update.py | 2 +- .../generated_samples/data_export_delete.py | 2 +- .../generated_samples/data_export_get.py | 2 +- .../data_export_list_by_workspace.py | 2 +- .../generated_samples/data_sources_create.py | 2 +- .../generated_samples/data_sources_delete.py | 2 +- .../generated_samples/data_sources_get.py | 2 +- .../data_sources_list_by_workspace.py | 2 +- .../linked_services_create.py | 2 +- .../linked_services_delete.py | 2 +- .../generated_samples/linked_services_get.py | 2 +- .../linked_services_list_by_workspace.py | 2 +- .../linked_storage_accounts_create.py | 2 +- .../linked_storage_accounts_delete.py | 2 +- .../linked_storage_accounts_get.py | 2 +- ...nked_storage_accounts_list_by_workspace.py | 2 +- .../operation_statuses_get.py | 2 +- .../operations_list_by_tenant.py | 2 +- .../query_pack_queries_delete.py | 2 +- .../query_pack_queries_get.py | 2 +- .../query_pack_queries_list.py | 2 +- .../generated_samples/query_packs_delete.py | 2 +- .../generated_samples/query_packs_get.py | 2 +- .../generated_samples/query_packs_list.py | 2 +- .../query_packs_list_by_resource_group.py | 2 +- .../saved_searches_get_schema.py | 2 +- .../saved_searches_list_by_workspace.py | 2 +- .../storage_insights_create_or_update.py | 2 +- .../storage_insights_delete.py | 2 +- .../generated_samples/storage_insights_get.py | 2 +- .../storage_insights_list_by_workspace.py | 2 +- .../generated_samples/tables_delete.py | 2 +- .../generated_samples/tables_get.py | 2 +- .../generated_samples/tables_list.py | 2 +- .../generated_samples/tables_migrate.py | 2 +- .../generated_samples/tables_search_cancel.py | 2 +- .../generated_samples/tables_upsert.py | 4 +- .../workspaces_available_service_tiers.py | 2 +- .../generated_samples/workspaces_create.py | 2 +- .../generated_samples/workspaces_delete.py | 2 +- .../workspaces_delete_saved_searches.py | 2 +- .../workspaces_disable_intelligence_pack.py | 2 +- .../workspaces_enable_intelligence_pack.py | 2 +- .../workspaces_gateways_delete.py | 2 +- .../generated_samples/workspaces_get.py | 2 +- .../workspaces_get_shared_keys.py | 2 +- .../workspaces_list_by_resource_group.py | 4 +- .../workspaces_list_intelligence_packs.py | 2 +- .../workspaces_list_management_groups.py | 2 +- .../workspaces_list_usages.py | 2 +- .../generated_samples/workspaces_purge.py | 2 +- .../workspaces_purge_operation.py | 2 +- .../workspaces_purge_resource_id.py | 2 +- .../workspaces_regenerate_shared_keys.py | 2 +- ...kspaces_saved_searches_create_or_update.py | 2 +- .../workspaces_saved_searches_get.py | 2 +- .../workspaces_subscription_list.py | 2 +- .../generated_samples/workspaces_update.py | 2 +- .../generated_tests/conftest.py | 2 +- ...ment_available_service_tiers_operations.py | 4 +- ...vailable_service_tiers_operations_async.py | 4 +- ...nalytics_management_clusters_operations.py | 32 +- ...cs_management_clusters_operations_async.py | 32 +- ...tics_management_data_exports_operations.py | 16 +- ...anagement_data_exports_operations_async.py | 16 +- ...tics_management_data_sources_operations.py | 16 +- ...anagement_data_sources_operations_async.py | 16 +- ...anagement_deleted_workspaces_operations.py | 8 +- ...ent_deleted_workspaces_operations_async.py | 8 +- ...nalytics_management_gateways_operations.py | 4 +- ...cs_management_gateways_operations_async.py | 4 +- ...anagement_intelligence_packs_operations.py | 12 +- ...ent_intelligence_packs_operations_async.py | 12 +- ...s_management_linked_services_operations.py | 16 +- ...gement_linked_services_operations_async.py | 16 +- ...ment_linked_storage_accounts_operations.py | 16 +- ...inked_storage_accounts_operations_async.py | 16 +- ...management_management_groups_operations.py | 4 +- ...ment_management_groups_operations_async.py | 4 +- ...anagement_operation_statuses_operations.py | 4 +- ...ent_operation_statuses_operations_async.py | 4 +- ...est_log_analytics_management_operations.py | 4 +- ...g_analytics_management_operations_async.py | 4 +- ...analytics_management_queries_operations.py | 24 +- ...ics_management_queries_operations_async.py | 24 +- ...ytics_management_query_packs_operations.py | 44 +- ...management_query_packs_operations_async.py | 44 +- ...cs_management_saved_searches_operations.py | 16 +- ...agement_saved_searches_operations_async.py | 16 +- ..._analytics_management_schema_operations.py | 4 +- ...tics_management_schema_operations_async.py | 4 +- ...ytics_management_shared_keys_operations.py | 8 +- ...management_shared_keys_operations_async.py | 8 +- ...ment_storage_insight_configs_operations.py | 16 +- ...torage_insight_configs_operations_async.py | 16 +- ..._analytics_management_tables_operations.py | 28 +- ...tics_management_tables_operations_async.py | 28 +- ..._analytics_management_usages_operations.py | 4 +- ...tics_management_usages_operations_async.py | 4 +- ...s_management_workspace_purge_operations.py | 8 +- ...gement_workspace_purge_operations_async.py | 8 +- ...lytics_management_workspaces_operations.py | 42 +- ..._management_workspaces_operations_async.py | 42 +- .../azure-mgmt-loganalytics/setup.py | 10 +- 168 files changed, 2443 insertions(+), 1537 deletions(-) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json b/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json index 5edd9181339e..084d95a8e484 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json +++ b/sdk/loganalytics/azure-mgmt-loganalytics/_meta.json @@ -1,11 +1,11 @@ { - "commit": "690a7656d65a03b134fa44fc7bb8013dc18a15b5", + "commit": "46d73ce82efedd9892969d8eebdfae350b69f99e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.19.0", + "@autorest/python@6.27.2", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/operationalinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/azure-sdk-for-python/sdk --tag=package-2022-10 --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/operationalinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.27.2 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/operationalinsights/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py index 4353bcf34274..bffaef07aa46 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/__init__.py @@ -5,15 +5,21 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._log_analytics_management_client import LogAnalyticsManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._log_analytics_management_client import LogAnalyticsManagementClient # type: ignore from ._version import VERSION __version__ = VERSION try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -21,6 +27,6 @@ __all__ = [ "LogAnalyticsManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py index 4adc03491fa7..f9e38f27fd3d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_configuration.py @@ -14,7 +14,6 @@ from ._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential @@ -28,9 +27,14 @@ class LogAnalyticsManagementClientConfiguration: # pylint: disable=too-many-ins :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2025-02-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -38,6 +42,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs self.credential = credential self.subscription_id = subscription_id + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-loganalytics/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py index 7b63f83d07d8..5cea4065459a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_log_analytics_management_client.py @@ -44,21 +44,23 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class LogAnalyticsManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class LogAnalyticsManagementClient: # pylint: disable=too-many-instance-attributes """Operational Insights Client. - :ivar query_packs: QueryPacksOperations operations - :vartype query_packs: azure.mgmt.loganalytics.operations.QueryPacksOperations - :ivar queries: QueriesOperations operations - :vartype queries: azure.mgmt.loganalytics.operations.QueriesOperations + :ivar available_service_tiers: AvailableServiceTiersOperations operations + :vartype available_service_tiers: + azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations :ivar data_exports: DataExportsOperations operations :vartype data_exports: azure.mgmt.loganalytics.operations.DataExportsOperations :ivar data_sources: DataSourcesOperations operations :vartype data_sources: azure.mgmt.loganalytics.operations.DataSourcesOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations :ivar intelligence_packs: IntelligencePacksOperations operations :vartype intelligence_packs: azure.mgmt.loganalytics.operations.IntelligencePacksOperations :ivar linked_services: LinkedServicesOperations operations @@ -68,42 +70,42 @@ class LogAnalyticsManagementClient: # pylint: disable=client-accepts-api-versio azure.mgmt.loganalytics.operations.LinkedStorageAccountsOperations :ivar management_groups: ManagementGroupsOperations operations :vartype management_groups: azure.mgmt.loganalytics.operations.ManagementGroupsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.loganalytics.operations.Operations :ivar operation_statuses: OperationStatusesOperations operations :vartype operation_statuses: azure.mgmt.loganalytics.operations.OperationStatusesOperations + :ivar queries: QueriesOperations operations + :vartype queries: azure.mgmt.loganalytics.operations.QueriesOperations + :ivar query_packs: QueryPacksOperations operations + :vartype query_packs: azure.mgmt.loganalytics.operations.QueryPacksOperations + :ivar saved_searches: SavedSearchesOperations operations + :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations + :ivar schema: SchemaOperations operations + :vartype schema: azure.mgmt.loganalytics.operations.SchemaOperations :ivar shared_keys: SharedKeysOperations operations :vartype shared_keys: azure.mgmt.loganalytics.operations.SharedKeysOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations :ivar storage_insight_configs: StorageInsightConfigsOperations operations :vartype storage_insight_configs: azure.mgmt.loganalytics.operations.StorageInsightConfigsOperations - :ivar saved_searches: SavedSearchesOperations operations - :vartype saved_searches: azure.mgmt.loganalytics.operations.SavedSearchesOperations - :ivar available_service_tiers: AvailableServiceTiersOperations operations - :vartype available_service_tiers: - azure.mgmt.loganalytics.operations.AvailableServiceTiersOperations - :ivar gateways: GatewaysOperations operations - :vartype gateways: azure.mgmt.loganalytics.operations.GatewaysOperations - :ivar schema: SchemaOperations operations - :vartype schema: azure.mgmt.loganalytics.operations.SchemaOperations + :ivar tables: TablesOperations operations + :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.loganalytics.operations.UsagesOperations :ivar workspace_purge: WorkspacePurgeOperations operations :vartype workspace_purge: azure.mgmt.loganalytics.operations.WorkspacePurgeOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.loganalytics.operations.ClustersOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.loganalytics.operations.Operations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.loganalytics.operations.WorkspacesOperations :ivar deleted_workspaces: DeletedWorkspacesOperations operations :vartype deleted_workspaces: azure.mgmt.loganalytics.operations.DeletedWorkspacesOperations - :ivar tables: TablesOperations operations - :vartype tables: azure.mgmt.loganalytics.operations.TablesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -142,10 +144,13 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.query_packs = QueryPacksOperations(self._client, self._config, self._serialize, self._deserialize) - self.queries = QueriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.available_service_tiers = AvailableServiceTiersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.data_exports = DataExportsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) self.intelligence_packs = IntelligencePacksOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -156,28 +161,25 @@ def __init__( self.management_groups = ManagementGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.operation_statuses = OperationStatusesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.queries = QueriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_packs = QueryPacksOperations(self._client, self._config, self._serialize, self._deserialize) + self.saved_searches = SavedSearchesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schema = SchemaOperations(self._client, self._config, self._serialize, self._deserialize) self.shared_keys = SharedKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.storage_insight_configs = StorageInsightConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.saved_searches = SavedSearchesOperations(self._client, self._config, self._serialize, self._deserialize) - self.available_service_tiers = AvailableServiceTiersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) - self.schema = SchemaOperations(self._client, self._config, self._serialize, self._deserialize) + self.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_purge = WorkspacePurgeOperations(self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) self.deleted_workspaces = DeletedWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_serialization.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_serialization.py index 8139854b97bb..b24ab2885450 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_serialization.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_serialization.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. @@ -24,7 +25,6 @@ # # -------------------------------------------------------------------------- -# pylint: skip-file # pyright: reportUnnecessaryTypeIgnoreComment=false from base64 import b64decode, b64encode @@ -52,7 +52,6 @@ MutableMapping, Type, List, - Mapping, ) try: @@ -91,6 +90,8 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: :param data: Input, could be bytes or stream (will be decoded with UTF8) or text :type data: str or bytes or IO :param str content_type: The content type. + :return: The deserialized data. + :rtype: object """ if hasattr(data, "read"): # Assume a stream @@ -112,7 +113,7 @@ def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: try: return json.loads(data_as_str) except ValueError as err: - raise DeserializationError("JSON is invalid: {}".format(err), err) + raise DeserializationError("JSON is invalid: {}".format(err), err) from err elif "xml" in (content_type or []): try: @@ -155,6 +156,11 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], Use bytes and headers to NOT use any requests/aiohttp or whatever specific implementation. Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object """ # Try to use content-type from headers if available content_type = None @@ -184,15 +190,30 @@ class UTC(datetime.tzinfo): """Time Zone info for handling UTC""" def utcoffset(self, dt): - """UTF offset for UTC is 0.""" + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ return datetime.timedelta(0) def tzname(self, dt): - """Timestamp representation.""" + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ return "Z" def dst(self, dt): - """No daylight saving for UTC.""" + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ return datetime.timedelta(hours=1) @@ -206,7 +227,7 @@ class _FixedOffset(datetime.tzinfo): # type: ignore :param datetime.timedelta offset: offset in timedelta format """ - def __init__(self, offset): + def __init__(self, offset) -> None: self.__offset = offset def utcoffset(self, dt): @@ -235,24 +256,26 @@ def __getinitargs__(self): _FLATTEN = re.compile(r"(? None: self.additional_properties: Optional[Dict[str, Any]] = {} - for k in kwargs: + for k in kwargs: # pylint: disable=consider-using-dict-items if k not in self._attribute_map: _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) elif k in self._validation and self._validation[k].get("readonly", False): @@ -300,13 +330,23 @@ def __init__(self, **kwargs: Any) -> None: setattr(self, k, kwargs[k]) def __eq__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ if isinstance(other, self.__class__): return self.__dict__ == other.__dict__ return False def __ne__(self, other: Any) -> bool: - """Compare objects by comparing all attributes.""" + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ return not self.__eq__(other) def __str__(self) -> str: @@ -326,7 +366,11 @@ def is_xml_model(cls) -> bool: @classmethod def _create_xml_node(cls): - """Create XML node.""" + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ try: xml_map = cls._xml_map # type: ignore except AttributeError: @@ -346,7 +390,9 @@ def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) def as_dict( self, @@ -380,12 +426,15 @@ def my_key_transformer(key, attr_desc, value): If you want XML serialization, you can pass the kwargs is_xml=True. + :param bool keep_readonly: If you want to serialize the readonly attributes :param function key_transformer: A key transformer function. :returns: A dict JSON compatible object :rtype: dict """ serializer = Serializer(self._infer_class_models()) - return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) # type: ignore + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) @classmethod def _infer_class_models(cls): @@ -395,7 +444,7 @@ def _infer_class_models(cls): client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} if cls.__name__ not in client_models: raise ValueError("Not Autorest generated code") - except Exception: + except Exception: # pylint: disable=broad-exception-caught # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. client_models = {cls.__name__: cls} return client_models @@ -408,6 +457,7 @@ def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = N :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) return deserializer(cls.__name__, data, content_type=content_type) # type: ignore @@ -426,9 +476,11 @@ def from_dict( and last_rest_key_case_insensitive_extractor) :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. :param str content_type: JSON by default, set application/xml if XML. :returns: An instance of this model :raises: DeserializationError if something went wrong + :rtype: ModelType """ deserializer = Deserializer(cls._infer_class_models()) deserializer.key_extractors = ( # type: ignore @@ -448,21 +500,25 @@ def _flatten_subtype(cls, key, objects): return {} result = dict(cls._subtype_map[key]) for valuetype in cls._subtype_map[key].values(): - result.update(objects[valuetype]._flatten_subtype(key, objects)) + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access return result @classmethod def _classify(cls, response, objects): """Check the class _subtype_map for any child classes. We want to ignore any inherited _subtype_maps. - Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class """ for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): subtype_value = None if not isinstance(response, ET.Element): rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] - subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + subtype_value = response.get(rest_api_response_key, None) or response.get(subtype_key, None) else: subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) if subtype_value: @@ -501,11 +557,13 @@ def _decode_attribute_map_key(key): inside the received data. :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str """ return key.replace("\\.", ".") -class Serializer(object): +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -540,7 +598,7 @@ class Serializer(object): "multiple": lambda x, y: x % y != 0, } - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.serialize_type = { "iso-8601": Serializer.serialize_iso, "rfc-1123": Serializer.serialize_rfc, @@ -560,13 +618,16 @@ def __init__(self, classes: Optional[Mapping[str, type]] = None): self.key_transformer = full_restapi_key_transformer self.client_side_validation = True - def _serialize(self, target_obj, data_type=None, **kwargs): + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): """Serialize data into a string according to type. - :param target_obj: The data to be serialized. + :param object target_obj: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str, dict :raises: SerializationError if serialization fails. + :returns: The serialized data. """ key_transformer = kwargs.get("key_transformer", self.key_transformer) keep_readonly = kwargs.get("keep_readonly", False) @@ -592,12 +653,14 @@ def _serialize(self, target_obj, data_type=None, **kwargs): serialized = {} if is_xml_model_serialization: - serialized = target_obj._create_xml_node() + serialized = target_obj._create_xml_node() # pylint: disable=protected-access try: - attributes = target_obj._attribute_map + attributes = target_obj._attribute_map # pylint: disable=protected-access for attr, attr_desc in attributes.items(): attr_name = attr - if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): continue if attr_name == "additional_properties" and attr_desc["key"] == "": @@ -633,7 +696,8 @@ def _serialize(self, target_obj, data_type=None, **kwargs): if isinstance(new_attr, list): serialized.extend(new_attr) # type: ignore elif isinstance(new_attr, ET.Element): - # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. if "name" not in getattr(orig_attr, "_xml_map", {}): splitted_tag = new_attr.tag.split("}") if len(splitted_tag) == 2: # Namespace @@ -664,17 +728,17 @@ def _serialize(self, target_obj, data_type=None, **kwargs): except (AttributeError, KeyError, TypeError) as err: msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) raise SerializationError(msg) from err - else: - return serialized + return serialized def body(self, data, data_type, **kwargs): """Serialize data intended for a request body. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: dict :raises: SerializationError if serialization fails. :raises: ValueError if data is None + :returns: The serialized request body """ # Just in case this is a dict @@ -703,7 +767,7 @@ def body(self, data, data_type, **kwargs): attribute_key_case_insensitive_extractor, last_rest_key_case_insensitive_extractor, ] - data = deserializer._deserialize(data_type, data) + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access except DeserializationError as err: raise SerializationError("Unable to build a model: " + str(err)) from err @@ -712,9 +776,11 @@ def body(self, data, data_type, **kwargs): def url(self, name, data, data_type, **kwargs): """Serialize data intended for a URL path. - :param data: The data to be serialized. + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str + :returns: The serialized URL path :raises: TypeError if serialization fails. :raises: ValueError if data is None """ @@ -728,21 +794,20 @@ def url(self, name, data, data_type, **kwargs): output = output.replace("{", quote("{")).replace("}", quote("}")) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return output + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output def query(self, name, data, data_type, **kwargs): """Serialize data intended for a URL query. - :param data: The data to be serialized. + :param str name: The name of the query parameter. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :keyword bool skip_quote: Whether to skip quote the serialized result. - Defaults to False. :rtype: str, list :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized query parameter """ try: # Treat the list aside, since we don't want to encode the div separator @@ -759,19 +824,20 @@ def query(self, name, data, data_type, **kwargs): output = str(output) else: output = quote(str(output), safe="") - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def header(self, name, data, data_type, **kwargs): """Serialize data intended for a request header. - :param data: The data to be serialized. + :param str name: The name of the header. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. :rtype: str :raises: TypeError if serialization fails. :raises: ValueError if data is None + :returns: The serialized header """ try: if data_type in ["[str]"]: @@ -780,21 +846,20 @@ def header(self, name, data, data_type, **kwargs): output = self.serialize_data(data, data_type, **kwargs) if data_type == "bool": output = json.dumps(output) - except SerializationError: - raise TypeError("{} must be type {}.".format(name, data_type)) - else: - return str(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) def serialize_data(self, data, data_type, **kwargs): """Serialize generic data according to supplied data type. - :param data: The data to be serialized. + :param object data: The data to be serialized. :param str data_type: The type to be serialized from. - :param bool required: Whether it's essential that the data not be - empty or None :raises: AttributeError if required data is None. :raises: ValueError if data is None :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list """ if data is None: raise ValueError("No value for given attribute") @@ -805,7 +870,7 @@ def serialize_data(self, data, data_type, **kwargs): if data_type in self.basic_types.values(): return self.serialize_basic(data, data_type, **kwargs) - elif data_type in self.serialize_type: + if data_type in self.serialize_type: return self.serialize_type[data_type](data, **kwargs) # If dependencies is empty, try with current data class @@ -821,11 +886,10 @@ def serialize_data(self, data, data_type, **kwargs): except (ValueError, TypeError) as err: msg = "Unable to serialize value: {!r} as type: {!r}." raise SerializationError(msg.format(data, data_type)) from err - else: - return self._serialize(data, **kwargs) + return self._serialize(data, **kwargs) @classmethod - def _get_custom_serializers(cls, data_type, **kwargs): + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) if custom_serializer: return custom_serializer @@ -841,23 +905,26 @@ def serialize_basic(cls, data, data_type, **kwargs): - basic_types_serializers dict[str, callable] : If set, use the callable as serializer - is_xml bool : If set, use xml_basic_types_serializers - :param data: Object to be serialized. + :param obj data: Object to be serialized. :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec + return eval(data_type)(data) # nosec # pylint: disable=eval-used @classmethod def serialize_unicode(cls, data): """Special handling for serializing unicode strings in Py2. Encode to UTF-8 if unicode, otherwise handle as a str. - :param data: Object to be serialized. + :param str data: Object to be serialized. :rtype: str + :return: serialized object """ try: # If I received an enum, return its value return data.value @@ -871,8 +938,7 @@ def serialize_unicode(cls, data): return data except NameError: return str(data) - else: - return str(data) + return str(data) def serialize_iter(self, data, iter_type, div=None, **kwargs): """Serialize iterable. @@ -882,15 +948,13 @@ def serialize_iter(self, data, iter_type, div=None, **kwargs): serialization_ctxt['type'] should be same as data_type. - is_xml bool : If set, serialize as XML - :param list attr: Object to be serialized. + :param list data: Object to be serialized. :param str iter_type: Type of object in the iterable. - :param bool required: Whether the objects in the iterable must - not be None or empty. :param str div: If set, this str will be used to combine the elements in the iterable into a combined string. Default is 'None'. - :keyword bool do_quote: Whether to quote the serialized result of each iterable element. Defaults to False. :rtype: list, str + :return: serialized iterable """ if isinstance(data, str): raise SerializationError("Refuse str type as a valid iter type.") @@ -945,9 +1009,8 @@ def serialize_dict(self, attr, dict_type, **kwargs): :param dict attr: Object to be serialized. :param str dict_type: Type of object in the dictionary. - :param bool required: Whether the objects in the dictionary must - not be None or empty. :rtype: dict + :return: serialized dictionary """ serialization_ctxt = kwargs.get("serialization_ctxt", {}) serialized = {} @@ -971,7 +1034,7 @@ def serialize_dict(self, attr, dict_type, **kwargs): return serialized - def serialize_object(self, attr, **kwargs): + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Serialize a generic object. This will be handled as a dictionary. If object passed in is not a basic type (str, int, float, dict, list) it will simply be @@ -979,6 +1042,7 @@ def serialize_object(self, attr, **kwargs): :param dict attr: Object to be serialized. :rtype: dict or str + :return: serialized object """ if attr is None: return None @@ -1003,7 +1067,7 @@ def serialize_object(self, attr, **kwargs): return self.serialize_decimal(attr) # If it's a model or I know this dependency, serialize as a Model - elif obj_type in self.dependencies.values() or isinstance(attr, Model): + if obj_type in self.dependencies.values() or isinstance(attr, Model): return self._serialize(attr) if obj_type == dict: @@ -1034,56 +1098,61 @@ def serialize_enum(attr, enum_obj=None): try: enum_obj(result) # type: ignore return result - except ValueError: + except ValueError as exc: for enum_value in enum_obj: # type: ignore if enum_value.value.lower() == str(attr).lower(): return enum_value.value error = "{!r} is not valid value for enum {!r}" - raise SerializationError(error.format(attr, enum_obj)) + raise SerializationError(error.format(attr, enum_obj)) from exc @staticmethod - def serialize_bytearray(attr, **kwargs): + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument """Serialize bytearray into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ return b64encode(attr).decode() @staticmethod - def serialize_base64(attr, **kwargs): + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument """Serialize str into base-64 string. - :param attr: Object to be serialized. + :param str attr: Object to be serialized. :rtype: str + :return: serialized base64 """ encoded = b64encode(attr).decode("ascii") return encoded.strip("=").replace("+", "-").replace("/", "_") @staticmethod - def serialize_decimal(attr, **kwargs): + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument """Serialize Decimal object to float. - :param attr: Object to be serialized. + :param decimal attr: Object to be serialized. :rtype: float + :return: serialized decimal """ return float(attr) @staticmethod - def serialize_long(attr, **kwargs): + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument """Serialize long (Py2) or int (Py3). - :param attr: Object to be serialized. + :param int attr: Object to be serialized. :rtype: int/long + :return: serialized long """ return _long_type(attr) @staticmethod - def serialize_date(attr, **kwargs): + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument """Serialize Date object into ISO-8601 formatted string. :param Date attr: Object to be serialized. :rtype: str + :return: serialized date """ if isinstance(attr, str): attr = isodate.parse_date(attr) @@ -1091,11 +1160,12 @@ def serialize_date(attr, **kwargs): return t @staticmethod - def serialize_time(attr, **kwargs): + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument """Serialize Time object into ISO-8601 formatted string. :param datetime.time attr: Object to be serialized. :rtype: str + :return: serialized time """ if isinstance(attr, str): attr = isodate.parse_time(attr) @@ -1105,30 +1175,32 @@ def serialize_time(attr, **kwargs): return t @staticmethod - def serialize_duration(attr, **kwargs): + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument """Serialize TimeDelta object into ISO-8601 formatted string. :param TimeDelta attr: Object to be serialized. :rtype: str + :return: serialized duration """ if isinstance(attr, str): attr = isodate.parse_duration(attr) return isodate.duration_isoformat(attr) @staticmethod - def serialize_rfc(attr, **kwargs): + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into RFC-1123 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: TypeError if format invalid. + :return: serialized rfc """ try: if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") utc = attr.utctimetuple() - except AttributeError: - raise TypeError("RFC1123 object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( Serializer.days[utc.tm_wday], @@ -1141,12 +1213,13 @@ def serialize_rfc(attr, **kwargs): ) @staticmethod - def serialize_iso(attr, **kwargs): + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into ISO-8601 formatted string. :param Datetime attr: Object to be serialized. :rtype: str :raises: SerializationError if format invalid. + :return: serialized iso """ if isinstance(attr, str): attr = isodate.parse_datetime(attr) @@ -1172,13 +1245,14 @@ def serialize_iso(attr, **kwargs): raise TypeError(msg) from err @staticmethod - def serialize_unix(attr, **kwargs): + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument """Serialize Datetime object into IntTime format. This is represented as seconds. :param Datetime attr: Object to be serialized. :rtype: int :raises: SerializationError if format invalid + :return: serialied unix """ if isinstance(attr, int): return attr @@ -1186,11 +1260,11 @@ def serialize_unix(attr, **kwargs): if not attr.tzinfo: _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") return int(calendar.timegm(attr.utctimetuple())) - except AttributeError: - raise TypeError("Unix time object must be valid Datetime object.") + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc -def rest_key_extractor(attr, attr_desc, data): +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument key = attr_desc["key"] working_data = data @@ -1211,7 +1285,9 @@ def rest_key_extractor(attr, attr_desc, data): return working_data.get(key) -def rest_key_case_insensitive_extractor(attr, attr_desc, data): +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): key = attr_desc["key"] working_data = data @@ -1232,17 +1308,29 @@ def rest_key_case_insensitive_extractor(attr, attr_desc, data): return attribute_key_case_insensitive_extractor(key, None, working_data) -def last_rest_key_extractor(attr, attr_desc, data): - """Extract the attribute in "data" based on the last part of the JSON path key.""" +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) return attribute_key_extractor(dict_keys[-1], None, data) -def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument """Extract the attribute in "data" based on the last part of the JSON path key. This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute """ key = attr_desc["key"] dict_keys = _FLATTEN.split(key) @@ -1279,7 +1367,7 @@ def _extract_name_from_internal_type(internal_type): return xml_name -def xml_key_extractor(attr, attr_desc, data): +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements if isinstance(data, dict): return None @@ -1331,22 +1419,21 @@ def xml_key_extractor(attr, attr_desc, data): if is_iter_type: if is_wrapped: return None # is_wrapped no node, we want None - else: - return [] # not wrapped, assume empty list + return [] # not wrapped, assume empty list return None # Assume it's not there, maybe an optional node. # If is_iter_type and not wrapped, return all found children if is_iter_type: if not is_wrapped: return children - else: # Iter and wrapped, should have found one node only (the wrap one) - if len(children) != 1: - raise DeserializationError( - "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( - xml_name - ) + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name ) - return list(children[0]) # Might be empty list and that's ok. + ) + return list(children[0]) # Might be empty list and that's ok. # Here it's not a itertype, we should have found one element only or empty if len(children) > 1: @@ -1354,7 +1441,7 @@ def xml_key_extractor(attr, attr_desc, data): return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. @@ -1363,9 +1450,9 @@ class Deserializer(object): basic_types = {str: "str", int: "int", bool: "bool", float: "float"} - valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") - def __init__(self, classes: Optional[Mapping[str, type]] = None): + def __init__(self, classes: Optional[Mapping[str, type]] = None) -> None: self.deserialize_type = { "iso-8601": Deserializer.deserialize_iso, "rfc-1123": Deserializer.deserialize_rfc, @@ -1403,11 +1490,12 @@ def __call__(self, target_obj, response_data, content_type=None): :param str content_type: Swagger "produces" if available. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ data = self._unpack_content(response_data, content_type) return self._deserialize(target_obj, data) - def _deserialize(self, target_obj, data): + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements """Call the deserializer on a model. Data needs to be already deserialized as JSON or XML ElementTree @@ -1416,12 +1504,13 @@ def _deserialize(self, target_obj, data): :param object data: Object to deserialize. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ # This is already a model, go recursive just in case if hasattr(data, "_attribute_map"): constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] try: - for attr, mapconfig in data._attribute_map.items(): + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access if attr in constants: continue value = getattr(data, attr) @@ -1440,13 +1529,13 @@ def _deserialize(self, target_obj, data): if isinstance(response, str): return self.deserialize_data(data, response) - elif isinstance(response, type) and issubclass(response, Enum): + if isinstance(response, type) and issubclass(response, Enum): return self.deserialize_enum(data, response) if data is None or data is CoreNull: return data try: - attributes = response._attribute_map # type: ignore + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access d_attrs = {} for attr, attr_desc in attributes.items(): # Check empty string. If it's not empty, someone has a real "additionalProperties"... @@ -1476,9 +1565,8 @@ def _deserialize(self, target_obj, data): except (AttributeError, TypeError, KeyError) as err: msg = "Unable to deserialize to object: " + class_name # type: ignore raise DeserializationError(msg) from err - else: - additional_properties = self._build_additional_properties(attributes, data) - return self._instantiate_model(response, d_attrs, additional_properties) + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) def _build_additional_properties(self, attribute_map, data): if not self.additional_properties_detection: @@ -1505,6 +1593,8 @@ def _classify_target(self, target, data): :param str target: The target object type to deserialize to. :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple """ if target is None: return None, None @@ -1516,7 +1606,7 @@ def _classify_target(self, target, data): return target, target try: - target = target._classify(data, self.dependencies) # type: ignore + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access except AttributeError: pass # Target is not a Model, no classify return target, target.__class__.__name__ # type: ignore @@ -1531,10 +1621,12 @@ def failsafe_deserialize(self, target_obj, data, content_type=None): :param str target_obj: The target object type to deserialize to. :param str/dict data: The response data to deserialize. :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object """ try: return self(target_obj, data, content_type=content_type) - except: + except: # pylint: disable=bare-except _LOGGER.debug( "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True ) @@ -1552,10 +1644,12 @@ def _unpack_content(raw_data, content_type=None): If raw_data is something else, bypass all logic and return it directly. - :param raw_data: Data to be processed. - :param content_type: How to parse if raw_data is a string/bytes. + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. :raises JSONDecodeError: If JSON is requested and parsing is impossible. :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. """ # Assume this is enough to detect a Pipeline Response without importing it context = getattr(raw_data, "context", {}) @@ -1579,24 +1673,35 @@ def _unpack_content(raw_data, content_type=None): def _instantiate_model(self, response, attrs, additional_properties=None): """Instantiate a response model passing in deserialized args. - :param response: The response model class. - :param d_attrs: The deserialized response attributes. + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. """ if callable(response): subtype = getattr(response, "_subtype_map", {}) try: - readonly = [k for k, v in response._validation.items() if v.get("readonly")] - const = [k for k, v in response._validation.items() if v.get("constant")] + readonly = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} response_obj = response(**kwargs) for attr in readonly: setattr(response_obj, attr, attrs.get(attr)) if additional_properties: - response_obj.additional_properties = additional_properties + response_obj.additional_properties = additional_properties # type: ignore return response_obj except TypeError as err: msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore - raise DeserializationError(msg + str(err)) + raise DeserializationError(msg + str(err)) from err else: try: for attr, value in attrs.items(): @@ -1605,15 +1710,16 @@ def _instantiate_model(self, response, attrs, additional_properties=None): except Exception as exp: msg = "Unable to populate response model. " msg += "Type: {}, Error: {}".format(type(response), exp) - raise DeserializationError(msg) + raise DeserializationError(msg) from exp - def deserialize_data(self, data, data_type): + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements """Process data for deserialization according to data type. :param str data: The response string to be deserialized. :param str data_type: The type to deserialize to. :raises: DeserializationError if deserialization fails. :return: Deserialized object. + :rtype: object """ if data is None: return data @@ -1627,7 +1733,11 @@ def deserialize_data(self, data, data_type): if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): return data - is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: return None data_val = self.deserialize_type[data_type](data) @@ -1647,14 +1757,14 @@ def deserialize_data(self, data, data_type): msg = "Unable to deserialize response data." msg += " Data: {}, {}".format(data, data_type) raise DeserializationError(msg) from err - else: - return self._deserialize(obj_type, data) + return self._deserialize(obj_type, data) def deserialize_iter(self, attr, iter_type): """Deserialize an iterable. :param list attr: Iterable to be deserialized. :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. :rtype: list """ if attr is None: @@ -1671,6 +1781,7 @@ def deserialize_dict(self, attr, dict_type): :param dict/list attr: Dictionary to be deserialized. Also accepts a list of key, value pairs. :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. :rtype: dict """ if isinstance(attr, list): @@ -1681,11 +1792,12 @@ def deserialize_dict(self, attr, dict_type): attr = {el.tag: el.text for el in attr} return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} - def deserialize_object(self, attr, **kwargs): + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements """Deserialize a generic object. This will be handled as a dictionary. :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. :rtype: dict :raises: TypeError if non-builtin datatype encountered. """ @@ -1720,11 +1832,10 @@ def deserialize_object(self, attr, **kwargs): pass return deserialized - else: - error = "Cannot deserialize generic object with type: " - raise TypeError(error + str(obj_type)) + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) - def deserialize_basic(self, attr, data_type): + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements """Deserialize basic builtin data type from string. Will attempt to convert to str, int, float and bool. This function will also accept '1', '0', 'true' and 'false' as @@ -1732,6 +1843,7 @@ def deserialize_basic(self, attr, data_type): :param str attr: response string to be deserialized. :param str data_type: deserialization data type. + :return: Deserialized basic type. :rtype: str, int, float or bool :raises: TypeError if string format is not valid. """ @@ -1743,24 +1855,23 @@ def deserialize_basic(self, attr, data_type): if data_type == "str": # None or '', node is empty string. return "" - else: - # None or '', node with a strong type is None. - # Don't try to model "empty bool" or "empty int" - return None + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None if data_type == "bool": if attr in [True, False, 1, 0]: return bool(attr) - elif isinstance(attr, str): + if isinstance(attr, str): if attr.lower() in ["true", "1"]: return True - elif attr.lower() in ["false", "0"]: + if attr.lower() in ["false", "0"]: return False raise TypeError("Invalid boolean value: {}".format(attr)) if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec + return eval(data_type)(attr) # nosec # pylint: disable=eval-used @staticmethod def deserialize_unicode(data): @@ -1768,6 +1879,7 @@ def deserialize_unicode(data): as a string. :param str data: response string to be deserialized. + :return: Deserialized string. :rtype: str or unicode """ # We might be here because we have an enum modeled as string, @@ -1781,8 +1893,7 @@ def deserialize_unicode(data): return data except NameError: return str(data) - else: - return str(data) + return str(data) @staticmethod def deserialize_enum(data, enum_obj): @@ -1794,6 +1905,7 @@ def deserialize_enum(data, enum_obj): :param str data: Response string to be deserialized. If this value is None or invalid it will be returned as-is. :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. :rtype: Enum """ if isinstance(data, enum_obj) or data is None: @@ -1804,9 +1916,9 @@ def deserialize_enum(data, enum_obj): # Workaround. We might consider remove it in the future. try: return list(enum_obj.__members__.values())[data] - except IndexError: + except IndexError as exc: error = "{!r} is not a valid index for enum {!r}" - raise DeserializationError(error.format(data, enum_obj)) + raise DeserializationError(error.format(data, enum_obj)) from exc try: return enum_obj(str(data)) except ValueError: @@ -1822,6 +1934,7 @@ def deserialize_bytearray(attr): """Deserialize string into bytearray. :param str attr: response string to be deserialized. + :return: Deserialized bytearray :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1834,6 +1947,7 @@ def deserialize_base64(attr): """Deserialize base64 encoded string into string. :param str attr: response string to be deserialized. + :return: Deserialized base64 string :rtype: bytearray :raises: TypeError if string format invalid. """ @@ -1849,8 +1963,9 @@ def deserialize_decimal(attr): """Deserialize string into Decimal object. :param str attr: response string to be deserialized. - :rtype: Decimal + :return: Deserialized decimal :raises: DeserializationError if string format invalid. + :rtype: decimal """ if isinstance(attr, ET.Element): attr = attr.text @@ -1865,6 +1980,7 @@ def deserialize_long(attr): """Deserialize string into long (Py2) or int (Py3). :param str attr: response string to be deserialized. + :return: Deserialized int :rtype: long or int :raises: ValueError if string format invalid. """ @@ -1877,6 +1993,7 @@ def deserialize_duration(attr): """Deserialize ISO-8601 formatted string into TimeDelta object. :param str attr: response string to be deserialized. + :return: Deserialized duration :rtype: TimeDelta :raises: DeserializationError if string format invalid. """ @@ -1887,14 +2004,14 @@ def deserialize_duration(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize duration object." raise DeserializationError(msg) from err - else: - return duration + return duration @staticmethod def deserialize_date(attr): """Deserialize ISO-8601 formatted string into Date object. :param str attr: response string to be deserialized. + :return: Deserialized date :rtype: Date :raises: DeserializationError if string format invalid. """ @@ -1910,6 +2027,7 @@ def deserialize_time(attr): """Deserialize ISO-8601 formatted string into time object. :param str attr: response string to be deserialized. + :return: Deserialized time :rtype: datetime.time :raises: DeserializationError if string format invalid. """ @@ -1924,6 +2042,7 @@ def deserialize_rfc(attr): """Deserialize RFC-1123 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1939,14 +2058,14 @@ def deserialize_rfc(attr): except ValueError as err: msg = "Cannot deserialize to rfc datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_iso(attr): """Deserialize ISO-8601 formatted string into Datetime object. :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime :rtype: Datetime :raises: DeserializationError if string format invalid. """ @@ -1976,8 +2095,7 @@ def deserialize_iso(attr): except (ValueError, OverflowError, AttributeError) as err: msg = "Cannot deserialize datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj @staticmethod def deserialize_unix(attr): @@ -1985,6 +2103,7 @@ def deserialize_unix(attr): This is represented as seconds. :param int attr: Object to be serialized. + :return: Deserialized datetime :rtype: Datetime :raises: DeserializationError if format invalid """ @@ -1996,5 +2115,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - else: - return date_obj + return date_obj diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py index e43de950c09c..efe7276fe05f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "13.0.0b7" +VERSION = "7.0.0b1" diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/__init__.py index 39a87b28a9bc..f8722e6aa42d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/__init__.py @@ -5,12 +5,18 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._log_analytics_management_client import LogAnalyticsManagementClient +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._log_analytics_management_client import LogAnalyticsManagementClient # type: ignore try: from ._patch import __all__ as _patch_all - from ._patch import * # pylint: disable=unused-wildcard-import + from ._patch import * except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk @@ -18,6 +24,6 @@ __all__ = [ "LogAnalyticsManagementClient", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py index 7d70ad5d4b55..d0f8a6a5a8d7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_configuration.py @@ -14,7 +14,6 @@ from .._version import VERSION if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential @@ -28,9 +27,14 @@ class LogAnalyticsManagementClientConfiguration: # pylint: disable=too-many-ins :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "2025-02-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -38,6 +42,7 @@ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **k self.credential = credential self.subscription_id = subscription_id + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-loganalytics/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py index 12fcfbaab165..39896c9ec908 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/_log_analytics_management_client.py @@ -44,21 +44,23 @@ ) if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class LogAnalyticsManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class LogAnalyticsManagementClient: # pylint: disable=too-many-instance-attributes """Operational Insights Client. - :ivar query_packs: QueryPacksOperations operations - :vartype query_packs: azure.mgmt.loganalytics.aio.operations.QueryPacksOperations - :ivar queries: QueriesOperations operations - :vartype queries: azure.mgmt.loganalytics.aio.operations.QueriesOperations + :ivar available_service_tiers: AvailableServiceTiersOperations operations + :vartype available_service_tiers: + azure.mgmt.loganalytics.aio.operations.AvailableServiceTiersOperations + :ivar clusters: ClustersOperations operations + :vartype clusters: azure.mgmt.loganalytics.aio.operations.ClustersOperations :ivar data_exports: DataExportsOperations operations :vartype data_exports: azure.mgmt.loganalytics.aio.operations.DataExportsOperations :ivar data_sources: DataSourcesOperations operations :vartype data_sources: azure.mgmt.loganalytics.aio.operations.DataSourcesOperations + :ivar gateways: GatewaysOperations operations + :vartype gateways: azure.mgmt.loganalytics.aio.operations.GatewaysOperations :ivar intelligence_packs: IntelligencePacksOperations operations :vartype intelligence_packs: azure.mgmt.loganalytics.aio.operations.IntelligencePacksOperations :ivar linked_services: LinkedServicesOperations operations @@ -68,42 +70,42 @@ class LogAnalyticsManagementClient: # pylint: disable=client-accepts-api-versio azure.mgmt.loganalytics.aio.operations.LinkedStorageAccountsOperations :ivar management_groups: ManagementGroupsOperations operations :vartype management_groups: azure.mgmt.loganalytics.aio.operations.ManagementGroupsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.loganalytics.aio.operations.Operations :ivar operation_statuses: OperationStatusesOperations operations :vartype operation_statuses: azure.mgmt.loganalytics.aio.operations.OperationStatusesOperations + :ivar queries: QueriesOperations operations + :vartype queries: azure.mgmt.loganalytics.aio.operations.QueriesOperations + :ivar query_packs: QueryPacksOperations operations + :vartype query_packs: azure.mgmt.loganalytics.aio.operations.QueryPacksOperations + :ivar saved_searches: SavedSearchesOperations operations + :vartype saved_searches: azure.mgmt.loganalytics.aio.operations.SavedSearchesOperations + :ivar schema: SchemaOperations operations + :vartype schema: azure.mgmt.loganalytics.aio.operations.SchemaOperations :ivar shared_keys: SharedKeysOperations operations :vartype shared_keys: azure.mgmt.loganalytics.aio.operations.SharedKeysOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.loganalytics.aio.operations.UsagesOperations :ivar storage_insight_configs: StorageInsightConfigsOperations operations :vartype storage_insight_configs: azure.mgmt.loganalytics.aio.operations.StorageInsightConfigsOperations - :ivar saved_searches: SavedSearchesOperations operations - :vartype saved_searches: azure.mgmt.loganalytics.aio.operations.SavedSearchesOperations - :ivar available_service_tiers: AvailableServiceTiersOperations operations - :vartype available_service_tiers: - azure.mgmt.loganalytics.aio.operations.AvailableServiceTiersOperations - :ivar gateways: GatewaysOperations operations - :vartype gateways: azure.mgmt.loganalytics.aio.operations.GatewaysOperations - :ivar schema: SchemaOperations operations - :vartype schema: azure.mgmt.loganalytics.aio.operations.SchemaOperations + :ivar tables: TablesOperations operations + :vartype tables: azure.mgmt.loganalytics.aio.operations.TablesOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.loganalytics.aio.operations.UsagesOperations :ivar workspace_purge: WorkspacePurgeOperations operations :vartype workspace_purge: azure.mgmt.loganalytics.aio.operations.WorkspacePurgeOperations - :ivar clusters: ClustersOperations operations - :vartype clusters: azure.mgmt.loganalytics.aio.operations.ClustersOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.loganalytics.aio.operations.Operations :ivar workspaces: WorkspacesOperations operations :vartype workspaces: azure.mgmt.loganalytics.aio.operations.WorkspacesOperations :ivar deleted_workspaces: DeletedWorkspacesOperations operations :vartype deleted_workspaces: azure.mgmt.loganalytics.aio.operations.DeletedWorkspacesOperations - :ivar tables: TablesOperations operations - :vartype tables: azure.mgmt.loganalytics.aio.operations.TablesOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2025-02-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -142,10 +144,13 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.query_packs = QueryPacksOperations(self._client, self._config, self._serialize, self._deserialize) - self.queries = QueriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.available_service_tiers = AvailableServiceTiersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) self.data_exports = DataExportsOperations(self._client, self._config, self._serialize, self._deserialize) self.data_sources = DataSourcesOperations(self._client, self._config, self._serialize, self._deserialize) + self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) self.intelligence_packs = IntelligencePacksOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -156,28 +161,25 @@ def __init__( self.management_groups = ManagementGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.operation_statuses = OperationStatusesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.queries = QueriesOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_packs = QueryPacksOperations(self._client, self._config, self._serialize, self._deserialize) + self.saved_searches = SavedSearchesOperations(self._client, self._config, self._serialize, self._deserialize) + self.schema = SchemaOperations(self._client, self._config, self._serialize, self._deserialize) self.shared_keys = SharedKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.storage_insight_configs = StorageInsightConfigsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.saved_searches = SavedSearchesOperations(self._client, self._config, self._serialize, self._deserialize) - self.available_service_tiers = AvailableServiceTiersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.gateways = GatewaysOperations(self._client, self._config, self._serialize, self._deserialize) - self.schema = SchemaOperations(self._client, self._config, self._serialize, self._deserialize) + self.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.workspace_purge = WorkspacePurgeOperations(self._client, self._config, self._serialize, self._deserialize) - self.clusters = ClustersOperations(self._client, self._config, self._serialize, self._deserialize) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize) self.deleted_workspaces = DeletedWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.tables = TablesOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py index 7364a7f5d3b9..107833bd78f0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/__init__.py @@ -5,57 +5,63 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._query_packs_operations import QueryPacksOperations -from ._queries_operations import QueriesOperations -from ._data_exports_operations import DataExportsOperations -from ._data_sources_operations import DataSourcesOperations -from ._intelligence_packs_operations import IntelligencePacksOperations -from ._linked_services_operations import LinkedServicesOperations -from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations -from ._management_groups_operations import ManagementGroupsOperations -from ._operation_statuses_operations import OperationStatusesOperations -from ._shared_keys_operations import SharedKeysOperations -from ._usages_operations import UsagesOperations -from ._storage_insight_configs_operations import StorageInsightConfigsOperations -from ._saved_searches_operations import SavedSearchesOperations -from ._available_service_tiers_operations import AvailableServiceTiersOperations -from ._gateways_operations import GatewaysOperations -from ._schema_operations import SchemaOperations -from ._workspace_purge_operations import WorkspacePurgeOperations -from ._clusters_operations import ClustersOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._deleted_workspaces_operations import DeletedWorkspacesOperations -from ._tables_operations import TablesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._available_service_tiers_operations import AvailableServiceTiersOperations # type: ignore +from ._clusters_operations import ClustersOperations # type: ignore +from ._data_exports_operations import DataExportsOperations # type: ignore +from ._data_sources_operations import DataSourcesOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._intelligence_packs_operations import IntelligencePacksOperations # type: ignore +from ._linked_services_operations import LinkedServicesOperations # type: ignore +from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations # type: ignore +from ._management_groups_operations import ManagementGroupsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operation_statuses_operations import OperationStatusesOperations # type: ignore +from ._queries_operations import QueriesOperations # type: ignore +from ._query_packs_operations import QueryPacksOperations # type: ignore +from ._saved_searches_operations import SavedSearchesOperations # type: ignore +from ._schema_operations import SchemaOperations # type: ignore +from ._shared_keys_operations import SharedKeysOperations # type: ignore +from ._storage_insight_configs_operations import StorageInsightConfigsOperations # type: ignore +from ._tables_operations import TablesOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._workspace_purge_operations import WorkspacePurgeOperations # type: ignore +from ._workspaces_operations import WorkspacesOperations # type: ignore +from ._deleted_workspaces_operations import DeletedWorkspacesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryPacksOperations", - "QueriesOperations", + "AvailableServiceTiersOperations", + "ClustersOperations", "DataExportsOperations", "DataSourcesOperations", + "GatewaysOperations", "IntelligencePacksOperations", "LinkedServicesOperations", "LinkedStorageAccountsOperations", "ManagementGroupsOperations", + "Operations", "OperationStatusesOperations", - "SharedKeysOperations", - "UsagesOperations", - "StorageInsightConfigsOperations", + "QueriesOperations", + "QueryPacksOperations", "SavedSearchesOperations", - "AvailableServiceTiersOperations", - "GatewaysOperations", "SchemaOperations", + "SharedKeysOperations", + "StorageInsightConfigsOperations", + "TablesOperations", + "UsagesOperations", "WorkspacePurgeOperations", - "ClustersOperations", - "Operations", "WorkspacesOperations", "DeletedWorkspacesOperations", - "TablesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py index 92aec8106a28..323e27c16b20 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_available_service_tiers_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +67,7 @@ async def list_by_workspace( :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -79,7 +78,7 @@ async def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.AvailableServiceTier]] = kwargs.pop("cls", None) _request = build_list_by_workspace_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py index bcb536061b23..3997732b3932 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_clusters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -43,7 +43,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -81,10 +81,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -105,7 +105,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -146,10 +157,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Cluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +180,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -202,7 +224,7 @@ async def get_next(next_link=None): async def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, parameters: Union[_models.Cluster, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -213,7 +235,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -246,7 +268,7 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -255,10 +277,17 @@ async def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -342,7 +371,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -387,7 +416,7 @@ def get_long_running_output(pipeline_response): ) async def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -398,7 +427,7 @@ async def _delete_initial(self, resource_group_name: str, cluster_name: str, **k _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -451,7 +480,7 @@ async def begin_delete(self, resource_group_name: str, cluster_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -501,7 +530,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) :rtype: ~azure.mgmt.loganalytics.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -512,7 +541,7 @@ async def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -551,7 +580,7 @@ async def _update_initial( parameters: Union[_models.ClusterPatch, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -562,7 +591,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -595,7 +624,7 @@ async def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -604,10 +633,17 @@ async def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -693,7 +729,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py index 12188cb7a4b2..82d0d4cc62e3 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_exports_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -79,10 +79,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataExportListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -104,7 +104,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -219,7 +230,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.DataExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -230,7 +241,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataExport] = kwargs.pop("cls", None) @@ -292,7 +303,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.DataExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +314,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataExport] = kwargs.pop("cls", None) _request = build_get_request( @@ -337,9 +348,7 @@ async def get( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, data_export_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, workspace_name: str, data_export_name: str, **kwargs: Any) -> None: """Deletes the specified data export in a given workspace.. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -353,7 +362,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -364,7 +373,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py index 836f3487f420..3607d47d3f88 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_data_sources_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -146,7 +146,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.DataSource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +157,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataSource] = kwargs.pop("cls", None) @@ -202,9 +202,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, data_source_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, workspace_name: str, data_source_name: str, **kwargs: Any) -> None: """Deletes a data source instance. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -218,7 +216,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +227,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -274,7 +272,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.DataSource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -285,7 +283,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataSource] = kwargs.pop("cls", None) _request = build_get_request( @@ -340,10 +338,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataSourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -367,7 +365,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_deleted_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_deleted_workspaces_operations.py index 483f6f97587a..34f7445ef8ea 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_deleted_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_deleted_workspaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,10 +65,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Workspace"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -88,7 +88,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,10 +143,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -156,7 +167,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py index 67f55f918558..551c5efe1acc 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_gateways_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,9 +53,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, gateway_id: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, workspace_name: str, gateway_id: str, **kwargs: Any) -> None: """Delete a Log Analytics gateway. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -70,7 +67,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -81,7 +78,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py index adfc3b321813..8c9007cf39ce 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_intelligence_packs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -54,7 +53,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def disable( # pylint: disable=inconsistent-return-statements + async def disable( self, resource_group_name: str, workspace_name: str, intelligence_pack_name: str, **kwargs: Any ) -> None: """Disables an intelligence pack for a given workspace. @@ -70,7 +69,7 @@ async def disable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -81,7 +80,7 @@ async def disable( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_disable_request( @@ -110,7 +109,7 @@ async def disable( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def enable( # pylint: disable=inconsistent-return-statements + async def enable( self, resource_group_name: str, workspace_name: str, intelligence_pack_name: str, **kwargs: Any ) -> None: """Enables an intelligence pack for a given workspace. @@ -126,7 +125,7 @@ async def enable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -137,7 +136,7 @@ async def enable( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_enable_request( @@ -181,7 +180,7 @@ async def list( :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -192,7 +191,7 @@ async def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.IntelligencePack]] = kwargs.pop("cls", None) _request = build_list_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py index fb464b3a9f0e..4058d76888a8 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_services_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -41,7 +41,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,7 +73,7 @@ async def _create_or_update_initial( parameters: Union[_models.LinkedService, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -84,7 +84,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -224,7 +224,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -272,7 +272,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, workspace_name: str, linked_service_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -283,7 +283,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -341,7 +341,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -400,7 +400,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.LinkedService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -411,7 +411,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) _request = build_get_request( @@ -461,10 +461,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedServiceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -486,7 +486,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py index 528e9c15a8cc..5e964f4c0317 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_linked_storage_accounts_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -154,7 +154,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -165,7 +165,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkedStorageAccountsResource] = kwargs.pop("cls", None) @@ -210,7 +210,7 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, workspace_name: str, @@ -232,7 +232,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -243,7 +243,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -294,7 +294,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -305,7 +305,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedStorageAccountsResource] = kwargs.pop("cls", None) _request = build_get_request( @@ -358,10 +358,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedStorageAccountsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -383,7 +383,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py index f182f16eb10e..d3686bdfd4e0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_management_groups_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -73,10 +73,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListManagementGroupsResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -98,7 +98,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py index b19817fea735..3fca0456cb4b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operation_statuses_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,7 +64,7 @@ async def get(self, location: str, async_operation_id: str, **kwargs: Any) -> _m :rtype: ~azure.mgmt.loganalytics.models.OperationStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -76,7 +75,7 @@ async def get(self, location: str, async_operation_id: str, **kwargs: Any) -> _m _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operations.py index 18f251fe07b9..e54814737be0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -65,10 +65,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -87,7 +87,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_queries_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_queries_operations.py index ee4c05d9271e..b00ed3f6459f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_queries_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_queries_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -39,7 +39,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -97,10 +97,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackQueryListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -125,7 +125,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -281,11 +292,11 @@ def search( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQueryListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +331,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -367,7 +389,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -378,7 +400,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) _request = build_get_request( @@ -499,7 +521,7 @@ async def put( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -510,7 +532,7 @@ async def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) @@ -643,7 +665,7 @@ async def update( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -654,7 +676,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) @@ -700,9 +722,7 @@ async def update( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, query_pack_name: str, id: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, query_pack_name: str, id: str, **kwargs: Any) -> 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. @@ -716,7 +736,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -727,7 +747,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_query_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_query_packs_operations.py index 67fa93e86b11..8cd1515eeaa8 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_query_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_query_packs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -40,7 +40,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -77,10 +77,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.LogAnalyticsQueryPack"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -100,7 +100,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -148,10 +159,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -172,7 +183,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -276,7 +298,7 @@ async def create_or_update_without_name( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -287,7 +309,7 @@ async def create_or_update_without_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) @@ -331,9 +353,7 @@ async def create_or_update_without_name( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, query_pack_name: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, query_pack_name: str, **kwargs: Any) -> None: """Deletes a Log Analytics QueryPack. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -345,7 +365,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -356,7 +376,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -397,7 +417,7 @@ async def get(self, resource_group_name: str, query_pack_name: str, **kwargs: An :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -408,7 +428,7 @@ async def get(self, resource_group_name: str, query_pack_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) _request = build_get_request( @@ -523,7 +543,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +554,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) @@ -654,7 +674,7 @@ async def update_tags( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -665,7 +685,7 @@ async def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py index 1bbf27a480ba..2f08fc5cafb4 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_saved_searches_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +34,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -60,9 +59,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, saved_search_id: str, **kwargs: Any - ) -> None: + async def delete(self, resource_group_name: str, workspace_name: str, saved_search_id: str, **kwargs: Any) -> None: """Deletes the specified saved search in a given workspace. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -76,7 +73,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -87,7 +84,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -200,7 +197,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.SavedSearch :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -211,7 +208,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SavedSearch] = kwargs.pop("cls", None) @@ -272,7 +269,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.SavedSearch :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -283,7 +280,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SavedSearch] = kwargs.pop("cls", None) _request = build_get_request( @@ -330,7 +327,7 @@ async def list_by_workspace( :rtype: ~azure.mgmt.loganalytics.models.SavedSearchesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -341,7 +338,7 @@ async def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SavedSearchesListResult] = kwargs.pop("cls", None) _request = build_list_by_workspace_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py index fb7220cd78cf..11637b5b2a95 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_schema_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -68,7 +67,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -79,7 +78,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SearchGetSchemaResponse] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py index 67c955511b62..7fd58a9fcf73 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_shared_keys_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -66,7 +65,7 @@ async def get_shared_keys(self, resource_group_name: str, workspace_name: str, * :rtype: ~azure.mgmt.loganalytics.models.SharedKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -77,7 +76,7 @@ async def get_shared_keys(self, resource_group_name: str, workspace_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SharedKeys] = kwargs.pop("cls", None) _request = build_get_shared_keys_request( @@ -122,7 +121,7 @@ async def regenerate(self, resource_group_name: str, workspace_name: str, **kwar :rtype: ~azure.mgmt.loganalytics.models.SharedKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -133,7 +132,7 @@ async def regenerate(self, resource_group_name: str, workspace_name: str, **kwar _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SharedKeys] = kwargs.pop("cls", None) _request = build_regenerate_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py index 7a50bfcce3d3..d8c97e95d0d1 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_storage_insight_configs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -37,7 +37,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -146,7 +146,7 @@ async def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.StorageInsight :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -157,7 +157,7 @@ async def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StorageInsight] = kwargs.pop("cls", None) @@ -218,7 +218,7 @@ async def get( :rtype: ~azure.mgmt.loganalytics.models.StorageInsight :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -229,7 +229,7 @@ async def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageInsight] = kwargs.pop("cls", None) _request = build_get_request( @@ -262,7 +262,7 @@ async def get( return deserialized # type: ignore @distributed_trace_async - async def delete( # pylint: disable=inconsistent-return-statements + async def delete( self, resource_group_name: str, workspace_name: str, storage_insight_name: str, **kwargs: Any ) -> None: """Deletes a storageInsightsConfigs resource. @@ -278,7 +278,7 @@ async def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -289,7 +289,7 @@ async def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -335,10 +335,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageInsightListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -360,7 +360,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_tables_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_tables_operations.py index 1189e01c9d95..add0ffb76169 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_tables_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_tables_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -44,7 +44,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -86,10 +86,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TablesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -111,7 +111,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -149,7 +160,7 @@ async def _create_or_update_initial( parameters: Union[_models.Table, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +171,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -298,7 +309,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -354,7 +365,7 @@ async def _update_initial( parameters: Union[_models.Table, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -365,7 +376,7 @@ async def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -503,7 +514,7 @@ async def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -566,7 +577,7 @@ async def get(self, resource_group_name: str, workspace_name: str, table_name: s :rtype: ~azure.mgmt.loganalytics.models.Table :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +588,7 @@ async def get(self, resource_group_name: str, workspace_name: str, table_name: s _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) _request = build_get_request( @@ -613,7 +624,7 @@ async def get(self, resource_group_name: str, workspace_name: str, table_name: s async def _delete_initial( self, resource_group_name: str, workspace_name: str, table_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -624,7 +635,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -655,10 +666,17 @@ async def _delete_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -682,7 +700,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -724,9 +742,7 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def migrate( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, workspace_name: str, table_name: str, **kwargs: Any - ) -> None: + async def migrate(self, resource_group_name: str, workspace_name: str, table_name: str, **kwargs: Any) -> None: """Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of Data Collection Rule-based Custom Logs. @@ -741,7 +757,7 @@ async def migrate( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -752,7 +768,7 @@ async def migrate( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_migrate_request( @@ -782,7 +798,7 @@ async def migrate( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @distributed_trace_async - async def cancel_search( # pylint: disable=inconsistent-return-statements + async def cancel_search( self, resource_group_name: str, workspace_name: str, table_name: str, **kwargs: Any ) -> None: """Cancel a log analytics workspace search results table query run. @@ -798,7 +814,7 @@ async def cancel_search( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -809,7 +825,7 @@ async def cancel_search( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_search_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py index 380bde0cefff..33d7ad58248c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -72,10 +72,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -97,7 +97,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py index f988193e51e6..748611b600d7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspace_purge_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -159,7 +158,7 @@ async def purge( :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -170,7 +169,7 @@ async def purge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkspacePurgeResponse] = kwargs.pop("cls", None) @@ -236,7 +235,7 @@ async def get_purge_status( :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +246,7 @@ async def get_purge_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspacePurgeStatusResponse] = kwargs.pop("cls", None) _request = build_get_purge_status_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspaces_operations.py index 3dd7bac43089..a04c01d834dd 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/aio/operations/_workspaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( @@ -43,7 +43,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -78,10 +78,10 @@ def list(self, **kwargs: Any) -> AsyncIterable["_models.Workspace"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -101,7 +101,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -145,10 +156,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -169,7 +180,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -206,7 +228,7 @@ async def _create_or_update_initial( parameters: Union[_models.Workspace, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -217,7 +239,7 @@ async def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -348,7 +370,7 @@ async def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -395,7 +417,7 @@ def get_long_running_output(pipeline_response): async def _delete_initial( self, resource_group_name: str, workspace_name: str, force: Optional[bool] = None, **kwargs: Any ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -406,7 +428,7 @@ async def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -468,7 +490,7 @@ async def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -519,7 +541,7 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any :rtype: ~azure.mgmt.loganalytics.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -530,7 +552,7 @@ async def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) _request = build_get_request( @@ -638,7 +660,7 @@ async def update( :rtype: ~azure.mgmt.loganalytics.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -649,7 +671,7 @@ async def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py index 7fedf4cf528b..e4ee60c45bbb 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/__init__.py @@ -5,130 +5,147 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._models_py3 import AssociatedWorkspace -from ._models_py3 import AvailableServiceTier -from ._models_py3 import AzureEntityResource -from ._models_py3 import AzureResourceProperties -from ._models_py3 import CapacityReservationProperties -from ._models_py3 import Cluster -from ._models_py3 import ClusterListResult -from ._models_py3 import ClusterPatch -from ._models_py3 import ClusterSku -from ._models_py3 import Column -from ._models_py3 import CoreSummary -from ._models_py3 import DataExport -from ._models_py3 import DataExportListResult -from ._models_py3 import DataSource -from ._models_py3 import DataSourceFilter -from ._models_py3 import DataSourceListResult -from ._models_py3 import ErrorAdditionalInfo -from ._models_py3 import ErrorDetail -from ._models_py3 import ErrorResponse -from ._models_py3 import Identity -from ._models_py3 import IntelligencePack -from ._models_py3 import KeyVaultProperties -from ._models_py3 import LinkedService -from ._models_py3 import LinkedServiceListResult -from ._models_py3 import LinkedStorageAccountsListResult -from ._models_py3 import LinkedStorageAccountsResource -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 ManagedServiceIdentity -from ._models_py3 import ManagementGroup -from ._models_py3 import MetricName -from ._models_py3 import Operation -from ._models_py3 import OperationDisplay -from ._models_py3 import OperationListResult -from ._models_py3 import OperationStatus -from ._models_py3 import PrivateLinkScopedResource -from ._models_py3 import ProxyResource -from ._models_py3 import QueryPacksResource -from ._models_py3 import Resource -from ._models_py3 import RestoredLogs -from ._models_py3 import ResultStatistics -from ._models_py3 import SavedSearch -from ._models_py3 import SavedSearchesListResult -from ._models_py3 import Schema -from ._models_py3 import SearchGetSchemaResponse -from ._models_py3 import SearchMetadata -from ._models_py3 import SearchMetadataSchema -from ._models_py3 import SearchResults -from ._models_py3 import SearchSchemaValue -from ._models_py3 import SearchSort -from ._models_py3 import SharedKeys -from ._models_py3 import StorageAccount -from ._models_py3 import StorageInsight -from ._models_py3 import StorageInsightListResult -from ._models_py3 import StorageInsightStatus -from ._models_py3 import SystemData -from ._models_py3 import SystemDataAutoGenerated -from ._models_py3 import Table -from ._models_py3 import TablesListResult -from ._models_py3 import Tag -from ._models_py3 import TagsResource -from ._models_py3 import TrackedResource -from ._models_py3 import UsageMetric -from ._models_py3 import UserAssignedIdentity -from ._models_py3 import UserIdentityProperties -from ._models_py3 import Workspace -from ._models_py3 import WorkspaceCapping -from ._models_py3 import WorkspaceFeatures -from ._models_py3 import WorkspaceListManagementGroupsResult -from ._models_py3 import WorkspaceListResult -from ._models_py3 import WorkspaceListUsagesResult -from ._models_py3 import WorkspacePatch -from ._models_py3 import WorkspacePurgeBody -from ._models_py3 import WorkspacePurgeBodyFilters -from ._models_py3 import WorkspacePurgeResponse -from ._models_py3 import WorkspacePurgeStatusResponse -from ._models_py3 import WorkspaceSku +from typing import TYPE_CHECKING -from ._log_analytics_management_client_enums import BillingType -from ._log_analytics_management_client_enums import Capacity -from ._log_analytics_management_client_enums import CapacityReservationLevel -from ._log_analytics_management_client_enums import ClusterEntityStatus -from ._log_analytics_management_client_enums import ClusterSkuNameEnum -from ._log_analytics_management_client_enums import ColumnDataTypeHintEnum -from ._log_analytics_management_client_enums import ColumnTypeEnum -from ._log_analytics_management_client_enums import CreatedByType -from ._log_analytics_management_client_enums import DataIngestionStatus -from ._log_analytics_management_client_enums import DataSourceKind -from ._log_analytics_management_client_enums import DataSourceType -from ._log_analytics_management_client_enums import IdentityType -from ._log_analytics_management_client_enums import LinkedServiceEntityStatus -from ._log_analytics_management_client_enums import ManagedServiceIdentityType -from ._log_analytics_management_client_enums import ProvisioningStateEnum -from ._log_analytics_management_client_enums import PublicNetworkAccessType -from ._log_analytics_management_client_enums import PurgeState -from ._log_analytics_management_client_enums import SearchSortEnum -from ._log_analytics_management_client_enums import SkuNameEnum -from ._log_analytics_management_client_enums import SourceEnum -from ._log_analytics_management_client_enums import StorageInsightState -from ._log_analytics_management_client_enums import TablePlanEnum -from ._log_analytics_management_client_enums import TableSubTypeEnum -from ._log_analytics_management_client_enums import TableTypeEnum -from ._log_analytics_management_client_enums import Type -from ._log_analytics_management_client_enums import WorkspaceEntityStatus -from ._log_analytics_management_client_enums import WorkspaceSkuNameEnum +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models_py3 import ( # type: ignore + AssociatedWorkspace, + AvailableServiceTier, + AzureEntityResource, + CapacityReservationProperties, + Cluster, + ClusterListResult, + ClusterPatch, + ClusterReplicationProperties, + ClusterSku, + Column, + CoreSummary, + DataExport, + DataExportListResult, + DataSource, + DataSourceFilter, + DataSourceListResult, + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + Identity, + IntelligencePack, + KeyVaultProperties, + LinkedService, + LinkedServiceListResult, + LinkedStorageAccountsListResult, + LinkedStorageAccountsResource, + LogAnalyticsQueryPack, + LogAnalyticsQueryPackListResult, + LogAnalyticsQueryPackQuery, + LogAnalyticsQueryPackQueryListResult, + LogAnalyticsQueryPackQueryPropertiesRelated, + LogAnalyticsQueryPackQuerySearchProperties, + LogAnalyticsQueryPackQuerySearchPropertiesRelated, + ManagedServiceIdentity, + ManagementGroup, + MetricName, + Operation, + OperationDisplay, + OperationListResult, + OperationStatus, + PrivateLinkScopedResource, + ProxyResource, + ProxyResourceAutoGenerated, + Resource, + ResourceAutoGenerated, + RestoredLogs, + ResultStatistics, + SavedSearch, + SavedSearchesListResult, + Schema, + SearchGetSchemaResponse, + SearchMetadata, + SearchMetadataSchema, + SearchResults, + SearchSchemaValue, + SearchSort, + SharedKeys, + StorageAccount, + StorageInsight, + StorageInsightListResult, + StorageInsightStatus, + SystemData, + Table, + TablesListResult, + Tag, + TagsResource, + TrackedResource, + TrackedResourceAutoGenerated, + UsageMetric, + UserAssignedIdentity, + UserIdentityProperties, + Workspace, + WorkspaceCapping, + WorkspaceFailoverProperties, + WorkspaceFeatures, + WorkspaceListManagementGroupsResult, + WorkspaceListResult, + WorkspaceListUsagesResult, + WorkspacePatch, + WorkspacePurgeBody, + WorkspacePurgeBodyFilters, + WorkspacePurgeResponse, + WorkspacePurgeStatusResponse, + WorkspaceReplicationProperties, + WorkspaceSku, +) + +from ._log_analytics_management_client_enums import ( # type: ignore + BillingType, + Capacity, + CapacityReservationLevel, + ClusterEntityStatus, + ClusterReplicationState, + ClusterSkuNameEnum, + ColumnDataTypeHintEnum, + ColumnTypeEnum, + CreatedByType, + DataIngestionStatus, + DataSourceKind, + DataSourceType, + IdentityType, + LinkedServiceEntityStatus, + ManagedServiceIdentityType, + ProvisioningStateEnum, + PublicNetworkAccessType, + PurgeState, + SearchSortEnum, + SkuNameEnum, + SourceEnum, + StorageInsightState, + TablePlanEnum, + TableSubTypeEnum, + TableTypeEnum, + Type, + WorkspaceEntityStatus, + WorkspaceFailoverState, + WorkspaceReplicationState, + WorkspaceSkuNameEnum, +) from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ "AssociatedWorkspace", "AvailableServiceTier", "AzureEntityResource", - "AzureResourceProperties", "CapacityReservationProperties", "Cluster", "ClusterListResult", "ClusterPatch", + "ClusterReplicationProperties", "ClusterSku", "Column", "CoreSummary", @@ -163,8 +180,9 @@ "OperationStatus", "PrivateLinkScopedResource", "ProxyResource", - "QueryPacksResource", + "ProxyResourceAutoGenerated", "Resource", + "ResourceAutoGenerated", "RestoredLogs", "ResultStatistics", "SavedSearch", @@ -182,17 +200,18 @@ "StorageInsightListResult", "StorageInsightStatus", "SystemData", - "SystemDataAutoGenerated", "Table", "TablesListResult", "Tag", "TagsResource", "TrackedResource", + "TrackedResourceAutoGenerated", "UsageMetric", "UserAssignedIdentity", "UserIdentityProperties", "Workspace", "WorkspaceCapping", + "WorkspaceFailoverProperties", "WorkspaceFeatures", "WorkspaceListManagementGroupsResult", "WorkspaceListResult", @@ -202,11 +221,13 @@ "WorkspacePurgeBodyFilters", "WorkspacePurgeResponse", "WorkspacePurgeStatusResponse", + "WorkspaceReplicationProperties", "WorkspaceSku", "BillingType", "Capacity", "CapacityReservationLevel", "ClusterEntityStatus", + "ClusterReplicationState", "ClusterSkuNameEnum", "ColumnDataTypeHintEnum", "ColumnTypeEnum", @@ -229,7 +250,9 @@ "TableTypeEnum", "Type", "WorkspaceEntityStatus", + "WorkspaceFailoverState", + "WorkspaceReplicationState", "WorkspaceSkuNameEnum", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py index 612e6e0c9aa8..b8dfe9d2ba4b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_log_analytics_management_client_enums.py @@ -49,6 +49,9 @@ class CapacityReservationLevel(int, Enum, metaclass=CaseInsensitiveEnumMeta): TEN_HUNDRED = 1000 TWO_THOUSAND = 2000 FIVE_THOUSAND = 5000 + TEN_THOUSAND = 10000 + TWENTY_FIVE_THOUSAND = 25000 + FIFTY_THOUSAND = 50000 class ClusterEntityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -63,6 +66,20 @@ class ClusterEntityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" +class ClusterReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the cluster replication.""" + + SUCCEEDED = "Succeeded" + ENABLE_REQUESTED = "EnableRequested" + ENABLING = "Enabling" + DISABLE_REQUESTED = "DisableRequested" + DISABLING = "Disabling" + ROLLBACK_REQUESTED = "RollbackRequested" + ROLLING_BACK = "RollingBack" + FAILED = "Failed" + CANCELED = "Canceled" + + class ClusterSkuNameEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The SKU (tier) of a cluster.""" @@ -173,12 +190,8 @@ class DataSourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The type of identity that creates/modifies resources.""" + """Type of managed service identity.""" - USER = "user" - APPLICATION = "application" - MANAGED_IDENTITY = "managedIdentity" - KEY = "key" SYSTEM_ASSIGNED = "SystemAssigned" USER_ASSIGNED = "UserAssigned" NONE = "None" @@ -276,7 +289,7 @@ class TablePlanEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Instruct the system how to handle and charge the logs ingested to this table.""" BASIC = "Basic" - """Logs that are adjusted to support high volume low value verbose logs.""" + """Logs that are adjusted to support high volume low value verbose logs.""" ANALYTICS = "Analytics" """Logs that allow monitoring and analytics.""" @@ -329,6 +342,30 @@ class WorkspaceEntityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): UPDATING = "Updating" +class WorkspaceFailoverState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The failover state of the replication.""" + + INACTIVE = "Inactive" + ACTIVATING = "Activating" + ACTIVE = "Active" + DEACTIVATING = "Deactivating" + FAILED = "Failed" + + +class WorkspaceReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The provisioning state of the replication.""" + + SUCCEEDED = "Succeeded" + ENABLE_REQUESTED = "EnableRequested" + ENABLING = "Enabling" + DISABLE_REQUESTED = "DisableRequested" + DISABLING = "Disabling" + ROLLBACK_REQUESTED = "RollbackRequested" + ROLLING_BACK = "RollingBack" + FAILED = "Failed" + CANCELED = "Canceled" + + class WorkspaceSkuNameEnum(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The name of the SKU.""" diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py index eaba73b1ab6d..4eb9fea6a8c2 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/models/_models_py3.py @@ -1,5 +1,5 @@ -# coding=utf-8 # pylint: disable=too-many-lines +# 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. @@ -16,10 +16,9 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports from .. import models as _models JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object @@ -191,44 +190,6 @@ def __init__(self, **kwargs: Any) -> None: self.etag = None -class AzureResourceProperties(_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.loganalytics.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: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - class CapacityReservationProperties(_serialization.Model): """The Capacity Reservation properties. @@ -306,7 +267,7 @@ def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kw self.location = location -class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes +class Cluster(TrackedResource): """The top level Log Analytics cluster resource container. Variables are only populated by the server, and will be ignored when sending a request. @@ -355,6 +316,8 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes :ivar capacity_reservation_properties: Additional properties for capacity reservation. :vartype capacity_reservation_properties: ~azure.mgmt.loganalytics.models.CapacityReservationProperties + :ivar replication: Cluster's replication properties. + :vartype replication: ~azure.mgmt.loganalytics.models.ClusterReplicationProperties """ _validation = { @@ -389,6 +352,7 @@ class Cluster(TrackedResource): # pylint: disable=too-many-instance-attributes "key": "properties.capacityReservationProperties", "type": "CapacityReservationProperties", }, + "replication": {"key": "properties.replication", "type": "ClusterReplicationProperties"}, } def __init__( @@ -404,6 +368,7 @@ def __init__( key_vault_properties: Optional["_models.KeyVaultProperties"] = None, associated_workspaces: Optional[List["_models.AssociatedWorkspace"]] = None, capacity_reservation_properties: Optional["_models.CapacityReservationProperties"] = None, + replication: Optional["_models.ClusterReplicationProperties"] = None, **kwargs: Any ) -> None: """ @@ -434,6 +399,8 @@ def __init__( :keyword capacity_reservation_properties: Additional properties for capacity reservation. :paramtype capacity_reservation_properties: ~azure.mgmt.loganalytics.models.CapacityReservationProperties + :keyword replication: Cluster's replication properties. + :paramtype replication: ~azure.mgmt.loganalytics.models.ClusterReplicationProperties """ super().__init__(tags=tags, location=location, **kwargs) self.identity = identity @@ -448,6 +415,7 @@ def __init__( self.created_date = None self.associated_workspaces = associated_workspaces self.capacity_reservation_properties = capacity_reservation_properties + self.replication = replication class ClusterListResult(_serialization.Model): @@ -532,6 +500,70 @@ def __init__( self.billing_type = billing_type +class ClusterReplicationProperties(_serialization.Model): + """Cluster replication properties. + + 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 server. + + :ivar location: The secondary location of the replication. Required. + :vartype location: str + :ivar enabled: Specifies whether the replication is enabled or not. When true the cluster is + replicate to the specified location. Required. + :vartype enabled: bool + :ivar is_availability_zones_enabled: Should enable AvailabilityZones for the given replicated + cluster. + :vartype is_availability_zones_enabled: bool + :ivar provisioning_state: The provisioning state of the cluster replication. Known values are: + "Succeeded", "EnableRequested", "Enabling", "DisableRequested", "Disabling", + "RollbackRequested", "RollingBack", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.ClusterReplicationState + :ivar created_date: The cluster's replication creation time. + :vartype created_date: str + :ivar last_modified_date: The last time the cluster's replication was updated. + :vartype last_modified_date: str + """ + + _validation = { + "location": {"required": True}, + "enabled": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_date": {"readonly": True}, + "last_modified_date": {"readonly": True}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + "is_availability_zones_enabled": {"key": "isAvailabilityZonesEnabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "created_date": {"key": "createdDate", "type": "str"}, + "last_modified_date": {"key": "lastModifiedDate", "type": "str"}, + } + + def __init__( + self, *, location: str, enabled: bool, is_availability_zones_enabled: Optional[bool] = None, **kwargs: Any + ) -> None: + """ + :keyword location: The secondary location of the replication. Required. + :paramtype location: str + :keyword enabled: Specifies whether the replication is enabled or not. When true the cluster is + replicate to the specified location. Required. + :paramtype enabled: bool + :keyword is_availability_zones_enabled: Should enable AvailabilityZones for the given + replicated cluster. + :paramtype is_availability_zones_enabled: bool + """ + super().__init__(**kwargs) + self.location = location + self.enabled = enabled + self.is_availability_zones_enabled = is_availability_zones_enabled + self.provisioning_state = None + self.created_date = None + self.last_modified_date = None + + class ClusterSku(_serialization.Model): """The cluster sku definition. @@ -687,7 +719,7 @@ class ProxyResource(Resource): """ -class DataExport(ProxyResource): # pylint: disable=too-many-instance-attributes +class DataExport(ProxyResource): """The top level data export resource container. Variables are only populated by the server, and will be ignored when sending a request. @@ -1065,8 +1097,8 @@ class Identity(_serialization.Model): :vartype principal_id: str :ivar tenant_id: The tenant ID of resource. :vartype tenant_id: str - :ivar type: Type of managed service identity. Required. Known values are: "user", - "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", and "None". + :ivar type: Type of managed service identity. Required. Known values are: "SystemAssigned", + "UserAssigned", and "None". :vartype type: str or ~azure.mgmt.loganalytics.models.IdentityType :ivar user_assigned_identities: The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: @@ -1096,8 +1128,8 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword type: Type of managed service identity. Required. Known values are: "user", - "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", and "None". + :keyword type: Type of managed service identity. Required. Known values are: "SystemAssigned", + "UserAssigned", and "None". :paramtype type: str or ~azure.mgmt.loganalytics.models.IdentityType :keyword user_assigned_identities: The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: @@ -1355,29 +1387,77 @@ def __init__(self, *, storage_account_ids: Optional[List[str]] = None, **kwargs: self.storage_account_ids = storage_account_ids -class QueryPacksResource(_serialization.Model): - """An azure resource object. +class ResourceAutoGenerated(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.loganalytics.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: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResourceAutoGenerated(ResourceAutoGenerated): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Azure resource Id. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long :vartype id: str - :ivar name: Azure resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Azure resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "location": {"required": True}, } @@ -1385,42 +1465,45 @@ class QueryPacksResource(_serialization.Model): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword location: Resource location. Required. - :paramtype location: str :keyword tags: Resource tags. :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str """ super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location self.tags = tags + self.location = location -class LogAnalyticsQueryPack(QueryPacksResource): +class LogAnalyticsQueryPack(TrackedResourceAutoGenerated): """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 server. - :ivar id: Azure resource Id. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long :vartype id: str - :ivar name: Azure resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Azure resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData :ivar tags: Resource tags. :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: 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. @@ -1437,6 +1520,7 @@ class LogAnalyticsQueryPack(QueryPacksResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, + "system_data": {"readonly": True}, "location": {"required": True}, "query_pack_id": {"readonly": True}, "time_created": {"readonly": True}, @@ -1448,8 +1532,9 @@ class LogAnalyticsQueryPack(QueryPacksResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "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"}, @@ -1458,12 +1543,12 @@ class LogAnalyticsQueryPack(QueryPacksResource): def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword location: Resource location. Required. - :paramtype location: str :keyword tags: Resource tags. :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str """ - super().__init__(location=location, tags=tags, **kwargs) + super().__init__(tags=tags, location=location, **kwargs) self.query_pack_id = None self.time_created = None self.time_modified = None @@ -1506,18 +1591,41 @@ def __init__( self.next_link = next_link -class LogAnalyticsQueryPackQuery(AzureResourceProperties): # pylint: disable=too-many-instance-attributes +class ProxyResourceAutoGenerated(ResourceAutoGenerated): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData + """ + + +class LogAnalyticsQueryPackQuery(ProxyResourceAutoGenerated): """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. + :ivar id: Fully qualified resource ID for the resource. E.g. + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long :vartype id: str - :ivar name: Azure resource name. + :ivar name: The name of the resource. :vartype name: str - :ivar type: Azure resource type. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: Read only system data. + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData :ivar id_properties_id: The unique ID of your application. This field cannot be changed. :vartype id_properties_id: str @@ -2193,7 +2301,7 @@ def __init__(self, **kwargs: Any) -> None: self.scanned_gb = None -class SavedSearch(ProxyResource): # pylint: disable=too-many-instance-attributes +class SavedSearch(ProxyResource): """Value object for saved search results. Variables are only populated by the server, and will be ignored when sending a request. @@ -2323,7 +2431,7 @@ def __init__(self, *, value: Optional[List["_models.SavedSearch"]] = None, **kwa self.value = value -class Schema(_serialization.Model): # pylint: disable=too-many-instance-attributes +class Schema(_serialization.Model): """Table's schema. Variables are only populated by the server, and will be ignored when sending a request. @@ -2444,7 +2552,7 @@ def __init__( self.value = value -class SearchMetadata(_serialization.Model): # pylint: disable=too-many-instance-attributes +class SearchMetadata(_serialization.Model): """Metadata for search results. :ivar search_id: The request id of the search. @@ -2985,72 +3093,6 @@ def __init__( class SystemData(_serialization.Model): - """Read only system data. - - :ivar created_by: An identifier for the identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "user", "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", and "None". - :vartype created_by_type: str or ~azure.mgmt.loganalytics.models.IdentityType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: An identifier for the identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "user", "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", and - "None". - :vartype last_modified_by_type: str or ~azure.mgmt.loganalytics.models.IdentityType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype 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, "_models.IdentityType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.IdentityType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: An identifier for the identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "user", "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", and "None". - :paramtype created_by_type: str or ~azure.mgmt.loganalytics.models.IdentityType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: An identifier for the identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "user", "application", "managedIdentity", "key", "SystemAssigned", "UserAssigned", - and "None". - :paramtype last_modified_by_type: str or ~azure.mgmt.loganalytics.models.IdentityType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__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 SystemDataAutoGenerated(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. @@ -3114,7 +3156,7 @@ def __init__( self.last_modified_at = last_modified_at -class Table(ProxyResource): # pylint: disable=too-many-instance-attributes +class Table(ProxyResource): """Workspace data table definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -3128,7 +3170,7 @@ class Table(ProxyResource): # pylint: disable=too-many-instance-attributes "Microsoft.Storage/storageAccounts". :vartype type: str :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.loganalytics.models.SystemDataAutoGenerated + :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData :ivar retention_in_days: The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention. :vartype retention_in_days: int @@ -3183,7 +3225,7 @@ class Table(ProxyResource): # pylint: disable=too-many-instance-attributes "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemDataAutoGenerated"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "retention_in_days": {"key": "properties.retentionInDays", "type": "int"}, "total_retention_in_days": {"key": "properties.totalRetentionInDays", "type": "int"}, "archive_retention_in_days": {"key": "properties.archiveRetentionInDays", "type": "int"}, @@ -3433,7 +3475,7 @@ def __init__(self, **kwargs: Any) -> None: self.client_id = None -class Workspace(TrackedResource): # pylint: disable=too-many-instance-attributes +class Workspace(TrackedResource): """The top level Workspace resource container. Variables are only populated by the server, and will be ignored when sending a request. @@ -3455,7 +3497,7 @@ class Workspace(TrackedResource): # pylint: disable=too-many-instance-attribute :ivar identity: The identity of the resource. :vartype identity: ~azure.mgmt.loganalytics.models.Identity :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~azure.mgmt.loganalytics.models.SystemDataAutoGenerated + :vartype system_data: ~azure.mgmt.loganalytics.models.SystemData :ivar etag: The etag of the workspace. :vartype etag: str :ivar provisioning_state: The provisioning state of the workspace. Known values are: @@ -3496,6 +3538,10 @@ class Workspace(TrackedResource): # pylint: disable=too-many-instance-attribute Rule to use for this workspace. Expected format is - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. # pylint: disable=line-too-long :vartype default_data_collection_rule_resource_id: str + :ivar replication: workspace replication properties. + :vartype replication: ~azure.mgmt.loganalytics.models.WorkspaceReplicationProperties + :ivar failover: workspace failover properties. + :vartype failover: ~azure.mgmt.loganalytics.models.WorkspaceFailoverProperties """ _validation = { @@ -3518,7 +3564,7 @@ class Workspace(TrackedResource): # pylint: disable=too-many-instance-attribute "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, "identity": {"key": "identity", "type": "Identity"}, - "system_data": {"key": "systemData", "type": "SystemDataAutoGenerated"}, + "system_data": {"key": "systemData", "type": "SystemData"}, "etag": {"key": "etag", "type": "str"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "customer_id": {"key": "properties.customerId", "type": "str"}, @@ -3539,6 +3585,8 @@ class Workspace(TrackedResource): # pylint: disable=too-many-instance-attribute "key": "properties.defaultDataCollectionRuleResourceId", "type": "str", }, + "replication": {"key": "properties.replication", "type": "WorkspaceReplicationProperties"}, + "failover": {"key": "properties.failover", "type": "WorkspaceFailoverProperties"}, } def __init__( @@ -3556,6 +3604,8 @@ def __init__( force_cmk_for_query: Optional[bool] = None, features: Optional["_models.WorkspaceFeatures"] = None, default_data_collection_rule_resource_id: Optional[str] = None, + replication: Optional["_models.WorkspaceReplicationProperties"] = None, + failover: Optional["_models.WorkspaceFailoverProperties"] = None, **kwargs: Any ) -> None: """ @@ -3591,6 +3641,10 @@ def __init__( Collection Rule to use for this workspace. Expected format is - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. # pylint: disable=line-too-long :paramtype default_data_collection_rule_resource_id: str + :keyword replication: workspace replication properties. + :paramtype replication: ~azure.mgmt.loganalytics.models.WorkspaceReplicationProperties + :keyword failover: workspace failover properties. + :paramtype failover: ~azure.mgmt.loganalytics.models.WorkspaceFailoverProperties """ super().__init__(tags=tags, location=location, **kwargs) self.identity = identity @@ -3609,6 +3663,8 @@ def __init__( self.private_link_scoped_resources = None self.features = features self.default_data_collection_rule_resource_id = default_data_collection_rule_resource_id + self.replication = replication + self.failover = failover class WorkspaceCapping(_serialization.Model): @@ -3648,9 +3704,40 @@ def __init__(self, *, daily_quota_gb: Optional[float] = None, **kwargs: Any) -> self.data_ingestion_status = None +class WorkspaceFailoverProperties(_serialization.Model): + """The failover state of the replication. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar state: The failover state of the replication. Known values are: "Inactive", "Activating", + "Active", "Deactivating", and "Failed". + :vartype state: str or ~azure.mgmt.loganalytics.models.WorkspaceFailoverState + :ivar last_modified_date: The last time when the failover state was updated. + :vartype last_modified_date: str + """ + + _validation = { + "state": {"readonly": True}, + "last_modified_date": {"readonly": True}, + } + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + "last_modified_date": {"key": "lastModifiedDate", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.state = None + self.last_modified_date = None + + class WorkspaceFeatures(_serialization.Model): """Workspace features. + Variables are only populated by the server, and will be ignored when sending a request. + :ivar additional_properties: Unmatched properties from the message are deserialized to this collection. :vartype additional_properties: dict[str, any] @@ -3666,8 +3753,15 @@ class WorkspaceFeatures(_serialization.Model): :vartype cluster_resource_id: str :ivar disable_local_auth: Disable Non-AAD based Auth. :vartype disable_local_auth: bool + :ivar unified_sentinel_billing_only: An indication if the specify workspace is limited to + sentinel's unified billing model only. + :vartype unified_sentinel_billing_only: bool """ + _validation = { + "unified_sentinel_billing_only": {"readonly": True}, + } + _attribute_map = { "additional_properties": {"key": "", "type": "{object}"}, "enable_data_export": {"key": "enableDataExport", "type": "bool"}, @@ -3678,6 +3772,7 @@ class WorkspaceFeatures(_serialization.Model): }, "cluster_resource_id": {"key": "clusterResourceId", "type": "str"}, "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"}, + "unified_sentinel_billing_only": {"key": "unifiedSentinelBillingOnly", "type": "bool"}, } def __init__( @@ -3715,6 +3810,7 @@ def __init__( self.enable_log_access_using_only_resource_permissions = enable_log_access_using_only_resource_permissions self.cluster_resource_id = cluster_resource_id self.disable_local_auth = disable_local_auth + self.unified_sentinel_billing_only = None class WorkspaceListManagementGroupsResult(_serialization.Model): @@ -3777,7 +3873,7 @@ def __init__(self, *, value: Optional[List["_models.UsageMetric"]] = None, **kwa self.value = value -class WorkspacePatch(AzureEntityResource): # pylint: disable=too-many-instance-attributes +class WorkspacePatch(AzureEntityResource): """The top level Workspace resource container. Variables are only populated by the server, and will be ignored when sending a request. @@ -3834,6 +3930,10 @@ class WorkspacePatch(AzureEntityResource): # pylint: disable=too-many-instance- Rule to use for this workspace. Expected format is - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. # pylint: disable=line-too-long :vartype default_data_collection_rule_resource_id: str + :ivar replication: workspace replication properties. + :vartype replication: ~azure.mgmt.loganalytics.models.WorkspaceReplicationProperties + :ivar failover: workspace failover properties. + :vartype failover: ~azure.mgmt.loganalytics.models.WorkspaceFailoverProperties """ _validation = { @@ -3874,6 +3974,8 @@ class WorkspacePatch(AzureEntityResource): # pylint: disable=too-many-instance- "key": "properties.defaultDataCollectionRuleResourceId", "type": "str", }, + "replication": {"key": "properties.replication", "type": "WorkspaceReplicationProperties"}, + "failover": {"key": "properties.failover", "type": "WorkspaceFailoverProperties"}, } def __init__( @@ -3889,6 +3991,8 @@ def __init__( force_cmk_for_query: Optional[bool] = None, features: Optional["_models.WorkspaceFeatures"] = None, default_data_collection_rule_resource_id: Optional[str] = None, + replication: Optional["_models.WorkspaceReplicationProperties"] = None, + failover: Optional["_models.WorkspaceFailoverProperties"] = None, **kwargs: Any ) -> None: """ @@ -3920,6 +4024,10 @@ def __init__( Collection Rule to use for this workspace. Expected format is - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. # pylint: disable=line-too-long :paramtype default_data_collection_rule_resource_id: str + :keyword replication: workspace replication properties. + :paramtype replication: ~azure.mgmt.loganalytics.models.WorkspaceReplicationProperties + :keyword failover: workspace failover properties. + :paramtype failover: ~azure.mgmt.loganalytics.models.WorkspaceFailoverProperties """ super().__init__(**kwargs) self.identity = identity @@ -3937,6 +4045,8 @@ def __init__( self.private_link_scoped_resources = None self.features = features self.default_data_collection_rule_resource_id = default_data_collection_rule_resource_id + self.replication = replication + self.failover = failover class WorkspacePurgeBody(_serialization.Model): @@ -4084,6 +4194,60 @@ def __init__(self, *, status: Union[str, "_models.PurgeState"], **kwargs: Any) - self.status = status +class WorkspaceReplicationProperties(_serialization.Model): + """Workspace replication properties. + + 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 server. + + :ivar location: The location of the replication. Required. + :vartype location: str + :ivar enabled: Specifies whether the replication is enabled or not. When true, workspace + configuration and data is replicated to the specified location. Required. + :vartype enabled: bool + :ivar provisioning_state: The provisioning state of the replication. Known values are: + "Succeeded", "EnableRequested", "Enabling", "DisableRequested", "Disabling", + "RollbackRequested", "RollingBack", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.loganalytics.models.WorkspaceReplicationState + :ivar created_date: The last time when the replication was enabled. + :vartype created_date: str + :ivar last_modified_date: The last time when the replication was updated. + :vartype last_modified_date: str + """ + + _validation = { + "location": {"required": True}, + "enabled": {"required": True}, + "provisioning_state": {"readonly": True}, + "created_date": {"readonly": True}, + "last_modified_date": {"readonly": True}, + } + + _attribute_map = { + "location": {"key": "location", "type": "str"}, + "enabled": {"key": "enabled", "type": "bool"}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "created_date": {"key": "createdDate", "type": "str"}, + "last_modified_date": {"key": "lastModifiedDate", "type": "str"}, + } + + def __init__(self, *, location: str, enabled: bool, **kwargs: Any) -> None: + """ + :keyword location: The location of the replication. Required. + :paramtype location: str + :keyword enabled: Specifies whether the replication is enabled or not. When true, workspace + configuration and data is replicated to the specified location. Required. + :paramtype enabled: bool + """ + super().__init__(**kwargs) + self.location = location + self.enabled = enabled + self.provisioning_state = None + self.created_date = None + self.last_modified_date = None + + class WorkspaceSku(_serialization.Model): """The SKU (tier) of a workspace. @@ -4095,8 +4259,8 @@ class WorkspaceSku(_serialization.Model): "PerNode", "PerGB2018", "Standalone", "CapacityReservation", and "LACluster". :vartype name: str or ~azure.mgmt.loganalytics.models.WorkspaceSkuNameEnum :ivar capacity_reservation_level: The capacity reservation level in GB for this workspace, when - CapacityReservation sku is selected. Known values are: 100, 200, 300, 400, 500, 1000, 2000, and - 5000. + CapacityReservation sku is selected. Known values are: 100, 200, 300, 400, 500, 1000, 2000, + 5000, 10000, 25000, and 50000. :vartype capacity_reservation_level: int or ~azure.mgmt.loganalytics.models.CapacityReservationLevel :ivar last_sku_update: The last time when the sku was updated. @@ -4127,7 +4291,7 @@ def __init__( :paramtype name: str or ~azure.mgmt.loganalytics.models.WorkspaceSkuNameEnum :keyword capacity_reservation_level: The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. Known values are: 100, 200, 300, 400, 500, 1000, - 2000, and 5000. + 2000, 5000, 10000, 25000, and 50000. :paramtype capacity_reservation_level: int or ~azure.mgmt.loganalytics.models.CapacityReservationLevel """ diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py index 7364a7f5d3b9..107833bd78f0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/__init__.py @@ -5,57 +5,63 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +# pylint: disable=wrong-import-position -from ._query_packs_operations import QueryPacksOperations -from ._queries_operations import QueriesOperations -from ._data_exports_operations import DataExportsOperations -from ._data_sources_operations import DataSourcesOperations -from ._intelligence_packs_operations import IntelligencePacksOperations -from ._linked_services_operations import LinkedServicesOperations -from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations -from ._management_groups_operations import ManagementGroupsOperations -from ._operation_statuses_operations import OperationStatusesOperations -from ._shared_keys_operations import SharedKeysOperations -from ._usages_operations import UsagesOperations -from ._storage_insight_configs_operations import StorageInsightConfigsOperations -from ._saved_searches_operations import SavedSearchesOperations -from ._available_service_tiers_operations import AvailableServiceTiersOperations -from ._gateways_operations import GatewaysOperations -from ._schema_operations import SchemaOperations -from ._workspace_purge_operations import WorkspacePurgeOperations -from ._clusters_operations import ClustersOperations -from ._operations import Operations -from ._workspaces_operations import WorkspacesOperations -from ._deleted_workspaces_operations import DeletedWorkspacesOperations -from ._tables_operations import TablesOperations +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._available_service_tiers_operations import AvailableServiceTiersOperations # type: ignore +from ._clusters_operations import ClustersOperations # type: ignore +from ._data_exports_operations import DataExportsOperations # type: ignore +from ._data_sources_operations import DataSourcesOperations # type: ignore +from ._gateways_operations import GatewaysOperations # type: ignore +from ._intelligence_packs_operations import IntelligencePacksOperations # type: ignore +from ._linked_services_operations import LinkedServicesOperations # type: ignore +from ._linked_storage_accounts_operations import LinkedStorageAccountsOperations # type: ignore +from ._management_groups_operations import ManagementGroupsOperations # type: ignore +from ._operations import Operations # type: ignore +from ._operation_statuses_operations import OperationStatusesOperations # type: ignore +from ._queries_operations import QueriesOperations # type: ignore +from ._query_packs_operations import QueryPacksOperations # type: ignore +from ._saved_searches_operations import SavedSearchesOperations # type: ignore +from ._schema_operations import SchemaOperations # type: ignore +from ._shared_keys_operations import SharedKeysOperations # type: ignore +from ._storage_insight_configs_operations import StorageInsightConfigsOperations # type: ignore +from ._tables_operations import TablesOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._workspace_purge_operations import WorkspacePurgeOperations # type: ignore +from ._workspaces_operations import WorkspacesOperations # type: ignore +from ._deleted_workspaces_operations import DeletedWorkspacesOperations # type: ignore from ._patch import __all__ as _patch_all -from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "QueryPacksOperations", - "QueriesOperations", + "AvailableServiceTiersOperations", + "ClustersOperations", "DataExportsOperations", "DataSourcesOperations", + "GatewaysOperations", "IntelligencePacksOperations", "LinkedServicesOperations", "LinkedStorageAccountsOperations", "ManagementGroupsOperations", + "Operations", "OperationStatusesOperations", - "SharedKeysOperations", - "UsagesOperations", - "StorageInsightConfigsOperations", + "QueriesOperations", + "QueryPacksOperations", "SavedSearchesOperations", - "AvailableServiceTiersOperations", - "GatewaysOperations", "SchemaOperations", + "SharedKeysOperations", + "StorageInsightConfigsOperations", + "TablesOperations", + "UsagesOperations", "WorkspacePurgeOperations", - "ClustersOperations", - "Operations", "WorkspacesOperations", "DeletedWorkspacesOperations", - "TablesOperations", ] -__all__.extend([p for p in _patch_all if p not in __all__]) +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py index f5a14985d4b7..396302393ed0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_available_service_tiers_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +110,7 @@ def list_by_workspace( :rtype: list[~azure.mgmt.loganalytics.models.AvailableServiceTier] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -122,7 +121,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.AvailableServiceTier]] = kwargs.pop("cls", None) _request = build_list_by_workspace_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py index 0bdd628d0595..a3090a7327df 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_clusters_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +77,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -179,7 +179,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -275,10 +275,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -299,7 +299,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -340,10 +351,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Cluster"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ClusterListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -363,7 +374,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -396,7 +418,7 @@ def get_next(next_link=None): def _create_or_update_initial( self, resource_group_name: str, cluster_name: str, parameters: Union[_models.Cluster, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -407,7 +429,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -440,7 +462,7 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -449,10 +471,17 @@ def _create_or_update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -533,7 +562,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -578,7 +607,7 @@ def get_long_running_output(pipeline_response): ) def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -589,7 +618,7 @@ def _delete_initial(self, resource_group_name: str, cluster_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -642,7 +671,7 @@ def begin_delete(self, resource_group_name: str, cluster_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -692,7 +721,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo :rtype: ~azure.mgmt.loganalytics.models.Cluster :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -703,7 +732,7 @@ def get(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -742,7 +771,7 @@ def _update_initial( parameters: Union[_models.ClusterPatch, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -753,7 +782,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -786,7 +815,7 @@ def _update_initial( response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -795,10 +824,17 @@ def _update_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -881,7 +917,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Cluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py index f7cb66c14785..9cbe79d0639d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_exports_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +136,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,10 +249,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataExportListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -274,7 +274,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -389,7 +400,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.DataExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -400,7 +411,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataExport] = kwargs.pop("cls", None) @@ -462,7 +473,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.DataExport :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -473,7 +484,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataExport] = kwargs.pop("cls", None) _request = build_get_request( @@ -523,7 +534,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -534,7 +545,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py index f022fbf95bf0..50ad214f592e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_data_sources_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -88,7 +88,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -124,7 +124,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -171,7 +171,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +312,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.DataSource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -323,7 +323,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataSource] = kwargs.pop("cls", None) @@ -384,7 +384,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -395,7 +395,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -440,7 +440,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.DataSource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -451,7 +451,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataSource] = kwargs.pop("cls", None) _request = build_get_request( @@ -506,10 +506,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataSourceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -533,7 +533,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py index edeb17269ab1..405612ce5dac 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_deleted_workspaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +42,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -68,7 +68,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,10 +124,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Workspace"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -147,7 +147,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -191,10 +202,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -215,7 +226,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py index 1d5a4d78fdd9..9d5636ffd262 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_gateways_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +41,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -108,7 +107,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -119,7 +118,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py index 0bfcf5191431..fb5ba8be4d5b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_intelligence_packs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, List, Optional, Type, TypeVar +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +41,7 @@ def build_disable_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -77,7 +76,7 @@ def build_enable_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -113,7 +112,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +182,7 @@ def disable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -194,7 +193,7 @@ def disable( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_disable_request( @@ -239,7 +238,7 @@ def enable( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -250,7 +249,7 @@ def enable( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_enable_request( @@ -292,7 +291,7 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> :rtype: list[~azure.mgmt.loganalytics.models.IntelligencePack] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -303,7 +302,7 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.IntelligencePack]] = kwargs.pop("cls", None) _request = build_list_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py index 2997e59abacf..5c7b47140170 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_services_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -93,7 +93,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,7 +134,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -175,7 +175,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -236,7 +236,7 @@ def _create_or_update_initial( parameters: Union[_models.LinkedService, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -247,7 +247,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -387,7 +387,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -435,7 +435,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, workspace_name: str, linked_service_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +446,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -504,7 +504,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -563,7 +563,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.LinkedService :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -574,7 +574,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedService] = kwargs.pop("cls", None) _request = build_get_request( @@ -624,10 +624,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedServiceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -649,7 +649,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py index c98231c49c0b..d5701000e11d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_linked_storage_accounts_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +49,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -96,7 +96,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -136,7 +136,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +177,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -323,7 +323,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +334,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LinkedStorageAccountsResource] = kwargs.pop("cls", None) @@ -401,7 +401,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -412,7 +412,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -463,7 +463,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.LinkedStorageAccountsResource :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -474,7 +474,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedStorageAccountsResource] = kwargs.pop("cls", None) _request = build_get_request( @@ -527,10 +527,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LinkedStorageAccountsListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +552,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py index 59f63d691f69..0726a83de640 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_management_groups_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,10 +113,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListManagementGroupsResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py index a8afe095866c..d051e985379b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operation_statuses_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -41,7 +40,7 @@ def build_get_request(location: str, async_operation_id: str, subscription_id: s _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +96,7 @@ def get(self, location: str, async_operation_id: str, **kwargs: Any) -> _models. :rtype: ~azure.mgmt.loganalytics.models.OperationStatus :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -108,7 +107,7 @@ def get(self, location: str, async_operation_id: str, **kwargs: Any) -> _models. _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationStatus] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py index 3e71b8ff6954..1017e0a0ad38 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -42,7 +42,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,10 +87,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -109,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_queries_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_queries_operations.py index 03499676d0f3..affe43900efd 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_queries_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_queries_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +32,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -52,7 +53,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -98,7 +99,7 @@ def build_search_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -140,7 +141,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +175,7 @@ def build_put_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -211,7 +212,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -248,7 +249,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -329,10 +330,10 @@ def list( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackQueryListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -357,7 +358,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -513,11 +525,11 @@ def search( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQueryListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -552,7 +564,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -599,7 +622,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -610,7 +633,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) _request = build_get_request( @@ -731,7 +754,7 @@ def put( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -742,7 +765,7 @@ def put( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) @@ -875,7 +898,7 @@ def update( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPackQuery :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +909,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPackQuery] = kwargs.pop("cls", None) @@ -948,7 +971,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -959,7 +982,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_query_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_query_packs_operations.py index 5c8352b33be0..dbc8eb7b9ec5 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_query_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_query_packs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +43,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -69,7 +69,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +101,7 @@ def build_create_or_update_without_name_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -136,7 +136,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -202,7 +202,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -238,7 +238,7 @@ def build_update_tags_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -299,10 +299,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.LogAnalyticsQueryPack"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -322,7 +322,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -369,10 +380,10 @@ def list_by_resource_group( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPackListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -393,7 +404,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -497,7 +519,7 @@ def create_or_update_without_name( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -508,7 +530,7 @@ def create_or_update_without_name( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) @@ -566,7 +588,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -577,7 +599,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -618,7 +640,7 @@ def get(self, resource_group_name: str, query_pack_name: str, **kwargs: Any) -> :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -629,7 +651,7 @@ def get(self, resource_group_name: str, query_pack_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) _request = build_get_request( @@ -744,7 +766,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -755,7 +777,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) @@ -875,7 +897,7 @@ def update_tags( :rtype: ~azure.mgmt.loganalytics.models.LogAnalyticsQueryPack :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -886,7 +908,7 @@ def update_tags( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-09-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogAnalyticsQueryPack] = kwargs.pop("cls", None) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py index 95ff8c154536..1d3e8204c23a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_saved_searches_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -79,7 +78,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -123,7 +122,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,7 +163,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +233,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -245,7 +244,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -358,7 +357,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.SavedSearch :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -369,7 +368,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SavedSearch] = kwargs.pop("cls", None) @@ -430,7 +429,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.SavedSearch :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -441,7 +440,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SavedSearch] = kwargs.pop("cls", None) _request = build_get_request( @@ -488,7 +487,7 @@ def list_by_workspace( :rtype: ~azure.mgmt.loganalytics.models.SavedSearchesListResult :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -499,7 +498,7 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SavedSearchesListResult] = kwargs.pop("cls", None) _request = build_list_by_workspace_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py index 256ec008a860..c6b2e24887b7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_schema_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +108,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ :rtype: ~azure.mgmt.loganalytics.models.SearchGetSchemaResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -120,7 +119,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SearchGetSchemaResponse] = kwargs.pop("cls", None) _request = build_get_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py index 46f987e354be..9821a3283c02 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_shared_keys_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ( ClientAuthenticationError, @@ -29,7 +28,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -43,7 +42,7 @@ def build_get_shared_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +82,7 @@ def build_regenerate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +148,7 @@ def get_shared_keys(self, resource_group_name: str, workspace_name: str, **kwarg :rtype: ~azure.mgmt.loganalytics.models.SharedKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -160,7 +159,7 @@ def get_shared_keys(self, resource_group_name: str, workspace_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SharedKeys] = kwargs.pop("cls", None) _request = build_get_shared_keys_request( @@ -205,7 +204,7 @@ def regenerate(self, resource_group_name: str, workspace_name: str, **kwargs: An :rtype: ~azure.mgmt.loganalytics.models.SharedKeys :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -216,7 +215,7 @@ def regenerate(self, resource_group_name: str, workspace_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SharedKeys] = kwargs.pop("cls", None) _request = build_regenerate_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py index 3ccf5387e0b1..c846cb3d295f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_storage_insight_configs_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -31,7 +31,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -45,7 +45,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -89,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) # Construct URL _url = kwargs.pop( "template_url", @@ -165,7 +165,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -303,7 +303,7 @@ def create_or_update( :rtype: ~azure.mgmt.loganalytics.models.StorageInsight :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -314,7 +314,7 @@ def create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StorageInsight] = kwargs.pop("cls", None) @@ -375,7 +375,7 @@ def get( :rtype: ~azure.mgmt.loganalytics.models.StorageInsight :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -386,7 +386,7 @@ def get( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageInsight] = kwargs.pop("cls", None) _request = build_get_request( @@ -435,7 +435,7 @@ def delete( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +446,7 @@ def delete( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -492,10 +492,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StorageInsightListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -517,7 +517,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py index 289ff15d3bf1..bc3ed1f898d1 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_tables_operations.py @@ -1,4 +1,4 @@ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +8,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +36,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +50,7 @@ def build_list_by_workspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +90,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -111,7 +112,9 @@ def build_create_or_update_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -133,7 +136,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -155,7 +158,9 @@ def build_update_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -177,7 +182,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -198,7 +203,9 @@ def build_get_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -218,7 +225,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +246,9 @@ def build_delete_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -259,7 +268,7 @@ def build_migrate_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -280,7 +289,9 @@ def build_migrate_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -300,7 +311,7 @@ def build_cancel_search_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -321,7 +332,9 @@ def build_cancel_search_request( min_length=4, pattern=r"^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$", ), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "tableName": _SERIALIZER.url( + "table_name", table_name, "str", max_length=63, min_length=4, pattern=r"^[A-Za-z0-9-_]+$" + ), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -372,10 +385,10 @@ def list_by_workspace( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TablesListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -397,7 +410,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -435,7 +459,7 @@ def _create_or_update_initial( parameters: Union[_models.Table, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -446,7 +470,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -584,7 +608,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -639,7 +663,7 @@ def _update_initial( parameters: Union[_models.Table, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -650,7 +674,7 @@ def _update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -788,7 +812,7 @@ def begin_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -850,7 +874,7 @@ def get(self, resource_group_name: str, workspace_name: str, table_name: str, ** :rtype: ~azure.mgmt.loganalytics.models.Table :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -861,7 +885,7 @@ def get(self, resource_group_name: str, workspace_name: str, table_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Table] = kwargs.pop("cls", None) _request = build_get_request( @@ -897,7 +921,7 @@ def get(self, resource_group_name: str, workspace_name: str, table_name: str, ** def _delete_initial( self, resource_group_name: str, workspace_name: str, table_name: str, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -908,7 +932,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -939,10 +963,17 @@ def _delete_initial( error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["azure-asyncoperation"] = self._deserialize( + "str", response.headers.get("azure-asyncoperation") + ) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -966,7 +997,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1024,7 +1055,7 @@ def migrate( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1035,7 +1066,7 @@ def migrate( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_migrate_request( @@ -1081,7 +1112,7 @@ def cancel_search( # pylint: disable=inconsistent-return-statements :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -1092,7 +1123,7 @@ def cancel_search( # pylint: disable=inconsistent-return-statements _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_search_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py index 8463ceba961f..6a5a0069495c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_usages_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,7 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +30,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +44,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,10 +113,10 @@ def list(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListUsagesResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -138,7 +138,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py index 55bb9b7f7dba..10bf599f893b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspace_purge_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,7 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, @@ -30,7 +29,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,7 +43,7 @@ def build_purge_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -87,7 +86,7 @@ def build_get_purge_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -246,7 +245,7 @@ def purge( :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -257,7 +256,7 @@ def purge( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkspacePurgeResponse] = kwargs.pop("cls", None) @@ -323,7 +322,7 @@ def get_purge_status( :rtype: ~azure.mgmt.loganalytics.models.WorkspacePurgeStatusResponse :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -334,7 +333,7 @@ def get_purge_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-08-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspacePurgeStatusResponse] = kwargs.pop("cls", None) _request = build_get_purge_status_request( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py index af941812437c..3aee9218d0dc 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/_workspaces_operations.py @@ -1,4 +1,3 @@ -# pylint: disable=too-many-lines,too-many-statements # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,7 +7,8 @@ # -------------------------------------------------------------------------- from io import IOBase import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload +from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -35,7 +35,7 @@ if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports + from typing import MutableMapping # type: ignore T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -47,7 +47,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -73,7 +73,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +105,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -148,7 +148,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,7 +190,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +230,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -297,10 +297,10 @@ def list(self, **kwargs: Any) -> Iterable["_models.Workspace"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -320,7 +320,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -364,10 +375,10 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkspaceListResult] = kwargs.pop("cls", None) - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -388,7 +399,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -425,7 +447,7 @@ def _create_or_update_initial( parameters: Union[_models.Workspace, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -436,7 +458,7 @@ def _create_or_update_initial( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -564,7 +586,7 @@ def begin_create_or_update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -611,7 +633,7 @@ def get_long_running_output(pipeline_response): def _delete_initial( self, resource_group_name: str, workspace_name: str, force: Optional[bool] = None, **kwargs: Any ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -622,7 +644,7 @@ def _delete_initial( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -684,7 +706,7 @@ def begin_delete( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -735,7 +757,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ :rtype: ~azure.mgmt.loganalytics.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -746,7 +768,7 @@ def get(self, resource_group_name: str, workspace_name: str, **kwargs: Any) -> _ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) _request = build_get_request( @@ -854,7 +876,7 @@ def update( :rtype: ~azure.mgmt.loganalytics.models.Workspace :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, @@ -865,7 +887,7 @@ def update( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-10-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Workspace] = kwargs.pop("cls", None) diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_create.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_create.py index 3d9027cdcd17..14e8aecff73c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_create.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_create.py @@ -34,7 +34,7 @@ def main(): resource_group_name="oiautorest6685", cluster_name="oiautorest6685", parameters={ - "location": "australiasoutheast", + "location": "eastus", "sku": {"capacity": 1000, "name": "CapacityReservation"}, "tags": {"tag1": "val1"}, }, @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersCreate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersCreate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_delete.py index f6386e52f64b..119c1e314824 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_get.py index 98971c38db92..3371acb5507d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_list_by_resource_group.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_list_by_resource_group.py index 38cf9b85abcc..5abddc8bc8bc 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_list_by_resource_group.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersListByResourceGroup.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_subscription_list.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_subscription_list.py index 0bb8cf14db8a..7f75bc1c9dc0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_subscription_list.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_subscription_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersSubscriptionList.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersSubscriptionList.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_update.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_update.py index b5274f3a2b8d..a92df444a426 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_update.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/clusters_update.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ClustersUpdate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/ClustersUpdate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_create_or_update.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_create_or_update.py index 7b53bdaaca6f..f7bc9a20f9ce 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_create_or_update.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_create_or_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportCreateOrUpdate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataExportCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_delete.py index 46c8b5ec5279..1ef961c17b1b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataExportDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_get.py index 88ccaa7e568c..a999212c1b05 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataExportGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_list_by_workspace.py index f73fa3feebea..21b3a22662f3 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_export_list_by_workspace.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataExportListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataExportListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_create.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_create.py index e84362f87c38..41982b1686dd 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_create.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_create.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesCreate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataSourcesCreate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_delete.py index 32d06490844e..7ef78933b71b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataSourcesDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_get.py index 358dacaa37c6..1d6c7381f1ce 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataSourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_list_by_workspace.py index 370b11e7cc3b..c5f1e3225a67 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/data_sources_list_by_workspace.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/DataSourcesListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/DataSourcesListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_create.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_create.py index ca45e507a7ec..bde04b7a7a2e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_create.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_create.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesCreate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedServicesCreate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_delete.py index 30a5412f442e..0fe33abcf73d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_delete.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedServicesDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_get.py index b7df436bc6c6..0d21ef15cdfb 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedServicesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_list_by_workspace.py index ec254154bed7..e52a7b64ee06 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_services_list_by_workspace.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedServicesListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedServicesListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_create.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_create.py index a4975dd5a093..c0dfcc7d27b4 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_create.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsCreate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedStorageAccountsCreate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_delete.py index b512fca2adfd..c91cdba00960 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedStorageAccountsDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_get.py index 91149cc477da..2c1846be38d1 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedStorageAccountsGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_list_by_workspace.py index cb171feefe26..40572017d63e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/linked_storage_accounts_list_by_workspace.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/LinkedStorageAccountsListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/LinkedStorageAccountsListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operation_statuses_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operation_statuses_get.py index ca75de32507f..a9c135646a2b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operation_statuses_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operation_statuses_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/OperationStatusesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/OperationStatusesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operations_list_by_tenant.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operations_list_by_tenant.py index 1a675593e69d..e1ff7b29ee2b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operations_list_by_tenant.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/operations_list_by_tenant.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/OperationsListByTenant.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/OperationsListByTenant.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_delete.py index aa7d99adf1ba..4bcea4c6fb7b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPackQueriesDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_get.py index 7cc2450995f0..52f3e758761b 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPackQueriesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_list.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_list.py index 689351a85ad4..1da170623c58 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_list.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_pack_queries_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesList.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPackQueriesList.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_delete.py index a19fc00230d5..8e298e6a4d47 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_delete.py @@ -36,6 +36,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPacksDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_get.py index 66fe5278a2ef..7375790924b9 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPacksGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list.py index e51ff5f26d01..b453a4dfdb65 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksList.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPacksList.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list_by_resource_group.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list_by_resource_group.py index ba092ff61dd6..d2cff1e972f9 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list_by_resource_group.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/query_packs_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksListByResourceGroup.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/QueryPacksListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_get_schema.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_get_schema.py index edbd2af2b017..da125d956fa0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_get_schema.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_get_schema.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesGetSchema.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/SavedSearchesGetSchema.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_list_by_workspace.py index 34401c2cdfe2..f9fe0e899a46 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/saved_searches_list_by_workspace.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/SavedSearchesListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/SavedSearchesListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_create_or_update.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_create_or_update.py index e3f5998755fc..ae1b46af4f7c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_create_or_update.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_create_or_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsCreateOrUpdate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/StorageInsightsCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_delete.py index 29ba98854692..04c2c2c6a7d5 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/StorageInsightsDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_get.py index cb700ea8c6d2..05757d9cb61c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/StorageInsightsGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_list_by_workspace.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_list_by_workspace.py index d0408e4b7899..3b379bd76136 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_list_by_workspace.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/storage_insights_list_by_workspace.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/StorageInsightsListByWorkspace.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/StorageInsightsListByWorkspace.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_delete.py index e0bfe4656fa6..b582a5863a68 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_get.py index 035130a6d7ec..480aeb08f1ac 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_list.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_list.py index d9debdcf1d2a..79de6bc52659 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_list.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesList.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesList.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_migrate.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_migrate.py index 47958c7c1bcb..d975cd18199c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_migrate.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_migrate.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesMigrate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesMigrate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_search_cancel.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_search_cancel.py index e4d548d6240d..855aaa34022f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_search_cancel.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_search_cancel.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesSearchCancel.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesSearchCancel.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_upsert.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_upsert.py index ec01780d1520..7665b7ebbbb0 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_upsert.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/tables_upsert.py @@ -30,7 +30,7 @@ def main(): subscription_id="00000000-0000-0000-0000-00000000000", ) - response = client.tables.begin_update( + response = client.tables.begin_create_or_update( resource_group_name="oiautorest6685", workspace_name="oiautorest6685", table_name="AzureNetworkFlow", @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/TablesUpsert.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/TablesUpsert.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_available_service_tiers.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_available_service_tiers.py index 2dd225845d6c..4360bbe05f7c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_available_service_tiers.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_available_service_tiers.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesAvailableServiceTiers.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesAvailableServiceTiers.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_create.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_create.py index 22fb133340a8..733048c3e3d7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_create.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_create.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesCreate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesCreate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete.py index 11b3d0ee7e07..95c9ddbeab68 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete_saved_searches.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete_saved_searches.py index 8b9fd9c84200..1b689e43f476 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete_saved_searches.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_delete_saved_searches.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDeleteSavedSearches.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesDeleteSavedSearches.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_disable_intelligence_pack.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_disable_intelligence_pack.py index 77948284f902..414ae92a5457 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_disable_intelligence_pack.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_disable_intelligence_pack.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesDisableIntelligencePack.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesDisableIntelligencePack.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_enable_intelligence_pack.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_enable_intelligence_pack.py index f19ec4f6cb0f..cf9942285909 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_enable_intelligence_pack.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_enable_intelligence_pack.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesEnableIntelligencePack.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesEnableIntelligencePack.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_gateways_delete.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_gateways_delete.py index 516b776c582c..10df9fae42b8 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_gateways_delete.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_gateways_delete.py @@ -37,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGatewaysDelete.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesGatewaysDelete.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get.py index 658a7fbd4fd0..d7ec59374c54 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get_shared_keys.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get_shared_keys.py index 08e6a242c781..852c57346a9d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get_shared_keys.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_get_shared_keys.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesGetSharedKeys.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesGetSharedKeys.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_by_resource_group.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_by_resource_group.py index b71d980c3e4e..32438c32a185 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_by_resource_group.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_by_resource_group.py @@ -30,13 +30,13 @@ def main(): subscription_id="00000000-0000-0000-0000-00000000000", ) - response = client.workspaces.list_by_resource_group( + response = client.deleted_workspaces.list_by_resource_group( resource_group_name="oiautorest6685", ) for item in response: print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesListByResourceGroup.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_intelligence_packs.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_intelligence_packs.py index 3ed8bf4c2e7b..580cda419bcd 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_intelligence_packs.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_intelligence_packs.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListIntelligencePacks.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesListIntelligencePacks.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_management_groups.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_management_groups.py index 2b4f496106c1..ef6a51ead13d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_management_groups.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_management_groups.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListManagementGroups.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesListManagementGroups.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_usages.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_usages.py index 80d12940f217..dda04020afcf 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_usages.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_list_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesListUsages.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesListUsages.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge.py index 5f2d589a4aca..b98f6209fd15 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurge.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesPurge.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_operation.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_operation.py index 845dc6de3fa0..85c60f112ea6 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_operation.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_operation.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeOperation.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesPurgeOperation.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_resource_id.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_resource_id.py index 7a47452ca322..9f5e0405c12e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_resource_id.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_purge_resource_id.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesPurgeResourceId.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesPurgeResourceId.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_regenerate_shared_keys.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_regenerate_shared_keys.py index 75b952d527df..2149952fb7d2 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_regenerate_shared_keys.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_regenerate_shared_keys.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesRegenerateSharedKeys.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesRegenerateSharedKeys.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_create_or_update.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_create_or_update.py index d254f65b0972..4a25ef0820a3 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_create_or_update.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_create_or_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_get.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_get.py index fa6cb56271d0..a69874629013 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_get.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_saved_searches_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/WorkspacesSavedSearchesGet.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesSavedSearchesGet.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_subscription_list.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_subscription_list.py index 251fd49f9799..19d2bd8d920c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_subscription_list.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_subscription_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesSubscriptionList.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesSubscriptionList.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_update.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_update.py index 804286e0d7b0..b67a8c2ecf64 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_update.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_samples/workspaces_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/WorkspacesUpdate.json +# x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2025-02-01/examples/WorkspacesUpdate.json if __name__ == "__main__": main() diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/conftest.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/conftest.py index 1fbe0ba3e8b2..879575556450 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/conftest.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/conftest.py @@ -18,7 +18,7 @@ load_dotenv() -# aovid record sensitive identity information in recordings +# For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): loganalyticsmanagement_subscription_id = os.environ.get( diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations.py index 7227fc83cd7e..4c93e0068414 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_available_service_tiers_list_by_workspace(self, resource_group): response = self.client.available_service_tiers.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations_async.py index 45b08534c726..3e6b0168d3db 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_available_service_tiers_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_available_service_tiers_list_by_workspace(self, resource_group): response = await self.client.available_service_tiers.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations.py index 31742b02cb41..3aa446164856 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations.py @@ -20,10 +20,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_clusters_list_by_resource_group(self, resource_group): response = self.client.clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -31,9 +31,9 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_clusters_list(self, resource_group): response = self.client.clusters.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_clusters_begin_create_or_update(self, resource_group): response = self.client.clusters.begin_create_or_update( resource_group_name=resource_group.name, cluster_name="str", @@ -67,11 +67,19 @@ def test_begin_create_or_update(self, resource_group): "lastModifiedDate": "str", "name": "str", "provisioningState": "str", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "isAvailabilityZonesEnabled": bool, + "lastModifiedDate": "str", + "provisioningState": "str", + }, "sku": {"capacity": 0, "name": "str"}, "tags": {"str": "str"}, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,11 +87,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_clusters_begin_delete(self, resource_group): response = self.client.clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -91,11 +99,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_clusters_get(self, resource_group): response = self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -103,7 +111,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_clusters_begin_update(self, resource_group): response = self.client.clusters.begin_update( resource_group_name=resource_group.name, cluster_name="str", @@ -119,7 +127,7 @@ def test_begin_update(self, resource_group): "sku": {"capacity": 0, "name": "str"}, "tags": {"str": "str"}, }, - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations_async.py index 1cb078e0d3ce..deacfb97f211 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_clusters_operations_async.py @@ -21,10 +21,10 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_clusters_list_by_resource_group(self, resource_group): response = self.client.clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -32,9 +32,9 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_clusters_list(self, resource_group): response = self.client.clusters.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_clusters_begin_create_or_update(self, resource_group): response = await ( await self.client.clusters.begin_create_or_update( resource_group_name=resource_group.name, @@ -74,11 +74,19 @@ async def test_begin_create_or_update(self, resource_group): "lastModifiedDate": "str", "name": "str", "provisioningState": "str", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "isAvailabilityZonesEnabled": bool, + "lastModifiedDate": "str", + "provisioningState": "str", + }, "sku": {"capacity": 0, "name": "str"}, "tags": {"str": "str"}, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -87,12 +95,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_clusters_begin_delete(self, resource_group): response = await ( await self.client.clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -101,11 +109,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_clusters_get(self, resource_group): response = await self.client.clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -113,7 +121,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_clusters_begin_update(self, resource_group): response = await ( await self.client.clusters.begin_update( resource_group_name=resource_group.name, @@ -135,7 +143,7 @@ async def test_begin_update(self, resource_group): "sku": {"capacity": 0, "name": "str"}, "tags": {"str": "str"}, }, - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations.py index b38e545a8332..1c006707cf5d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_data_exports_list_by_workspace(self, resource_group): response = self.client.data_exports.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,7 +32,7 @@ def test_list_by_workspace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_data_exports_create_or_update(self, resource_group): response = self.client.data_exports.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -49,7 +49,7 @@ def test_create_or_update(self, resource_group): "tableNames": ["str"], "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -57,12 +57,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_data_exports_get(self, resource_group): response = self.client.data_exports.get( resource_group_name=resource_group.name, workspace_name="str", data_export_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -70,12 +70,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_data_exports_delete(self, resource_group): response = self.client.data_exports.delete( resource_group_name=resource_group.name, workspace_name="str", data_export_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations_async.py index c8c275998c56..3905b0bd03c9 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_exports_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_data_exports_list_by_workspace(self, resource_group): response = self.client.data_exports.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ async def test_list_by_workspace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_data_exports_create_or_update(self, resource_group): response = await self.client.data_exports.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -50,7 +50,7 @@ async def test_create_or_update(self, resource_group): "tableNames": ["str"], "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_data_exports_get(self, resource_group): response = await self.client.data_exports.get( resource_group_name=resource_group.name, workspace_name="str", data_export_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -71,12 +71,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_data_exports_delete(self, resource_group): response = await self.client.data_exports.delete( resource_group_name=resource_group.name, workspace_name="str", data_export_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations.py index 641ca14768be..e97da8bde259 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_data_sources_create_or_update(self, resource_group): response = self.client.data_sources.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -34,7 +34,7 @@ def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -42,12 +42,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_data_sources_delete(self, resource_group): response = self.client.data_sources.delete( resource_group_name=resource_group.name, workspace_name="str", data_source_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -55,12 +55,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_data_sources_get(self, resource_group): response = self.client.data_sources.get( resource_group_name=resource_group.name, workspace_name="str", data_source_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -68,12 +68,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_data_sources_list_by_workspace(self, resource_group): response = self.client.data_sources.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", filter="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations_async.py index eaadae597f26..fa5c7b6ba4f9 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_data_sources_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_data_sources_create_or_update(self, resource_group): response = await self.client.data_sources.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -35,7 +35,7 @@ async def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -43,12 +43,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_data_sources_delete(self, resource_group): response = await self.client.data_sources.delete( resource_group_name=resource_group.name, workspace_name="str", data_source_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -56,12 +56,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_data_sources_get(self, resource_group): response = await self.client.data_sources.get( resource_group_name=resource_group.name, workspace_name="str", data_source_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -69,12 +69,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_data_sources_list_by_workspace(self, resource_group): response = self.client.data_sources.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", filter="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations.py index e2655da89001..38ecee3c0446 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_deleted_workspaces_list(self, resource_group): response = self.client.deleted_workspaces.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_deleted_workspaces_list_by_resource_group(self, resource_group): response = self.client.deleted_workspaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations_async.py index 40790285853a..438800df700a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_deleted_workspaces_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_deleted_workspaces_list(self, resource_group): response = self.client.deleted_workspaces.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_deleted_workspaces_list_by_resource_group(self, resource_group): response = self.client.deleted_workspaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations.py index 206d2eb6ecab..eeb6e30aa204 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_gateways_delete(self, resource_group): response = self.client.gateways.delete( resource_group_name=resource_group.name, workspace_name="str", gateway_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations_async.py index 83924d573d7c..eb860f2d3638 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_gateways_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_gateways_delete(self, resource_group): response = await self.client.gateways.delete( resource_group_name=resource_group.name, workspace_name="str", gateway_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations.py index 265bd2880bbe..710bf0e482bc 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_disable(self, resource_group): + def test_intelligence_packs_disable(self, resource_group): response = self.client.intelligence_packs.disable( resource_group_name=resource_group.name, workspace_name="str", intelligence_pack_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_disable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_enable(self, resource_group): + def test_intelligence_packs_enable(self, resource_group): response = self.client.intelligence_packs.enable( resource_group_name=resource_group.name, workspace_name="str", intelligence_pack_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -46,11 +46,11 @@ def test_enable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_intelligence_packs_list(self, resource_group): response = self.client.intelligence_packs.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations_async.py index d39adeee23b3..f4a6fb1c3cc4 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_intelligence_packs_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_disable(self, resource_group): + async def test_intelligence_packs_disable(self, resource_group): response = await self.client.intelligence_packs.disable( resource_group_name=resource_group.name, workspace_name="str", intelligence_pack_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -34,12 +34,12 @@ async def test_disable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_enable(self, resource_group): + async def test_intelligence_packs_enable(self, resource_group): response = await self.client.intelligence_packs.enable( resource_group_name=resource_group.name, workspace_name="str", intelligence_pack_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -47,11 +47,11 @@ async def test_enable(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_intelligence_packs_list(self, resource_group): response = await self.client.intelligence_packs.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations.py index 485f4c2f70f2..ae0b449e1cad 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_linked_services_begin_create_or_update(self, resource_group): response = self.client.linked_services.begin_create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -34,7 +34,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "writeAccessResourceId": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -42,12 +42,12 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_linked_services_begin_delete(self, resource_group): response = self.client.linked_services.begin_delete( resource_group_name=resource_group.name, workspace_name="str", linked_service_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -55,12 +55,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_linked_services_get(self, resource_group): response = self.client.linked_services.get( resource_group_name=resource_group.name, workspace_name="str", linked_service_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -68,11 +68,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_linked_services_list_by_workspace(self, resource_group): response = self.client.linked_services.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations_async.py index bd80aac4523c..b8c65e705d0c 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_services_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_linked_services_begin_create_or_update(self, resource_group): response = await ( await self.client.linked_services.begin_create_or_update( resource_group_name=resource_group.name, @@ -36,7 +36,7 @@ async def test_begin_create_or_update(self, resource_group): "type": "str", "writeAccessResourceId": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -45,13 +45,13 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_linked_services_begin_delete(self, resource_group): response = await ( await self.client.linked_services.begin_delete( resource_group_name=resource_group.name, workspace_name="str", linked_service_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -60,12 +60,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_linked_services_get(self, resource_group): response = await self.client.linked_services.get( resource_group_name=resource_group.name, workspace_name="str", linked_service_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -73,11 +73,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_linked_services_list_by_workspace(self, resource_group): response = self.client.linked_services.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations.py index 07442c313288..8586b455b150 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_linked_storage_accounts_create_or_update(self, resource_group): response = self.client.linked_storage_accounts.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -32,7 +32,7 @@ def test_create_or_update(self, resource_group): "storageAccountIds": ["str"], "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -40,12 +40,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_linked_storage_accounts_delete(self, resource_group): response = self.client.linked_storage_accounts.delete( resource_group_name=resource_group.name, workspace_name="str", data_source_type="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -53,12 +53,12 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_linked_storage_accounts_get(self, resource_group): response = self.client.linked_storage_accounts.get( resource_group_name=resource_group.name, workspace_name="str", data_source_type="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -66,11 +66,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_linked_storage_accounts_list_by_workspace(self, resource_group): response = self.client.linked_storage_accounts.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations_async.py index 2f312b4bed51..7833bea6dfd7 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_linked_storage_accounts_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_linked_storage_accounts_create_or_update(self, resource_group): response = await self.client.linked_storage_accounts.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -33,7 +33,7 @@ async def test_create_or_update(self, resource_group): "storageAccountIds": ["str"], "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -41,12 +41,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_linked_storage_accounts_delete(self, resource_group): response = await self.client.linked_storage_accounts.delete( resource_group_name=resource_group.name, workspace_name="str", data_source_type="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -54,12 +54,12 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_linked_storage_accounts_get(self, resource_group): response = await self.client.linked_storage_accounts.get( resource_group_name=resource_group.name, workspace_name="str", data_source_type="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -67,11 +67,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_linked_storage_accounts_list_by_workspace(self, resource_group): response = self.client.linked_storage_accounts.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations.py index ab224612c265..dd84c5babc38 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_management_groups_list(self, resource_group): response = self.client.management_groups.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations_async.py index dfbcf1d4b08a..53ad65ca0109 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_management_groups_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_management_groups_list(self, resource_group): response = self.client.management_groups.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations.py index dcd1005b384e..0d40980dc05d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_operation_statuses_get(self, resource_group): response = self.client.operation_statuses.get( location="str", async_operation_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations_async.py index b8c5b5191f30..da195a3d4f84 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operation_statuses_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_operation_statuses_get(self, resource_group): response = await self.client.operation_statuses.get( location="str", async_operation_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations.py index a71bbdeaec2f..b04b0d6c44a5 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations_async.py index 566b357e7439..a0534c35afd2 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations.py index 369cab55436b..bd244de072f8 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_queries_list(self, resource_group): response = self.client.queries.list( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,7 +32,7 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_search(self, resource_group): + def test_queries_search(self, resource_group): response = self.client.queries.search( resource_group_name=resource_group.name, query_pack_name="str", @@ -40,7 +40,7 @@ def test_search(self, resource_group): "related": {"categories": ["str"], "resourceTypes": ["str"], "solutions": ["str"]}, "tags": {"str": ["str"]}, }, - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -48,12 +48,12 @@ def test_search(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_queries_get(self, resource_group): response = self.client.queries.get( resource_group_name=resource_group.name, query_pack_name="str", id="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_put(self, resource_group): + def test_queries_put(self, resource_group): response = self.client.queries.put( resource_group_name=resource_group.name, query_pack_name="str", @@ -88,7 +88,7 @@ def test_put(self, resource_group): "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_queries_update(self, resource_group): response = self.client.queries.update( resource_group_name=resource_group.name, query_pack_name="str", @@ -123,7 +123,7 @@ def test_update(self, resource_group): "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -131,12 +131,12 @@ def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_queries_delete(self, resource_group): response = self.client.queries.delete( resource_group_name=resource_group.name, query_pack_name="str", id="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations_async.py index d466472e6c15..f4706200516d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_queries_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_queries_list(self, resource_group): response = self.client.queries.list( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_search(self, resource_group): + async def test_queries_search(self, resource_group): response = self.client.queries.search( resource_group_name=resource_group.name, query_pack_name="str", @@ -41,7 +41,7 @@ async def test_search(self, resource_group): "related": {"categories": ["str"], "resourceTypes": ["str"], "solutions": ["str"]}, "tags": {"str": ["str"]}, }, - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -49,12 +49,12 @@ async def test_search(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_queries_get(self, resource_group): response = await self.client.queries.get( resource_group_name=resource_group.name, query_pack_name="str", id="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_put(self, resource_group): + async def test_queries_put(self, resource_group): response = await self.client.queries.put( resource_group_name=resource_group.name, query_pack_name="str", @@ -89,7 +89,7 @@ async def test_put(self, resource_group): "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -97,7 +97,7 @@ async def test_put(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_queries_update(self, resource_group): response = await self.client.queries.update( resource_group_name=resource_group.name, query_pack_name="str", @@ -124,7 +124,7 @@ async def test_update(self, resource_group): "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -132,12 +132,12 @@ async def test_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_queries_delete(self, resource_group): response = await self.client.queries.delete( resource_group_name=resource_group.name, query_pack_name="str", id="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations.py index e201d3e79fdc..68e272bece4d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_query_packs_list(self, resource_group): response = self.client.query_packs.list( - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_query_packs_list_by_resource_group(self, resource_group): response = self.client.query_packs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update_without_name(self, resource_group): + def test_query_packs_create_or_update_without_name(self, resource_group): response = self.client.query_packs.create_or_update_without_name( resource_group_name=resource_group.name, log_analytics_query_pack_payload={ @@ -50,12 +50,20 @@ def test_create_or_update_without_name(self, resource_group): "name": "str", "provisioningState": "str", "queryPackId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "timeCreated": "2020-02-20 00:00:00", "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -63,11 +71,11 @@ def test_create_or_update_without_name(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_query_packs_delete(self, resource_group): response = self.client.query_packs.delete( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -75,11 +83,11 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_query_packs_get(self, resource_group): response = self.client.query_packs.get( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -87,7 +95,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_query_packs_create_or_update(self, resource_group): response = self.client.query_packs.create_or_update( resource_group_name=resource_group.name, query_pack_name="str", @@ -97,12 +105,20 @@ def test_create_or_update(self, resource_group): "name": "str", "provisioningState": "str", "queryPackId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "timeCreated": "2020-02-20 00:00:00", "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -110,12 +126,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update_tags(self, resource_group): + def test_query_packs_update_tags(self, resource_group): response = self.client.query_packs.update_tags( resource_group_name=resource_group.name, query_pack_name="str", query_pack_tags={"tags": {"str": "str"}}, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations_async.py index e40f2126a2f0..4da03c6e52b3 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_query_packs_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_query_packs_list(self, resource_group): response = self.client.query_packs.list( - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_query_packs_list_by_resource_group(self, resource_group): response = self.client.query_packs.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2019-09-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update_without_name(self, resource_group): + async def test_query_packs_create_or_update_without_name(self, resource_group): response = await self.client.query_packs.create_or_update_without_name( resource_group_name=resource_group.name, log_analytics_query_pack_payload={ @@ -51,12 +51,20 @@ async def test_create_or_update_without_name(self, resource_group): "name": "str", "provisioningState": "str", "queryPackId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "timeCreated": "2020-02-20 00:00:00", "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -64,11 +72,11 @@ async def test_create_or_update_without_name(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_query_packs_delete(self, resource_group): response = await self.client.query_packs.delete( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -76,11 +84,11 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_query_packs_get(self, resource_group): response = await self.client.query_packs.get( resource_group_name=resource_group.name, query_pack_name="str", - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -88,7 +96,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_query_packs_create_or_update(self, resource_group): response = await self.client.query_packs.create_or_update( resource_group_name=resource_group.name, query_pack_name="str", @@ -98,12 +106,20 @@ async def test_create_or_update(self, resource_group): "name": "str", "provisioningState": "str", "queryPackId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "timeCreated": "2020-02-20 00:00:00", "timeModified": "2020-02-20 00:00:00", "type": "str", }, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -111,12 +127,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update_tags(self, resource_group): + async def test_query_packs_update_tags(self, resource_group): response = await self.client.query_packs.update_tags( resource_group_name=resource_group.name, query_pack_name="str", query_pack_tags={"tags": {"str": "str"}}, - api_version="2019-09-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations.py index 732c7b0741e9..77c88e77fcd1 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_saved_searches_delete(self, resource_group): response = self.client.saved_searches.delete( resource_group_name=resource_group.name, workspace_name="str", saved_search_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_saved_searches_create_or_update(self, resource_group): response = self.client.saved_searches.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -51,7 +51,7 @@ def test_create_or_update(self, resource_group): "type": "str", "version": 0, }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -59,12 +59,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_saved_searches_get(self, resource_group): response = self.client.saved_searches.get( resource_group_name=resource_group.name, workspace_name="str", saved_search_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -72,11 +72,11 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_saved_searches_list_by_workspace(self, resource_group): response = self.client.saved_searches.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations_async.py index 7afeabdffb9f..1f00b13baf20 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_saved_searches_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_saved_searches_delete(self, resource_group): response = await self.client.saved_searches.delete( resource_group_name=resource_group.name, workspace_name="str", saved_search_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_saved_searches_create_or_update(self, resource_group): response = await self.client.saved_searches.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -52,7 +52,7 @@ async def test_create_or_update(self, resource_group): "type": "str", "version": 0, }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -60,12 +60,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_saved_searches_get(self, resource_group): response = await self.client.saved_searches.get( resource_group_name=resource_group.name, workspace_name="str", saved_search_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -73,11 +73,11 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_saved_searches_list_by_workspace(self, resource_group): response = await self.client.saved_searches.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations.py index 4af4e214066e..958666886061 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_schema_get(self, resource_group): response = self.client.schema.get( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations_async.py index a968c33a96d3..9602419bc383 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_schema_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_schema_get(self, resource_group): response = await self.client.schema.get( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations.py index c3f672c8316e..5a605715f88f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_shared_keys(self, resource_group): + def test_shared_keys_get_shared_keys(self, resource_group): response = self.client.shared_keys.get_shared_keys( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -32,11 +32,11 @@ def test_get_shared_keys(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_regenerate(self, resource_group): + def test_shared_keys_regenerate(self, resource_group): response = self.client.shared_keys.regenerate( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations_async.py index f38805abe402..26a719dd4109 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_shared_keys_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_shared_keys(self, resource_group): + async def test_shared_keys_get_shared_keys(self, resource_group): response = await self.client.shared_keys.get_shared_keys( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -33,11 +33,11 @@ async def test_get_shared_keys(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_regenerate(self, resource_group): + async def test_shared_keys_regenerate(self, resource_group): response = await self.client.shared_keys.regenerate( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations.py index f36d19061e8c..e4a0ae3a0c0f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_or_update(self, resource_group): + def test_storage_insight_configs_create_or_update(self, resource_group): response = self.client.storage_insight_configs.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -36,7 +36,7 @@ def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -44,12 +44,12 @@ def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_storage_insight_configs_get(self, resource_group): response = self.client.storage_insight_configs.get( resource_group_name=resource_group.name, workspace_name="str", storage_insight_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -57,12 +57,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_delete(self, resource_group): + def test_storage_insight_configs_delete(self, resource_group): response = self.client.storage_insight_configs.delete( resource_group_name=resource_group.name, workspace_name="str", storage_insight_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -70,11 +70,11 @@ def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_storage_insight_configs_list_by_workspace(self, resource_group): response = self.client.storage_insight_configs.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations_async.py index 7a6dffb0491e..5cee0e80b6df 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_storage_insight_configs_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_or_update(self, resource_group): + async def test_storage_insight_configs_create_or_update(self, resource_group): response = await self.client.storage_insight_configs.create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -37,7 +37,7 @@ async def test_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -45,12 +45,12 @@ async def test_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_storage_insight_configs_get(self, resource_group): response = await self.client.storage_insight_configs.get( resource_group_name=resource_group.name, workspace_name="str", storage_insight_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -58,12 +58,12 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_delete(self, resource_group): + async def test_storage_insight_configs_delete(self, resource_group): response = await self.client.storage_insight_configs.delete( resource_group_name=resource_group.name, workspace_name="str", storage_insight_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -71,11 +71,11 @@ async def test_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_storage_insight_configs_list_by_workspace(self, resource_group): response = self.client.storage_insight_configs.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations.py index 157b5ce8fb0a..9000c7a0e14a 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_workspace(self, resource_group): + def test_tables_list_by_workspace(self, resource_group): response = self.client.tables.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -32,7 +32,7 @@ def test_list_by_workspace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_tables_begin_create_or_update(self, resource_group): response = self.client.tables.begin_create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -107,7 +107,7 @@ def test_begin_create_or_update(self, resource_group): "totalRetentionInDaysAsDefault": bool, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -115,7 +115,7 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_tables_begin_update(self, resource_group): response = self.client.tables.begin_update( resource_group_name=resource_group.name, workspace_name="str", @@ -190,7 +190,7 @@ def test_begin_update(self, resource_group): "totalRetentionInDaysAsDefault": bool, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -198,12 +198,12 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_tables_get(self, resource_group): response = self.client.tables.get( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -211,12 +211,12 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_tables_begin_delete(self, resource_group): response = self.client.tables.begin_delete( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -224,12 +224,12 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_migrate(self, resource_group): + def test_tables_migrate(self, resource_group): response = self.client.tables.migrate( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -237,12 +237,12 @@ def test_migrate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_cancel_search(self, resource_group): + def test_tables_cancel_search(self, resource_group): response = self.client.tables.cancel_search( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations_async.py index 11d406880927..9a0b7e16b951 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_tables_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_workspace(self, resource_group): + async def test_tables_list_by_workspace(self, resource_group): response = self.client.tables.list_by_workspace( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ async def test_list_by_workspace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_tables_begin_create_or_update(self, resource_group): response = await ( await self.client.tables.begin_create_or_update( resource_group_name=resource_group.name, @@ -109,7 +109,7 @@ async def test_begin_create_or_update(self, resource_group): "totalRetentionInDaysAsDefault": bool, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -118,7 +118,7 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_tables_begin_update(self, resource_group): response = await ( await self.client.tables.begin_update( resource_group_name=resource_group.name, @@ -194,7 +194,7 @@ async def test_begin_update(self, resource_group): "totalRetentionInDaysAsDefault": bool, "type": "str", }, - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -203,12 +203,12 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_tables_get(self, resource_group): response = await self.client.tables.get( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -216,13 +216,13 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_tables_begin_delete(self, resource_group): response = await ( await self.client.tables.begin_delete( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -231,12 +231,12 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_migrate(self, resource_group): + async def test_tables_migrate(self, resource_group): response = await self.client.tables.migrate( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -244,12 +244,12 @@ async def test_migrate(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_cancel_search(self, resource_group): + async def test_tables_cancel_search(self, resource_group): response = await self.client.tables.cancel_search( resource_group_name=resource_group.name, workspace_name="str", table_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations.py index 64bc44c3d434..123de1a5523f 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations.py @@ -20,11 +20,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_usages_list(self, resource_group): response = self.client.usages.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations_async.py index c1a19dcf2b39..8d399d70db01 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_usages_operations_async.py @@ -21,11 +21,11 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_usages_list(self, resource_group): response = self.client.usages.list( resource_group_name=resource_group.name, workspace_name="str", - api_version="2020-08-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations.py index ef87dcf94da4..e37c99cd60d9 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations.py @@ -20,12 +20,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_purge(self, resource_group): + def test_workspace_purge_purge(self, resource_group): response = self.client.workspace_purge.purge( resource_group_name=resource_group.name, workspace_name="str", body={"filters": [{"column": "str", "key": "str", "operator": "str", "value": {}}], "table": "str"}, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -33,12 +33,12 @@ def test_purge(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get_purge_status(self, resource_group): + def test_workspace_purge_get_purge_status(self, resource_group): response = self.client.workspace_purge.get_purge_status( resource_group_name=resource_group.name, workspace_name="str", purge_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations_async.py index ce90884ab927..feaaafbbcfdf 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspace_purge_operations_async.py @@ -21,12 +21,12 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_purge(self, resource_group): + async def test_workspace_purge_purge(self, resource_group): response = await self.client.workspace_purge.purge( resource_group_name=resource_group.name, workspace_name="str", body={"filters": [{"column": "str", "key": "str", "operator": "str", "value": {}}], "table": "str"}, - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -34,12 +34,12 @@ async def test_purge(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get_purge_status(self, resource_group): + async def test_workspace_purge_get_purge_status(self, resource_group): response = await self.client.workspace_purge.get_purge_status( resource_group_name=resource_group.name, workspace_name="str", purge_id="str", - api_version="2020-08-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations.py index 66fc8f15243d..3dae8afe13fb 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations.py @@ -20,9 +20,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list(self, resource_group): + def test_workspaces_list(self, resource_group): response = self.client.workspaces.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,10 +30,10 @@ def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_workspaces_list_by_resource_group(self, resource_group): response = self.client.workspaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_update(self, resource_group): + def test_workspaces_begin_create_or_update(self, resource_group): response = self.client.workspaces.begin_create_or_update( resource_group_name=resource_group.name, workspace_name="str", @@ -51,12 +51,14 @@ def test_begin_create_or_update(self, resource_group): "customerId": "str", "defaultDataCollectionRuleResourceId": "str", "etag": "str", + "failover": {"lastModifiedDate": "str", "state": "str"}, "features": { "clusterResourceId": "str", "disableLocalAuth": bool, "enableDataExport": bool, "enableLogAccessUsingOnlyResourcePermissions": bool, "immediatePurgeDataOn30Days": bool, + "unifiedSentinelBillingOnly": bool, }, "forceCmkForQuery": bool, "id": "str", @@ -72,6 +74,13 @@ def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": "Enabled", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "lastModifiedDate": "str", + "provisioningState": "str", + }, "retentionInDays": 0, "sku": {"name": "str", "capacityReservationLevel": 0, "lastSkuUpdate": "str"}, "systemData": { @@ -86,7 +95,7 @@ def test_begin_create_or_update(self, resource_group): "type": "str", "workspaceCapping": {"dailyQuotaGb": 0.0, "dataIngestionStatus": "str", "quotaNextResetTime": "str"}, }, - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -94,11 +103,11 @@ def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_workspaces_begin_delete(self, resource_group): response = self.client.workspaces.begin_delete( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -106,11 +115,11 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_workspaces_get(self, resource_group): response = self.client.workspaces.get( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -118,7 +127,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update(self, resource_group): + def test_workspaces_update(self, resource_group): response = self.client.workspaces.update( resource_group_name=resource_group.name, workspace_name="str", @@ -127,12 +136,14 @@ def test_update(self, resource_group): "customerId": "str", "defaultDataCollectionRuleResourceId": "str", "etag": "str", + "failover": {"lastModifiedDate": "str", "state": "str"}, "features": { "clusterResourceId": "str", "disableLocalAuth": bool, "enableDataExport": bool, "enableLogAccessUsingOnlyResourcePermissions": bool, "immediatePurgeDataOn30Days": bool, + "unifiedSentinelBillingOnly": bool, }, "forceCmkForQuery": bool, "id": "str", @@ -148,13 +159,20 @@ def test_update(self, resource_group): "provisioningState": "str", "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": "Enabled", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "lastModifiedDate": "str", + "provisioningState": "str", + }, "retentionInDays": 0, "sku": {"name": "str", "capacityReservationLevel": 0, "lastSkuUpdate": "str"}, "tags": {"str": "str"}, "type": "str", "workspaceCapping": {"dailyQuotaGb": 0.0, "dataIngestionStatus": "str", "quotaNextResetTime": "str"}, }, - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations_async.py b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations_async.py index bbb4da741d11..beb5f4a4936d 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations_async.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/generated_tests/test_log_analytics_management_workspaces_operations_async.py @@ -21,9 +21,9 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list(self, resource_group): + async def test_workspaces_list(self, resource_group): response = self.client.workspaces.list( - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,10 +31,10 @@ async def test_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_workspaces_list_by_resource_group(self, resource_group): response = self.client.workspaces.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-10-01", + api_version="2025-02-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_update(self, resource_group): + async def test_workspaces_begin_create_or_update(self, resource_group): response = await ( await self.client.workspaces.begin_create_or_update( resource_group_name=resource_group.name, @@ -53,12 +53,14 @@ async def test_begin_create_or_update(self, resource_group): "customerId": "str", "defaultDataCollectionRuleResourceId": "str", "etag": "str", + "failover": {"lastModifiedDate": "str", "state": "str"}, "features": { "clusterResourceId": "str", "disableLocalAuth": bool, "enableDataExport": bool, "enableLogAccessUsingOnlyResourcePermissions": bool, "immediatePurgeDataOn30Days": bool, + "unifiedSentinelBillingOnly": bool, }, "forceCmkForQuery": bool, "id": "str", @@ -74,6 +76,13 @@ async def test_begin_create_or_update(self, resource_group): "provisioningState": "str", "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": "Enabled", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "lastModifiedDate": "str", + "provisioningState": "str", + }, "retentionInDays": 0, "sku": {"name": "str", "capacityReservationLevel": 0, "lastSkuUpdate": "str"}, "systemData": { @@ -92,7 +101,7 @@ async def test_begin_create_or_update(self, resource_group): "quotaNextResetTime": "str", }, }, - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -101,12 +110,12 @@ async def test_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_workspaces_begin_delete(self, resource_group): response = await ( await self.client.workspaces.begin_delete( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) ).result() # call '.result()' to poll until service return final result @@ -115,11 +124,11 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_workspaces_get(self, resource_group): response = await self.client.workspaces.get( resource_group_name=resource_group.name, workspace_name="str", - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself @@ -127,7 +136,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update(self, resource_group): + async def test_workspaces_update(self, resource_group): response = await self.client.workspaces.update( resource_group_name=resource_group.name, workspace_name="str", @@ -136,12 +145,14 @@ async def test_update(self, resource_group): "customerId": "str", "defaultDataCollectionRuleResourceId": "str", "etag": "str", + "failover": {"lastModifiedDate": "str", "state": "str"}, "features": { "clusterResourceId": "str", "disableLocalAuth": bool, "enableDataExport": bool, "enableLogAccessUsingOnlyResourcePermissions": bool, "immediatePurgeDataOn30Days": bool, + "unifiedSentinelBillingOnly": bool, }, "forceCmkForQuery": bool, "id": "str", @@ -157,13 +168,20 @@ async def test_update(self, resource_group): "provisioningState": "str", "publicNetworkAccessForIngestion": "Enabled", "publicNetworkAccessForQuery": "Enabled", + "replication": { + "enabled": bool, + "location": "str", + "createdDate": "str", + "lastModifiedDate": "str", + "provisioningState": "str", + }, "retentionInDays": 0, "sku": {"name": "str", "capacityReservationLevel": 0, "lastSkuUpdate": "str"}, "tags": {"str": "str"}, "type": "str", "workspaceCapping": {"dailyQuotaGb": 0.0, "dataIngestionStatus": "str", "quotaNextResetTime": "str"}, }, - api_version="2022-10-01", + api_version="2025-02-01", ) # please add some check logic here by yourself diff --git a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py index a670f6068bab..ef114923de9e 100644 --- a/sdk/loganalytics/azure-mgmt-loganalytics/setup.py +++ b/sdk/loganalytics/azure-mgmt-loganalytics/setup.py @@ -22,11 +22,9 @@ # Version extraction inspired from 'requests' with open( - ( - os.path.join(package_folder_path, "version.py") - if os.path.exists(os.path.join(package_folder_path, "version.py")) - else os.path.join(package_folder_path, "_version.py") - ), + os.path.join(package_folder_path, "version.py") + if os.path.exists(os.path.join(package_folder_path, "version.py")) + else os.path.join(package_folder_path, "_version.py"), "r", ) as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) @@ -51,7 +49,7 @@ url="https://github.com/Azure/azure-sdk-for-python", keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product classifiers=[ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3",