Skip to content

Commit

Permalink
Advisor with Autorest.Python 2.1.34
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel committed Jan 17, 2018
1 parent 974e3df commit 61b546f
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ def __init__(
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not isinstance(subscription_id, str):
raise TypeError("Parameter 'subscription_id' must be str.")
if not base_url:
base_url = 'https://management.azure.com'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ class ARMErrorResponseBody(Model):
}

def __init__(self, message=None, code=None):
super(ARMErrorResponseBody, self).__init__()
self.message = message
self.code = code
4 changes: 2 additions & 2 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class ConfigData(Model):
:param name: The name of the configuration resource.
:type name: str
:param properties: The list of property name/value pairs.
:type properties: :class:`ConfigDataProperties
<azure.mgmt.advisor.models.ConfigDataProperties>`
:type properties: ~azure.mgmt.advisor.models.ConfigDataProperties
"""

_attribute_map = {
Expand All @@ -34,6 +33,7 @@ class ConfigData(Model):
}

def __init__(self, id=None, type=None, name=None, properties=None):
super(ConfigData, self).__init__()
self.id = id
self.type = type
self.name = name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ConfigDataProperties(Model):
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict
:type additional_properties: dict[str, object]
:param exclude: Exclude the resource from Advisor evaluations. Valid
values: False (default) or True.
:type exclude: bool
Expand All @@ -34,6 +34,7 @@ class ConfigDataProperties(Model):
}

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
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class ConfigurationListResult(Model):
"""The list of Advisor configurations.
:param value: The list of configurations.
:type value: list of :class:`ConfigData
<azure.mgmt.advisor.models.ConfigData>`
:type value: list[~azure.mgmt.advisor.models.ConfigData]
:param next_link: The link used to get the next page of configurations.
:type next_link: str
"""
Expand All @@ -28,5 +27,6 @@ class ConfigurationListResult(Model):
}

def __init__(self, value=None, next_link=None):
super(ConfigurationListResult, self).__init__()
self.value = value
self.next_link = next_link
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class OperationDisplayInfo(Model):
}

def __init__(self, description=None, operation=None, provider=None, resource=None):
super(OperationDisplayInfo, self).__init__()
self.description = description
self.operation = operation
self.provider = provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class OperationEntity(Model):
:param name: Operation name: {provider}/{resource}/{operation}.
:type name: str
:param display: The operation supported by Advisor.
:type display: :class:`OperationDisplayInfo
<azure.mgmt.advisor.models.OperationDisplayInfo>`
:type display: ~azure.mgmt.advisor.models.OperationDisplayInfo
"""

_attribute_map = {
Expand All @@ -28,5 +27,6 @@ class OperationEntity(Model):
}

def __init__(self, name=None, display=None):
super(OperationEntity, self).__init__()
self.name = name
self.display = display
1 change: 1 addition & 0 deletions azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Resource(Model):
}

def __init__(self):
super(Resource, self).__init__()
self.id = None
self.name = None
self.type = None
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ class ResourceRecommendationBase(Resource):
:vartype type: str
:param category: The category of the recommendation. Possible values
include: 'HighAvailability', 'Security', 'Performance', 'Cost'
:type category: str or :class:`Category
<azure.mgmt.advisor.models.Category>`
:type category: str or ~azure.mgmt.advisor.models.Category
:param impact: The business impact of the recommendation. Possible values
include: 'High', 'Medium', 'Low'
:type impact: str or :class:`Impact <azure.mgmt.advisor.models.Impact>`
:type impact: str or ~azure.mgmt.advisor.models.Impact
:param impacted_field: The resource type identified by Advisor.
:type impacted_field: str
:param impacted_value: The resource identified by Advisor.
Expand All @@ -39,18 +38,17 @@ class ResourceRecommendationBase(Resource):
validity of the recommendation.
:type last_updated: datetime
:param metadata: The recommendation metadata.
:type metadata: dict
:type metadata: dict[str, object]
:param recommendation_type_id: The recommendation-type GUID.
:type recommendation_type_id: str
:param risk: The potential risk of not implementing the recommendation.
Possible values include: 'Error', 'Warning', 'None'
:type risk: str or :class:`Risk <azure.mgmt.advisor.models.Risk>`
:type risk: str or ~azure.mgmt.advisor.models.Risk
:param short_description: A summary of the recommendation.
:type short_description: :class:`ShortDescription
<azure.mgmt.advisor.models.ShortDescription>`
:type short_description: ~azure.mgmt.advisor.models.ShortDescription
:param suppression_ids: The list of snoozed and dismissed rules for the
recommendation.
:type suppression_ids: list of str
:type suppression_ids: list[str]
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ class ShortDescription(Model):
}

def __init__(self, problem=None, solution=None):
super(ShortDescription, self).__init__()
self.problem = problem
self.solution = solution
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ConfigurationsOperations(object):
:ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19".
"""

models = models

def __init__(self, client, config, serializer, deserializer):

self._client = client
Expand All @@ -47,13 +49,9 @@ def list_by_subscription(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: :class:`ConfigurationListResult
<azure.mgmt.advisor.models.ConfigurationListResult>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: :class:`ConfigurationListResult
<azure.mgmt.advisor.models.ConfigurationListResult>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:return: ConfigurationListResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.advisor.models.ConfigurationListResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -79,7 +77,7 @@ def list_by_subscription(

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -106,20 +104,15 @@ def create_in_subscription(
:param config_contract: The Azure Advisor configuration data
structure.
:type config_contract: :class:`ConfigData
<azure.mgmt.advisor.models.ConfigData>`
:type config_contract: ~azure.mgmt.advisor.models.ConfigData
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: :class:`ARMErrorResponseBody
<azure.mgmt.advisor.models.ARMErrorResponseBody>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: :class:`ARMErrorResponseBody
<azure.mgmt.advisor.models.ARMErrorResponseBody>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:return: ARMErrorResponseBody or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.advisor.models.ARMErrorResponseBody or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -149,7 +142,7 @@ def create_in_subscription(
# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [204, 400]:
exp = CloudError(response)
Expand Down Expand Up @@ -178,13 +171,9 @@ def list_by_resource_group(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: :class:`ConfigurationListResult
<azure.mgmt.advisor.models.ConfigurationListResult>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: :class:`ConfigurationListResult
<azure.mgmt.advisor.models.ConfigurationListResult>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:return: ConfigurationListResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.advisor.models.ConfigurationListResult or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand All @@ -211,7 +200,7 @@ def list_by_resource_group(

# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, **operation_config)
response = self._client.send(request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand All @@ -235,22 +224,17 @@ def create_in_resource_group(
:param config_contract: The Azure Advisor configuration data
structure.
:type config_contract: :class:`ConfigData
<azure.mgmt.advisor.models.ConfigData>`
:type config_contract: ~azure.mgmt.advisor.models.ConfigData
:param resource_group: The name of the Azure resource group.
:type resource_group: str
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: :class:`ARMErrorResponseBody
<azure.mgmt.advisor.models.ARMErrorResponseBody>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>` if
raw=true
:rtype: :class:`ARMErrorResponseBody
<azure.mgmt.advisor.models.ARMErrorResponseBody>` or
:class:`ClientRawResponse<msrest.pipeline.ClientRawResponse>`
:return: ARMErrorResponseBody or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.advisor.models.ARMErrorResponseBody or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -281,7 +265,7 @@ def create_in_resource_group(
# Construct and send request
request = self._client.put(url, query_parameters)
response = self._client.send(
request, header_parameters, body_content, **operation_config)
request, header_parameters, body_content, stream=False, **operation_config)

if response.status_code not in [204, 400]:
exp = CloudError(response)
Expand Down
11 changes: 6 additions & 5 deletions azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Operations(object):
:ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19".
"""

models = models

def __init__(self, client, config, serializer, deserializer):

self._client = client
Expand All @@ -44,10 +46,9 @@ def list(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
:return: An iterator like instance of :class:`OperationEntity
<azure.mgmt.advisor.models.OperationEntity>`
:rtype: :class:`OperationEntityPaged
<azure.mgmt.advisor.models.OperationEntityPaged>`
:return: An iterator like instance of OperationEntity
:rtype:
~azure.mgmt.advisor.models.OperationEntityPaged[~azure.mgmt.advisor.models.OperationEntity]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
def internal_paging(next_link=None, raw=False):
Expand Down Expand Up @@ -77,7 +78,7 @@ def internal_paging(next_link=None, raw=False):
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(
request, header_parameters, **operation_config)
request, header_parameters, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
Expand Down
Loading

0 comments on commit 61b546f

Please sign in to comment.