Skip to content

Commit

Permalink
GA cognitiveservices track2 sdk (Azure#15901)
Browse files Browse the repository at this point in the history
  • Loading branch information
00Kai0 authored and rakshith91 committed Jan 8, 2021
1 parent 51c79e5 commit ffb1960
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 183 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 11.0.0 (2020-12-22)

**Features**

- Model CognitiveServicesAccountProperties has a new parameter date_created

## 11.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 = "11.0.0b1"
VERSION = "11.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 AccountsOperations:
:param deserializer: An object model deserializer.
"""

models = models
models = _models

def __init__(self, client, config, serializer, deserializer) -> None:
self._client = client
Expand All @@ -45,9 +45,9 @@ async def create(
self,
resource_group_name: str,
account_name: str,
account: "models.CognitiveServicesAccount",
account: "_models.CognitiveServicesAccount",
**kwargs
) -> "models.CognitiveServicesAccount":
) -> "_models.CognitiveServicesAccount":
"""Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds
the keys for developer to access intelligent APIs. It's also the resource type for billing.
Expand All @@ -62,7 +62,7 @@ async def create(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccount"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccount"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -98,7 +98,7 @@ async def create(

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

if response.status_code == 200:
Expand All @@ -120,9 +120,9 @@ async def update(
self,
resource_group_name: str,
account_name: str,
account: "models.CognitiveServicesAccount",
account: "_models.CognitiveServicesAccount",
**kwargs
) -> "models.CognitiveServicesAccount":
) -> "_models.CognitiveServicesAccount":
"""Updates a Cognitive Services account.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -136,7 +136,7 @@ async def update(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccount"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccount"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -172,7 +172,7 @@ async def update(

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

if response.status_code == 200:
Expand Down Expand Up @@ -235,7 +235,7 @@ async def delete(

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

if cls:
Expand All @@ -248,7 +248,7 @@ async def get_properties(
resource_group_name: str,
account_name: str,
**kwargs
) -> "models.CognitiveServicesAccount":
) -> "_models.CognitiveServicesAccount":
"""Returns a Cognitive Services account specified by the parameters.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -260,7 +260,7 @@ async def get_properties(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccount
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccount"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccount"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -291,7 +291,7 @@ async def get_properties(

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

deserialized = self._deserialize('CognitiveServicesAccount', pipeline_response)
Expand All @@ -306,7 +306,7 @@ def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
) -> AsyncIterable["models.CognitiveServicesAccountListResult"]:
) -> AsyncIterable["_models.CognitiveServicesAccountListResult"]:
"""Returns all the resources of a particular type belonging to a resource group.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -316,7 +316,7 @@ def list_by_resource_group(
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccountListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccountListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -362,7 +362,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.Error, response)
error = self._deserialize(_models.Error, 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 @@ -376,15 +376,15 @@ async def get_next(next_link=None):
def list(
self,
**kwargs
) -> AsyncIterable["models.CognitiveServicesAccountListResult"]:
) -> AsyncIterable["_models.CognitiveServicesAccountListResult"]:
"""Returns all the resources of a particular type belonging to a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either CognitiveServicesAccountListResult or the result of cls(response)
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccountListResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccountListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -429,7 +429,7 @@ async def get_next(next_link=None):
response = pipeline_response.http_response

if response.status_code not in [200]:
error = self._deserialize(models.Error, response)
error = self._deserialize(_models.Error, 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 @@ -445,7 +445,7 @@ async def list_keys(
resource_group_name: str,
account_name: str,
**kwargs
) -> "models.CognitiveServicesAccountKeys":
) -> "_models.CognitiveServicesAccountKeys":
"""Lists the account keys for the specified Cognitive Services account.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -457,7 +457,7 @@ async def list_keys(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountKeys
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccountKeys"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccountKeys"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -488,7 +488,7 @@ async def list_keys(

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

deserialized = self._deserialize('CognitiveServicesAccountKeys', pipeline_response)
Expand All @@ -503,9 +503,9 @@ async def regenerate_key(
self,
resource_group_name: str,
account_name: str,
key_name: Union[str, "models.KeyName"],
key_name: Union[str, "_models.KeyName"],
**kwargs
) -> "models.CognitiveServicesAccountKeys":
) -> "_models.CognitiveServicesAccountKeys":
"""Regenerates the specified account key for the specified Cognitive Services account.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -519,13 +519,13 @@ async def regenerate_key(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountKeys
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccountKeys"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccountKeys"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_parameters = models.RegenerateKeyParameters(key_name=key_name)
_parameters = _models.RegenerateKeyParameters(key_name=key_name)
api_version = "2017-04-18"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
Expand Down Expand Up @@ -557,7 +557,7 @@ async def regenerate_key(

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

deserialized = self._deserialize('CognitiveServicesAccountKeys', pipeline_response)
Expand All @@ -573,7 +573,7 @@ async def list_skus(
resource_group_name: str,
account_name: str,
**kwargs
) -> "models.CognitiveServicesAccountEnumerateSkusResult":
) -> "_models.CognitiveServicesAccountEnumerateSkusResult":
"""List available SKUs for the requested Cognitive Services account.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -585,7 +585,7 @@ async def list_skus(
:rtype: ~azure.mgmt.cognitiveservices.models.CognitiveServicesAccountEnumerateSkusResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CognitiveServicesAccountEnumerateSkusResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CognitiveServicesAccountEnumerateSkusResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -616,7 +616,7 @@ async def list_skus(

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

deserialized = self._deserialize('CognitiveServicesAccountEnumerateSkusResult', pipeline_response)
Expand All @@ -633,7 +633,7 @@ async def get_usages(
account_name: str,
filter: Optional[str] = None,
**kwargs
) -> "models.UsagesResult":
) -> "_models.UsagesResult":
"""Get usages for the requested Cognitive Services account.
:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -648,7 +648,7 @@ async def get_usages(
:rtype: ~azure.mgmt.cognitiveservices.models.UsagesResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.UsagesResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.UsagesResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -681,7 +681,7 @@ async def get_usages(

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

deserialized = self._deserialize('UsagesResult', pipeline_response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,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 @@ -27,7 +27,7 @@ async def check_sku_availability(
kind: str,
type: str,
**kwargs
) -> "models.CheckSkuAvailabilityResultList":
) -> "_models.CheckSkuAvailabilityResultList":
"""Check available SKUs.
:param location: Resource location.
Expand All @@ -43,13 +43,13 @@ async def check_sku_availability(
:rtype: ~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResultList
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CheckSkuAvailabilityResultList"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckSkuAvailabilityResultList"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_parameters = models.CheckSkuAvailabilityParameter(skus=skus, kind=kind, type=type)
_parameters = _models.CheckSkuAvailabilityParameter(skus=skus, kind=kind, type=type)
api_version = "2017-04-18"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
Expand Down Expand Up @@ -95,7 +95,7 @@ async def check_domain_availability(
subdomain_name: str,
type: str,
**kwargs
) -> "models.CheckDomainAvailabilityResult":
) -> "_models.CheckDomainAvailabilityResult":
"""Check whether a domain is available.
:param subdomain_name: The subdomain name to use.
Expand All @@ -107,13 +107,13 @@ async def check_domain_availability(
:rtype: ~azure.mgmt.cognitiveservices.models.CheckDomainAvailabilityResult
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["models.CheckDomainAvailabilityResult"]
cls = kwargs.pop('cls', None) # type: ClsType["_models.CheckDomainAvailabilityResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))

_parameters = models.CheckDomainAvailabilityParameter(subdomain_name=subdomain_name, type=type)
_parameters = _models.CheckDomainAvailabilityParameter(subdomain_name=subdomain_name, type=type)
api_version = "2017-04-18"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
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 Cognitive Services account 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.cognitiveservices.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
Loading

0 comments on commit ffb1960

Please sign in to comment.