Skip to content

Commit

Permalink
GA advisor track2 sdk (Azure#15900)
Browse files Browse the repository at this point in the history
  • Loading branch information
00Kai0 authored and rakshith91 committed Jan 8, 2021
1 parent 81b9d4b commit 51c79e5
Show file tree
Hide file tree
Showing 17 changed files with 150 additions and 230 deletions.
6 changes: 6 additions & 0 deletions sdk/advisor/azure-mgmt-advisor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 9.0.0 (2020-12-22)

**Features**

- Model SuppressionContract has a new parameter expiration_time_stamp

## 9.0.0b1 (2020-11-03)

This is beta preview version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "9.0.0b1"
VERSION = "9.0.0"
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class ConfigurationsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list_by_subscription(
self,
**kwargs
) -> AsyncIterable["models.ConfigurationListResult"]:
) -> AsyncIterable["_models.ConfigurationListResult"]:
"""Retrieve Azure Advisor configurations.
Retrieve Azure Advisor configurations and also retrieve configurations of contained resource
Expand All @@ -55,7 +55,7 @@ def list_by_subscription(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.advisor.models.ConfigurationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -100,7 +100,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ArmErrorResponse, response)
error = self._deserialize(_models.ArmErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -113,10 +113,10 @@ async def get_next(next_link=None):

async def create_in_subscription(
self,
configuration_name: Union[str, "models.ConfigurationName"],
config_contract: "models.ConfigData",
configuration_name: Union[str, "_models.ConfigurationName"],
config_contract: "_models.ConfigData",
**kwargs
) -> "models.ConfigData":
) -> "_models.ConfigData":
"""Create/Overwrite Azure Advisor configuration.
Create/Overwrite Azure Advisor configuration and also delete all configurations of contained
Expand All @@ -131,7 +131,7 @@ async def create_in_subscription(
:rtype: ~azure.mgmt.advisor.models.ConfigData
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigData"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigData"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -166,7 +166,7 @@ async def create_in_subscription(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ArmErrorResponse, response)
error = self._deserialize(_models.ArmErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ConfigData', pipeline_response)
Expand All @@ -181,7 +181,7 @@ def list_by_resource_group(
self,
resource_group: str,
**kwargs
) -> AsyncIterable["models.ConfigurationListResult"]:
) -> AsyncIterable["_models.ConfigurationListResult"]:
"""Retrieve Azure Advisor configurations.
Retrieve Azure Advisor configurations.
Expand All @@ -193,7 +193,7 @@ def list_by_resource_group(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.advisor.models.ConfigurationListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigurationListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -239,7 +239,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.ArmErrorResponse, response)
error = self._deserialize(_models.ArmErrorResponse, response)
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

Expand All @@ -252,11 +252,11 @@ async def get_next(next_link=None):

async def create_in_resource_group(
self,
configuration_name: Union[str, "models.ConfigurationName"],
configuration_name: Union[str, "_models.ConfigurationName"],
resource_group: str,
config_contract: "models.ConfigData",
config_contract: "_models.ConfigData",
**kwargs
) -> "models.ConfigData":
) -> "_models.ConfigData":
"""Create/Overwrite Azure Advisor configuration.
Create/Overwrite Azure Advisor configuration.
Expand All @@ -272,7 +272,7 @@ async def create_in_resource_group(
:rtype: ~azure.mgmt.advisor.models.ConfigData
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ConfigData"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigData"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -308,7 +308,7 @@ async def create_in_resource_group(

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize(models.ArmErrorResponse, response)
error = self._deserialize(_models.ArmErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('ConfigData', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class Operations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -44,15 +44,15 @@ def __init__(self, client, config, serializer, deserializer) -> None:
def list(
self,
**kwargs
) -> AsyncIterable["models.OperationEntityListResult"]:
) -> AsyncIterable["_models.OperationEntityListResult"]:
"""Lists all the available Advisor REST API operations.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either OperationEntityListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.advisor.models.OperationEntityListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationEntityListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationEntityListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class RecommendationMetadataOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -45,7 +45,7 @@ async def get(
self,
name: str,
**kwargs
) -> Union["models.MetadataEntity", "models.ARMErrorResponseBody"]:
) -> Union["_models.MetadataEntity", "_models.ARMErrorResponseBody"]:
"""Gets the metadata entity.
Gets the metadata entity.
Expand All @@ -57,7 +57,7 @@ async def get(
:rtype: ~azure.mgmt.advisor.models.MetadataEntity or ~azure.mgmt.advisor.models.ARMErrorResponseBody
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType[Union["models.MetadataEntity", "models.ARMErrorResponseBody"]]
cls = kwargs.pop('cls', None) # type: ClsType[Union["_models.MetadataEntity", "_models.ARMErrorResponseBody"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -103,7 +103,7 @@ async def get(
def list(
self,
**kwargs
) -> AsyncIterable["models.MetadataEntityListResult"]:
) -> AsyncIterable["_models.MetadataEntityListResult"]:
"""Gets the list of metadata entities.
Gets the list of metadata entities.
Expand All @@ -113,7 +113,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.advisor.models.MetadataEntityListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.MetadataEntityListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.MetadataEntityListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core.exceptions import ARMErrorFormat

from ... import models
from ... import models as _models

T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
Expand All @@ -33,7 +33,7 @@ class RecommendationsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand Down Expand Up @@ -150,7 +150,7 @@ def list(
top: Optional[int] = None,
skip_token: Optional[str] = None,
**kwargs
) -> AsyncIterable["models.ResourceRecommendationBaseListResult"]:
) -> AsyncIterable["_models.ResourceRecommendationBaseListResult"]:
"""Obtains cached recommendations for a subscription. The recommendations are generated or
computed by invoking generateRecommendations.
Expand All @@ -169,7 +169,7 @@ def list(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.advisor.models.ResourceRecommendationBaseListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceRecommendationBaseListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceRecommendationBaseListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -235,7 +235,7 @@ async def get(
resource_uri: str,
recommendation_id: str,
**kwargs
) -> "models.ResourceRecommendationBase":
) -> "_models.ResourceRecommendationBase":
"""Obtains details of a cached recommendation.
:param resource_uri: The fully qualified Azure Resource Manager identifier of the resource to
Expand All @@ -248,7 +248,7 @@ async def get(
:rtype: ~azure.mgmt.advisor.models.ResourceRecommendationBase
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.ResourceRecommendationBase"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceRecommendationBase"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down
Loading

0 comments on commit 51c79e5

Please sign in to comment.