diff --git a/sdk/security/azure-mgmt-security/_meta.json b/sdk/security/azure-mgmt-security/_meta.json index d2dee5a74e00..67981715c735 100644 --- a/sdk/security/azure-mgmt-security/_meta.json +++ b/sdk/security/azure-mgmt-security/_meta.json @@ -1,11 +1,11 @@ { - "commit": "a3974594e96506c6fa921be80f349d67b555e534", + "commit": "d702fd0f9e68bf182abdf7df2abbc57c2430829d", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.2", "use": [ - "@autorest/python@6.4.7", + "@autorest/python@6.4.8", "@autorest/modelerfour@4.24.3" ], - "autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", + "autorest_command": "autorest specification/security/resource-manager/readme.md --generate-sample=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.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False", "readme": "specification/security/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_operations_mixin.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_operations_mixin.py new file mode 100644 index 000000000000..471697b80488 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_operations_mixin.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from ._serialization import Serializer, Deserializer +from typing import Any, IO, Optional, Union + +from . import models as _models + + +class SecurityCenterOperationsMixin(object): + + def get_sensitivity_settings( + self, + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Gets data sensitivity settings for sensitive data discovery. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + api_version = self._get_api_version('get_sensitivity_settings') + if api_version == '2023-02-01-preview': + from .v2023_02_01_preview.operations import SecurityCenterOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'get_sensitivity_settings'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._config.api_version = api_version + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.get_sensitivity_settings(**kwargs) + + def update_sensitivity_settings( + self, + sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO], + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Is either a + UpdateSensitivitySettingsRequest type or a IO type. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + api_version = self._get_api_version('update_sensitivity_settings') + if api_version == '2023-02-01-preview': + from .v2023_02_01_preview.operations import SecurityCenterOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'update_sensitivity_settings'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._config.api_version = api_version + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return mixin_instance.update_sensitivity_settings(sensitivity_settings, **kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py index 264dbd194175..b8485efbf5cb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py @@ -29,7 +29,7 @@ def __init__(self, *args, **kwargs): """ pass -class SecurityCenter(MultiApiClientMixin, _SDKClient): +class SecurityCenter(SecurityCenterOperationsMixin, MultiApiClientMixin, _SDKClient): """API spec for Microsoft.Security (Azure Security Center) resource provider. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -996,6 +996,20 @@ def security_solutions_reference_data(self): self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def sensitivity_settings(self): + """Instance depends on the API version: + + * 2023-02-01-preview: :class:`SensitivitySettingsOperations` + """ + api_version = self._get_api_version('sensitivity_settings') + if api_version == '2023-02-01-preview': + from .v2023_02_01_preview.operations import SensitivitySettingsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'sensitivity_settings'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def server_vulnerability_assessment(self): """Instance depends on the API version: diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py index fbf12e61f12c..a30a458f8b5b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/_version.py @@ -5,4 +5,4 @@ # license information. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "0.1.0" \ No newline at end of file diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_operations_mixin.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_operations_mixin.py new file mode 100644 index 000000000000..a07be5c0f813 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_operations_mixin.py @@ -0,0 +1,75 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- +from .._serialization import Serializer, Deserializer +from typing import Any, IO, Optional, Union + +from .. import models as _models + + +class SecurityCenterOperationsMixin(object): + + async def get_sensitivity_settings( + self, + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Gets data sensitivity settings for sensitive data discovery. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + api_version = self._get_api_version('get_sensitivity_settings') + if api_version == '2023-02-01-preview': + from ..v2023_02_01_preview.aio.operations import SecurityCenterOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'get_sensitivity_settings'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._config.api_version = api_version + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return await mixin_instance.get_sensitivity_settings(**kwargs) + + async def update_sensitivity_settings( + self, + sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO], + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Is either a + UpdateSensitivitySettingsRequest type or a IO type. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + api_version = self._get_api_version('update_sensitivity_settings') + if api_version == '2023-02-01-preview': + from ..v2023_02_01_preview.aio.operations import SecurityCenterOperationsMixin as OperationClass + else: + raise ValueError("API version {} does not have operation 'update_sensitivity_settings'".format(api_version)) + mixin_instance = OperationClass() + mixin_instance._client = self._client + mixin_instance._config = self._config + mixin_instance._config.api_version = api_version + mixin_instance._serialize = Serializer(self._models_dict(api_version)) + mixin_instance._serialize.client_side_validation = False + mixin_instance._deserialize = Deserializer(self._models_dict(api_version)) + return await mixin_instance.update_sensitivity_settings(sensitivity_settings, **kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py index 96a0e28100b5..328b4eeb6336 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/aio/_security_center.py @@ -29,7 +29,7 @@ def __init__(self, *args, **kwargs): """ pass -class SecurityCenter(MultiApiClientMixin, _SDKClient): +class SecurityCenter(SecurityCenterOperationsMixin, MultiApiClientMixin, _SDKClient): """API spec for Microsoft.Security (Azure Security Center) resource provider. This ready contains multiple API versions, to help you deal with all of the Azure clouds @@ -996,6 +996,20 @@ def security_solutions_reference_data(self): self._config.api_version = api_version return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def sensitivity_settings(self): + """Instance depends on the API version: + + * 2023-02-01-preview: :class:`SensitivitySettingsOperations` + """ + api_version = self._get_api_version('sensitivity_settings') + if api_version == '2023-02-01-preview': + from ..v2023_02_01_preview.aio.operations import SensitivitySettingsOperations as OperationClass + else: + raise ValueError("API version {} does not have operation group 'sensitivity_settings'".format(api_version)) + self._config.api_version = api_version + return OperationClass(self._client, self._config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def server_vulnerability_assessment(self): """Instance depends on the API version: diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py index 7958a48f535f..8999267c836b 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2015_06_01_preview/operations/_tasks_operations.py @@ -97,7 +97,7 @@ def build_list_by_home_region_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_subscription_level_task_request( +def build_get_subscription_level_task_request( # pylint: disable=name-too-long asc_location: str, task_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -130,7 +130,7 @@ def build_get_subscription_level_task_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_task_state_request( +def build_update_subscription_level_task_state_request( # pylint: disable=name-too-long asc_location: str, task_name: str, task_update_action_type: Union[str, _models.TaskUpdateActionType], @@ -205,7 +205,7 @@ def build_list_by_resource_group_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_resource_group_level_task_request( +def build_get_resource_group_level_task_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, task_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -241,7 +241,7 @@ def build_get_resource_group_level_task_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_task_state_request( +def build_update_resource_group_level_task_state_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, task_name: str, diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2017_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2018_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2019_08_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py index bcf3c5da7047..af32132504f5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01/operations/_jit_network_access_policies_operations.py @@ -131,7 +131,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_and_region_request( +def build_list_by_resource_group_and_region_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2020_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py index e39d5f37ae0e..70f8583e6e83 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/aio/operations/_alerts_operations.py @@ -546,7 +546,7 @@ async def get_resource_group_level( } @distributed_trace_async - async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -606,7 +606,7 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi } @distributed_trace_async - async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -666,7 +666,7 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi } @distributed_trace_async - async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -726,7 +726,7 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons } @distributed_trace_async - async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -790,7 +790,7 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon } @distributed_trace_async - async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -854,7 +854,7 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon } @distributed_trace_async - async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py index f12a1ef841c6..da34005b6b36 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_01/operations/_alerts_operations.py @@ -96,7 +96,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_subscription_level_by_region_request( +def build_list_subscription_level_by_region_request( # pylint: disable=name-too-long asc_location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -127,7 +127,7 @@ def build_list_subscription_level_by_region_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_resource_group_level_by_region_request( +def build_list_resource_group_level_by_region_request( # pylint: disable=name-too-long asc_location: str, resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -231,7 +231,7 @@ def build_get_resource_group_level_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_dismiss_request( +def build_update_subscription_level_state_to_dismiss_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -264,7 +264,7 @@ def build_update_subscription_level_state_to_dismiss_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_resolve_request( +def build_update_subscription_level_state_to_resolve_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -297,7 +297,7 @@ def build_update_subscription_level_state_to_resolve_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_activate_request( +def build_update_subscription_level_state_to_activate_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -330,7 +330,7 @@ def build_update_subscription_level_state_to_activate_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_resolve_request( +def build_update_resource_group_level_state_to_resolve_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -366,7 +366,7 @@ def build_update_resource_group_level_state_to_resolve_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_dismiss_request( +def build_update_resource_group_level_state_to_dismiss_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -402,7 +402,7 @@ def build_update_resource_group_level_state_to_dismiss_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_activate_request( +def build_update_resource_group_level_state_to_activate_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -967,7 +967,7 @@ def get_resource_group_level( } @distributed_trace - def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1027,7 +1027,7 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- } @distributed_trace - def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1087,7 +1087,7 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- } @distributed_trace - def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1147,7 +1147,7 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent } @distributed_trace - def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1211,7 +1211,7 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten } @distributed_trace - def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1275,7 +1275,7 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten } @distributed_trace - def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, resource_group_name: str, **kwargs: Any ) -> None: """Update the alert's state. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_01_15_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_05_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_06_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2021_10_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py index 602b5ed5c87d..e1342647ec00 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/aio/operations/_alerts_operations.py @@ -548,7 +548,7 @@ async def get_resource_group_level( } @distributed_trace_async - async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -608,7 +608,7 @@ async def update_subscription_level_state_to_dismiss( # pylint: disable=inconsi } @distributed_trace_async - async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -668,7 +668,7 @@ async def update_subscription_level_state_to_resolve( # pylint: disable=inconsi } @distributed_trace_async - async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -728,7 +728,7 @@ async def update_subscription_level_state_to_activate( # pylint: disable=incons } @distributed_trace_async - async def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements + async def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -788,7 +788,7 @@ async def update_subscription_level_state_to_in_progress( # pylint: disable=inc } @distributed_trace_async - async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -852,7 +852,7 @@ async def update_resource_group_level_state_to_resolve( # pylint: disable=incon } @distributed_trace_async - async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -916,7 +916,7 @@ async def update_resource_group_level_state_to_dismiss( # pylint: disable=incon } @distributed_trace_async - async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -980,7 +980,7 @@ async def update_resource_group_level_state_to_activate( # pylint: disable=inco } @distributed_trace_async - async def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements + async def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py index a9003d2e03bd..16f712874b23 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01/operations/_alerts_operations.py @@ -96,7 +96,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_subscription_level_by_region_request( +def build_list_subscription_level_by_region_request( # pylint: disable=name-too-long asc_location: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -127,7 +127,7 @@ def build_list_subscription_level_by_region_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_resource_group_level_by_region_request( +def build_list_resource_group_level_by_region_request( # pylint: disable=name-too-long asc_location: str, resource_group_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -231,7 +231,7 @@ def build_get_resource_group_level_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_dismiss_request( +def build_update_subscription_level_state_to_dismiss_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -264,7 +264,7 @@ def build_update_subscription_level_state_to_dismiss_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_resolve_request( +def build_update_subscription_level_state_to_resolve_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -297,7 +297,7 @@ def build_update_subscription_level_state_to_resolve_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_activate_request( +def build_update_subscription_level_state_to_activate_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -330,7 +330,7 @@ def build_update_subscription_level_state_to_activate_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_subscription_level_state_to_in_progress_request( +def build_update_subscription_level_state_to_in_progress_request( # pylint: disable=name-too-long asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -363,7 +363,7 @@ def build_update_subscription_level_state_to_in_progress_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_resolve_request( +def build_update_resource_group_level_state_to_resolve_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -399,7 +399,7 @@ def build_update_resource_group_level_state_to_resolve_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_dismiss_request( +def build_update_resource_group_level_state_to_dismiss_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -435,7 +435,7 @@ def build_update_resource_group_level_state_to_dismiss_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_activate_request( +def build_update_resource_group_level_state_to_activate_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -471,7 +471,7 @@ def build_update_resource_group_level_state_to_activate_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_resource_group_level_state_to_in_progress_request( +def build_update_resource_group_level_state_to_in_progress_request( # pylint: disable=name-too-long resource_group_name: str, asc_location: str, alert_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1036,7 +1036,7 @@ def get_resource_group_level( } @distributed_trace - def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1096,7 +1096,7 @@ def update_subscription_level_state_to_dismiss( # pylint: disable=inconsistent- } @distributed_trace - def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1156,7 +1156,7 @@ def update_subscription_level_state_to_resolve( # pylint: disable=inconsistent- } @distributed_trace - def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1216,7 +1216,7 @@ def update_subscription_level_state_to_activate( # pylint: disable=inconsistent } @distributed_trace - def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements + def update_subscription_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements,name-too-long self, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1276,7 +1276,7 @@ def update_subscription_level_state_to_in_progress( # pylint: disable=inconsist } @distributed_trace - def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_resolve( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1340,7 +1340,7 @@ def update_resource_group_level_state_to_resolve( # pylint: disable=inconsisten } @distributed_trace - def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1404,7 +1404,7 @@ def update_resource_group_level_state_to_dismiss( # pylint: disable=inconsisten } @distributed_trace - def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_activate( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. @@ -1468,7 +1468,7 @@ def update_resource_group_level_state_to_activate( # pylint: disable=inconsiste } @distributed_trace - def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements + def update_resource_group_level_state_to_in_progress( # pylint: disable=inconsistent-return-statements,name-too-long self, resource_group_name: str, asc_location: str, alert_name: str, **kwargs: Any ) -> None: """Update the alert's state. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_03_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_05_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_07_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_08_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_11_20_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_11_20_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_11_20_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2022_11_20_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_01_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_configuration.py index 8a7cdf3df6dc..609737dfab82 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_configuration.py @@ -27,20 +27,14 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-02-01-preview") - if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_metadata.json b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_metadata.json index 160c8c1866b8..598fbd966e8f 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_metadata.json +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_metadata.json @@ -1,6 +1,6 @@ { "chosen_version": "2023-02-01-preview", - "total_api_version_list": ["2023-02-01-preview"], + "total_api_version_list": ["2023-02-01-preview", "2023-02-15-preview"], "client": { "name": "SecurityCenter", "filename": "_security_center", @@ -10,8 +10,8 @@ "azure_arm": true, "has_lro_operations": false, "client_side_validation": false, - "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", - "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"ARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \".._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"SecurityCenterOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}, \"regular\": {\"azurecore\": {\"azure.mgmt.core\": [\"AsyncARMPipelineClient\"], \"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"]}, \"local\": {\"._configuration\": [\"SecurityCenterConfiguration\"], \"..._serialization\": [\"Deserializer\", \"Serializer\"], \"._operations_mixin\": [\"SecurityCenterOperationsMixin\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "global_parameters": { "sync": { @@ -96,6 +96,41 @@ "sql_vulnerability_assessment_scans": "SqlVulnerabilityAssessmentScansOperations", "sql_vulnerability_assessment_scan_results": "SqlVulnerabilityAssessmentScanResultsOperations", "health_reports": "HealthReportsOperations", - "health_report": "HealthReportOperations" + "health_report": "HealthReportOperations", + "sensitivity_settings": "SensitivitySettingsOperations" + }, + "operation_mixins": { + "sync_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\".\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", + "async_imports": "{\"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"regular\": {\"local\": {\"..\": [[\"models\", \"_models\"]]}, \"stdlib\": {\"typing\": [\"IO\", \"Optional\", \"Union\"]}}}", + "sync_mixin_typing_definitions": "", + "async_mixin_typing_definitions": "", + "operations": { + "update_sensitivity_settings" : { + "sync": { + "signature": "def update_sensitivity_settings(\n self,\n sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO],\n **kwargs: Any\n) -\u003e _models.GetSensitivitySettingsResponse:\n", + "doc": "\"\"\"Updates data sensitivity settings for sensitive data discovery.\n\n:param sensitivity_settings: The data sensitivity settings to update. Is either a\n UpdateSensitivitySettingsRequest type or a IO type. Required.\n:type sensitivity_settings:\n ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetSensitivitySettingsResponse or the result of cls(response)\n:rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "sensitivity_settings, **kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def update_sensitivity_settings(\n self,\n sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO],\n **kwargs: Any\n) -\u003e _models.GetSensitivitySettingsResponse:\n", + "doc": "\"\"\"Updates data sensitivity settings for sensitive data discovery.\n\n:param sensitivity_settings: The data sensitivity settings to update. Is either a\n UpdateSensitivitySettingsRequest type or a IO type. Required.\n:type sensitivity_settings:\n ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO\n:keyword content_type: Body Parameter content-type. Known values are: \u0027application/json\u0027.\n Default value is None.\n:paramtype content_type: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetSensitivitySettingsResponse or the result of cls(response)\n:rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "sensitivity_settings, **kwargs" + } + }, + "get_sensitivity_settings" : { + "sync": { + "signature": "def get_sensitivity_settings(\n self,\n **kwargs: Any\n) -\u003e _models.GetSensitivitySettingsResponse:\n", + "doc": "\"\"\"Gets data sensitivity settings for sensitive data discovery.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetSensitivitySettingsResponse or the result of cls(response)\n:rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" + }, + "async": { + "coroutine": true, + "signature": "async def get_sensitivity_settings(\n self,\n **kwargs: Any\n) -\u003e _models.GetSensitivitySettingsResponse:\n", + "doc": "\"\"\"Gets data sensitivity settings for sensitive data discovery.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: GetSensitivitySettingsResponse or the result of cls(response)\n:rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse\n:raises ~azure.core.exceptions.HttpResponseError:\n\"\"\"", + "call": "**kwargs" + } + } + } } } diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_security_center.py index 035e3016766b..32e9c70a195c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_security_center.py @@ -18,6 +18,8 @@ from .operations import ( HealthReportOperations, HealthReportsOperations, + SecurityCenterOperationsMixin, + SensitivitySettingsOperations, SqlVulnerabilityAssessmentBaselineRulesOperations, SqlVulnerabilityAssessmentScanResultsOperations, SqlVulnerabilityAssessmentScansOperations, @@ -28,7 +30,9 @@ from azure.core.credentials import TokenCredential -class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword +class SecurityCenter( + SecurityCenterOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """API spec for Microsoft.Security (Azure Security Center) resource provider. :ivar sql_vulnerability_assessment_baseline_rules: @@ -48,13 +52,13 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword :ivar health_report: HealthReportOperations operations :vartype health_report: azure.mgmt.security.v2023_02_01_preview.operations.HealthReportOperations + :ivar sensitivity_settings: SensitivitySettingsOperations operations + :vartype sensitivity_settings: + azure.mgmt.security.v2023_02_01_preview.operations.SensitivitySettingsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str """ def __init__( @@ -78,6 +82,9 @@ def __init__( ) self.health_reports = HealthReportsOperations(self._client, self._config, self._serialize, self._deserialize) self.health_report = HealthReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.sensitivity_settings = SensitivitySettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_vendor.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_vendor.py index bd0df84f5319..4fd188e4b6ce 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_vendor.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_vendor.py @@ -5,10 +5,19 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import List, cast +from abc import ABC +from typing import List, TYPE_CHECKING, cast from azure.core.pipeline.transport import HttpRequest +from ._configuration import SecurityCenterConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from .._serialization import Deserializer, Serializer + def _convert_request(request, files=None): data = request.content if not files else None @@ -28,3 +37,12 @@ def _format_url_section(template, **kwargs): formatted_components = cast(List[str], template.split("/")) components = [c for c in formatted_components if "{}".format(key.args[0]) not in c] template = "/".join(components) + + +class SecurityCenterMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: SecurityCenterConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_configuration.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_configuration.py index 16b6d2c553e0..8ac0b2407111 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_configuration.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_configuration.py @@ -27,20 +27,14 @@ class SecurityCenterConfiguration(Configuration): # pylint: disable=too-many-in :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(SecurityCenterConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-02-01-preview") - if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential - self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-security/{}".format(VERSION)) self._configure(**kwargs) diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_security_center.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_security_center.py index 55f9e3c2d844..c6ca613b505d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_security_center.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_security_center.py @@ -18,6 +18,8 @@ from .operations import ( HealthReportOperations, HealthReportsOperations, + SecurityCenterOperationsMixin, + SensitivitySettingsOperations, SqlVulnerabilityAssessmentBaselineRulesOperations, SqlVulnerabilityAssessmentScanResultsOperations, SqlVulnerabilityAssessmentScansOperations, @@ -28,7 +30,9 @@ from azure.core.credentials_async import AsyncTokenCredential -class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword +class SecurityCenter( + SecurityCenterOperationsMixin +): # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """API spec for Microsoft.Security (Azure Security Center) resource provider. :ivar sql_vulnerability_assessment_baseline_rules: @@ -48,13 +52,13 @@ class SecurityCenter: # pylint: disable=client-accepts-api-version-keyword :ivar health_report: HealthReportOperations operations :vartype health_report: azure.mgmt.security.v2023_02_01_preview.aio.operations.HealthReportOperations + :ivar sensitivity_settings: SensitivitySettingsOperations operations + :vartype sensitivity_settings: + azure.mgmt.security.v2023_02_01_preview.aio.operations.SensitivitySettingsOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-02-01-preview". Note that overriding - this default value may result in unsupported behavior. - :paramtype api_version: str """ def __init__( @@ -78,6 +82,9 @@ def __init__( ) self.health_reports = HealthReportsOperations(self._client, self._config, self._serialize, self._deserialize) self.health_report = HealthReportOperations(self._client, self._config, self._serialize, self._deserialize) + self.sensitivity_settings = SensitivitySettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_vendor.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_vendor.py new file mode 100644 index 000000000000..b5f27b3e8331 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/_vendor.py @@ -0,0 +1,28 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from azure.core.pipeline.transport import HttpRequest + +from ._configuration import SecurityCenterConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from ..._serialization import Deserializer, Serializer + + +class SecurityCenterMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: SecurityCenterConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/__init__.py index 2f6c26588ad8..23d26a61e0d8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/__init__.py @@ -11,6 +11,8 @@ from ._sql_vulnerability_assessment_scan_results_operations import SqlVulnerabilityAssessmentScanResultsOperations from ._health_reports_operations import HealthReportsOperations from ._health_report_operations import HealthReportOperations +from ._security_center_operations import SecurityCenterOperationsMixin +from ._sensitivity_settings_operations import SensitivitySettingsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -22,6 +24,8 @@ "SqlVulnerabilityAssessmentScanResultsOperations", "HealthReportsOperations", "HealthReportOperations", + "SecurityCenterOperationsMixin", + "SensitivitySettingsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_report_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_report_operations.py index 852329018d70..fb0807ec9557 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_report_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_report_operations.py @@ -26,6 +26,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._health_report_operations import build_get_request +from .._vendor import SecurityCenterMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_reports_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_reports_operations.py index dca763a5abab..d4ee405c0d8a 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_reports_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_health_reports_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- 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 ( @@ -28,6 +27,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._health_reports_operations import build_list_request +from .._vendor import SecurityCenterMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -94,18 +94,7 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - # 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 = HttpRequest("GET", next_link) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_security_center_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_security_center_operations.py new file mode 100644 index 000000000000..a689f7a52872 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_security_center_operations.py @@ -0,0 +1,201 @@ +# 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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._security_center_operations import ( + build_get_sensitivity_settings_request, + build_update_sensitivity_settings_request, +) +from .._vendor import SecurityCenterMixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SecurityCenterOperationsMixin(SecurityCenterMixinABC): + @overload + async def update_sensitivity_settings( + self, + sensitivity_settings: _models.UpdateSensitivitySettingsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_sensitivity_settings( + self, sensitivity_settings: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Required. + :type sensitivity_settings: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_sensitivity_settings( + self, sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO], **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Is either a + UpdateSensitivitySettingsRequest type or a IO type. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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", "2023-02-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GetSensitivitySettingsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sensitivity_settings, (IO, bytes)): + _content = sensitivity_settings + else: + _json = self._serialize.body(sensitivity_settings, "UpdateSensitivitySettingsRequest") + + request = build_update_sensitivity_settings_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.update_sensitivity_settings.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_sensitivity_settings.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings/current"} + + @distributed_trace_async + async def get_sensitivity_settings(self, **kwargs: Any) -> _models.GetSensitivitySettingsResponse: + """Gets data sensitivity settings for sensitive data discovery. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-15-preview")) + cls: ClsType[_models.GetSensitivitySettingsResponse] = kwargs.pop("cls", None) + + request = build_get_sensitivity_settings_request( + api_version=api_version, + template_url=self.get_sensitivity_settings.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_sensitivity_settings.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings/current"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sensitivity_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sensitivity_settings_operations.py new file mode 100644 index 000000000000..8cd4a5aed3bb --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sensitivity_settings_operations.py @@ -0,0 +1,104 @@ +# 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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._sensitivity_settings_operations import build_list_request +from .._vendor import SecurityCenterMixinABC + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class SensitivitySettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2023_02_01_preview.aio.SecurityCenter`'s + :attr:`sensitivity_settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def list(self, **kwargs: Any) -> _models.GetSensitivitySettingsListResponse: + """Gets a list with a single sensitivity settings resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsListResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsListResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-15-preview")) + cls: ClsType[_models.GetSensitivitySettingsListResponse] = kwargs.pop("cls", None) + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsListResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py index 02b232640a32..f497f4da1765 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -32,6 +32,7 @@ build_get_request, build_list_request, ) +from .._vendor import SecurityCenterMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py index faf8e1678563..852a82ec1b8d 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -26,6 +26,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessment_scan_results_operations import build_get_request, build_list_request +from .._vendor import SecurityCenterMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py index 3adad361e900..6fb256086780 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/aio/operations/_sql_vulnerability_assessment_scans_operations.py @@ -26,6 +26,7 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._sql_vulnerability_assessment_scans_operations import build_get_request, build_list_request +from .._vendor import SecurityCenterMixinABC T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/__init__.py index e9ffba511fbc..cf992c2febcb 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/__init__.py @@ -9,15 +9,22 @@ from ._models_py3 import Baseline from ._models_py3 import BaselineAdjustedResult from ._models_py3 import BenchmarkReference +from ._models_py3 import BuiltInInfoType from ._models_py3 import CloudErrorBody from ._models_py3 import EnvironmentDetails from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse +from ._models_py3 import GetSensitivitySettingsListResponse +from ._models_py3 import GetSensitivitySettingsResponse +from ._models_py3 import GetSensitivitySettingsResponseProperties +from ._models_py3 import GetSensitivitySettingsResponsePropertiesMipInformation from ._models_py3 import HealthDataClassification from ._models_py3 import HealthReport from ._models_py3 import HealthReportsList +from ._models_py3 import InfoType from ._models_py3 import Issue +from ._models_py3 import Label from ._models_py3 import QueryCheck from ._models_py3 import Remediation from ._models_py3 import Resource @@ -34,8 +41,10 @@ from ._models_py3 import ScanResults from ._models_py3 import Scans from ._models_py3 import Status +from ._models_py3 import UpdateSensitivitySettingsRequest from ._models_py3 import VaRule +from ._security_center_enums import MipIntegrationStatus from ._security_center_enums import RuleSeverity from ._security_center_enums import RuleStatus from ._security_center_enums import RuleType @@ -52,15 +61,22 @@ "Baseline", "BaselineAdjustedResult", "BenchmarkReference", + "BuiltInInfoType", "CloudErrorBody", "EnvironmentDetails", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", + "GetSensitivitySettingsListResponse", + "GetSensitivitySettingsResponse", + "GetSensitivitySettingsResponseProperties", + "GetSensitivitySettingsResponsePropertiesMipInformation", "HealthDataClassification", "HealthReport", "HealthReportsList", + "InfoType", "Issue", + "Label", "QueryCheck", "Remediation", "Resource", @@ -77,7 +93,9 @@ "ScanResults", "Scans", "Status", + "UpdateSensitivitySettingsRequest", "VaRule", + "MipIntegrationStatus", "RuleSeverity", "RuleStatus", "RuleType", diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_models_py3.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_models_py3.py index 227d5ed84ca3..01e1c29995dc 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_models_py3.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_models_py3.py @@ -123,6 +123,45 @@ def __init__(self, *, benchmark: Optional[str] = None, reference: Optional[str] self.reference = reference +class BuiltInInfoType(_serialization.Model): + """Pre-configured sensitive information type. + + :ivar name: Display name of the info type. + :vartype name: str + :ivar id: Id of the info type. + :vartype id: str + :ivar type: Category of the built-in info type. + :vartype type: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + type: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Display name of the info type. + :paramtype name: str + :keyword id: Id of the info type. + :paramtype id: str + :keyword type: Category of the built-in info type. + :paramtype type: str + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.type = type + + class CloudErrorBody(_serialization.Model): """The error detail. @@ -319,6 +358,183 @@ def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: A self.error = error +class GetSensitivitySettingsListResponse(_serialization.Model): + """A list with a single sensitivity settings resource. + + :ivar value: + :vartype value: + list[~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse] + """ + + _attribute_map = { + "value": {"key": "value", "type": "[GetSensitivitySettingsResponse]"}, + } + + def __init__( + self, *, value: Optional[List["_models.GetSensitivitySettingsResponse"]] = None, **kwargs: Any + ) -> None: + """ + :keyword value: + :paramtype value: + list[~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse] + """ + super().__init__(**kwargs) + self.value = value + + +class GetSensitivitySettingsResponse(_serialization.Model): + """Data sensitivity settings for sensitive data discovery. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the sensitivity settings. + :vartype id: str + :ivar type: The type of the sensitivity settings. + :vartype type: str + :ivar name: The name of the sensitivity settings. + :vartype name: str + :ivar properties: The sensitivity settings properties. + :vartype properties: + ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponseProperties + """ + + _validation = { + "id": {"readonly": True}, + "type": {"readonly": True}, + "name": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "GetSensitivitySettingsResponseProperties"}, + } + + def __init__( + self, *, properties: Optional["_models.GetSensitivitySettingsResponseProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: The sensitivity settings properties. + :paramtype properties: + ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponseProperties + """ + super().__init__(**kwargs) + self.id = None + self.type = None + self.name = None + self.properties = properties + + +class GetSensitivitySettingsResponseProperties(_serialization.Model): + """The sensitivity settings properties. + + :ivar sensitive_info_types_ids: List of selected sensitive info types' IDs. + :vartype sensitive_info_types_ids: list[str] + :ivar sensitivity_threshold_label_order: The order of the sensitivity threshold label. Any + label at or above this order will be considered sensitive. If set to -1, sensitivity by labels + is turned off. + :vartype sensitivity_threshold_label_order: float + :ivar sensitivity_threshold_label_id: The id of the sensitivity threshold label. Any label at + or above this rank will be considered sensitive. + :vartype sensitivity_threshold_label_id: str + :ivar mip_information: Microsoft information protection built-in and custom information types, + labels, and integration status. + :vartype mip_information: + ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponsePropertiesMipInformation + """ + + _attribute_map = { + "sensitive_info_types_ids": {"key": "sensitiveInfoTypesIds", "type": "[str]"}, + "sensitivity_threshold_label_order": {"key": "sensitivityThresholdLabelOrder", "type": "float"}, + "sensitivity_threshold_label_id": {"key": "sensitivityThresholdLabelId", "type": "str"}, + "mip_information": {"key": "mipInformation", "type": "GetSensitivitySettingsResponsePropertiesMipInformation"}, + } + + def __init__( + self, + *, + sensitive_info_types_ids: Optional[List[str]] = None, + sensitivity_threshold_label_order: Optional[float] = None, + sensitivity_threshold_label_id: Optional[str] = None, + mip_information: Optional["_models.GetSensitivitySettingsResponsePropertiesMipInformation"] = None, + **kwargs: Any + ) -> None: + """ + :keyword sensitive_info_types_ids: List of selected sensitive info types' IDs. + :paramtype sensitive_info_types_ids: list[str] + :keyword sensitivity_threshold_label_order: The order of the sensitivity threshold label. Any + label at or above this order will be considered sensitive. If set to -1, sensitivity by labels + is turned off. + :paramtype sensitivity_threshold_label_order: float + :keyword sensitivity_threshold_label_id: The id of the sensitivity threshold label. Any label + at or above this rank will be considered sensitive. + :paramtype sensitivity_threshold_label_id: str + :keyword mip_information: Microsoft information protection built-in and custom information + types, labels, and integration status. + :paramtype mip_information: + ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponsePropertiesMipInformation + """ + super().__init__(**kwargs) + self.sensitive_info_types_ids = sensitive_info_types_ids + self.sensitivity_threshold_label_order = sensitivity_threshold_label_order + self.sensitivity_threshold_label_id = sensitivity_threshold_label_id + self.mip_information = mip_information + + +class GetSensitivitySettingsResponsePropertiesMipInformation(_serialization.Model): + """Microsoft information protection built-in and custom information types, labels, and integration + status. + + :ivar mip_integration_status: Microsoft information protection integration status. Known values + are: "Ok", "noConsent", "noAutoLabelingRules", and "noMipLabels". + :vartype mip_integration_status: str or + ~azure.mgmt.security.v2023_02_01_preview.models.MipIntegrationStatus + :ivar labels: List of Microsoft information protection sensitivity labels. + :vartype labels: list[~azure.mgmt.security.v2023_02_01_preview.models.Label] + :ivar custom_info_types: List of custom user-defined information types. + :vartype custom_info_types: list[~azure.mgmt.security.v2023_02_01_preview.models.InfoType] + :ivar built_in_info_types: List of pre-configured sensitive information types. + :vartype built_in_info_types: + list[~azure.mgmt.security.v2023_02_01_preview.models.BuiltInInfoType] + """ + + _attribute_map = { + "mip_integration_status": {"key": "mipIntegrationStatus", "type": "str"}, + "labels": {"key": "labels", "type": "[Label]"}, + "custom_info_types": {"key": "customInfoTypes", "type": "[InfoType]"}, + "built_in_info_types": {"key": "builtInInfoTypes", "type": "[BuiltInInfoType]"}, + } + + def __init__( + self, + *, + mip_integration_status: Optional[Union[str, "_models.MipIntegrationStatus"]] = None, + labels: Optional[List["_models.Label"]] = None, + custom_info_types: Optional[List["_models.InfoType"]] = None, + built_in_info_types: Optional[List["_models.BuiltInInfoType"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword mip_integration_status: Microsoft information protection integration status. Known + values are: "Ok", "noConsent", "noAutoLabelingRules", and "noMipLabels". + :paramtype mip_integration_status: str or + ~azure.mgmt.security.v2023_02_01_preview.models.MipIntegrationStatus + :keyword labels: List of Microsoft information protection sensitivity labels. + :paramtype labels: list[~azure.mgmt.security.v2023_02_01_preview.models.Label] + :keyword custom_info_types: List of custom user-defined information types. + :paramtype custom_info_types: list[~azure.mgmt.security.v2023_02_01_preview.models.InfoType] + :keyword built_in_info_types: List of pre-configured sensitive information types. + :paramtype built_in_info_types: + list[~azure.mgmt.security.v2023_02_01_preview.models.BuiltInInfoType] + """ + super().__init__(**kwargs) + self.mip_integration_status = mip_integration_status + self.labels = labels + self.custom_info_types = custom_info_types + self.built_in_info_types = built_in_info_types + + class HealthDataClassification(_serialization.Model): """The classification of the health report. @@ -505,6 +721,45 @@ def __init__(self, **kwargs: Any) -> None: self.next_link = None +class InfoType(_serialization.Model): + """Custom user-defined information type. + + :ivar name: Display name of the info type. + :vartype name: str + :ivar id: Id of the info type. + :vartype id: str + :ivar description: Description of the info type. + :vartype description: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + description: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Display name of the info type. + :paramtype name: str + :keyword id: Id of the info type. + :paramtype id: str + :keyword description: Description of the info type. + :paramtype description: str + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.description = description + + class Issue(_serialization.Model): """The issue that caused the resource to by unhealthy. @@ -584,6 +839,47 @@ def __init__( self.issue_additional_data = issue_additional_data +class Label(_serialization.Model): + """Microsoft information protection sensitivity label. + + :ivar name: The display name of the label. + :vartype name: str + :ivar id: The ID of the label. + :vartype id: str + :ivar order: Labels are ordered by sensitivity level. The higher the order of the label, the + more sensitive it is. + :vartype order: float + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "order": {"key": "order", "type": "float"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + order: Optional[float] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The display name of the label. + :paramtype name: str + :keyword id: The ID of the label. + :paramtype id: str + :keyword order: Labels are ordered by sensitivity level. The higher the order of the label, the + more sensitive it is. + :paramtype order: float + """ + super().__init__(**kwargs) + self.name = name + self.id = id + self.order = order + + class QueryCheck(_serialization.Model): """The rule query details. @@ -1190,6 +1486,57 @@ def __init__(self, *, code: Optional[Union[str, "_models.StatusName"]] = None, * self.first_evaluation_date = None +class UpdateSensitivitySettingsRequest(_serialization.Model): + """Request to update data sensitivity settings for sensitive data discovery. + + All required parameters must be populated in order to send to Azure. + + :ivar sensitive_info_types_ids: List of selected sensitive info types' IDs. Required. + :vartype sensitive_info_types_ids: list[str] + :ivar sensitivity_threshold_label_order: The order of the sensitivity threshold label. Any + label at or above this order will be considered sensitive. If set to -1, sensitivity by labels + is turned off. + :vartype sensitivity_threshold_label_order: float + :ivar sensitivity_threshold_label_id: The id of the sensitivity threshold label. Any label at + or above this rank will be considered sensitive. + :vartype sensitivity_threshold_label_id: str + """ + + _validation = { + "sensitive_info_types_ids": {"required": True}, + } + + _attribute_map = { + "sensitive_info_types_ids": {"key": "sensitiveInfoTypesIds", "type": "[str]"}, + "sensitivity_threshold_label_order": {"key": "sensitivityThresholdLabelOrder", "type": "float"}, + "sensitivity_threshold_label_id": {"key": "sensitivityThresholdLabelId", "type": "str"}, + } + + def __init__( + self, + *, + sensitive_info_types_ids: List[str], + sensitivity_threshold_label_order: Optional[float] = None, + sensitivity_threshold_label_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword sensitive_info_types_ids: List of selected sensitive info types' IDs. Required. + :paramtype sensitive_info_types_ids: list[str] + :keyword sensitivity_threshold_label_order: The order of the sensitivity threshold label. Any + label at or above this order will be considered sensitive. If set to -1, sensitivity by labels + is turned off. + :paramtype sensitivity_threshold_label_order: float + :keyword sensitivity_threshold_label_id: The id of the sensitivity threshold label. Any label + at or above this rank will be considered sensitive. + :paramtype sensitivity_threshold_label_id: str + """ + super().__init__(**kwargs) + self.sensitive_info_types_ids = sensitive_info_types_ids + self.sensitivity_threshold_label_order = sensitivity_threshold_label_order + self.sensitivity_threshold_label_id = sensitivity_threshold_label_id + + class VaRule(_serialization.Model): """vulnerability assessment rule metadata details. diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_security_center_enums.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_security_center_enums.py index fc16589ddce5..8cc197f06336 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_security_center_enums.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/models/_security_center_enums.py @@ -10,6 +10,15 @@ from azure.core import CaseInsensitiveEnumMeta +class MipIntegrationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Microsoft information protection integration status.""" + + OK = "Ok" + NO_CONSENT = "noConsent" + NO_AUTO_LABELING_RULES = "noAutoLabelingRules" + NO_MIP_LABELS = "noMipLabels" + + class RuleSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The rule severity.""" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/__init__.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/__init__.py index 2f6c26588ad8..23d26a61e0d8 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/__init__.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/__init__.py @@ -11,6 +11,8 @@ from ._sql_vulnerability_assessment_scan_results_operations import SqlVulnerabilityAssessmentScanResultsOperations from ._health_reports_operations import HealthReportsOperations from ._health_report_operations import HealthReportOperations +from ._security_center_operations import SecurityCenterOperationsMixin +from ._sensitivity_settings_operations import SensitivitySettingsOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -22,6 +24,8 @@ "SqlVulnerabilityAssessmentScanResultsOperations", "HealthReportsOperations", "HealthReportOperations", + "SecurityCenterOperationsMixin", + "SensitivitySettingsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_report_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_report_operations.py index c8dcf4dbf55d..45b69e681987 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_report_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_report_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import SecurityCenterMixinABC, _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_reports_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_reports_operations.py index f87d7219a84e..e13bd8a57bc5 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_reports_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_health_reports_operations.py @@ -7,7 +7,6 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from typing import Any, Callable, Dict, Iterable, Optional, TypeVar -import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, @@ -27,7 +26,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import SecurityCenterMixinABC, _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -121,18 +120,7 @@ def prepare_request(next_link=None): request.url = self._client.format_url(request.url) else: - # 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 = HttpRequest("GET", next_link) request = _convert_request(request) request.url = self._client.format_url(request.url) request.method = "GET" diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_security_center_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_security_center_operations.py new file mode 100644 index 000000000000..b5f61abb4ee0 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_security_center_operations.py @@ -0,0 +1,241 @@ +# 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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import SecurityCenterMixinABC, _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_update_sensitivity_settings_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + _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", "2023-02-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Security/sensitivitySettings/current") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_sensitivity_settings_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", "2023-02-15-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Security/sensitivitySettings/current") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SecurityCenterOperationsMixin(SecurityCenterMixinABC): + @overload + def update_sensitivity_settings( + self, + sensitivity_settings: _models.UpdateSensitivitySettingsRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_sensitivity_settings( + self, sensitivity_settings: IO, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Required. + :type sensitivity_settings: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_sensitivity_settings( + self, sensitivity_settings: Union[_models.UpdateSensitivitySettingsRequest, IO], **kwargs: Any + ) -> _models.GetSensitivitySettingsResponse: + """Updates data sensitivity settings for sensitive data discovery. + + :param sensitivity_settings: The data sensitivity settings to update. Is either a + UpdateSensitivitySettingsRequest type or a IO type. Required. + :type sensitivity_settings: + ~azure.mgmt.security.v2023_02_01_preview.models.UpdateSensitivitySettingsRequest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _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", "2023-02-15-preview")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GetSensitivitySettingsResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(sensitivity_settings, (IO, bytes)): + _content = sensitivity_settings + else: + _json = self._serialize.body(sensitivity_settings, "UpdateSensitivitySettingsRequest") + + request = build_update_sensitivity_settings_request( + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.update_sensitivity_settings.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_sensitivity_settings.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings/current"} + + @distributed_trace + def get_sensitivity_settings(self, **kwargs: Any) -> _models.GetSensitivitySettingsResponse: + """Gets data sensitivity settings for sensitive data discovery. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-15-preview")) + cls: ClsType[_models.GetSensitivitySettingsResponse] = kwargs.pop("cls", None) + + request = build_get_sensitivity_settings_request( + api_version=api_version, + template_url=self.get_sensitivity_settings.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_sensitivity_settings.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings/current"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sensitivity_settings_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sensitivity_settings_operations.py new file mode 100644 index 000000000000..89e3756c5279 --- /dev/null +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sensitivity_settings_operations.py @@ -0,0 +1,125 @@ +# 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. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from ..._serialization import Serializer +from .._vendor import SecurityCenterMixinABC, _convert_request + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +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", "2023-02-15-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.Security/sensitivitySettings") + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class SensitivitySettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.security.v2023_02_01_preview.SecurityCenter`'s + :attr:`sensitivity_settings` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> _models.GetSensitivitySettingsListResponse: + """Gets a list with a single sensitivity settings resource. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GetSensitivitySettingsListResponse or the result of cls(response) + :rtype: ~azure.mgmt.security.v2023_02_01_preview.models.GetSensitivitySettingsListResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-15-preview")) + cls: ClsType[_models.GetSensitivitySettingsListResponse] = kwargs.pop("cls", None) + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("GetSensitivitySettingsListResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list.metadata = {"url": "/providers/Microsoft.Security/sensitivitySettings"} diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py index 5ed3ce4fed9b..2f3cdf8ad799 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_baseline_rules_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import SecurityCenterMixinABC, _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py index 552d1b48ddf1..6e6776c1695c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scan_results_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import SecurityCenterMixinABC, _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py index c51aca11e0e4..aa10e2d0cc7c 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_02_01_preview/operations/_sql_vulnerability_assessment_scans_operations.py @@ -25,7 +25,7 @@ from .. import models as _models from ..._serialization import Serializer -from .._vendor import _convert_request, _format_url_section +from .._vendor import SecurityCenterMixinABC, _convert_request, _format_url_section T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] diff --git a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_03_01_preview/_version.py b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_03_01_preview/_version.py index 34ea7990c4b4..e5754a47ce68 100644 --- a/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_03_01_preview/_version.py +++ b/sdk/security/azure-mgmt-security/azure/mgmt/security/v2023_03_01_preview/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "5.0.0" +VERSION = "1.0.0b1"