Skip to content

Commit

Permalink
[AutoPR advisor/resource-manager] Swaggerfix (#2721)
Browse files Browse the repository at this point in the history
* Generated from 8f325f540f597ae184379bed0676e8cdfd42039f

Add C# settings

* Generated from a3db9ba57ede1858830cee525cf8f2bb9124e143

Remove wrong tag
  • Loading branch information
AutorestCI authored Jun 28, 2018
1 parent 412e27e commit d0789c0
Show file tree
Hide file tree
Showing 25 changed files with 523 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import ServiceClient
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(
self.subscription_id = subscription_id


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

self.config = AdvisorManagementClientConfiguration(credentials, subscription_id, base_url)
self._client = ServiceClient(self.config.credentials, self.config)
super(AdvisorManagementClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2017-04-19'
Expand Down
29 changes: 20 additions & 9 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,26 @@
# regenerated.
# --------------------------------------------------------------------------

from .config_data_properties import ConfigDataProperties
from .config_data import ConfigData
from .arm_error_response_body import ARMErrorResponseBody
from .short_description import ShortDescription
from .resource_recommendation_base import ResourceRecommendationBase
from .resource import Resource
from .operation_display_info import OperationDisplayInfo
from .operation_entity import OperationEntity
from .suppression_contract import SuppressionContract
try:
from .config_data_properties_py3 import ConfigDataProperties
from .config_data_py3 import ConfigData
from .arm_error_response_body_py3 import ARMErrorResponseBody
from .short_description_py3 import ShortDescription
from .resource_recommendation_base_py3 import ResourceRecommendationBase
from .resource_py3 import Resource
from .operation_display_info_py3 import OperationDisplayInfo
from .operation_entity_py3 import OperationEntity
from .suppression_contract_py3 import SuppressionContract
except (SyntaxError, ImportError):
from .config_data_properties import ConfigDataProperties
from .config_data import ConfigData
from .arm_error_response_body import ARMErrorResponseBody
from .short_description import ShortDescription
from .resource_recommendation_base import ResourceRecommendationBase
from .resource import Resource
from .operation_display_info import OperationDisplayInfo
from .operation_entity import OperationEntity
from .suppression_contract import SuppressionContract
from .config_data_paged import ConfigDataPaged
from .resource_recommendation_base_paged import ResourceRecommendationBasePaged
from .operation_entity_paged import OperationEntityPaged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
from enum import Enum


class Category(Enum):
class Category(str, Enum):

high_availability = "HighAvailability"
security = "Security"
performance = "Performance"
cost = "Cost"


class Impact(Enum):
class Impact(str, Enum):

high = "High"
medium = "Medium"
low = "Low"


class Risk(Enum):
class Risk(str, Enum):

error = "Error"
warning = "Warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ARMErrorResponseBody(Model):
'code': {'key': 'code', 'type': 'str'},
}

def __init__(self, message=None, code=None):
super(ARMErrorResponseBody, self).__init__()
self.message = message
self.code = code
def __init__(self, **kwargs):
super(ARMErrorResponseBody, self).__init__(**kwargs)
self.message = kwargs.get('message', None)
self.code = kwargs.get('code', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ARMErrorResponseBody(Model):
"""ARM error response body.
:param message: Gets or sets the string that describes the error in detail
and provides debugging information.
:type message: str
:param code: Gets or sets the string that can be used to programmatically
identify the error.
:type code: str
"""

_attribute_map = {
'message': {'key': 'message', 'type': 'str'},
'code': {'key': 'code', 'type': 'str'},
}

def __init__(self, *, message: str=None, code: str=None, **kwargs) -> None:
super(ARMErrorResponseBody, self).__init__(**kwargs)
self.message = message
self.code = code
12 changes: 6 additions & 6 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class ConfigData(Model):
'properties': {'key': 'properties', 'type': 'ConfigDataProperties'},
}

def __init__(self, id=None, type=None, name=None, properties=None):
super(ConfigData, self).__init__()
self.id = id
self.type = type
self.name = name
self.properties = properties
def __init__(self, **kwargs):
super(ConfigData, self).__init__(**kwargs)
self.id = kwargs.get('id', None)
self.type = kwargs.get('type', None)
self.name = kwargs.get('name', None)
self.properties = kwargs.get('properties', None)
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class ConfigDataProperties(Model):
'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'},
}

def __init__(self, additional_properties=None, exclude=None, low_cpu_threshold=None):
super(ConfigDataProperties, self).__init__()
self.additional_properties = additional_properties
self.exclude = exclude
self.low_cpu_threshold = low_cpu_threshold
def __init__(self, **kwargs):
super(ConfigDataProperties, self).__init__(**kwargs)
self.additional_properties = kwargs.get('additional_properties', None)
self.exclude = kwargs.get('exclude', None)
self.low_cpu_threshold = kwargs.get('low_cpu_threshold', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ConfigDataProperties(Model):
"""The list of property name/value pairs.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param exclude: Exclude the resource from Advisor evaluations. Valid
values: False (default) or True.
:type exclude: bool
:param low_cpu_threshold: Minimum percentage threshold for Advisor low CPU
utilization evaluation. Valid only for subscriptions. Valid values: 5
(default), 10, 15 or 20.
:type low_cpu_threshold: str
"""

_attribute_map = {
'additional_properties': {'key': '', 'type': '{object}'},
'exclude': {'key': 'exclude', 'type': 'bool'},
'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'},
}

def __init__(self, *, additional_properties=None, exclude: bool=None, low_cpu_threshold: str=None, **kwargs) -> None:
super(ConfigDataProperties, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.exclude = exclude
self.low_cpu_threshold = low_cpu_threshold
40 changes: 40 additions & 0 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ConfigData(Model):
"""The Advisor configuration data structure.
:param id: The resource Id of the configuration resource.
:type id: str
:param type: The type of the configuration resource.
:type type: str
:param name: The name of the configuration resource.
:type name: str
:param properties: The list of property name/value pairs.
:type properties: ~azure.mgmt.advisor.models.ConfigDataProperties
"""

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ConfigDataProperties'},
}

def __init__(self, *, id: str=None, type: str=None, name: str=None, properties=None, **kwargs) -> None:
super(ConfigData, self).__init__(**kwargs)
self.id = id
self.type = type
self.name = name
self.properties = properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class OperationDisplayInfo(Model):
'resource': {'key': 'resource', 'type': 'str'},
}

def __init__(self, description=None, operation=None, provider=None, resource=None):
super(OperationDisplayInfo, self).__init__()
self.description = description
self.operation = operation
self.provider = provider
self.resource = resource
def __init__(self, **kwargs):
super(OperationDisplayInfo, self).__init__(**kwargs)
self.description = kwargs.get('description', None)
self.operation = kwargs.get('operation', None)
self.provider = kwargs.get('provider', None)
self.resource = kwargs.get('resource', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class OperationDisplayInfo(Model):
"""The operation supported by Advisor.
:param description: The description of the operation.
:type description: str
:param operation: The action that users can perform, based on their
permission level.
:type operation: str
:param provider: Service provider: Microsoft Advisor.
:type provider: str
:param resource: Resource on which the operation is performed.
:type resource: str
"""

_attribute_map = {
'description': {'key': 'description', 'type': 'str'},
'operation': {'key': 'operation', 'type': 'str'},
'provider': {'key': 'provider', 'type': 'str'},
'resource': {'key': 'resource', 'type': 'str'},
}

def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None:
super(OperationDisplayInfo, self).__init__(**kwargs)
self.description = description
self.operation = operation
self.provider = provider
self.resource = resource
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class OperationEntity(Model):
'display': {'key': 'display', 'type': 'OperationDisplayInfo'},
}

def __init__(self, name=None, display=None):
super(OperationEntity, self).__init__()
self.name = name
self.display = display
def __init__(self, **kwargs):
super(OperationEntity, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.display = kwargs.get('display', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class OperationEntity(Model):
"""The operation supported by Advisor.
:param name: Operation name: {provider}/{resource}/{operation}.
:type name: str
:param display: The operation supported by Advisor.
:type display: ~azure.mgmt.advisor.models.OperationDisplayInfo
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'display': {'key': 'display', 'type': 'OperationDisplayInfo'},
}

def __init__(self, *, name: str=None, display=None, **kwargs) -> None:
super(OperationEntity, self).__init__(**kwargs)
self.name = name
self.display = display
4 changes: 2 additions & 2 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class Resource(Model):
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self):
super(Resource, self).__init__()
def __init__(self, **kwargs):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None
Loading

0 comments on commit d0789c0

Please sign in to comment.