Skip to content

Commit a6db4a5

Browse files
author
SDKAuto
committed
CodeGen from PR 34242 in Azure/azure-rest-api-specs
Merge 8fbc11097a7044c1adc129e989a96f3988cf536d into 11059b2f00c7572b276dc9862c0b41db8702cc78
1 parent ebf29c4 commit a6db4a5

File tree

63 files changed

+2706
-1171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+2706
-1171
lines changed

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

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

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

1313
### Prerequisites
1414

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

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "43f10d3b8bacd5fc6b01254b5050c613f26c3573",
2+
"commit": "c908490d3d2b6fdd1a5dfa108a0f47183e4c06e0",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.13.19",
6+
"@autorest/python@6.34.1",
77
"@autorest/[email protected]"
88
],
9-
"autorest_command": "autorest specification/appcomplianceautomation/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.13.19 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/appcomplianceautomation/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.34.1 --use=@autorest/[email protected] --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/appcomplianceautomation/resource-manager/readme.md"
1111
}

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._app_compliance_automation_mgmt_client import AppComplianceAutomationMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._app_compliance_automation_mgmt_client import AppComplianceAutomationMgmtClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"AppComplianceAutomationMgmtClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/_app_compliance_automation_mgmt_client.py

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

1213
from azure.core.pipeline import policies
1314
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1416
from azure.mgmt.core import ARMPipelineClient
1517
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1619

1720
from . import models as _models
1821
from ._configuration import AppComplianceAutomationMgmtClientConfiguration
19-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
2023
from .operations import (
2124
EvidenceOperations,
2225
Operations,
@@ -28,11 +31,10 @@
2831
)
2932

3033
if TYPE_CHECKING:
31-
# pylint: disable=unused-import,ungrouped-imports
3234
from azure.core.credentials import TokenCredential
3335

3436

35-
class AppComplianceAutomationMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
37+
class AppComplianceAutomationMgmtClient: # pylint: disable=too-many-instance-attributes
3638
"""App Compliance Automation Tool for Microsoft 365 API spec.
3739
3840
:ivar provider_actions: ProviderActionsOperations operations
@@ -53,7 +55,7 @@ class AppComplianceAutomationMgmtClient: # pylint: disable=client-accepts-api-v
5355
:vartype webhook: azure.mgmt.appcomplianceautomation.operations.WebhookOperations
5456
:param credential: Credential needed for the client to connect to Azure. Required.
5557
:type credential: ~azure.core.credentials.TokenCredential
56-
:param base_url: Service URL. Default value is "https://management.azure.com".
58+
:param base_url: Service URL. Default value is None.
5759
:type base_url: str
5860
:keyword api_version: Api Version. Default value is "2024-06-27". Note that overriding this
5961
default value may result in unsupported behavior.
@@ -62,10 +64,16 @@ class AppComplianceAutomationMgmtClient: # pylint: disable=client-accepts-api-v
6264
Retry-After header is present.
6365
"""
6466

65-
def __init__(
66-
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
67-
) -> None:
68-
self._config = AppComplianceAutomationMgmtClientConfiguration(credential=credential, **kwargs)
67+
def __init__(self, credential: "TokenCredential", base_url: Optional[str] = None, **kwargs: Any) -> None:
68+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
69+
_endpoints = get_arm_endpoints(_cloud)
70+
if not base_url:
71+
base_url = _endpoints["resource_manager"]
72+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
73+
self._config = AppComplianceAutomationMgmtClientConfiguration(
74+
credential=credential, credential_scopes=credential_scopes, **kwargs
75+
)
76+
6977
_policies = kwargs.pop("policies", None)
7078
if _policies is None:
7179
_policies = [
@@ -84,7 +92,7 @@ def __init__(
8492
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
8593
self._config.http_logging_policy,
8694
]
87-
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
95+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
8896

8997
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
9098
self._serialize = Serializer(client_models)
@@ -127,7 +135,7 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
127135
def close(self) -> None:
128136
self._client.close()
129137

130-
def __enter__(self) -> "AppComplianceAutomationMgmtClient":
138+
def __enter__(self) -> Self:
131139
self._client.__enter__()
132140
return self
133141

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/_configuration.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from ._version import VERSION
1515

1616
if TYPE_CHECKING:
17-
# pylint: disable=unused-import,ungrouped-imports
1817
from azure.core.credentials import TokenCredential
1918

2019

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,3 @@
44
# Code generated by Microsoft (R) AutoRest Code Generator.
55
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
66
# --------------------------------------------------------------------------
7-
8-
from azure.core.pipeline.transport import HttpRequest
9-
10-
11-
def _convert_request(request, files=None):
12-
data = request.content if not files else None
13-
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
14-
if files:
15-
request.set_formdata_body(files)
16-
return request

0 commit comments

Comments
 (0)