Skip to content

Commit

Permalink
CodeGen from PR 15761 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 3291fc14aa322bb700c18ded7f537a8ebfe5dc08 into 2105605
  • Loading branch information
SDKAuto committed Aug 24, 2021
1 parent 3fe8964 commit d86bd4d
Show file tree
Hide file tree
Showing 27 changed files with 908 additions and 1,094 deletions.
1 change: 1 addition & 0 deletions sdk/securityinsight/azure-mgmt-securityinsight/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.5",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "0e45df7785faa80de410a215a5873f3338e26a08",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
"readme": "specification/securityinsights/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,103 @@
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false
"has_lro_operations": false,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityInsightsConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SecurityInsightsConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync_method": {
"sync": {
"credential": {
"method_signature": "credential, # type: \"TokenCredential\"",
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id, # type: str",
"description": "Azure subscription ID.",
"docstring_type": "str",
"required": true
}
},
"async_method": {
"async": {
"credential": {
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"method_signature": "subscription_id, # type: str",
"signature": "subscription_id: str,",
"description": "Azure subscription ID.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"alert_rules": "AlertRulesOperations",
"actions": "ActionsOperations",
"alert_rule_templates": "AlertRuleTemplatesOperations",
"bookmarks": "BookmarksOperations",
"data_connectors": "DataConnectorsOperations",
"operations": "Operations",
"incidents": "IncidentsOperations",
"incident_comments": "IncidentCommentsOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import SecurityInsightsConfiguration
from .operations import Operations
from .operations import AlertRulesOperations
from .operations import ActionsOperations
from .operations import AlertRuleTemplatesOperations
from .operations import BookmarksOperations
from .operations import DataConnectorsOperations
from .operations import Operations
from .operations import IncidentsOperations
from .operations import IncidentCommentsOperations
from . import models
Expand All @@ -32,8 +33,6 @@
class SecurityInsights(object):
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.securityinsight.operations.Operations
:ivar alert_rules: AlertRulesOperations operations
:vartype alert_rules: azure.mgmt.securityinsight.operations.AlertRulesOperations
:ivar actions: ActionsOperations operations
Expand All @@ -44,6 +43,8 @@ class SecurityInsights(object):
:vartype bookmarks: azure.mgmt.securityinsight.operations.BookmarksOperations
:ivar data_connectors: DataConnectorsOperations operations
:vartype data_connectors: azure.mgmt.securityinsight.operations.DataConnectorsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.securityinsight.operations.Operations
:ivar incidents: IncidentsOperations operations
:vartype incidents: azure.mgmt.securityinsight.operations.IncidentsOperations
:ivar incident_comments: IncidentCommentsOperations operations
Expand All @@ -70,10 +71,9 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.alert_rules = AlertRulesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.actions = ActionsOperations(
Expand All @@ -84,11 +84,31 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.data_connectors = DataConnectorsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.incidents = IncidentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -16,12 +17,12 @@
from azure.core.credentials_async import AsyncTokenCredential

from ._configuration import SecurityInsightsConfiguration
from .operations import Operations
from .operations import AlertRulesOperations
from .operations import ActionsOperations
from .operations import AlertRuleTemplatesOperations
from .operations import BookmarksOperations
from .operations import DataConnectorsOperations
from .operations import Operations
from .operations import IncidentsOperations
from .operations import IncidentCommentsOperations
from .. import models
Expand All @@ -30,8 +31,6 @@
class SecurityInsights(object):
"""API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.securityinsight.aio.operations.Operations
:ivar alert_rules: AlertRulesOperations operations
:vartype alert_rules: azure.mgmt.securityinsight.aio.operations.AlertRulesOperations
:ivar actions: ActionsOperations operations
Expand All @@ -42,6 +41,8 @@ class SecurityInsights(object):
:vartype bookmarks: azure.mgmt.securityinsight.aio.operations.BookmarksOperations
:ivar data_connectors: DataConnectorsOperations operations
:vartype data_connectors: azure.mgmt.securityinsight.aio.operations.DataConnectorsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.securityinsight.aio.operations.Operations
:ivar incidents: IncidentsOperations operations
:vartype incidents: azure.mgmt.securityinsight.aio.operations.IncidentsOperations
:ivar incident_comments: IncidentCommentsOperations operations
Expand All @@ -67,10 +68,9 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.alert_rules = AlertRulesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.actions = ActionsOperations(
Expand All @@ -81,11 +81,30 @@ def __init__(
self._client, self._config, self._serialize, self._deserialize)
self.data_connectors = DataConnectorsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.incidents = IncidentsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.incident_comments = IncidentCommentsOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', pattern=r'^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

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

from ._operations import Operations
from ._alert_rules_operations import AlertRulesOperations
from ._actions_operations import ActionsOperations
from ._alert_rule_templates_operations import AlertRuleTemplatesOperations
from ._bookmarks_operations import BookmarksOperations
from ._data_connectors_operations import DataConnectorsOperations
from ._operations import Operations
from ._incidents_operations import IncidentsOperations
from ._incident_comments_operations import IncidentCommentsOperations

__all__ = [
'Operations',
'AlertRulesOperations',
'ActionsOperations',
'AlertRuleTemplatesOperations',
'BookmarksOperations',
'DataConnectorsOperations',
'Operations',
'IncidentsOperations',
'IncidentCommentsOperations',
]
Loading

0 comments on commit d86bd4d

Please sign in to comment.