Skip to content

Commit 5d277ae

Browse files
chenjianfei2017SDK AutomationChenjianfeiAutorestCI
authored
Authoriaztion release 0814 (Azure#13109)
* Generated from 77e263ef8341b9d756874a8015822f11088de88d revise tag of authorization * release authorization * add test * Packaging update of azure-mgmt-authorization Co-authored-by: SDK Automation <[email protected]> Co-authored-by: Chenjianfei <[email protected]> Co-authored-by: Azure SDK Bot <[email protected]>
1 parent c96ce20 commit 5d277ae

19 files changed

+1495
-115
lines changed

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

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

3+
## 0.61.0 (2020-08-10)
4+
5+
**Features**
6+
7+
- Model RoleAssignmentCreateParameters has a new parameter condition
8+
- Model RoleAssignmentCreateParameters has a new parameter description
9+
- Model RoleAssignmentCreateParameters has a new parameter condition_version
10+
- Model RoleAssignment has a new parameter condition
11+
- Model RoleAssignment has a new parameter description
12+
- Model RoleAssignment has a new parameter condition_version
13+
314
## 0.60.0 (2019-06-25)
415

516
**Breaking changes**
Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,21 @@
1-
## Microsoft Azure SDK for Python
1+
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Authorization Management Client Library.
4+
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
5+
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
46

5-
Azure Resource Manager (ARM) is the next generation of management APIs
6-
that replace the old Azure Service Management (ASM).
77

8-
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
8+
# Usage
99

10-
For the older Azure Service Management (ASM) libraries, see
11-
[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy)
12-
library.
13-
14-
For a more complete set of Azure libraries, see the
15-
[azure sdk python release](https://aka.ms/azsdk/python/all).
16-
17-
## Usage
18-
19-
For code examples, see [Authorization
20-
Management](https://docs.microsoft.com/python/api/overview/azure/authorization)
10+
For code examples, see [Authorization Management](https://docs.microsoft.com/python/api/overview/azure/authorization)
2111
on docs.microsoft.com.
2212

23-
## Provide Feedback
2413

25-
If you encounter any bugs or have suggestions, please file an issue in
26-
the [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
14+
# Provide Feedback
15+
16+
If you encounter any bugs or have suggestions, please file an issue in the
17+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
2718
section of the project.
2819

29-
![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-authorization%2FREADME.png)
20+
21+
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-authorization%2FREADME.png)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
8383
* 2018-01-01-preview: :mod:`v2018_01_01_preview.models<azure.mgmt.authorization.v2018_01_01_preview.models>`
8484
* 2018-07-01-preview: :mod:`v2018_07_01_preview.models<azure.mgmt.authorization.v2018_07_01_preview.models>`
8585
* 2018-09-01-preview: :mod:`v2018_09_01_preview.models<azure.mgmt.authorization.v2018_09_01_preview.models>`
86+
* 2020-04-01-preview: :mod:`v2020_04_01_preview.models<azure.mgmt.authorization.v2020_04_01_preview.models>`
8687
"""
8788
if api_version == '2015-06-01':
8889
from .v2015_06_01 import models
@@ -99,6 +100,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
99100
elif api_version == '2018-09-01-preview':
100101
from .v2018_09_01_preview import models
101102
return models
103+
elif api_version == '2020-04-01-preview':
104+
from .v2020_04_01_preview import models
105+
return models
102106
raise NotImplementedError("APIVersion {} is not available".format(api_version))
103107

104108
@property
@@ -182,6 +186,7 @@ def role_assignments(self):
182186
* 2015-07-01: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2015_07_01.operations.RoleAssignmentsOperations>`
183187
* 2018-01-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2018_01_01_preview.operations.RoleAssignmentsOperations>`
184188
* 2018-09-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2018_09_01_preview.operations.RoleAssignmentsOperations>`
189+
* 2020-04-01-preview: :class:`RoleAssignmentsOperations<azure.mgmt.authorization.v2020_04_01_preview.operations.RoleAssignmentsOperations>`
185190
"""
186191
api_version = self._get_api_version('role_assignments')
187192
if api_version == '2015-07-01':
@@ -190,6 +195,8 @@ def role_assignments(self):
190195
from .v2018_01_01_preview.operations import RoleAssignmentsOperations as OperationClass
191196
elif api_version == '2018-09-01-preview':
192197
from .v2018_09_01_preview.operations import RoleAssignmentsOperations as OperationClass
198+
elif api_version == '2020-04-01-preview':
199+
from .v2020_04_01_preview.operations import RoleAssignmentsOperations as OperationClass
193200
else:
194201
raise NotImplementedError("APIVersion {} is not available".format(api_version))
195202
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
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,49 @@
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 RoleAssignmentsOperations
17+
from . import models
18+
19+
20+
class AuthorizationManagementClient(SDKClient):
21+
"""Role based access control provides you a way to apply granular level policy administration down to individual resources or resource groups. These operations enable you to manage role assignments. A role assignment grants access to Azure Active Directory users.
22+
23+
:ivar config: Configuration for client.
24+
:vartype config: AuthorizationManagementClientConfiguration
25+
26+
:ivar role_assignments: RoleAssignments operations
27+
:vartype role_assignments: azure.mgmt.authorization.v2020_04_01_preview.operations.RoleAssignmentsOperations
28+
29+
:param credentials: Credentials needed for the client to connect to Azure.
30+
:type credentials: :mod:`A msrestazure Credentials
31+
object<msrestazure.azure_active_directory>`
32+
:param subscription_id: The ID of the target subscription.
33+
:type subscription_id: str
34+
:param str base_url: Service URL
35+
"""
36+
37+
def __init__(
38+
self, credentials, subscription_id, base_url=None):
39+
40+
self.config = AuthorizationManagementClientConfiguration(credentials, subscription_id, base_url)
41+
super(AuthorizationManagementClient, self).__init__(self.config.credentials, self.config)
42+
43+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
44+
self.api_version = '2020-04-01-preview'
45+
self._serialize = Serializer(client_models)
46+
self._deserialize = Deserializer(client_models)
47+
48+
self.role_assignments = RoleAssignmentsOperations(
49+
self._client, self.config, self._serialize, self._deserialize)
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 RoleAssignment
14+
from ._models_py3 import RoleAssignmentCreateParameters
15+
from ._models_py3 import RoleAssignmentFilter
16+
except (SyntaxError, ImportError):
17+
from ._models import RoleAssignment
18+
from ._models import RoleAssignmentCreateParameters
19+
from ._models import RoleAssignmentFilter
20+
from ._paged_models import RoleAssignmentPaged
21+
from ._authorization_management_client_enums import (
22+
PrincipalType,
23+
)
24+
25+
__all__ = [
26+
'RoleAssignment',
27+
'RoleAssignmentCreateParameters',
28+
'RoleAssignmentFilter',
29+
'RoleAssignmentPaged',
30+
'PrincipalType',
31+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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 enum import Enum
13+
14+
15+
class PrincipalType(str, Enum):
16+
17+
user = "User"
18+
group = "Group"
19+
service_principal = "ServicePrincipal"
20+
unknown = "Unknown"
21+
directory_role_template = "DirectoryRoleTemplate"
22+
foreign_group = "ForeignGroup"
23+
application = "Application"
24+
msi = "MSI"
25+
directory_object_or_group = "DirectoryObjectOrGroup"
26+
everyone = "Everyone"

0 commit comments

Comments
 (0)