Skip to content

Commit

Permalink
CodeGen from PR 30800 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge ba7c89c5c27bb73d2afd6c1db05fd289256a7c9e into cf170ef8e99c2ed03edf520c54effa6d5435df28
  • Loading branch information
SDKAuto committed Oct 9, 2024
1 parent 54f7c9a commit c33faac
Show file tree
Hide file tree
Showing 333 changed files with 19,535 additions and 36,508 deletions.
14 changes: 6 additions & 8 deletions sdk/securityinsight/azure-mgmt-securityinsight/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Security Insight Management Client Library.
This package has been tested with Python 3.7+.
This package has been tested with Python 3.8+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand All @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For

### Prerequisites

- Python 3.7+ is required to use this package.
- Python 3.8+ is required to use this package.
- [Azure subscription](https://azure.microsoft.com/free/)

### Install the package
Expand All @@ -28,7 +28,7 @@ By default, [Azure Active Directory](https://aka.ms/awps/aad) token authenticati

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
- `AZURE_CLIENT_SECRET` for Azure client secret.

In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.

Expand All @@ -45,8 +45,9 @@ client = SecurityInsights(credential=DefaultAzureCredential(), subscription_id=s

## Examples


Code samples for this package can be found at [Security Insight Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
Code samples for this package can be found at:
- [Search Security Insight Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)


## Troubleshooting
Expand All @@ -58,6 +59,3 @@ Code samples for this package can be found at [Security Insight Management](http
If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-securityinsight%2FREADME.png)
10 changes: 5 additions & 5 deletions sdk/securityinsight/azure-mgmt-securityinsight/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "89a9bf17524904e7670f0fd2d62ac882ca00d85c",
"commit": "a2ce7717a53228e327fdee3871c866ab83f8b342",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"autorest": "3.10.2",
"use": [
"@autorest/python@6.2.7",
"@autorest/modelerfour@4.24.3"
"@autorest/python@6.19.0",
"@autorest/modelerfour@4.27.0"
],
"autorest_command": "autorest specification/securityinsights/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.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/securityinsights/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
"readme": "specification/securityinsights/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,35 @@
# 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
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

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


class SecurityInsightsConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
class SecurityInsightsConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
"""Configuration for SecurityInsights.
Note that all parameters used to create this instance are saved as instance
attributes.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-12-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-09-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

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

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -54,6 +46,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-securityinsight/{}".format(VERSION))
self.polling_interval = kwargs.get("polling_interval", 30)
self._configure(**kwargs)

def _configure(self, **kwargs: Any) -> None:
Expand All @@ -62,9 +55,9 @@ def _configure(self, **kwargs: Any) -> None:
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#
# --------------------------------------------------------------------------


# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
Expand Down
Loading

0 comments on commit c33faac

Please sign in to comment.