Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions sdk/security/azure-mgmt-security/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/[email protected].2"
"@autorest/python@5.16.0",
"@autorest/[email protected].3"
],
"commit": "a8719243647b7c6d06ed287483d788808de7ecab",
"commit": "a8cac4886317b10030cfc757b4f56ef075418eab",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/security/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/[email protected].2 --version=3.4.5",
"autorest_command": "autorest specification/security/resource-manager/readme.md --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/[email protected].3 --version=3.7.2",
"readme": "specification/security/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
# --------------------------------------------------------------------------

from ._security_center import SecurityCenter
from ._version import VERSION

__version__ = VERSION
__all__ = ['SecurityCenter']

try:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# 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.
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from typing import TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand All @@ -20,7 +22,6 @@

from azure.core.credentials import TokenCredential


class SecurityCenterConfiguration(Configuration):
"""Configuration for SecurityCenter.

Expand All @@ -31,31 +32,25 @@ class SecurityCenterConfiguration(Configuration):
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: Azure subscription ID.
:type subscription_id: str
:param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations.
:type asc_location: str
"""

def __init__(
self,
credential, # type: "TokenCredential"
subscription_id, # type: str
asc_location, # type: str
**kwargs # type: Any
):
# type: (...) -> None
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if asc_location is None:
raise ValueError("Parameter 'asc_location' must not be None.")
super(SecurityCenterConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.asc_location = asc_location
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-security/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-security/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand All @@ -73,4 +68,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
1,030 changes: 758 additions & 272 deletions sdk/security/azure-mgmt-security/azure/mgmt/security/_security_center.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# 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.
# 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.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential


class SecurityCenterConfiguration(Configuration):
"""Configuration for SecurityCenter.

Expand All @@ -29,30 +30,24 @@ class SecurityCenterConfiguration(Configuration):
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: Azure subscription ID.
:type subscription_id: str
:param asc_location: The location where ASC stores the data of the subscription. can be retrieved from Get locations.
:type asc_location: str
"""

def __init__(
self,
credential: "AsyncTokenCredential",
subscription_id: str,
asc_location: str,
**kwargs: Any
**kwargs # type: Any
) -> None:
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if asc_location is None:
raise ValueError("Parameter 'asc_location' must not be None.")
super(SecurityCenterConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
self.asc_location = asc_location
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-security/{}'.format(VERSION))
kwargs.setdefault('sdk_moniker', 'azure-mgmt-security/{}'.format(VERSION))
self._configure(**kwargs)

def _configure(
Expand All @@ -69,4 +64,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
Loading