Skip to content

Commit 5b26c59

Browse files
azure-sdkmsyyc
andauthored
[AutoRelease] t2-policyinsights-2022-10-07-66471(Do not merge) (Azure#26694)
* code and test * Update CHANGELOG.md Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 369dfd2 commit 5b26c59

40 files changed

+18011
-12305
lines changed

sdk/policyinsights/azure-mgmt-policyinsights/CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Release History
22

3+
## 1.1.0b3 (2022-10-10)
4+
5+
### Features Added
6+
7+
- Added operation PolicyRestrictionsOperations.check_at_management_group_scope
8+
- Model Attestation has a new parameter assessment_date
9+
- Model Attestation has a new parameter metadata
10+
11+
### Breaking Changes
12+
13+
- Operation PolicyEventsOperations.list_query_results_for_management_group has a new parameter policy_events_resource
14+
- Operation PolicyEventsOperations.list_query_results_for_policy_definition has a new parameter policy_events_resource
15+
- Operation PolicyEventsOperations.list_query_results_for_policy_set_definition has a new parameter policy_events_resource
16+
- Operation PolicyEventsOperations.list_query_results_for_resource has a new parameter policy_events_resource
17+
- Operation PolicyEventsOperations.list_query_results_for_resource_group has a new parameter policy_events_resource
18+
- Operation PolicyEventsOperations.list_query_results_for_resource_group_level_policy_assignment has a new parameter policy_events_resource
19+
- Operation PolicyEventsOperations.list_query_results_for_subscription has a new parameter policy_events_resource
20+
- Operation PolicyEventsOperations.list_query_results_for_subscription_level_policy_assignment has a new parameter policy_events_resource
21+
- Operation PolicyStatesOperations.summarize_for_management_group has a new parameter policy_states_summary_resource
22+
- Operation PolicyStatesOperations.summarize_for_policy_definition has a new parameter policy_states_summary_resource
23+
- Operation PolicyStatesOperations.summarize_for_policy_set_definition has a new parameter policy_states_summary_resource
24+
- Operation PolicyStatesOperations.summarize_for_resource has a new parameter policy_states_summary_resource
25+
- Operation PolicyStatesOperations.summarize_for_resource_group has a new parameter policy_states_summary_resource
26+
- Operation PolicyStatesOperations.summarize_for_resource_group_level_policy_assignment has a new parameter policy_states_summary_resource
27+
- Operation PolicyStatesOperations.summarize_for_subscription has a new parameter policy_states_summary_resource
28+
- Operation PolicyStatesOperations.summarize_for_subscription_level_policy_assignment has a new parameter policy_states_summary_resource
29+
- Operation PolicyTrackedResourcesOperations.list_query_results_for_management_group has a new parameter policy_tracked_resources_resource
30+
- Operation PolicyTrackedResourcesOperations.list_query_results_for_resource has a new parameter policy_tracked_resources_resource
31+
- Operation PolicyTrackedResourcesOperations.list_query_results_for_resource_group has a new parameter policy_tracked_resources_resource
32+
- Operation PolicyTrackedResourcesOperations.list_query_results_for_subscription has a new parameter policy_tracked_resources_resource
33+
334
## 1.1.0b2 (2021-12-04)
435

536
**Features**

sdk/policyinsights/azure-mgmt-policyinsights/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include _meta.json
22
recursive-include tests *.py *.json
3+
recursive-include samples *.py *.md
34
include *.md
45
include azure/__init__.py
56
include azure/mgmt/__init__.py
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.5",
2+
"autorest": "3.9.2",
33
"use": [
4-
"@autorest/python@5.8.4",
5-
"@autorest/modelerfour@4.19.2"
4+
"@autorest/python@6.1.9",
5+
"@autorest/modelerfour@4.24.3"
66
],
7-
"commit": "4a2c1e8f277dd11a0da89d56eab8ff1a922d3a69",
7+
"commit": "05a9cdab363b8ec824094ee73950c04594325172",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/policyinsights/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",
9+
"autorest_command": "autorest specification/policyinsights/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.9 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
1010
"readme": "specification/policyinsights/resource-manager/readme.md"
1111
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13-
__all__ = ['PolicyInsightsClient']
1413

1514
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
15+
from ._patch import __all__ as _patch_all
16+
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
1817
except ImportError:
19-
pass
18+
_patch_all = []
19+
from ._patch import patch_sdk as _patch_sdk
20+
21+
__all__ = ["PolicyInsightsClient"]
22+
__all__.extend([p for p in _patch_all if p not in __all__])
23+
24+
_patch_sdk()

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

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

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

24-
class PolicyInsightsClientConfiguration(Configuration):
22+
class PolicyInsightsClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
2523
"""Configuration for PolicyInsightsClient.
2624
2725
Note that all parameters used to create this instance are saved as instance
2826
attributes.
2927
30-
:param credential: Credential needed for the client to connect to Azure.
28+
:param credential: Credential needed for the client to connect to Azure. Required.
3129
:type credential: ~azure.core.credentials.TokenCredential
32-
:param subscription_id: Microsoft Azure subscription ID.
30+
:param subscription_id: Microsoft Azure subscription ID. Required.
3331
:type subscription_id: str
3432
"""
3533

36-
def __init__(
37-
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
34+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
35+
super(PolicyInsightsClientConfiguration, self).__init__(**kwargs)
4336
if credential is None:
4437
raise ValueError("Parameter 'credential' must not be None.")
4538
if subscription_id is None:
4639
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(PolicyInsightsClientConfiguration, self).__init__(**kwargs)
4840

4941
self.credential = credential
5042
self.subscription_id = subscription_id
51-
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
52-
kwargs.setdefault('sdk_moniker', 'mgmt-policyinsights/{}'.format(VERSION))
43+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
44+
kwargs.setdefault("sdk_moniker", "mgmt-policyinsights/{}".format(VERSION))
5345
self._configure(**kwargs)
5446

5547
def _configure(
56-
self,
57-
**kwargs # type: Any
48+
self, **kwargs # type: Any
5849
):
5950
# type: (...) -> None
60-
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
61-
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
62-
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
63-
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
64-
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
65-
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
66-
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
67-
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
68-
self.authentication_policy = kwargs.get('authentication_policy')
51+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
52+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
53+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
54+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
55+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
56+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
57+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
58+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.authentication_policy = kwargs.get("authentication_policy")
6960
if self.credential and not self.authentication_policy:
70-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
61+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
62+
self.credential, *self.credential_scopes, **kwargs
63+
)

sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/_metadata.json

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ------------------------------------
2+
# Copyright (c) Microsoft Corporation.
3+
# Licensed under the MIT License.
4+
# ------------------------------------
5+
"""Customize generated code here.
6+
7+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
8+
"""
9+
from typing import List
10+
11+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
12+
13+
14+
def patch_sdk():
15+
"""Do not remove from this file.
16+
17+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
18+
you can't accomplish using the techniques described in
19+
https://aka.ms/azsdk/python/dpcodegen/python/customize
20+
"""

0 commit comments

Comments
 (0)