Skip to content

Commit dafd4ec

Browse files
author
SDKAuto
committed
CodeGen from PR 14560 in Azure/azure-rest-api-specs
Merge 5de4c00e98f1308ecd79dca90c41302202bebb29 into 5d011b5
1 parent fd411ac commit dafd4ec

File tree

129 files changed

+26647
-440
lines changed

Some content is hidden

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

129 files changed

+26647
-440
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include _meta.json
12
recursive-include tests *.py *.yaml
23
include *.md
34
include azure/__init__.py
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"autorest": "V2",
3+
"use": "@microsoft.azure/autorest.python@~4.0.71",
4+
"commit": "5870565676a0956e0bd2f05b1918203c2722e0ca",
5+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6+
"autorest_command": "autorest specification/authorization/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk [email protected]/autorest.python@~4.0.71 --version=V2",
7+
"readme": "specification/authorization/resource-manager/readme.md"
8+
}

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

Lines changed: 392 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@
1111

1212
try:
1313
from ._models_py3 import ClassicAdministrator
14+
from ._models_py3 import ErrorAdditionalInfo
15+
from ._models_py3 import ErrorDetail
16+
from ._models_py3 import ErrorResponse, ErrorResponseException
1417
except (SyntaxError, ImportError):
1518
from ._models import ClassicAdministrator
19+
from ._models import ErrorAdditionalInfo
20+
from ._models import ErrorDetail
21+
from ._models import ErrorResponse, ErrorResponseException
1622
from ._paged_models import ClassicAdministratorPaged
1723

1824
__all__ = [
1925
'ClassicAdministrator',
26+
'ErrorAdditionalInfo',
27+
'ErrorDetail',
28+
'ErrorResponse', 'ErrorResponseException',
2029
'ClassicAdministratorPaged',
2130
]

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

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from msrest.serialization import Model
13+
from msrest.exceptions import HttpOperationError
1314

1415

1516
class ClassicAdministrator(Model):
@@ -50,3 +51,108 @@ class CloudError(Model):
5051

5152
_attribute_map = {
5253
}
54+
55+
56+
class ErrorAdditionalInfo(Model):
57+
"""The resource management error additional info.
58+
59+
Variables are only populated by the server, and will be ignored when
60+
sending a request.
61+
62+
:ivar type: The additional info type.
63+
:vartype type: str
64+
:ivar info: The additional info.
65+
:vartype info: object
66+
"""
67+
68+
_validation = {
69+
'type': {'readonly': True},
70+
'info': {'readonly': True},
71+
}
72+
73+
_attribute_map = {
74+
'type': {'key': 'type', 'type': 'str'},
75+
'info': {'key': 'info', 'type': 'object'},
76+
}
77+
78+
def __init__(self, **kwargs):
79+
super(ErrorAdditionalInfo, self).__init__(**kwargs)
80+
self.type = None
81+
self.info = None
82+
83+
84+
class ErrorDetail(Model):
85+
"""The error detail.
86+
87+
Variables are only populated by the server, and will be ignored when
88+
sending a request.
89+
90+
:ivar code: The error code.
91+
:vartype code: str
92+
:ivar message: The error message.
93+
:vartype message: str
94+
:ivar target: The error target.
95+
:vartype target: str
96+
:ivar details: The error details.
97+
:vartype details:
98+
list[~azure.mgmt.authorization.v2015_06_01.models.ErrorDetail]
99+
:ivar additional_info: The error additional info.
100+
:vartype additional_info:
101+
list[~azure.mgmt.authorization.v2015_06_01.models.ErrorAdditionalInfo]
102+
"""
103+
104+
_validation = {
105+
'code': {'readonly': True},
106+
'message': {'readonly': True},
107+
'target': {'readonly': True},
108+
'details': {'readonly': True},
109+
'additional_info': {'readonly': True},
110+
}
111+
112+
_attribute_map = {
113+
'code': {'key': 'code', 'type': 'str'},
114+
'message': {'key': 'message', 'type': 'str'},
115+
'target': {'key': 'target', 'type': 'str'},
116+
'details': {'key': 'details', 'type': '[ErrorDetail]'},
117+
'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'},
118+
}
119+
120+
def __init__(self, **kwargs):
121+
super(ErrorDetail, self).__init__(**kwargs)
122+
self.code = None
123+
self.message = None
124+
self.target = None
125+
self.details = None
126+
self.additional_info = None
127+
128+
129+
class ErrorResponse(Model):
130+
"""Error response.
131+
132+
Common error response for all Azure Resource Manager APIs to return error
133+
details for failed operations. (This also follows the OData error response
134+
format.).
135+
136+
:param error: The error object.
137+
:type error: ~azure.mgmt.authorization.v2015_06_01.models.ErrorDetail
138+
"""
139+
140+
_attribute_map = {
141+
'error': {'key': 'error', 'type': 'ErrorDetail'},
142+
}
143+
144+
def __init__(self, **kwargs):
145+
super(ErrorResponse, self).__init__(**kwargs)
146+
self.error = kwargs.get('error', None)
147+
148+
149+
class ErrorResponseException(HttpOperationError):
150+
"""Server responsed with exception of type: 'ErrorResponse'.
151+
152+
:param deserialize: A deserializer
153+
:param response: Server response to be deserialized.
154+
"""
155+
156+
def __init__(self, deserialize, response, *args):
157+
158+
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)

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

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# --------------------------------------------------------------------------
1111

1212
from msrest.serialization import Model
13+
from msrest.exceptions import HttpOperationError
1314

1415

1516
class ClassicAdministrator(Model):
@@ -50,3 +51,108 @@ class CloudError(Model):
5051

5152
_attribute_map = {
5253
}
54+
55+
56+
class ErrorAdditionalInfo(Model):
57+
"""The resource management error additional info.
58+
59+
Variables are only populated by the server, and will be ignored when
60+
sending a request.
61+
62+
:ivar type: The additional info type.
63+
:vartype type: str
64+
:ivar info: The additional info.
65+
:vartype info: object
66+
"""
67+
68+
_validation = {
69+
'type': {'readonly': True},
70+
'info': {'readonly': True},
71+
}
72+
73+
_attribute_map = {
74+
'type': {'key': 'type', 'type': 'str'},
75+
'info': {'key': 'info', 'type': 'object'},
76+
}
77+
78+
def __init__(self, **kwargs) -> None:
79+
super(ErrorAdditionalInfo, self).__init__(**kwargs)
80+
self.type = None
81+
self.info = None
82+
83+
84+
class ErrorDetail(Model):
85+
"""The error detail.
86+
87+
Variables are only populated by the server, and will be ignored when
88+
sending a request.
89+
90+
:ivar code: The error code.
91+
:vartype code: str
92+
:ivar message: The error message.
93+
:vartype message: str
94+
:ivar target: The error target.
95+
:vartype target: str
96+
:ivar details: The error details.
97+
:vartype details:
98+
list[~azure.mgmt.authorization.v2015_06_01.models.ErrorDetail]
99+
:ivar additional_info: The error additional info.
100+
:vartype additional_info:
101+
list[~azure.mgmt.authorization.v2015_06_01.models.ErrorAdditionalInfo]
102+
"""
103+
104+
_validation = {
105+
'code': {'readonly': True},
106+
'message': {'readonly': True},
107+
'target': {'readonly': True},
108+
'details': {'readonly': True},
109+
'additional_info': {'readonly': True},
110+
}
111+
112+
_attribute_map = {
113+
'code': {'key': 'code', 'type': 'str'},
114+
'message': {'key': 'message', 'type': 'str'},
115+
'target': {'key': 'target', 'type': 'str'},
116+
'details': {'key': 'details', 'type': '[ErrorDetail]'},
117+
'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'},
118+
}
119+
120+
def __init__(self, **kwargs) -> None:
121+
super(ErrorDetail, self).__init__(**kwargs)
122+
self.code = None
123+
self.message = None
124+
self.target = None
125+
self.details = None
126+
self.additional_info = None
127+
128+
129+
class ErrorResponse(Model):
130+
"""Error response.
131+
132+
Common error response for all Azure Resource Manager APIs to return error
133+
details for failed operations. (This also follows the OData error response
134+
format.).
135+
136+
:param error: The error object.
137+
:type error: ~azure.mgmt.authorization.v2015_06_01.models.ErrorDetail
138+
"""
139+
140+
_attribute_map = {
141+
'error': {'key': 'error', 'type': 'ErrorDetail'},
142+
}
143+
144+
def __init__(self, *, error=None, **kwargs) -> None:
145+
super(ErrorResponse, self).__init__(**kwargs)
146+
self.error = error
147+
148+
149+
class ErrorResponseException(HttpOperationError):
150+
"""Server responsed with exception of type: 'ErrorResponse'.
151+
152+
:param deserialize: A deserializer
153+
:param response: Server response to be deserialized.
154+
"""
155+
156+
def __init__(self, deserialize, response, *args):
157+
158+
super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)

sdk/authorization/azure-mgmt-authorization/azure/mgmt/authorization/v2015_06_01/operations/_classic_administrators_operations.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import uuid
1313
from msrest.pipeline import ClientRawResponse
14-
from msrestazure.azure_exceptions import CloudError
1514

1615
from .. import models
1716

@@ -52,20 +51,21 @@ def list(
5251
:return: An iterator like instance of ClassicAdministrator
5352
:rtype:
5453
~azure.mgmt.authorization.v2015_06_01.models.ClassicAdministratorPaged[~azure.mgmt.authorization.v2015_06_01.models.ClassicAdministrator]
55-
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
54+
:raises:
55+
:class:`ErrorResponseException<azure.mgmt.authorization.v2015_06_01.models.ErrorResponseException>`
5656
"""
5757
def prepare_request(next_link=None):
5858
if not next_link:
5959
# Construct URL
6060
url = self.list.metadata['url']
6161
path_format_arguments = {
62-
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str')
62+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1)
6363
}
6464
url = self._client.format_url(url, **path_format_arguments)
6565

6666
# Construct parameters
6767
query_parameters = {}
68-
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
68+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1)
6969

7070
else:
7171
url = next_link
@@ -91,9 +91,7 @@ def internal_paging(next_link=None):
9191
response = self._client.send(request, stream=False, **operation_config)
9292

9393
if response.status_code not in [200]:
94-
exp = CloudError(response)
95-
exp.request_id = response.headers.get('x-ms-request-id')
96-
raise exp
94+
raise models.ErrorResponseException(self._deserialize, response)
9795

9896
return response
9997

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
try:
1313
from ._models_py3 import ClassicAdministrator
14+
from ._models_py3 import ErrorAdditionalInfo
15+
from ._models_py3 import ErrorDetail
16+
from ._models_py3 import ErrorResponse, ErrorResponseException
1417
from ._models_py3 import Permission
1518
from ._models_py3 import ProviderOperation
1619
from ._models_py3 import ProviderOperationsMetadata
@@ -24,6 +27,9 @@
2427
from ._models_py3 import RoleDefinitionFilter
2528
except (SyntaxError, ImportError):
2629
from ._models import ClassicAdministrator
30+
from ._models import ErrorAdditionalInfo
31+
from ._models import ErrorDetail
32+
from ._models import ErrorResponse, ErrorResponseException
2733
from ._models import Permission
2834
from ._models import ProviderOperation
2935
from ._models import ProviderOperationsMetadata
@@ -43,6 +49,9 @@
4349

4450
__all__ = [
4551
'ClassicAdministrator',
52+
'ErrorAdditionalInfo',
53+
'ErrorDetail',
54+
'ErrorResponse', 'ErrorResponseException',
4655
'Permission',
4756
'ProviderOperation',
4857
'ProviderOperationsMetadata',

0 commit comments

Comments
 (0)