Skip to content

Commit ed4748d

Browse files
azure-sdkmsyycChenxiJiang333
authored
[AutoRelease] t2-appcomplianceautomation-2024-06-27-17246(can only be merged by SDK owner) (#36261)
* code and test * Update sdk_packaging.toml * Update README.md * Update testcases * Update test_cli_mgmt_appcomplianceautomation.py --------- Co-authored-by: azure-sdk <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]> Co-authored-by: ChenxiJiang333 <[email protected]>
1 parent 9d63a2d commit ed4748d

File tree

65 files changed

+10946
-2642
lines changed

Some content is hidden

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

65 files changed

+10946
-2642
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
11
# Release History
22

3+
## 1.0.0 (2024-06-23)
4+
5+
### Features Added
6+
7+
- Added operation ReportOperations.begin_fix
8+
- Added operation ReportOperations.begin_sync_cert_record
9+
- Added operation ReportOperations.begin_verify
10+
- Added operation ReportOperations.get_scoping_questions
11+
- Added operation ReportOperations.list
12+
- Added operation ReportOperations.nested_resource_check_name_availability
13+
- Added operation SnapshotOperations.list
14+
- Added operation group EvidenceOperations
15+
- Added operation group ProviderActionsOperations
16+
- Added operation group ScopingConfigurationOperations
17+
- Added operation group WebhookOperations
18+
- Model ComplianceReportItem has a new parameter control_family_name
19+
- Model ComplianceReportItem has a new parameter control_status
20+
- Model ComplianceReportItem has a new parameter resource_origin
21+
- Model ComplianceReportItem has a new parameter resource_status
22+
- Model ComplianceReportItem has a new parameter resource_status_change_date
23+
- Model ComplianceReportItem has a new parameter responsibility_description
24+
- Model ComplianceReportItem has a new parameter responsibility_title
25+
- Model Control has a new parameter control_name
26+
- Model Control has a new parameter responsibilities
27+
- Model ControlFamily has a new parameter control_family_name
28+
- Model ControlFamily has a new parameter control_family_status
29+
- Model OverviewStatus has a new parameter not_applicable_count
30+
- Model OverviewStatus has a new parameter pending_count
31+
- Model ReportProperties has a new parameter cert_records
32+
- Model ReportProperties has a new parameter errors
33+
- Model ReportProperties has a new parameter storage_info
34+
- Model ResourceMetadata has a new parameter account_id
35+
- Model ResourceMetadata has a new parameter resource_origin
36+
37+
### Breaking Changes
38+
39+
- Client name is changed from `AppComplianceAutomationToolForMicrosoft365` to `AppComplianceAutomationMgmtClient`
40+
- Model Category no longer has parameter category_type
41+
- Model ComplianceReportItem no longer has parameter compliance_state
42+
- Model ComplianceReportItem no longer has parameter control_type
43+
- Model ComplianceReportItem no longer has parameter policy_description
44+
- Model ComplianceReportItem no longer has parameter policy_display_name
45+
- Model ComplianceReportItem no longer has parameter policy_id
46+
- Model ComplianceReportItem no longer has parameter resource_group
47+
- Model ComplianceReportItem no longer has parameter status_change_date
48+
- Model ComplianceReportItem no longer has parameter subscription_id
49+
- Model Control no longer has parameter assessments
50+
- Model Control no longer has parameter control_short_name
51+
- Model Control no longer has parameter control_type
52+
- Model ControlFamily no longer has parameter family_name
53+
- Model ControlFamily no longer has parameter family_status
54+
- Model ControlFamily no longer has parameter family_type
55+
- Model ReportProperties no longer has parameter id
56+
- Model ReportProperties no longer has parameter report_name
57+
- Model ResourceMetadata no longer has parameter resource_name
58+
- Model ResourceMetadata no longer has parameter tags
59+
- Model SnapshotProperties no longer has parameter id
60+
- Operation ReportOperations.begin_create_or_update has a new required parameter properties
61+
- Operation ReportOperations.begin_create_or_update no longer has parameter parameters
62+
- Operation ReportOperations.begin_update has a new required parameter properties
63+
- Operation ReportOperations.begin_update no longer has parameter parameters
64+
- Operation SnapshotOperations.begin_download has a new required parameter body
65+
- Operation SnapshotOperations.begin_download no longer has parameter parameters
66+
- Removed operation group ReportsOperations
67+
- Removed operation group SnapshotsOperations
68+
369
## 1.0.0b1 (2022-11-15)
470

571
* Initial Release

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

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
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.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
17-
Code samples for this package can be found at [Appcomplianceautomation Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
15+
- Python 3.8+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-appcomplianceautomation
22+
pip install azure-identity
23+
```
24+
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.appcomplianceautomation import AppComplianceAutomationMgmtClient
40+
import os
41+
42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = AppComplianceAutomationMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
45+
46+
## Examples
47+
48+
Code samples for this package can be found at:
49+
- [Search Appcomplianceautomation Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
2258

2359
If you encounter any bugs or have suggestions, please file an issue in the
2460
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
2561
section of the project.
26-
27-
28-
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-appcomplianceautomation%2FREADME.png)
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "21426cf85836ec17aaa4f20f58324a8666925e34",
2+
"commit": "43f10d3b8bacd5fc6b01254b5050c613f26c3573",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.2.1",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.13.19",
7+
"@autorest/modelerfour@4.27.0"
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.2.1 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
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/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/appcomplianceautomation/resource-manager/readme.md"
1111
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"AssetsRepo": "Azure/azure-sdk-assets",
3+
"AssetsRepoPrefixPath": "python",
4+
"TagPrefix": "python/appcomplianceautomation/azure-mgmt-appcomplianceautomation",
5+
"Tag": "python/appcomplianceautomation/azure-mgmt-appcomplianceautomation_bd8828fa65"
6+
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._app_compliance_automation_tool_for_microsoft365 import AppComplianceAutomationToolForMicrosoft365
9+
from ._app_compliance_automation_mgmt_client import AppComplianceAutomationMgmtClient
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
1313

1414
try:
1515
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
16+
from ._patch import * # pylint: disable=unused-wildcard-import
1717
except ImportError:
1818
_patch_all = []
1919
from ._patch import patch_sdk as _patch_sdk
2020

2121
__all__ = [
22-
"AppComplianceAutomationToolForMicrosoft365",
22+
"AppComplianceAutomationMgmtClient",
2323
]
2424
__all__.extend([p for p in _patch_all if p not in __all__])
2525

sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/_app_compliance_automation_tool_for_microsoft365.py renamed to sdk/appcomplianceautomation/azure-mgmt-appcomplianceautomation/azure/mgmt/appcomplianceautomation/_app_compliance_automation_mgmt_client.py

Lines changed: 61 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,54 @@
99
from copy import deepcopy
1010
from typing import Any, TYPE_CHECKING
1111

12+
from azure.core.pipeline import policies
1213
from azure.core.rest import HttpRequest, HttpResponse
1314
from azure.mgmt.core import ARMPipelineClient
15+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
1416

15-
from . import models
16-
from ._configuration import AppComplianceAutomationToolForMicrosoft365Configuration
17+
from . import models as _models
18+
from ._configuration import AppComplianceAutomationMgmtClientConfiguration
1719
from ._serialization import Deserializer, Serializer
18-
from .operations import Operations, ReportOperations, ReportsOperations, SnapshotOperations, SnapshotsOperations
20+
from .operations import (
21+
EvidenceOperations,
22+
Operations,
23+
ProviderActionsOperations,
24+
ReportOperations,
25+
ScopingConfigurationOperations,
26+
SnapshotOperations,
27+
WebhookOperations,
28+
)
1929

2030
if TYPE_CHECKING:
2131
# pylint: disable=unused-import,ungrouped-imports
2232
from azure.core.credentials import TokenCredential
2333

2434

25-
class AppComplianceAutomationToolForMicrosoft365: # pylint: disable=client-accepts-api-version-keyword
35+
class AppComplianceAutomationMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
2636
"""App Compliance Automation Tool for Microsoft 365 API spec.
2737
38+
:ivar provider_actions: ProviderActionsOperations operations
39+
:vartype provider_actions:
40+
azure.mgmt.appcomplianceautomation.operations.ProviderActionsOperations
2841
:ivar operations: Operations operations
2942
:vartype operations: azure.mgmt.appcomplianceautomation.operations.Operations
30-
:ivar reports: ReportsOperations operations
31-
:vartype reports: azure.mgmt.appcomplianceautomation.operations.ReportsOperations
3243
:ivar report: ReportOperations operations
3344
:vartype report: azure.mgmt.appcomplianceautomation.operations.ReportOperations
34-
:ivar snapshots: SnapshotsOperations operations
35-
:vartype snapshots: azure.mgmt.appcomplianceautomation.operations.SnapshotsOperations
45+
:ivar evidence: EvidenceOperations operations
46+
:vartype evidence: azure.mgmt.appcomplianceautomation.operations.EvidenceOperations
47+
:ivar scoping_configuration: ScopingConfigurationOperations operations
48+
:vartype scoping_configuration:
49+
azure.mgmt.appcomplianceautomation.operations.ScopingConfigurationOperations
3650
:ivar snapshot: SnapshotOperations operations
3751
:vartype snapshot: azure.mgmt.appcomplianceautomation.operations.SnapshotOperations
52+
:ivar webhook: WebhookOperations operations
53+
:vartype webhook: azure.mgmt.appcomplianceautomation.operations.WebhookOperations
3854
:param credential: Credential needed for the client to connect to Azure. Required.
3955
:type credential: ~azure.core.credentials.TokenCredential
4056
:param base_url: Service URL. Default value is "https://management.azure.com".
4157
:type base_url: str
42-
:keyword api_version: Api Version. Default value is "2022-11-16-preview". Note that overriding
43-
this default value may result in unsupported behavior.
58+
:keyword api_version: Api Version. Default value is "2024-06-27". Note that overriding this
59+
default value may result in unsupported behavior.
4460
:paramtype api_version: str
4561
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
4662
Retry-After header is present.
@@ -49,20 +65,44 @@ class AppComplianceAutomationToolForMicrosoft365: # pylint: disable=client-acce
4965
def __init__(
5066
self, credential: "TokenCredential", base_url: str = "https://management.azure.com", **kwargs: Any
5167
) -> None:
52-
self._config = AppComplianceAutomationToolForMicrosoft365Configuration(credential=credential, **kwargs)
53-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
54-
55-
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
68+
self._config = AppComplianceAutomationMgmtClientConfiguration(credential=credential, **kwargs)
69+
_policies = kwargs.pop("policies", None)
70+
if _policies is None:
71+
_policies = [
72+
policies.RequestIdPolicy(**kwargs),
73+
self._config.headers_policy,
74+
self._config.user_agent_policy,
75+
self._config.proxy_policy,
76+
policies.ContentDecodePolicy(**kwargs),
77+
ARMAutoResourceProviderRegistrationPolicy(),
78+
self._config.redirect_policy,
79+
self._config.retry_policy,
80+
self._config.authentication_policy,
81+
self._config.custom_hook_policy,
82+
self._config.logging_policy,
83+
policies.DistributedTracingPolicy(**kwargs),
84+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
85+
self._config.http_logging_policy,
86+
]
87+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
88+
89+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
5690
self._serialize = Serializer(client_models)
5791
self._deserialize = Deserializer(client_models)
5892
self._serialize.client_side_validation = False
93+
self.provider_actions = ProviderActionsOperations(
94+
self._client, self._config, self._serialize, self._deserialize
95+
)
5996
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
60-
self.reports = ReportsOperations(self._client, self._config, self._serialize, self._deserialize)
6197
self.report = ReportOperations(self._client, self._config, self._serialize, self._deserialize)
62-
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
98+
self.evidence = EvidenceOperations(self._client, self._config, self._serialize, self._deserialize)
99+
self.scoping_configuration = ScopingConfigurationOperations(
100+
self._client, self._config, self._serialize, self._deserialize
101+
)
63102
self.snapshot = SnapshotOperations(self._client, self._config, self._serialize, self._deserialize)
103+
self.webhook = WebhookOperations(self._client, self._config, self._serialize, self._deserialize)
64104

65-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
105+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
66106
"""Runs the network request through the client's chained policies.
67107
68108
>>> from azure.core.rest import HttpRequest
@@ -82,17 +122,14 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
82122

83123
request_copy = deepcopy(request)
84124
request_copy.url = self._client.format_url(request_copy.url)
85-
return self._client.send_request(request_copy, **kwargs)
125+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
86126

87-
def close(self):
88-
# type: () -> None
127+
def close(self) -> None:
89128
self._client.close()
90129

91-
def __enter__(self):
92-
# type: () -> AppComplianceAutomationToolForMicrosoft365
130+
def __enter__(self) -> "AppComplianceAutomationMgmtClient":
93131
self._client.__enter__()
94132
return self
95133

96-
def __exit__(self, *exc_details):
97-
# type: (Any) -> None
134+
def __exit__(self, *exc_details: Any) -> None:
98135
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)