Skip to content

Commit 054d230

Browse files
AutorestCIZim Kalinowski
authored and
Zim Kalinowski
committed
[AutoPR resources/resource-manager] Adding a baseline folder for new api version 2019-06-01 as a baseline. Content unchanged at the moment. I will do it soon (#6889)
* Generated from 75581e4277112188117db523a260ae818d949523 added stable/2019-06-01 version for Authorization RP * Generated from edd74f0a1be6f17caa185525a63e594aef956acc Addressed review comments.
1 parent 449b0a6 commit 054d230

15 files changed

+3169
-2
lines changed

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/_policy_client.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class PolicyClient(MultiApiClientMixin, SDKClient):
4646
:type profile: azure.profiles.KnownProfiles
4747
"""
4848

49-
DEFAULT_API_VERSION = '2019-01-01'
49+
DEFAULT_API_VERSION = '2019-06-01'
5050
_PROFILE_TAG = "azure.mgmt.resource.policy.PolicyClient"
5151
LATEST_PROFILE = ProfileDefinition({
5252
_PROFILE_TAG: {
@@ -79,6 +79,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
7979
* 2018-03-01: :mod:`v2018_03_01.models<azure.mgmt.resource.policy.v2018_03_01.models>`
8080
* 2018-05-01: :mod:`v2018_05_01.models<azure.mgmt.resource.policy.v2018_05_01.models>`
8181
* 2019-01-01: :mod:`v2019_01_01.models<azure.mgmt.resource.policy.v2019_01_01.models>`
82+
* 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.resource.policy.v2019_06_01.models>`
8283
"""
8384
if api_version == '2015-10-01-preview':
8485
from .v2015_10_01_preview import models
@@ -101,6 +102,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
101102
elif api_version == '2019-01-01':
102103
from .v2019_01_01 import models
103104
return models
105+
elif api_version == '2019-06-01':
106+
from .v2019_06_01 import models
107+
return models
104108
raise NotImplementedError("APIVersion {} is not available".format(api_version))
105109

106110
@property
@@ -114,6 +118,7 @@ def policy_assignments(self):
114118
* 2018-03-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyAssignmentsOperations>`
115119
* 2018-05-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyAssignmentsOperations>`
116120
* 2019-01-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyAssignmentsOperations>`
121+
* 2019-06-01: :class:`PolicyAssignmentsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyAssignmentsOperations>`
117122
"""
118123
api_version = self._get_api_version('policy_assignments')
119124
if api_version == '2015-10-01-preview':
@@ -130,6 +135,8 @@ def policy_assignments(self):
130135
from .v2018_05_01.operations import PolicyAssignmentsOperations as OperationClass
131136
elif api_version == '2019-01-01':
132137
from .v2019_01_01.operations import PolicyAssignmentsOperations as OperationClass
138+
elif api_version == '2019-06-01':
139+
from .v2019_06_01.operations import PolicyAssignmentsOperations as OperationClass
133140
else:
134141
raise NotImplementedError("APIVersion {} is not available".format(api_version))
135142
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -145,6 +152,7 @@ def policy_definitions(self):
145152
* 2018-03-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicyDefinitionsOperations>`
146153
* 2018-05-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicyDefinitionsOperations>`
147154
* 2019-01-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicyDefinitionsOperations>`
155+
* 2019-06-01: :class:`PolicyDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicyDefinitionsOperations>`
148156
"""
149157
api_version = self._get_api_version('policy_definitions')
150158
if api_version == '2015-10-01-preview':
@@ -161,6 +169,8 @@ def policy_definitions(self):
161169
from .v2018_05_01.operations import PolicyDefinitionsOperations as OperationClass
162170
elif api_version == '2019-01-01':
163171
from .v2019_01_01.operations import PolicyDefinitionsOperations as OperationClass
172+
elif api_version == '2019-06-01':
173+
from .v2019_06_01.operations import PolicyDefinitionsOperations as OperationClass
164174
else:
165175
raise NotImplementedError("APIVersion {} is not available".format(api_version))
166176
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
@@ -173,6 +183,7 @@ def policy_set_definitions(self):
173183
* 2018-03-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_03_01.operations.PolicySetDefinitionsOperations>`
174184
* 2018-05-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2018_05_01.operations.PolicySetDefinitionsOperations>`
175185
* 2019-01-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_01_01.operations.PolicySetDefinitionsOperations>`
186+
* 2019-06-01: :class:`PolicySetDefinitionsOperations<azure.mgmt.resource.policy.v2019_06_01.operations.PolicySetDefinitionsOperations>`
176187
"""
177188
api_version = self._get_api_version('policy_set_definitions')
178189
if api_version == '2017-06-01-preview':
@@ -183,6 +194,8 @@ def policy_set_definitions(self):
183194
from .v2018_05_01.operations import PolicySetDefinitionsOperations as OperationClass
184195
elif api_version == '2019-01-01':
185196
from .v2019_01_01.operations import PolicySetDefinitionsOperations as OperationClass
197+
elif api_version == '2019-06-01':
198+
from .v2019_06_01.operations import PolicySetDefinitionsOperations as OperationClass
186199
else:
187200
raise NotImplementedError("APIVersion {} is not available".format(api_version))
188201
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# Licensed under the MIT License. See License.txt in the project root for
55
# license information.
66
# --------------------------------------------------------------------------
7-
from .v2019_01_01.models import *
7+
from .v2019_06_01.models import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from ._configuration import PolicyClientConfiguration
13+
from ._policy_client import PolicyClient
14+
__all__ = ['PolicyClient', 'PolicyClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
from msrestazure import AzureConfiguration
12+
13+
from .version import VERSION
14+
15+
16+
class PolicyClientConfiguration(AzureConfiguration):
17+
"""Configuration for PolicyClient
18+
Note that all parameters used to create this instance are saved as instance
19+
attributes.
20+
21+
:param credentials: Credentials needed for the client to connect to Azure.
22+
:type credentials: :mod:`A msrestazure Credentials
23+
object<msrestazure.azure_active_directory>`
24+
:param subscription_id: The ID of the target subscription.
25+
:type subscription_id: str
26+
:param str base_url: Service URL
27+
"""
28+
29+
def __init__(
30+
self, credentials, subscription_id, base_url=None):
31+
32+
if credentials is None:
33+
raise ValueError("Parameter 'credentials' must not be None.")
34+
if subscription_id is None:
35+
raise ValueError("Parameter 'subscription_id' must not be None.")
36+
if not base_url:
37+
base_url = 'https://management.azure.com'
38+
39+
super(PolicyClientConfiguration, self).__init__(base_url)
40+
41+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42+
self.keep_alive = True
43+
44+
self.add_user_agent('azure-mgmt-resource/{}'.format(VERSION))
45+
self.add_user_agent('Azure-SDK-For-Python')
46+
47+
self.credentials = credentials
48+
self.subscription_id = subscription_id
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import PolicyClientConfiguration
16+
from .operations import PolicyAssignmentsOperations
17+
from .operations import PolicyDefinitionsOperations
18+
from .operations import PolicySetDefinitionsOperations
19+
from . import models
20+
21+
22+
class PolicyClient(SDKClient):
23+
"""To manage and control access to your resources, you can define customized policies and assign them at a scope.
24+
25+
:ivar config: Configuration for client.
26+
:vartype config: PolicyClientConfiguration
27+
28+
:ivar policy_assignments: PolicyAssignments operations
29+
:vartype policy_assignments: azure.mgmt.resource.policy.v2019_06_01.operations.PolicyAssignmentsOperations
30+
:ivar policy_definitions: PolicyDefinitions operations
31+
:vartype policy_definitions: azure.mgmt.resource.policy.v2019_06_01.operations.PolicyDefinitionsOperations
32+
:ivar policy_set_definitions: PolicySetDefinitions operations
33+
:vartype policy_set_definitions: azure.mgmt.resource.policy.v2019_06_01.operations.PolicySetDefinitionsOperations
34+
35+
:param credentials: Credentials needed for the client to connect to Azure.
36+
:type credentials: :mod:`A msrestazure Credentials
37+
object<msrestazure.azure_active_directory>`
38+
:param subscription_id: The ID of the target subscription.
39+
:type subscription_id: str
40+
:param str base_url: Service URL
41+
"""
42+
43+
def __init__(
44+
self, credentials, subscription_id, base_url=None):
45+
46+
self.config = PolicyClientConfiguration(credentials, subscription_id, base_url)
47+
super(PolicyClient, self).__init__(self.config.credentials, self.config)
48+
49+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
50+
self.api_version = '2019-06-01'
51+
self._serialize = Serializer(client_models)
52+
self._deserialize = Deserializer(client_models)
53+
54+
self.policy_assignments = PolicyAssignmentsOperations(
55+
self._client, self.config, self._serialize, self._deserialize)
56+
self.policy_definitions = PolicyDefinitionsOperations(
57+
self._client, self.config, self._serialize, self._deserialize)
58+
self.policy_set_definitions = PolicySetDefinitionsOperations(
59+
self._client, self.config, self._serialize, self._deserialize)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
try:
13+
from ._models_py3 import ErrorResponse, ErrorResponseException
14+
from ._models_py3 import Identity
15+
from ._models_py3 import PolicyAssignment
16+
from ._models_py3 import PolicyDefinition
17+
from ._models_py3 import PolicyDefinitionReference
18+
from ._models_py3 import PolicySetDefinition
19+
from ._models_py3 import PolicySku
20+
except (SyntaxError, ImportError):
21+
from ._models import ErrorResponse, ErrorResponseException
22+
from ._models import Identity
23+
from ._models import PolicyAssignment
24+
from ._models import PolicyDefinition
25+
from ._models import PolicyDefinitionReference
26+
from ._models import PolicySetDefinition
27+
from ._models import PolicySku
28+
from ._paged_models import PolicyAssignmentPaged
29+
from ._paged_models import PolicyDefinitionPaged
30+
from ._paged_models import PolicySetDefinitionPaged
31+
from ._policy_client_enums import (
32+
EnforcementMode,
33+
ResourceIdentityType,
34+
PolicyType,
35+
)
36+
37+
__all__ = [
38+
'ErrorResponse', 'ErrorResponseException',
39+
'Identity',
40+
'PolicyAssignment',
41+
'PolicyDefinition',
42+
'PolicyDefinitionReference',
43+
'PolicySetDefinition',
44+
'PolicySku',
45+
'PolicyAssignmentPaged',
46+
'PolicyDefinitionPaged',
47+
'PolicySetDefinitionPaged',
48+
'EnforcementMode',
49+
'ResourceIdentityType',
50+
'PolicyType',
51+
]

0 commit comments

Comments
 (0)