Skip to content

Commit

Permalink
CodeGen from PR 21267 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
release-securityinsights-Microsoft.SecurityInsights-2022-11-01-preview (Azure#21267)

* Adds base for updating Microsoft.SecurityInsights from version preview/2022-10-01-preview to version 2022-11-01-preview

* Updates readme

* Updates API version in new specs and examples

* added recommendations specs (Azure#21118)

* model validation fixes (Azure#21350)

Co-authored-by: Vaspate <[email protected]>
Co-authored-by: dosegal <[email protected]>
  • Loading branch information
3 people committed Nov 7, 2022
1 parent 1d023ea commit 94b4c03
Show file tree
Hide file tree
Showing 254 changed files with 11,677 additions and 567 deletions.
12 changes: 6 additions & 6 deletions sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.8.4",
"commit": "b20e4034615cfed39916e77538229254c9b1b701",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.1.6",
"@autorest/modelerfour@4.23.5"
"@autorest/python@6.2.1",
"@autorest/modelerfour@4.24.3"
],
"commit": "e24bbf6a66cb0a19c072c6f15cee163acbd7acf7",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.8.4 --version-tolerant=False",
"autorest_command": "autorest specification/securityinsights/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/securityinsights/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["SecurityInsights"]
__all__ = [
"SecurityInsights",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -14,6 +15,11 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -29,14 +35,14 @@ class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(SecurityInsightsConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-09-01-preview") # type: str
api_version = kwargs.pop("api_version", "2022-11-01-preview") # type: Literal["2022-11-01-preview"]

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
EntityQueryTemplatesOperations,
EntityRelationsOperations,
FileImportsOperations,
GetOperations,
GetRecommendationsOperations,
IPGeodataOperations,
IncidentCommentsOperations,
IncidentRelationsOperations,
Expand All @@ -48,6 +50,7 @@
ThreatIntelligenceIndicatorMetricsOperations,
ThreatIntelligenceIndicatorOperations,
ThreatIntelligenceIndicatorsOperations,
UpdateOperations,
WatchlistItemsOperations,
WatchlistsOperations,
)
Expand Down Expand Up @@ -117,6 +120,13 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype source_control: azure.mgmt.securityinsight.operations.SourceControlOperations
:ivar source_controls: SourceControlsOperations operations
:vartype source_controls: azure.mgmt.securityinsight.operations.SourceControlsOperations
:ivar get_recommendations: GetRecommendationsOperations operations
:vartype get_recommendations:
azure.mgmt.securityinsight.operations.GetRecommendationsOperations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.securityinsight.operations.GetOperations
:ivar update: UpdateOperations operations
:vartype update: azure.mgmt.securityinsight.operations.UpdateOperations
:ivar threat_intelligence_indicator: ThreatIntelligenceIndicatorOperations operations
:vartype threat_intelligence_indicator:
azure.mgmt.securityinsight.operations.ThreatIntelligenceIndicatorOperations
Expand Down Expand Up @@ -144,7 +154,7 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -215,6 +225,11 @@ def __init__(
)
self.source_control = SourceControlOperations(self._client, self._config, self._serialize, self._deserialize)
self.source_controls = SourceControlsOperations(self._client, self._config, self._serialize, self._deserialize)
self.get_recommendations = GetRecommendationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
self.update = UpdateOperations(self._client, self._config, self._serialize, self._deserialize)
self.threat_intelligence_indicator = ThreatIntelligenceIndicatorOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "2.0.0b1"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["SecurityInsights"]
__all__ = [
"SecurityInsights",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -14,6 +15,11 @@

from .._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential
Expand All @@ -29,14 +35,14 @@ class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(SecurityInsightsConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-09-01-preview") # type: str
api_version = kwargs.pop("api_version", "2022-11-01-preview") # type: Literal["2022-11-01-preview"]

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
EntityQueryTemplatesOperations,
EntityRelationsOperations,
FileImportsOperations,
GetOperations,
GetRecommendationsOperations,
IPGeodataOperations,
IncidentCommentsOperations,
IncidentRelationsOperations,
Expand All @@ -48,6 +50,7 @@
ThreatIntelligenceIndicatorMetricsOperations,
ThreatIntelligenceIndicatorOperations,
ThreatIntelligenceIndicatorsOperations,
UpdateOperations,
WatchlistItemsOperations,
WatchlistsOperations,
)
Expand Down Expand Up @@ -121,6 +124,13 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:vartype source_control: azure.mgmt.securityinsight.aio.operations.SourceControlOperations
:ivar source_controls: SourceControlsOperations operations
:vartype source_controls: azure.mgmt.securityinsight.aio.operations.SourceControlsOperations
:ivar get_recommendations: GetRecommendationsOperations operations
:vartype get_recommendations:
azure.mgmt.securityinsight.aio.operations.GetRecommendationsOperations
:ivar get: GetOperations operations
:vartype get: azure.mgmt.securityinsight.aio.operations.GetOperations
:ivar update: UpdateOperations operations
:vartype update: azure.mgmt.securityinsight.aio.operations.UpdateOperations
:ivar threat_intelligence_indicator: ThreatIntelligenceIndicatorOperations operations
:vartype threat_intelligence_indicator:
azure.mgmt.securityinsight.aio.operations.ThreatIntelligenceIndicatorOperations
Expand Down Expand Up @@ -148,7 +158,7 @@ class SecurityInsights: # pylint: disable=client-accepts-api-version-keyword,to
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-11-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down Expand Up @@ -219,6 +229,11 @@ def __init__(
)
self.source_control = SourceControlOperations(self._client, self._config, self._serialize, self._deserialize)
self.source_controls = SourceControlsOperations(self._client, self._config, self._serialize, self._deserialize)
self.get_recommendations = GetRecommendationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.get = GetOperations(self._client, self._config, self._serialize, self._deserialize)
self.update = UpdateOperations(self._client, self._config, self._serialize, self._deserialize)
self.threat_intelligence_indicator = ThreatIntelligenceIndicatorOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
from ._product_settings_operations import ProductSettingsOperations
from ._source_control_operations import SourceControlOperations
from ._source_controls_operations import SourceControlsOperations
from ._get_recommendations_operations import GetRecommendationsOperations
from ._get_operations import GetOperations
from ._update_operations import UpdateOperations
from ._threat_intelligence_indicator_operations import ThreatIntelligenceIndicatorOperations
from ._threat_intelligence_indicators_operations import ThreatIntelligenceIndicatorsOperations
from ._threat_intelligence_indicator_metrics_operations import ThreatIntelligenceIndicatorMetricsOperations
Expand Down Expand Up @@ -72,6 +75,9 @@
"ProductSettingsOperations",
"SourceControlOperations",
"SourceControlsOperations",
"GetRecommendationsOperations",
"GetOperations",
"UpdateOperations",
"ThreatIntelligenceIndicatorOperations",
"ThreatIntelligenceIndicatorsOperations",
"ThreatIntelligenceIndicatorMetricsOperations",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
from urllib.parse import parse_qs, urljoin, urlparse
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand Down Expand Up @@ -35,6 +36,10 @@
build_list_by_alert_rule_request,
)

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -80,7 +85,9 @@ def list_by_alert_rule(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.ActionsList]

error_map = {
Expand Down Expand Up @@ -109,10 +116,17 @@ def prepare_request(next_link=None):

else:
# make call to next link with the client's api-version
_parsed_next_link = urlparse(next_link)
_next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query))
_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", urljoin(next_link, _parsed_next_link.path), params=_next_request_params)
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
Expand Down Expand Up @@ -174,7 +188,9 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.ActionResponse]

request = build_get_request(
Expand Down Expand Up @@ -320,7 +336,9 @@ async def create_or_update(
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
cls = kwargs.pop("cls", None) # type: ClsType[_models.ActionResponse]

Expand Down Expand Up @@ -403,7 +421,9 @@ async def delete( # pylint: disable=inconsistent-return-statements
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
cls = kwargs.pop("cls", None) # type: ClsType[None]

request = build_delete_request(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from urllib.parse import parse_qs, urljoin, urlparse
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand All @@ -30,6 +31,10 @@
from ..._vendor import _convert_request
from ...operations._alert_rule_templates_operations import build_get_request, build_list_request

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]

Expand Down Expand Up @@ -73,7 +78,9 @@ def list(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertRuleTemplatesList]

error_map = {
Expand Down Expand Up @@ -101,10 +108,17 @@ def prepare_request(next_link=None):

else:
# make call to next link with the client's api-version
_parsed_next_link = urlparse(next_link)
_next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query))
_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", urljoin(next_link, _parsed_next_link.path), params=_next_request_params)
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url) # type: ignore
request.method = "GET"
Expand Down Expand Up @@ -164,7 +178,9 @@ async def get(
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
api_version = kwargs.pop(
"api_version", _params.pop("api-version", self._config.api_version)
) # type: Literal["2022-11-01-preview"]
cls = kwargs.pop("cls", None) # type: ClsType[_models.AlertRuleTemplate]

request = build_get_request(
Expand Down
Loading

0 comments on commit 94b4c03

Please sign in to comment.