Skip to content

Commit d0789c0

Browse files
authored
[AutoPR advisor/resource-manager] Swaggerfix (#2721)
* Generated from 8f325f540f597ae184379bed0676e8cdfd42039f Add C# settings * Generated from a3db9ba57ede1858830cee525cf8f2bb9124e143 Remove wrong tag
1 parent 412e27e commit d0789c0

25 files changed

+523
-143
lines changed

azure-mgmt-advisor/azure/mgmt/advisor/advisor_management_client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from msrest.service_client import ServiceClient
12+
from msrest.service_client import SDKClient
1313
from msrest import Serializer, Deserializer
1414
from msrestazure import AzureConfiguration
1515
from .version import VERSION
@@ -52,7 +52,7 @@ def __init__(
5252
self.subscription_id = subscription_id
5353

5454

55-
class AdvisorManagementClient(object):
55+
class AdvisorManagementClient(SDKClient):
5656
"""REST APIs for Azure Advisor
5757
5858
:ivar config: Configuration for client.
@@ -79,7 +79,7 @@ def __init__(
7979
self, credentials, subscription_id, base_url=None):
8080

8181
self.config = AdvisorManagementClientConfiguration(credentials, subscription_id, base_url)
82-
self._client = ServiceClient(self.config.credentials, self.config)
82+
super(AdvisorManagementClient, self).__init__(self.config.credentials, self.config)
8383

8484
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8585
self.api_version = '2017-04-19'

azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py

+20-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,26 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .config_data_properties import ConfigDataProperties
13-
from .config_data import ConfigData
14-
from .arm_error_response_body import ARMErrorResponseBody
15-
from .short_description import ShortDescription
16-
from .resource_recommendation_base import ResourceRecommendationBase
17-
from .resource import Resource
18-
from .operation_display_info import OperationDisplayInfo
19-
from .operation_entity import OperationEntity
20-
from .suppression_contract import SuppressionContract
12+
try:
13+
from .config_data_properties_py3 import ConfigDataProperties
14+
from .config_data_py3 import ConfigData
15+
from .arm_error_response_body_py3 import ARMErrorResponseBody
16+
from .short_description_py3 import ShortDescription
17+
from .resource_recommendation_base_py3 import ResourceRecommendationBase
18+
from .resource_py3 import Resource
19+
from .operation_display_info_py3 import OperationDisplayInfo
20+
from .operation_entity_py3 import OperationEntity
21+
from .suppression_contract_py3 import SuppressionContract
22+
except (SyntaxError, ImportError):
23+
from .config_data_properties import ConfigDataProperties
24+
from .config_data import ConfigData
25+
from .arm_error_response_body import ARMErrorResponseBody
26+
from .short_description import ShortDescription
27+
from .resource_recommendation_base import ResourceRecommendationBase
28+
from .resource import Resource
29+
from .operation_display_info import OperationDisplayInfo
30+
from .operation_entity import OperationEntity
31+
from .suppression_contract import SuppressionContract
2132
from .config_data_paged import ConfigDataPaged
2233
from .resource_recommendation_base_paged import ResourceRecommendationBasePaged
2334
from .operation_entity_paged import OperationEntityPaged

azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
from enum import Enum
1313

1414

15-
class Category(Enum):
15+
class Category(str, Enum):
1616

1717
high_availability = "HighAvailability"
1818
security = "Security"
1919
performance = "Performance"
2020
cost = "Cost"
2121

2222

23-
class Impact(Enum):
23+
class Impact(str, Enum):
2424

2525
high = "High"
2626
medium = "Medium"
2727
low = "Low"
2828

2929

30-
class Risk(Enum):
30+
class Risk(str, Enum):
3131

3232
error = "Error"
3333
warning = "Warning"

azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ARMErrorResponseBody(Model):
2828
'code': {'key': 'code', 'type': 'str'},
2929
}
3030

31-
def __init__(self, message=None, code=None):
32-
super(ARMErrorResponseBody, self).__init__()
33-
self.message = message
34-
self.code = code
31+
def __init__(self, **kwargs):
32+
super(ARMErrorResponseBody, self).__init__(**kwargs)
33+
self.message = kwargs.get('message', None)
34+
self.code = kwargs.get('code', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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.serialization import Model
13+
14+
15+
class ARMErrorResponseBody(Model):
16+
"""ARM error response body.
17+
18+
:param message: Gets or sets the string that describes the error in detail
19+
and provides debugging information.
20+
:type message: str
21+
:param code: Gets or sets the string that can be used to programmatically
22+
identify the error.
23+
:type code: str
24+
"""
25+
26+
_attribute_map = {
27+
'message': {'key': 'message', 'type': 'str'},
28+
'code': {'key': 'code', 'type': 'str'},
29+
}
30+
31+
def __init__(self, *, message: str=None, code: str=None, **kwargs) -> None:
32+
super(ARMErrorResponseBody, self).__init__(**kwargs)
33+
self.message = message
34+
self.code = code

azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class ConfigData(Model):
3232
'properties': {'key': 'properties', 'type': 'ConfigDataProperties'},
3333
}
3434

35-
def __init__(self, id=None, type=None, name=None, properties=None):
36-
super(ConfigData, self).__init__()
37-
self.id = id
38-
self.type = type
39-
self.name = name
40-
self.properties = properties
35+
def __init__(self, **kwargs):
36+
super(ConfigData, self).__init__(**kwargs)
37+
self.id = kwargs.get('id', None)
38+
self.type = kwargs.get('type', None)
39+
self.name = kwargs.get('name', None)
40+
self.properties = kwargs.get('properties', None)

azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ class ConfigDataProperties(Model):
3333
'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'},
3434
}
3535

36-
def __init__(self, additional_properties=None, exclude=None, low_cpu_threshold=None):
37-
super(ConfigDataProperties, self).__init__()
38-
self.additional_properties = additional_properties
39-
self.exclude = exclude
40-
self.low_cpu_threshold = low_cpu_threshold
36+
def __init__(self, **kwargs):
37+
super(ConfigDataProperties, self).__init__(**kwargs)
38+
self.additional_properties = kwargs.get('additional_properties', None)
39+
self.exclude = kwargs.get('exclude', None)
40+
self.low_cpu_threshold = kwargs.get('low_cpu_threshold', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.serialization import Model
13+
14+
15+
class ConfigDataProperties(Model):
16+
"""The list of property name/value pairs.
17+
18+
:param additional_properties: Unmatched properties from the message are
19+
deserialized this collection
20+
:type additional_properties: dict[str, object]
21+
:param exclude: Exclude the resource from Advisor evaluations. Valid
22+
values: False (default) or True.
23+
:type exclude: bool
24+
:param low_cpu_threshold: Minimum percentage threshold for Advisor low CPU
25+
utilization evaluation. Valid only for subscriptions. Valid values: 5
26+
(default), 10, 15 or 20.
27+
:type low_cpu_threshold: str
28+
"""
29+
30+
_attribute_map = {
31+
'additional_properties': {'key': '', 'type': '{object}'},
32+
'exclude': {'key': 'exclude', 'type': 'bool'},
33+
'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'},
34+
}
35+
36+
def __init__(self, *, additional_properties=None, exclude: bool=None, low_cpu_threshold: str=None, **kwargs) -> None:
37+
super(ConfigDataProperties, self).__init__(**kwargs)
38+
self.additional_properties = additional_properties
39+
self.exclude = exclude
40+
self.low_cpu_threshold = low_cpu_threshold
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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.serialization import Model
13+
14+
15+
class ConfigData(Model):
16+
"""The Advisor configuration data structure.
17+
18+
:param id: The resource Id of the configuration resource.
19+
:type id: str
20+
:param type: The type of the configuration resource.
21+
:type type: str
22+
:param name: The name of the configuration resource.
23+
:type name: str
24+
:param properties: The list of property name/value pairs.
25+
:type properties: ~azure.mgmt.advisor.models.ConfigDataProperties
26+
"""
27+
28+
_attribute_map = {
29+
'id': {'key': 'id', 'type': 'str'},
30+
'type': {'key': 'type', 'type': 'str'},
31+
'name': {'key': 'name', 'type': 'str'},
32+
'properties': {'key': 'properties', 'type': 'ConfigDataProperties'},
33+
}
34+
35+
def __init__(self, *, id: str=None, type: str=None, name: str=None, properties=None, **kwargs) -> None:
36+
super(ConfigData, self).__init__(**kwargs)
37+
self.id = id
38+
self.type = type
39+
self.name = name
40+
self.properties = properties

azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class OperationDisplayInfo(Model):
3333
'resource': {'key': 'resource', 'type': 'str'},
3434
}
3535

36-
def __init__(self, description=None, operation=None, provider=None, resource=None):
37-
super(OperationDisplayInfo, self).__init__()
38-
self.description = description
39-
self.operation = operation
40-
self.provider = provider
41-
self.resource = resource
36+
def __init__(self, **kwargs):
37+
super(OperationDisplayInfo, self).__init__(**kwargs)
38+
self.description = kwargs.get('description', None)
39+
self.operation = kwargs.get('operation', None)
40+
self.provider = kwargs.get('provider', None)
41+
self.resource = kwargs.get('resource', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.serialization import Model
13+
14+
15+
class OperationDisplayInfo(Model):
16+
"""The operation supported by Advisor.
17+
18+
:param description: The description of the operation.
19+
:type description: str
20+
:param operation: The action that users can perform, based on their
21+
permission level.
22+
:type operation: str
23+
:param provider: Service provider: Microsoft Advisor.
24+
:type provider: str
25+
:param resource: Resource on which the operation is performed.
26+
:type resource: str
27+
"""
28+
29+
_attribute_map = {
30+
'description': {'key': 'description', 'type': 'str'},
31+
'operation': {'key': 'operation', 'type': 'str'},
32+
'provider': {'key': 'provider', 'type': 'str'},
33+
'resource': {'key': 'resource', 'type': 'str'},
34+
}
35+
36+
def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None:
37+
super(OperationDisplayInfo, self).__init__(**kwargs)
38+
self.description = description
39+
self.operation = operation
40+
self.provider = provider
41+
self.resource = resource

azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class OperationEntity(Model):
2626
'display': {'key': 'display', 'type': 'OperationDisplayInfo'},
2727
}
2828

29-
def __init__(self, name=None, display=None):
30-
super(OperationEntity, self).__init__()
31-
self.name = name
32-
self.display = display
29+
def __init__(self, **kwargs):
30+
super(OperationEntity, self).__init__(**kwargs)
31+
self.name = kwargs.get('name', None)
32+
self.display = kwargs.get('display', None)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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.serialization import Model
13+
14+
15+
class OperationEntity(Model):
16+
"""The operation supported by Advisor.
17+
18+
:param name: Operation name: {provider}/{resource}/{operation}.
19+
:type name: str
20+
:param display: The operation supported by Advisor.
21+
:type display: ~azure.mgmt.advisor.models.OperationDisplayInfo
22+
"""
23+
24+
_attribute_map = {
25+
'name': {'key': 'name', 'type': 'str'},
26+
'display': {'key': 'display', 'type': 'OperationDisplayInfo'},
27+
}
28+
29+
def __init__(self, *, name: str=None, display=None, **kwargs) -> None:
30+
super(OperationEntity, self).__init__(**kwargs)
31+
self.name = name
32+
self.display = display

azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Resource(Model):
3838
'type': {'key': 'type', 'type': 'str'},
3939
}
4040

41-
def __init__(self):
42-
super(Resource, self).__init__()
41+
def __init__(self, **kwargs):
42+
super(Resource, self).__init__(**kwargs)
4343
self.id = None
4444
self.name = None
4545
self.type = None

0 commit comments

Comments
 (0)