diff --git a/azure-mgmt-cognitiveservices/HISTORY.rst b/azure-mgmt-cognitiveservices/HISTORY.rst index 6cd5432eb409..35db6bd3e84b 100644 --- a/azure-mgmt-cognitiveservices/HISTORY.rst +++ b/azure-mgmt-cognitiveservices/HISTORY.rst @@ -3,6 +3,45 @@ Release History =============== +3.0.0 (2018-05-21) +++++++++++++++++++ + +**General Breaking changes** + +This version uses a next-generation code generator that *might* introduce breaking changes. + +- Model signatures now use only keyword-argument syntax. All positional arguments must be re-written as keyword-arguments. + To keep auto-completion in most cases, models are now generated for Python 2 and Python 3. Python 3 uses the "*" syntax for keyword-only arguments. +- Enum types now use the "str" mixin (class AzureEnum(str, Enum)) to improve the behavior when unrecognized enum values are encountered. + While this is not a breaking change, the distinctions are important, and are documented here: + https://docs.python.org/3/library/enum.html#others + At a glance: + + - "is" should not be used at all. + - "format" will return the string value, where "%s" string formatting will return `NameOfEnum.stringvalue`. Format syntax should be prefered. + +- New Long Running Operation: + + - Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same. + - Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used. + - The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`, + without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`. + - New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`, + the response of the initial call will be returned without polling. + - `polling` parameter accepts instances of subclasses of `msrest.polling.PollingMethod`. + - `add_done_callback` will no longer raise if called after polling is finished, but will instead execute the callback right away. + +**Features** + +- Add "resource_skus" operation group +- Update SKU list +- Add "accounts.get_usages" operation +- Client class can be used as a context manager to keep the underlying HTTP session open for performance + +**Bugfixes** + +- Compatibility of the sdist with wheel 0.31.0 + 2.0.0 (2017-10-26) ++++++++++++++++++ diff --git a/azure-mgmt-cognitiveservices/README.rst b/azure-mgmt-cognitiveservices/README.rst index b1a303e28a96..0ea301b72b84 100644 --- a/azure-mgmt-cognitiveservices/README.rst +++ b/azure-mgmt-cognitiveservices/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure Cognitive Services Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.3, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. @@ -37,8 +37,8 @@ Usage ===== For code examples, see `Cognitive Services Management -`__ -on readthedocs.org. +`__ +on docs.microsoft.com. Provide Feedback diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py index 4b2c6a87d068..e2c25cc61bb5 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/cognitive_services_management_client.py @@ -9,11 +9,12 @@ # 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 from .operations.accounts_operations import AccountsOperations +from .operations.resource_skus_operations import ResourceSkusOperations from .operations.operations import Operations from .operations.check_sku_availability_operations import CheckSkuAvailabilityOperations from . import models @@ -44,14 +45,14 @@ def __init__( super(CognitiveServicesManagementClientConfiguration, self).__init__(base_url) - self.add_user_agent('cognitiveservicesmanagementclient/{}'.format(VERSION)) + self.add_user_agent('azure-mgmt-cognitiveservices/{}'.format(VERSION)) self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials self.subscription_id = subscription_id -class CognitiveServicesManagementClient(object): +class CognitiveServicesManagementClient(SDKClient): """Cognitive Services Management Client :ivar config: Configuration for client. @@ -59,6 +60,8 @@ class CognitiveServicesManagementClient(object): :ivar accounts: Accounts operations :vartype accounts: azure.mgmt.cognitiveservices.operations.AccountsOperations + :ivar resource_skus: ResourceSkus operations + :vartype resource_skus: azure.mgmt.cognitiveservices.operations.ResourceSkusOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.cognitiveservices.operations.Operations :ivar check_sku_availability: CheckSkuAvailability operations @@ -76,7 +79,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = CognitiveServicesManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(CognitiveServicesManagementClient, 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-18' @@ -85,6 +88,8 @@ def __init__( self.accounts = AccountsOperations( self._client, self.config, self._serialize, self._deserialize) + self.resource_skus = ResourceSkusOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.check_sku_availability = CheckSkuAvailabilityOperations( diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py index 7cf6378c4341..4ae2382d277f 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py @@ -9,22 +9,52 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .cognitive_services_account_create_parameters import CognitiveServicesAccountCreateParameters -from .cognitive_services_account_update_parameters import CognitiveServicesAccountUpdateParameters -from .cognitive_services_account import CognitiveServicesAccount -from .cognitive_services_account_keys import CognitiveServicesAccountKeys -from .regenerate_key_parameters import RegenerateKeyParameters -from .cognitive_services_resource_and_sku import CognitiveServicesResourceAndSku -from .cognitive_services_account_enumerate_skus_result import CognitiveServicesAccountEnumerateSkusResult -from .error_body import ErrorBody -from .error import Error, ErrorException -from .operation_display_info import OperationDisplayInfo -from .operation_entity import OperationEntity -from .check_sku_availability_parameter import CheckSkuAvailabilityParameter -from .check_sku_availability_result import CheckSkuAvailabilityResult -from .check_sku_availability_result_list import CheckSkuAvailabilityResultList +try: + from .sku_py3 import Sku + from .cognitive_services_account_create_parameters_py3 import CognitiveServicesAccountCreateParameters + from .cognitive_services_account_update_parameters_py3 import CognitiveServicesAccountUpdateParameters + from .cognitive_services_account_py3 import CognitiveServicesAccount + from .cognitive_services_account_keys_py3 import CognitiveServicesAccountKeys + from .regenerate_key_parameters_py3 import RegenerateKeyParameters + from .cognitive_services_resource_and_sku_py3 import CognitiveServicesResourceAndSku + from .cognitive_services_account_enumerate_skus_result_py3 import CognitiveServicesAccountEnumerateSkusResult + from .metric_name_py3 import MetricName + from .usage_py3 import Usage + from .usages_result_py3 import UsagesResult + from .error_body_py3 import ErrorBody + from .error_py3 import Error, ErrorException + from .operation_display_info_py3 import OperationDisplayInfo + from .operation_entity_py3 import OperationEntity + from .check_sku_availability_parameter_py3 import CheckSkuAvailabilityParameter + from .check_sku_availability_result_py3 import CheckSkuAvailabilityResult + from .check_sku_availability_result_list_py3 import CheckSkuAvailabilityResultList + from .resource_sku_restriction_info_py3 import ResourceSkuRestrictionInfo + from .resource_sku_restrictions_py3 import ResourceSkuRestrictions + from .resource_sku_py3 import ResourceSku +except (SyntaxError, ImportError): + from .sku import Sku + from .cognitive_services_account_create_parameters import CognitiveServicesAccountCreateParameters + from .cognitive_services_account_update_parameters import CognitiveServicesAccountUpdateParameters + from .cognitive_services_account import CognitiveServicesAccount + from .cognitive_services_account_keys import CognitiveServicesAccountKeys + from .regenerate_key_parameters import RegenerateKeyParameters + from .cognitive_services_resource_and_sku import CognitiveServicesResourceAndSku + from .cognitive_services_account_enumerate_skus_result import CognitiveServicesAccountEnumerateSkusResult + from .metric_name import MetricName + from .usage import Usage + from .usages_result import UsagesResult + from .error_body import ErrorBody + from .error import Error, ErrorException + from .operation_display_info import OperationDisplayInfo + from .operation_entity import OperationEntity + from .check_sku_availability_parameter import CheckSkuAvailabilityParameter + from .check_sku_availability_result import CheckSkuAvailabilityResult + from .check_sku_availability_result_list import CheckSkuAvailabilityResultList + from .resource_sku_restriction_info import ResourceSkuRestrictionInfo + from .resource_sku_restrictions import ResourceSkuRestrictions + from .resource_sku import ResourceSku from .cognitive_services_account_paged import CognitiveServicesAccountPaged +from .resource_sku_paged import ResourceSkuPaged from .operation_entity_paged import OperationEntityPaged from .cognitive_services_management_client_enums import ( SkuName, @@ -32,6 +62,10 @@ Kind, ProvisioningState, KeyName, + UnitType, + QuotaUsageStatus, + ResourceSkuRestrictionsType, + ResourceSkuRestrictionsReasonCode, ) __all__ = [ @@ -43,6 +77,9 @@ 'RegenerateKeyParameters', 'CognitiveServicesResourceAndSku', 'CognitiveServicesAccountEnumerateSkusResult', + 'MetricName', + 'Usage', + 'UsagesResult', 'ErrorBody', 'Error', 'ErrorException', 'OperationDisplayInfo', @@ -50,11 +87,19 @@ 'CheckSkuAvailabilityParameter', 'CheckSkuAvailabilityResult', 'CheckSkuAvailabilityResultList', + 'ResourceSkuRestrictionInfo', + 'ResourceSkuRestrictions', + 'ResourceSku', 'CognitiveServicesAccountPaged', + 'ResourceSkuPaged', 'OperationEntityPaged', 'SkuName', 'SkuTier', 'Kind', 'ProvisioningState', 'KeyName', + 'UnitType', + 'QuotaUsageStatus', + 'ResourceSkuRestrictionsType', + 'ResourceSkuRestrictionsReasonCode', ] diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py index c85269f48567..c476eb892a2b 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter.py @@ -15,15 +15,18 @@ class CheckSkuAvailabilityParameter(Model): """Check SKU availability parameter. - :param skus: The SKU of the resource. + All required parameters must be populated in order to send to Azure. + + :param skus: Required. The SKU of the resource. :type skus: list[str or ~azure.mgmt.cognitiveservices.models.SkuName] - :param kind: The Kind of the resource. Possible values include: - 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech', - 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech', - 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition', - 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' + :param kind: Required. The Kind of the resource. Possible values include: + 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', + 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', + 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training', + 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition', + 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind - :param type: The Type of the resource. + :param type: Required. The Type of the resource. :type type: str """ @@ -39,7 +42,8 @@ class CheckSkuAvailabilityParameter(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, skus, kind, type): - self.skus = skus - self.kind = kind - self.type = type + def __init__(self, **kwargs): + super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) + self.skus = kwargs.get('skus', None) + self.kind = kwargs.get('kind', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py new file mode 100644 index 000000000000..3deeb3c9c009 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_parameter_py3.py @@ -0,0 +1,49 @@ +# 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 CheckSkuAvailabilityParameter(Model): + """Check SKU availability parameter. + + All required parameters must be populated in order to send to Azure. + + :param skus: Required. The SKU of the resource. + :type skus: list[str or ~azure.mgmt.cognitiveservices.models.SkuName] + :param kind: Required. The Kind of the resource. Possible values include: + 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', + 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', + 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training', + 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition', + 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' + :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind + :param type: Required. The Type of the resource. + :type type: str + """ + + _validation = { + 'skus': {'required': True}, + 'kind': {'required': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'skus': {'key': 'skus', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, skus, kind, type: str, **kwargs) -> None: + super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) + self.skus = skus + self.kind = kind + self.type = type diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py index 76d40c6f9fa7..e2ecedea825c 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result.py @@ -16,10 +16,11 @@ class CheckSkuAvailabilityResult(Model): """Check SKU availability result. :param kind: The Kind of the resource. Possible values include: - 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech', - 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', 'CustomSpeech', - 'Emotion', 'Face', 'LUIS', 'Recommendations', 'SpeakerRecognition', - 'Speech', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' + 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', + 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', + 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training', + 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition', + 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind :param type: The Type of the resource. :type type: str @@ -43,10 +44,11 @@ class CheckSkuAvailabilityResult(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, kind=None, type=None, sku_name=None, sku_available=None, reason=None, message=None): - self.kind = kind - self.type = type - self.sku_name = sku_name - self.sku_available = sku_available - self.reason = reason - self.message = message + def __init__(self, **kwargs): + super(CheckSkuAvailabilityResult, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.type = kwargs.get('type', None) + self.sku_name = kwargs.get('sku_name', None) + self.sku_available = kwargs.get('sku_available', None) + self.reason = kwargs.get('reason', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py index 6fc35cfcb251..bb5d7bdb5aba 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list.py @@ -24,5 +24,6 @@ class CheckSkuAvailabilityResultList(Model): 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, } - def __init__(self, value=None): - self.value = value + def __init__(self, **kwargs): + super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py new file mode 100644 index 000000000000..e5c1bee9636e --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_list_py3.py @@ -0,0 +1,29 @@ +# 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 CheckSkuAvailabilityResultList(Model): + """Check SKU availability result list. + + :param value: Check SKU availability result list. + :type value: + list[~azure.mgmt.cognitiveservices.models.CheckSkuAvailabilityResult] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CheckSkuAvailabilityResult]'}, + } + + def __init__(self, *, value=None, **kwargs) -> None: + super(CheckSkuAvailabilityResultList, self).__init__(**kwargs) + self.value = value diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py new file mode 100644 index 000000000000..f7700f27a219 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/check_sku_availability_result_py3.py @@ -0,0 +1,54 @@ +# 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 CheckSkuAvailabilityResult(Model): + """Check SKU availability result. + + :param kind: The Kind of the resource. Possible values include: + 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', + 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', 'ContentModerator', + 'CustomSpeech', 'CustomVision.Prediction', 'CustomVision.Training', + 'Emotion', 'Face', 'LUIS', 'QnAMaker', 'SpeakerRecognition', + 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' + :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind + :param type: The Type of the resource. + :type type: str + :param sku_name: The SKU of Cognitive Services account. Possible values + include: 'F0', 'P0', 'P1', 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6' + :type sku_name: str or ~azure.mgmt.cognitiveservices.models.SkuName + :param sku_available: Indicates the given SKU is available or not. + :type sku_available: bool + :param reason: Reason why the SKU is not available. + :type reason: str + :param message: Additional error message. + :type message: str + """ + + _attribute_map = { + 'kind': {'key': 'kind', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'sku_name': {'key': 'skuName', 'type': 'str'}, + 'sku_available': {'key': 'skuAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, kind=None, type: str=None, sku_name=None, sku_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: + super(CheckSkuAvailabilityResult, self).__init__(**kwargs) + self.kind = kind + self.type = type + self.sku_name = sku_name + self.sku_available = sku_available + self.reason = reason + self.message = message diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py index 19aeee889ac6..148b30e560b5 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account.py @@ -31,7 +31,7 @@ class CognitiveServicesAccount(Model): :vartype name: str :ivar provisioning_state: Gets the status of the cognitive services account at the time the operation was called. Possible values include: - 'Creating', 'ResolvingDNS', 'Succeeded', 'Failed' + 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' :vartype provisioning_state: str or ~azure.mgmt.cognitiveservices.models.ProvisioningState :param endpoint: Endpoint of the created account. @@ -63,7 +63,7 @@ class CognitiveServicesAccount(Model): 'kind': {'key': 'kind', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'ProvisioningState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, @@ -71,15 +71,16 @@ class CognitiveServicesAccount(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, etag=None, kind=None, location=None, endpoint=None, internal_id=None, sku=None, tags=None): - self.etag = etag + def __init__(self, **kwargs): + super(CognitiveServicesAccount, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) self.id = None - self.kind = kind - self.location = location + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) self.name = None self.provisioning_state = None - self.endpoint = endpoint - self.internal_id = internal_id - self.sku = sku - self.tags = tags + self.endpoint = kwargs.get('endpoint', None) + self.internal_id = kwargs.get('internal_id', None) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) self.type = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py index f0c9bcec22d6..c12b8a0eca1e 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters.py @@ -15,20 +15,23 @@ class CognitiveServicesAccountCreateParameters(Model): """The parameters to provide for the account. - :param sku: Required. Gets or sets the SKU of the resource. + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.cognitiveservices.models.Sku - :param kind: Required. Gets or sets the Kind of the resource. Possible - values include: 'Academic', 'Bing.Autosuggest', 'Bing.Search', - 'Bing.Speech', 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', - 'CustomSpeech', 'Emotion', 'Face', 'LUIS', 'Recommendations', - 'SpeakerRecognition', 'Speech', 'SpeechTranslation', 'TextAnalytics', + :param kind: Required. Required. Gets or sets the Kind of the resource. + Possible values include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch', + 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', + 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction', + 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker', + 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind - :param location: Required. Gets or sets the location of the resource. This - will be one of the supported and registered Azure Geo Regions (e.g. West - US, East US, Southeast Asia, etc.). The geo region of a resource cannot be - changed once it is created, but if an identical geo region is specified on - update the request will succeed. + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update the request will succeed. :type location: str :param tags: Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource @@ -36,8 +39,8 @@ class CognitiveServicesAccountCreateParameters(Model): resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. :type tags: dict[str, str] - :param properties: Must exist in the request. Must be an empty object. - Must not be null. + :param properties: Required. Must exist in the request. Must be an empty + object. Must not be null. :type properties: object """ @@ -56,9 +59,10 @@ class CognitiveServicesAccountCreateParameters(Model): 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, sku, kind, location, properties, tags=None): - self.sku = sku - self.kind = kind - self.location = location - self.tags = tags - self.properties = properties + def __init__(self, **kwargs): + super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py new file mode 100644 index 000000000000..bce9b69e99ed --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_create_parameters_py3.py @@ -0,0 +1,68 @@ +# 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 CognitiveServicesAccountCreateParameters(Model): + """The parameters to provide for the account. + + All required parameters must be populated in order to send to Azure. + + :param sku: Required. Required. Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param kind: Required. Required. Gets or sets the Kind of the resource. + Possible values include: 'Bing.Autosuggest.v7', 'Bing.CustomSearch', + 'Bing.Search.v7', 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', + 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction', + 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker', + 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics', + 'TextTranslation', 'WebLM' + :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind + :param location: Required. Required. Gets or sets the location of the + resource. This will be one of the supported and registered Azure Geo + Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a + resource cannot be changed once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :param properties: Required. Must exist in the request. Must be an empty + object. Must not be null. + :type properties: object + """ + + _validation = { + 'sku': {'required': True}, + 'kind': {'required': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, sku, kind, location: str, properties, tags=None, **kwargs) -> None: + super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) + self.sku = sku + self.kind = kind + self.location = location + self.tags = tags + self.properties = properties diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py index 72ba70ee4686..96992c1e071d 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result.py @@ -32,5 +32,6 @@ class CognitiveServicesAccountEnumerateSkusResult(Model): 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, } - def __init__(self): + def __init__(self, **kwargs): + super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) self.value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py new file mode 100644 index 000000000000..4327cfe5fa1c --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_enumerate_skus_result_py3.py @@ -0,0 +1,37 @@ +# 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 CognitiveServicesAccountEnumerateSkusResult(Model): + """The list of cognitive services accounts operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: Gets the list of Cognitive Services accounts and their + properties. + :vartype value: + list[~azure.mgmt.cognitiveservices.models.CognitiveServicesResourceAndSku] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[CognitiveServicesResourceAndSku]'}, + } + + def __init__(self, **kwargs) -> None: + super(CognitiveServicesAccountEnumerateSkusResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py index 5cf1aaf11fda..14f54a0735b3 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys.py @@ -26,6 +26,7 @@ class CognitiveServicesAccountKeys(Model): 'key2': {'key': 'key2', 'type': 'str'}, } - def __init__(self, key1=None, key2=None): - self.key1 = key1 - self.key2 = key2 + def __init__(self, **kwargs): + super(CognitiveServicesAccountKeys, self).__init__(**kwargs) + self.key1 = kwargs.get('key1', None) + self.key2 = kwargs.get('key2', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py new file mode 100644 index 000000000000..0407f9a5198b --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_keys_py3.py @@ -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 CognitiveServicesAccountKeys(Model): + """The access keys for the cognitive services account. + + :param key1: Gets the value of key 1. + :type key1: str + :param key2: Gets the value of key 2. + :type key2: str + """ + + _attribute_map = { + 'key1': {'key': 'key1', 'type': 'str'}, + 'key2': {'key': 'key2', 'type': 'str'}, + } + + def __init__(self, *, key1: str=None, key2: str=None, **kwargs) -> None: + super(CognitiveServicesAccountKeys, self).__init__(**kwargs) + self.key1 = key1 + self.key2 = key2 diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py new file mode 100644 index 000000000000..a249cb7dd2bc --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_py3.py @@ -0,0 +1,86 @@ +# 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 CognitiveServicesAccount(Model): + """Cognitive Services Account is an Azure resource representing the + provisioned account, its type, location and SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param etag: Entity Tag + :type etag: str + :ivar id: The id of the created account + :vartype id: str + :param kind: Type of cognitive service account. + :type kind: str + :param location: The location of the resource + :type location: str + :ivar name: The name of the created account + :vartype name: str + :ivar provisioning_state: Gets the status of the cognitive services + account at the time the operation was called. Possible values include: + 'Creating', 'ResolvingDNS', 'Moving', 'Deleting', 'Succeeded', 'Failed' + :vartype provisioning_state: str or + ~azure.mgmt.cognitiveservices.models.ProvisioningState + :param endpoint: Endpoint of the created account. + :type endpoint: str + :param internal_id: The internal identifier. + :type internal_id: str + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + :ivar type: Resource type + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'etag': {'key': 'etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, + 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, etag: str=None, kind: str=None, location: str=None, endpoint: str=None, internal_id: str=None, sku=None, tags=None, **kwargs) -> None: + super(CognitiveServicesAccount, self).__init__(**kwargs) + self.etag = etag + self.id = None + self.kind = kind + self.location = location + self.name = None + self.provisioning_state = None + self.endpoint = endpoint + self.internal_id = internal_id + self.sku = sku + self.tags = tags + self.type = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py index ccead5d5ee3f..5b78b1a13a91 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters.py @@ -30,6 +30,7 @@ class CognitiveServicesAccountUpdateParameters(Model): 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, sku=None, tags=None): - self.sku = sku - self.tags = tags + def __init__(self, **kwargs): + super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py new file mode 100644 index 000000000000..03cd5ba1328b --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py @@ -0,0 +1,36 @@ +# 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 CognitiveServicesAccountUpdateParameters(Model): + """The parameters to provide for the account. + + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + :param tags: Gets or sets a list of key value pairs that describe the + resource. These tags can be used in viewing and grouping this resource + (across resource groups). A maximum of 15 tags can be provided for a + resource. Each tag must have a key no greater than 128 characters and + value no greater than 256 characters. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, tags=None, **kwargs) -> None: + super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) + self.sku = sku + self.tags = tags diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py index b7de0c2dd55e..8d8c7ea8feb1 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): f0 = "F0" p0 = "P0" @@ -27,44 +27,78 @@ class SkuName(Enum): s6 = "S6" -class SkuTier(Enum): +class SkuTier(str, Enum): free = "Free" standard = "Standard" premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): - academic = "Academic" - bing_autosuggest = "Bing.Autosuggest" - bing_search = "Bing.Search" + bing_autosuggestv7 = "Bing.Autosuggest.v7" + bing_custom_search = "Bing.CustomSearch" + bing_searchv7 = "Bing.Search.v7" bing_speech = "Bing.Speech" - bing_spell_check = "Bing.SpellCheck" + bing_spell_checkv7 = "Bing.SpellCheck.v7" computer_vision = "ComputerVision" content_moderator = "ContentModerator" custom_speech = "CustomSpeech" + custom_vision_prediction = "CustomVision.Prediction" + custom_vision_training = "CustomVision.Training" emotion = "Emotion" face = "Face" luis = "LUIS" - recommendations = "Recommendations" + qn_amaker = "QnAMaker" speaker_recognition = "SpeakerRecognition" - speech = "Speech" speech_translation = "SpeechTranslation" text_analytics = "TextAnalytics" text_translation = "TextTranslation" web_lm = "WebLM" -class ProvisioningState(Enum): +class ProvisioningState(str, Enum): creating = "Creating" resolving_dns = "ResolvingDNS" + moving = "Moving" + deleting = "Deleting" succeeded = "Succeeded" failed = "Failed" -class KeyName(Enum): +class KeyName(str, Enum): key1 = "Key1" key2 = "Key2" + + +class UnitType(str, Enum): + + count = "Count" + bytes = "Bytes" + seconds = "Seconds" + percent = "Percent" + count_per_second = "CountPerSecond" + bytes_per_second = "BytesPerSecond" + milliseconds = "Milliseconds" + + +class QuotaUsageStatus(str, Enum): + + included = "Included" + blocked = "Blocked" + in_overage = "InOverage" + unknown = "Unknown" + + +class ResourceSkuRestrictionsType(str, Enum): + + location = "Location" + zone = "Zone" + + +class ResourceSkuRestrictionsReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py index e08584c04ff8..da6668117698 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku.py @@ -26,6 +26,7 @@ class CognitiveServicesResourceAndSku(Model): 'sku': {'key': 'sku', 'type': 'Sku'}, } - def __init__(self, resource_type=None, sku=None): - self.resource_type = resource_type - self.sku = sku + def __init__(self, **kwargs): + super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) + self.resource_type = kwargs.get('resource_type', None) + self.sku = kwargs.get('sku', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py new file mode 100644 index 000000000000..3151afd709e4 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_resource_and_sku_py3.py @@ -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 CognitiveServicesResourceAndSku(Model): + """Cognitive Services resource type and SKU. + + :param resource_type: Resource Namespace and Type + :type resource_type: str + :param sku: The SKU of Cognitive Services account. + :type sku: ~azure.mgmt.cognitiveservices.models.Sku + """ + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, resource_type: str=None, sku=None, **kwargs) -> None: + super(CognitiveServicesResourceAndSku, self).__init__(**kwargs) + self.resource_type = resource_type + self.sku = sku diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py index 84da2701249d..8a5104af371a 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error.py @@ -24,8 +24,9 @@ class Error(Model): 'error': {'key': 'error', 'type': 'ErrorBody'}, } - def __init__(self, error=None): - self.error = error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorException(HttpOperationError): diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py index b32a385e5ca7..4371278624ec 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body.py @@ -15,9 +15,11 @@ class ErrorBody(Model): """Cognitive Services error body. - :param code: error code + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code :type code: str - :param message: error message + :param message: Required. error message :type message: str """ @@ -31,6 +33,7 @@ class ErrorBody(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code, message): - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py new file mode 100644 index 000000000000..7851e15157c3 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_body_py3.py @@ -0,0 +1,39 @@ +# 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 ErrorBody(Model): + """Cognitive Services error body. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code + :type code: str + :param message: Required. error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(ErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py new file mode 100644 index 000000000000..54d832eb4725 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/error_py3.py @@ -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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Cognitive Services error object. + + :param error: The error body. + :type error: ~azure.mgmt.cognitiveservices.models.ErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py new file mode 100644 index 000000000000..fd3e3d504c9d --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name.py @@ -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 MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py new file mode 100644 index 000000000000..811d94729969 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/metric_name_py3.py @@ -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 MetricName(Model): + """A metric name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The name of the metric. + :vartype value: str + :ivar localized_value: The friendly name of the metric. + :vartype localized_value: str + """ + + _validation = { + 'value': {'readonly': True}, + 'localized_value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'localized_value': {'key': 'localizedValue', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(MetricName, self).__init__(**kwargs) + self.value = None + self.localized_value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py index e1fd7132c7f4..612864781d45 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info.py @@ -33,8 +33,9 @@ class OperationDisplayInfo(Model): 'resource': {'key': 'resource', 'type': 'str'}, } - def __init__(self, description=None, operation=None, provider=None, resource=None): - 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) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py new file mode 100644 index 000000000000..18ea28fc7a43 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_display_info_py3.py @@ -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 Cognitive Services. + + :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 Cognitive Services. + :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 diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py index 7721d2673521..3411ea34f450 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity.py @@ -32,8 +32,9 @@ class OperationEntity(Model): 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, name=None, display=None, origin=None, properties=None): - self.name = name - self.display = display - self.origin = origin - self.properties = properties + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py new file mode 100644 index 000000000000..654a27867bda --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/operation_entity_py3.py @@ -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 OperationEntity(Model): + """The operation supported by Cognitive Services. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Cognitive Services. + :type display: ~azure.mgmt.cognitiveservices.models.OperationDisplayInfo + :param origin: The origin of the operation. + :type origin: str + :param properties: Additional properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py index b2e27098273f..132a0d8c16cc 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters.py @@ -15,8 +15,10 @@ class RegenerateKeyParameters(Model): """Regenerate key parameters. - :param key_name: key name to generate (Key1|Key2). Possible values - include: 'Key1', 'Key2' + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. key name to generate (Key1|Key2). Possible + values include: 'Key1', 'Key2' :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName """ @@ -28,5 +30,6 @@ class RegenerateKeyParameters(Model): 'key_name': {'key': 'keyName', 'type': 'KeyName'}, } - def __init__(self, key_name): - self.key_name = key_name + def __init__(self, **kwargs): + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py new file mode 100644 index 000000000000..1fd67eabb405 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/regenerate_key_parameters_py3.py @@ -0,0 +1,35 @@ +# 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 RegenerateKeyParameters(Model): + """Regenerate key parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. key name to generate (Key1|Key2). Possible + values include: 'Key1', 'Key2' + :type key_name: str or ~azure.mgmt.cognitiveservices.models.KeyName + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'KeyName'}, + } + + def __init__(self, *, key_name, **kwargs) -> None: + super(RegenerateKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py new file mode 100644 index 000000000000..72f1cee9b8e9 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku.py @@ -0,0 +1,62 @@ +# 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 ResourceSku(Model): + """Describes an available Cognitive Services SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of Cognitive Services account. + :vartype tier: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs): + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.kind = None + self.locations = None + self.restrictions = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py new file mode 100644 index 000000000000..fb650eef27f1 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class ResourceSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceSkuPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py new file mode 100644 index 000000000000..3aa9b8470364 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_py3.py @@ -0,0 +1,62 @@ +# 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 ResourceSku(Model): + """Describes an available Cognitive Services SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of Cognitive Services account. + :vartype tier: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar restrictions: The restrictions because of which SKU cannot be used. + This is empty if there are no restrictions. + :vartype restrictions: + list[~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'kind': {'readonly': True}, + 'locations': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ResourceSkuRestrictions]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.kind = None + self.locations = None + self.restrictions = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py new file mode 100644 index 000000000000..677e93463d58 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info.py @@ -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 ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: Locations where the SKU is restricted + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py new file mode 100644 index 000000000000..008cf8d4c5fa --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restriction_info_py3.py @@ -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 ResourceSkuRestrictionInfo(Model): + """ResourceSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: Locations where the SKU is restricted + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py new file mode 100644 index 000000000000..5c1ae1141f3d --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions.py @@ -0,0 +1,57 @@ +# 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 ResourceSkuRestrictions(Model): + """Describes restrictions of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location', + 'Zone' + :vartype type: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the + SKU cannot be used. + :vartype restriction_info: + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py new file mode 100644 index 000000000000..62dee12bb165 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/resource_sku_restrictions_py3.py @@ -0,0 +1,57 @@ +# 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 ResourceSkuRestrictions(Model): + """Describes restrictions of a SKU. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of restrictions. Possible values include: 'Location', + 'Zone' + :vartype type: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to + location. This would be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the + SKU cannot be used. + :vartype restriction_info: + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: + 'QuotaId', 'NotAvailableForSubscription' + :vartype reason_code: str or + ~azure.mgmt.cognitiveservices.models.ResourceSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'ResourceSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ResourceSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py index b19731f46e6b..4a70094c16e5 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py @@ -18,9 +18,11 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: Gets or sets the sku name. Required for account creation, - optional for update. Possible values include: 'F0', 'P0', 'P1', 'P2', - 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6' + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation, optional for update. Possible values include: 'F0', 'P0', 'P1', + 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6' :type name: str or ~azure.mgmt.cognitiveservices.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible values include: 'Free', 'Standard', 'Premium' @@ -37,6 +39,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py new file mode 100644 index 000000000000..c0ffedc39c29 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py @@ -0,0 +1,45 @@ +# 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 Sku(Model): + """The SKU of the cognitive services account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or sets the sku name. Required for account + creation, optional for update. Possible values include: 'F0', 'P0', 'P1', + 'P2', 'S0', 'S1', 'S2', 'S3', 'S4', 'S5', 'S6' + :type name: str or ~azure.mgmt.cognitiveservices.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Free', 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.cognitiveservices.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py new file mode 100644 index 000000000000..6911376e0206 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage.py @@ -0,0 +1,66 @@ +# 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 Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: float + :ivar current_value: Current value for this metric. + :vartype current_value: float + :ivar next_reset_time: Next reset time for current quota. + :vartype next_reset_time: str + :param status: Cognitive Services account quota usage status. Possible + values include: 'Included', 'Blocked', 'InOverage', 'Unknown' + :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Usage, self).__init__(**kwargs) + self.unit = kwargs.get('unit', None) + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None + self.next_reset_time = None + self.status = kwargs.get('status', None) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py new file mode 100644 index 000000000000..b053f5be1790 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usage_py3.py @@ -0,0 +1,66 @@ +# 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 Usage(Model): + """The usage data for a usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param unit: The unit of the metric. Possible values include: 'Count', + 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', + 'Milliseconds' + :type unit: str or ~azure.mgmt.cognitiveservices.models.UnitType + :ivar name: The name information for the metric. + :vartype name: ~azure.mgmt.cognitiveservices.models.MetricName + :ivar quota_period: The quota period used to summarize the usage values. + :vartype quota_period: str + :ivar limit: Maximum value for this metric. + :vartype limit: float + :ivar current_value: Current value for this metric. + :vartype current_value: float + :ivar next_reset_time: Next reset time for current quota. + :vartype next_reset_time: str + :param status: Cognitive Services account quota usage status. Possible + values include: 'Included', 'Blocked', 'InOverage', 'Unknown' + :type status: str or ~azure.mgmt.cognitiveservices.models.QuotaUsageStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'quota_period': {'readonly': True}, + 'limit': {'readonly': True}, + 'current_value': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'unit': {'key': 'unit', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'MetricName'}, + 'quota_period': {'key': 'quotaPeriod', 'type': 'str'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, *, unit=None, status=None, **kwargs) -> None: + super(Usage, self).__init__(**kwargs) + self.unit = unit + self.name = None + self.quota_period = None + self.limit = None + self.current_value = None + self.next_reset_time = None + self.status = status diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py new file mode 100644 index 000000000000..67ece7d4e243 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result.py @@ -0,0 +1,35 @@ +# 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 UsagesResult(Model): + """The response to a list usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of usages for Cognitive Service account. + :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__(self, **kwargs): + super(UsagesResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py new file mode 100644 index 000000000000..880dd7fd58e3 --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/usages_result_py3.py @@ -0,0 +1,35 @@ +# 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 UsagesResult(Model): + """The response to a list usage request. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The list of usages for Cognitive Service account. + :vartype value: list[~azure.mgmt.cognitiveservices.models.Usage] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Usage]'}, + } + + def __init__(self, **kwargs) -> None: + super(UsagesResult, self).__init__(**kwargs) + self.value = None diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py index 5c91cb9c82ca..3596470cf0ad 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/__init__.py @@ -10,11 +10,13 @@ # -------------------------------------------------------------------------- from .accounts_operations import AccountsOperations +from .resource_skus_operations import ResourceSkusOperations from .operations import Operations from .check_sku_availability_operations import CheckSkuAvailabilityOperations __all__ = [ 'AccountsOperations', + 'ResourceSkusOperations', 'Operations', 'CheckSkuAvailabilityOperations', ] diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py index 3bedeb581323..3c940500295a 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py @@ -21,10 +21,12 @@ class AccountsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-18. Constant value: "2017-04-18". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -60,7 +62,7 @@ def create( :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -88,7 +90,7 @@ def create( # 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 [200, 201]: raise models.ErrorException(self._deserialize, response) @@ -105,6 +107,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} def update( self, resource_group_name, account_name, sku=None, tags=None, custom_headers=None, raw=False, **operation_config): @@ -137,7 +140,7 @@ def update( parameters = models.CognitiveServicesAccountUpdateParameters(sku=sku, tags=tags) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}' + url = self.update.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -165,7 +168,7 @@ def update( # Construct and send request request = self._client.patch(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 [200]: raise models.ErrorException(self._deserialize, response) @@ -180,6 +183,7 @@ def update( return client_raw_response return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} def delete( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -201,7 +205,7 @@ def delete( :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -225,7 +229,7 @@ def delete( # Construct and send request request = self._client.delete(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, 204]: raise models.ErrorException(self._deserialize, response) @@ -233,6 +237,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} def get_properties( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -255,7 +260,7 @@ def get_properties( :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}' + url = self.get_properties.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -279,7 +284,7 @@ def get_properties( # 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]: raise models.ErrorException(self._deserialize, response) @@ -294,6 +299,7 @@ def get_properties( return client_raw_response return deserialized + get_properties.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -318,7 +324,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -346,7 +352,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]: raise models.ErrorException(self._deserialize, response) @@ -362,6 +368,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts'} def list( self, custom_headers=None, raw=False, **operation_config): @@ -383,7 +390,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -410,7 +417,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]: raise models.ErrorException(self._deserialize, response) @@ -426,6 +433,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts'} def list_keys( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -449,7 +457,7 @@ def list_keys( :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys' + url = self.list_keys.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -473,7 +481,7 @@ def list_keys( # Construct and send request request = self._client.post(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]: raise models.ErrorException(self._deserialize, response) @@ -488,6 +496,7 @@ def list_keys( return client_raw_response return deserialized + list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys'} def regenerate_key( self, resource_group_name, account_name, key_name, custom_headers=None, raw=False, **operation_config): @@ -517,7 +526,7 @@ def regenerate_key( parameters = models.RegenerateKeyParameters(key_name=key_name) # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey' + url = self.regenerate_key.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -545,7 +554,7 @@ def regenerate_key( # Construct and send request request = self._client.post(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 [200]: raise models.ErrorException(self._deserialize, response) @@ -560,6 +569,7 @@ def regenerate_key( return client_raw_response return deserialized + regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey'} def list_skus( self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): @@ -584,7 +594,7 @@ def list_skus( :class:`ErrorException` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus' + url = self.list_skus.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), @@ -608,7 +618,7 @@ def list_skus( # 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]: raise models.ErrorException(self._deserialize, response) @@ -623,3 +633,72 @@ def list_skus( return client_raw_response return deserialized + list_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus'} + + def get_usages( + self, resource_group_name, account_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Get usages for the requested Cognitive Services account. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param account_name: The name of Cognitive Services account. + :type account_name: str + :param filter: An OData filter expression that describes a subset of + usages to return. The supported parameter is name.value (name of the + metric, can have an or of multiple names). + :type filter: 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`. + :return: UsagesResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.cognitiveservices.models.UsagesResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get_usages.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('UsagesResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_usages.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages'} diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py index d53105ddb252..d0e6a5631ad0 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/check_sku_availability_operations.py @@ -22,10 +22,12 @@ class CheckSkuAvailabilityOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-18. Constant value: "2017-04-18". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -44,10 +46,11 @@ def list( :param skus: The SKU of the resource. :type skus: list[str or ~azure.mgmt.cognitiveservices.models.SkuName] :param kind: The Kind of the resource. Possible values include: - 'Academic', 'Bing.Autosuggest', 'Bing.Search', 'Bing.Speech', - 'Bing.SpellCheck', 'ComputerVision', 'ContentModerator', - 'CustomSpeech', 'Emotion', 'Face', 'LUIS', 'Recommendations', - 'SpeakerRecognition', 'Speech', 'SpeechTranslation', 'TextAnalytics', + 'Bing.Autosuggest.v7', 'Bing.CustomSearch', 'Bing.Search.v7', + 'Bing.Speech', 'Bing.SpellCheck.v7', 'ComputerVision', + 'ContentModerator', 'CustomSpeech', 'CustomVision.Prediction', + 'CustomVision.Training', 'Emotion', 'Face', 'LUIS', 'QnAMaker', + 'SpeakerRecognition', 'SpeechTranslation', 'TextAnalytics', 'TextTranslation', 'WebLM' :type kind: str or ~azure.mgmt.cognitiveservices.models.Kind :param type: The Type of the resource. @@ -67,7 +70,7 @@ def list( parameters = models.CheckSkuAvailabilityParameter(skus=skus, kind=kind, type=type) # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'location': self._serialize.url("location", location, 'str') @@ -94,7 +97,7 @@ def list( # Construct and send request request = self._client.post(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 [200]: exp = CloudError(response) @@ -111,3 +114,4 @@ def list( return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/locations/{location}/checkSkuAvailability'} diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py index 240faac63efb..37bc3bc1163b 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py @@ -22,10 +22,12 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-18. Constant value: "2017-04-18". """ + models = models + def __init__(self, client, config, serializer, deserializer): self._client = client @@ -53,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.CognitiveServices/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -76,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) @@ -94,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.CognitiveServices/operations'} diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py new file mode 100644 index 000000000000..b719f342c8be --- /dev/null +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py @@ -0,0 +1,104 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ResourceSkusOperations(object): + """ResourceSkusOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-04-18. Constant value: "2017-04-18". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-04-18" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the list of Microsoft.CognitiveServices SKUs available for your + Subscription. + + :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`. + :return: An iterator like instance of ResourceSku + :rtype: + ~azure.mgmt.cognitiveservices.models.ResourceSkuPaged[~azure.mgmt.cognitiveservices.models.ResourceSku] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourceSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus'} diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py index 53c4c7ea05e8..7f225c6aab41 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "3.0.0" diff --git a/azure-mgmt-cognitiveservices/build.json b/azure-mgmt-cognitiveservices/build.json deleted file mode 100644 index d5356f60b700..000000000000 --- a/azure-mgmt-cognitiveservices/build.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "autorest": [ - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest-core", - "version": "2.0.4168", - "engines": { - "node": ">=7.10.0" - }, - "dependencies": {}, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/async-io": "~1.0.22", - "@microsoft.azure/extension": "~1.2.12", - "@types/commonmark": "^0.27.0", - "@types/jsonpath": "^0.1.29", - "@types/node": "^8.0.28", - "@types/pify": "0.0.28", - "@types/source-map": "^0.5.0", - "@types/yargs": "^8.0.2", - "commonmark": "^0.27.0", - "file-url": "^2.0.2", - "get-uri": "^2.0.0", - "jsonpath": "^0.2.11", - "linq-es2015": "^2.4.25", - "mocha": "3.4.2", - "mocha-typescript": "1.1.5", - "pify": "^3.0.0", - "safe-eval": "^0.3.0", - "shx": "^0.2.2", - "source-map": "^0.5.6", - "source-map-support": "^0.4.15", - "strip-bom": "^3.0.0", - "typescript": "2.5.3", - "untildify": "^3.0.2", - "urijs": "^1.18.10", - "vscode-jsonrpc": "^3.3.1", - "yaml-ast-parser": "https://github.com/olydis/yaml-ast-parser/releases/download/0.0.34/yaml-ast-parser-0.0.34.tgz", - "yargs": "^8.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_shasum": "33813111fc9bfa488bd600fbba48bc53cc9182c7", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest-core@2.0.4168", - "_from": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core", - "_where": "/root/.autorest/@microsoft.azure_autorest-core@2.0.4168/node_modules/@microsoft.azure/autorest-core" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.0.21", - "dependencies": { - "dotnet-2.0.0": "^1.3.2" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.1.1", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "3ce7d3939124b31830be15e5de99b9b7768afb90", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.0.21", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.0.21/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.modeler", - "version": "2.1.22", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_shasum": "ca425289fa38a210d279729048a4a91673f09c67", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.modeler@2.1.22", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler", - "_where": "/root/.autorest/@microsoft.azure_autorest.modeler@2.1.22/node_modules/@microsoft.azure/autorest.modeler" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - }, - { - "resolvedInfo": null, - "packageMetadata": { - "name": "@microsoft.azure/autorest.python", - "version": "2.0.19", - "dependencies": { - "dotnet-2.0.0": "^1.4.4" - }, - "optionalDependencies": {}, - "devDependencies": { - "@microsoft.azure/autorest.testserver": "^1.9.0", - "autorest": "^2.0.0", - "coffee-script": "^1.11.1", - "dotnet-sdk-2.0.0": "^1.4.4", - "gulp": "^3.9.1", - "gulp-filter": "^5.0.0", - "gulp-line-ending-corrector": "^1.0.1", - "iced-coffee-script": "^108.0.11", - "marked": "^0.3.6", - "marked-terminal": "^2.0.0", - "moment": "^2.17.1", - "run-sequence": "*", - "shx": "^0.2.2", - "through2-parallel": "^0.1.3", - "yargs": "^8.0.2", - "yarn": "^1.0.2" - }, - "bundleDependencies": false, - "peerDependencies": {}, - "deprecated": false, - "_resolved": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_shasum": "e069166c16fd903c8e1fdf9395b433f3043cb6e3", - "_shrinkwrap": null, - "bin": null, - "_id": "@microsoft.azure/autorest.python@2.0.19", - "_from": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_requested": { - "type": "directory", - "where": "/git-restapi", - "raw": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "rawSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "saveSpec": "file:/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "fetchSpec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python" - }, - "_spec": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python", - "_where": "/root/.autorest/@microsoft.azure_autorest.python@2.0.19/node_modules/@microsoft.azure/autorest.python" - }, - "extensionManager": { - "installationPath": "/root/.autorest", - "dotnetPath": "/root/.dotnet" - }, - "installationPath": "/root/.autorest" - } - ], - "autorest_bootstrap": {} -} \ No newline at end of file diff --git a/azure-mgmt-cognitiveservices/setup.py b/azure-mgmt-cognitiveservices/setup.py index 9e284f3fdb07..f6e9b649508b 100644 --- a/azure-mgmt-cognitiveservices/setup.py +++ b/azure-mgmt-cognitiveservices/setup.py @@ -69,7 +69,6 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -78,7 +77,7 @@ zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure~=0.4.11', + 'msrestazure>=0.4.27,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass