Skip to content

Commit bc98670

Browse files
author
SDKAuto
committed
CodeGen from PR 12815 in Azure/azure-rest-api-specs
Merge 9e3ee0b43d245e86f3aa9a0fdad0abb38fac1a10 into fbd2810
1 parent 5aa3396 commit bc98670

25 files changed

+4788
-32
lines changed

sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/_authorization_management_client.py

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,18 @@ class AuthorizationManagementClient(MultiApiClientMixin, SDKClient):
5151
LATEST_PROFILE = ProfileDefinition({
5252
_PROFILE_TAG: {
5353
None: DEFAULT_API_VERSION,
54+
'access_review_default_settings': '2018-05-01-preview',
55+
'access_review_instance': '2018-05-01-preview',
56+
'access_review_instance_decisions': '2018-05-01-preview',
57+
'access_review_instance_my_decisions': '2018-05-01-preview',
58+
'access_review_instances': '2018-05-01-preview',
59+
'access_review_instances_assigned_for_my_approval': '2018-05-01-preview',
60+
'access_review_schedule_definitions': '2018-05-01-preview',
61+
'access_review_schedule_definitions_assigned_for_my_approval': '2018-05-01-preview',
5462
'classic_administrators': '2015-07-01',
5563
'deny_assignments': '2018-07-01-preview',
5664
'global_administrator': '2015-07-01',
65+
'operations': '2018-05-01-preview',
5766
'permissions': '2018-01-01-preview',
5867
'provider_operations_metadata': '2018-01-01-preview',
5968
'role_definitions': '2018-01-01-preview',
@@ -81,6 +90,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
8190
* 2015-06-01: :mod:`v2015_06_01.models<azure.mgmt.authorization.v2015_06_01.models>`
8291
* 2015-07-01: :mod:`v2015_07_01.models<azure.mgmt.authorization.v2015_07_01.models>`
8392
* 2018-01-01-preview: :mod:`v2018_01_01_preview.models<azure.mgmt.authorization.v2018_01_01_preview.models>`
93+
* 2018-05-01-preview: :mod:`v2018_05_01_preview.models<azure.mgmt.authorization.v2018_05_01_preview.models>`
8494
* 2018-07-01-preview: :mod:`v2018_07_01_preview.models<azure.mgmt.authorization.v2018_07_01_preview.models>`
8595
* 2018-09-01-preview: :mod:`v2018_09_01_preview.models<azure.mgmt.authorization.v2018_09_01_preview.models>`
8696
* 2020-04-01-preview: :mod:`v2020_04_01_preview.models<azure.mgmt.authorization.v2020_04_01_preview.models>`
@@ -94,6 +104,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
94104
elif api_version == '2018-01-01-preview':
95105
from .v2018_01_01_preview import models
96106
return models
107+
elif api_version == '2018-05-01-preview':
108+
from .v2018_05_01_preview import models
109+
return models
97110
elif api_version == '2018-07-01-preview':
98111
from .v2018_07_01_preview import models
99112
return models
@@ -105,6 +118,110 @@ def models(cls, api_version=DEFAULT_API_VERSION):
105118
return models
106119
raise NotImplementedError("APIVersion {} is not available".format(api_version))
107120

121+
@property
122+
def access_review_default_settings(self):
123+
"""Instance depends on the API version:
124+
125+
* 2018-05-01-preview: :class:`AccessReviewDefaultSettingsOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewDefaultSettingsOperations>`
126+
"""
127+
api_version = self._get_api_version('access_review_default_settings')
128+
if api_version == '2018-05-01-preview':
129+
from .v2018_05_01_preview.operations import AccessReviewDefaultSettingsOperations as OperationClass
130+
else:
131+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
132+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
133+
134+
@property
135+
def access_review_instance(self):
136+
"""Instance depends on the API version:
137+
138+
* 2018-05-01-preview: :class:`AccessReviewInstanceOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceOperations>`
139+
"""
140+
api_version = self._get_api_version('access_review_instance')
141+
if api_version == '2018-05-01-preview':
142+
from .v2018_05_01_preview.operations import AccessReviewInstanceOperations as OperationClass
143+
else:
144+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
145+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
146+
147+
@property
148+
def access_review_instance_decisions(self):
149+
"""Instance depends on the API version:
150+
151+
* 2018-05-01-preview: :class:`AccessReviewInstanceDecisionsOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceDecisionsOperations>`
152+
"""
153+
api_version = self._get_api_version('access_review_instance_decisions')
154+
if api_version == '2018-05-01-preview':
155+
from .v2018_05_01_preview.operations import AccessReviewInstanceDecisionsOperations as OperationClass
156+
else:
157+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
158+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
159+
160+
@property
161+
def access_review_instance_my_decisions(self):
162+
"""Instance depends on the API version:
163+
164+
* 2018-05-01-preview: :class:`AccessReviewInstanceMyDecisionsOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceMyDecisionsOperations>`
165+
"""
166+
api_version = self._get_api_version('access_review_instance_my_decisions')
167+
if api_version == '2018-05-01-preview':
168+
from .v2018_05_01_preview.operations import AccessReviewInstanceMyDecisionsOperations as OperationClass
169+
else:
170+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
171+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
172+
173+
@property
174+
def access_review_instances(self):
175+
"""Instance depends on the API version:
176+
177+
* 2018-05-01-preview: :class:`AccessReviewInstancesOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesOperations>`
178+
"""
179+
api_version = self._get_api_version('access_review_instances')
180+
if api_version == '2018-05-01-preview':
181+
from .v2018_05_01_preview.operations import AccessReviewInstancesOperations as OperationClass
182+
else:
183+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
184+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
185+
186+
@property
187+
def access_review_instances_assigned_for_my_approval(self):
188+
"""Instance depends on the API version:
189+
190+
* 2018-05-01-preview: :class:`AccessReviewInstancesAssignedForMyApprovalOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesAssignedForMyApprovalOperations>`
191+
"""
192+
api_version = self._get_api_version('access_review_instances_assigned_for_my_approval')
193+
if api_version == '2018-05-01-preview':
194+
from .v2018_05_01_preview.operations import AccessReviewInstancesAssignedForMyApprovalOperations as OperationClass
195+
else:
196+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
197+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
198+
199+
@property
200+
def access_review_schedule_definitions(self):
201+
"""Instance depends on the API version:
202+
203+
* 2018-05-01-preview: :class:`AccessReviewScheduleDefinitionsOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsOperations>`
204+
"""
205+
api_version = self._get_api_version('access_review_schedule_definitions')
206+
if api_version == '2018-05-01-preview':
207+
from .v2018_05_01_preview.operations import AccessReviewScheduleDefinitionsOperations as OperationClass
208+
else:
209+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
210+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
211+
212+
@property
213+
def access_review_schedule_definitions_assigned_for_my_approval(self):
214+
"""Instance depends on the API version:
215+
216+
* 2018-05-01-preview: :class:`AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations<azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations>`
217+
"""
218+
api_version = self._get_api_version('access_review_schedule_definitions_assigned_for_my_approval')
219+
if api_version == '2018-05-01-preview':
220+
from .v2018_05_01_preview.operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations as OperationClass
221+
else:
222+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
223+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
224+
108225
@property
109226
def classic_administrators(self):
110227
"""Instance depends on the API version:
@@ -147,6 +264,19 @@ def global_administrator(self):
147264
raise NotImplementedError("APIVersion {} is not available".format(api_version))
148265
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
149266

267+
@property
268+
def operations(self):
269+
"""Instance depends on the API version:
270+
271+
* 2018-05-01-preview: :class:`Operations<azure.mgmt.authorization.v2018_05_01_preview.operations.Operations>`
272+
"""
273+
api_version = self._get_api_version('operations')
274+
if api_version == '2018-05-01-preview':
275+
from .v2018_05_01_preview.operations import Operations as OperationClass
276+
else:
277+
raise NotImplementedError("APIVersion {} is not available".format(api_version))
278+
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
279+
150280
@property
151281
def permissions(self):
152282
"""Instance depends on the API version:

sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
# --------------------------------------------------------------------------
77
from .v2015_07_01.models import *
88
from .v2018_01_01_preview.models import *
9+
from .v2018_05_01_preview.models import *
910
from .v2018_07_01_preview.models import *
1011
from .v2018_09_01_preview.models import *
Lines changed: 19 additions & 0 deletions
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 AuthorizationManagementClientConfiguration
13+
from ._authorization_management_client import AuthorizationManagementClient
14+
__all__ = ['AuthorizationManagementClient', 'AuthorizationManagementClientConfiguration']
15+
16+
from .version import VERSION
17+
18+
__version__ = VERSION
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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 AuthorizationManagementClientConfiguration
16+
from .operations import Operations
17+
from .operations import AccessReviewScheduleDefinitionsOperations
18+
from .operations import AccessReviewInstancesOperations
19+
from .operations import AccessReviewInstanceOperations
20+
from .operations import AccessReviewInstanceDecisionsOperations
21+
from .operations import AccessReviewDefaultSettingsOperations
22+
from .operations import AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations
23+
from .operations import AccessReviewInstancesAssignedForMyApprovalOperations
24+
from .operations import AccessReviewInstanceMyDecisionsOperations
25+
from . import models
26+
27+
28+
class AuthorizationManagementClient(SDKClient):
29+
"""Access reviews service provides the workflow for running access reviews on different kind of resources.
30+
31+
:ivar config: Configuration for client.
32+
:vartype config: AuthorizationManagementClientConfiguration
33+
34+
:ivar operations: Operations operations
35+
:vartype operations: azure.mgmt.authorization.v2018_05_01_preview.operations.Operations
36+
:ivar access_review_schedule_definitions: AccessReviewScheduleDefinitions operations
37+
:vartype access_review_schedule_definitions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsOperations
38+
:ivar access_review_instances: AccessReviewInstances operations
39+
:vartype access_review_instances: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesOperations
40+
:ivar access_review_instance: AccessReviewInstance operations
41+
:vartype access_review_instance: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceOperations
42+
:ivar access_review_instance_decisions: AccessReviewInstanceDecisions operations
43+
:vartype access_review_instance_decisions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceDecisionsOperations
44+
:ivar access_review_default_settings: AccessReviewDefaultSettings operations
45+
:vartype access_review_default_settings: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewDefaultSettingsOperations
46+
:ivar access_review_schedule_definitions_assigned_for_my_approval: AccessReviewScheduleDefinitionsAssignedForMyApproval operations
47+
:vartype access_review_schedule_definitions_assigned_for_my_approval: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations
48+
:ivar access_review_instances_assigned_for_my_approval: AccessReviewInstancesAssignedForMyApproval operations
49+
:vartype access_review_instances_assigned_for_my_approval: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstancesAssignedForMyApprovalOperations
50+
:ivar access_review_instance_my_decisions: AccessReviewInstanceMyDecisions operations
51+
:vartype access_review_instance_my_decisions: azure.mgmt.authorization.v2018_05_01_preview.operations.AccessReviewInstanceMyDecisionsOperations
52+
53+
:param credentials: Credentials needed for the client to connect to Azure.
54+
:type credentials: :mod:`A msrestazure Credentials
55+
object<msrestazure.azure_active_directory>`
56+
:param subscription_id: The ID of the target subscription.
57+
:type subscription_id: str
58+
:param str base_url: Service URL
59+
"""
60+
61+
def __init__(
62+
self, credentials, subscription_id, base_url=None):
63+
64+
self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, base_url)
65+
super(AuthorizationManagementClient, self).__init__(self.config.credentials, self.config)
66+
67+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
68+
self.api_version = '2018-05-01-preview'
69+
self._serialize = Serializer(client_models)
70+
self._deserialize = Deserializer(client_models)
71+
72+
self.operations = Operations(
73+
self._client, self.config, self._serialize, self._deserialize)
74+
self.access_review_schedule_definitions = AccessReviewScheduleDefinitionsOperations(
75+
self._client, self.config, self._serialize, self._deserialize)
76+
self.access_review_instances = AccessReviewInstancesOperations(
77+
self._client, self.config, self._serialize, self._deserialize)
78+
self.access_review_instance = AccessReviewInstanceOperations(
79+
self._client, self.config, self._serialize, self._deserialize)
80+
self.access_review_instance_decisions = AccessReviewInstanceDecisionsOperations(
81+
self._client, self.config, self._serialize, self._deserialize)
82+
self.access_review_default_settings = AccessReviewDefaultSettingsOperations(
83+
self._client, self.config, self._serialize, self._deserialize)
84+
self.access_review_schedule_definitions_assigned_for_my_approval = AccessReviewScheduleDefinitionsAssignedForMyApprovalOperations(
85+
self._client, self.config, self._serialize, self._deserialize)
86+
self.access_review_instances_assigned_for_my_approval = AccessReviewInstancesAssignedForMyApprovalOperations(
87+
self._client, self.config, self._serialize, self._deserialize)
88+
self.access_review_instance_my_decisions = AccessReviewInstanceMyDecisionsOperations(
89+
self._client, self.config, self._serialize, self._deserialize)
Lines changed: 48 additions & 0 deletions
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 AuthorizationManagementClientConfiguration(AzureConfiguration):
17+
"""Configuration for AuthorizationManagementClient
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(AuthorizationManagementClientConfiguration, 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-authorization/{}'.format(VERSION))
45+
self.add_user_agent('Azure-SDK-For-Python')
46+
47+
self.credentials = credentials
48+
self.subscription_id = subscription_id

0 commit comments

Comments
 (0)