From e70b965826aeabbc0d11c1ce8aacb2e6b8d01e15 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 1 May 2019 15:36:33 -0700 Subject: [PATCH] [AutoPR] cognitiveservices/resource-manager (#3761) * [AutoPR cognitiveservices/resource-manager] fixing sample names in cognitive services (#3757) * Generated from 167c81a0548ec8c460cd99b07b9ab6556333a981 fixing sample names in cognitive services * Packaging update of azure-mgmt-cognitiveservices * Generated from 8135b46c7d113104fd2450aee6f7566d83954417 (#4070) Change Kind and SKU name to string (from enum). * Generated from 1478010e6e64fe93ffc8d0eb70a5feab510a1bba (#4176) Adding customSubDomainName property. * [AutoPR cognitiveservices/resource-manager] Support Update properties (#4928) * Generated from c4d8eb435374b6bec4bd00900ea55c37fe4d238b Support Update properties * Packaging update of azure-mgmt-cognitiveservices * Generated from 90f73befd81d065883b594f8d9280062050f296e Update specification/cognitiveservices/resource-manager/Microsoft.CognitiveServices/stable/2017-04-18/cognitiveservices.json Co-Authored-By: yangyuan * ChangeLog * Update HISTORY.rst --- azure-mgmt-cognitiveservices/HISTORY.rst | 17 ++++- azure-mgmt-cognitiveservices/MANIFEST.in | 4 ++ azure-mgmt-cognitiveservices/README.rst | 19 ------ .../mgmt/cognitiveservices/models/__init__.py | 4 -- .../check_sku_availability_parameter.py | 11 +-- .../check_sku_availability_parameter_py3.py | 13 ++-- .../models/check_sku_availability_result.py | 14 ++-- .../check_sku_availability_result_py3.py | 16 ++--- .../models/cognitive_services_account.py | 5 ++ ...tive_services_account_create_parameters.py | 8 +-- ..._services_account_create_parameters_py3.py | 10 +-- .../models/cognitive_services_account_py3.py | 7 +- ...tive_services_account_update_parameters.py | 5 ++ ..._services_account_update_parameters_py3.py | 7 +- ...nitive_services_management_client_enums.py | 38 ----------- .../mgmt/cognitiveservices/models/sku.py | 5 +- .../mgmt/cognitiveservices/models/sku_py3.py | 7 +- .../operations/accounts_operations.py | 68 +++++++++---------- .../check_sku_availability_operations.py | 18 ++--- .../operations/operations.py | 7 +- .../operations/resource_skus_operations.py | 7 +- .../azure/mgmt/cognitiveservices/version.py | 2 +- azure-mgmt-cognitiveservices/setup.py | 1 + 23 files changed, 113 insertions(+), 180 deletions(-) diff --git a/azure-mgmt-cognitiveservices/HISTORY.rst b/azure-mgmt-cognitiveservices/HISTORY.rst index 35db6bd3e84b..afa5901d7f95 100644 --- a/azure-mgmt-cognitiveservices/HISTORY.rst +++ b/azure-mgmt-cognitiveservices/HISTORY.rst @@ -3,6 +3,19 @@ Release History =============== +4.0.0 (2019-05-01) +++++++++++++++++++ + +**Features** + +- Model CognitiveServicesAccount has a new parameter custom_sub_domain_name +- Model CognitiveServicesAccountUpdateParameters has a new parameter properties +- Operation AccountsOperations.update now takes optional properties + +**Breaking changes** + +- Remove limited enum Kind and SkuName. Replace all usage by a simple string (e.g. "Bing.SpellCheck.v7") + 3.0.0 (2018-05-21) ++++++++++++++++++ @@ -24,7 +37,7 @@ This version uses a next-generation code generator that *might* introduce breaki - 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`, + - 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. @@ -62,4 +75,4 @@ This version uses a next-generation code generator that *might* introduce breaki +++++++++++++++++++ * Initial Release (ApiVersion 2017-04-18) -* This wheel package is now built with the azure wheel extension \ No newline at end of file +* This wheel package is now built with the azure wheel extension diff --git a/azure-mgmt-cognitiveservices/MANIFEST.in b/azure-mgmt-cognitiveservices/MANIFEST.in index bb37a2723dae..e4884efef41b 100644 --- a/azure-mgmt-cognitiveservices/MANIFEST.in +++ b/azure-mgmt-cognitiveservices/MANIFEST.in @@ -1 +1,5 @@ +recursive-include tests *.py *.yaml include *.rst +include azure/__init__.py +include azure/mgmt/__init__.py + diff --git a/azure-mgmt-cognitiveservices/README.rst b/azure-mgmt-cognitiveservices/README.rst index 43bf9b4e4046..be54b05df719 100644 --- a/azure-mgmt-cognitiveservices/README.rst +++ b/azure-mgmt-cognitiveservices/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py index 4ae2382d277f..2468499507fa 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/__init__.py @@ -57,9 +57,7 @@ from .resource_sku_paged import ResourceSkuPaged from .operation_entity_paged import OperationEntityPaged from .cognitive_services_management_client_enums import ( - SkuName, SkuTier, - Kind, ProvisioningState, KeyName, UnitType, @@ -93,9 +91,7 @@ 'CognitiveServicesAccountPaged', 'ResourceSkuPaged', 'OperationEntityPaged', - 'SkuName', 'SkuTier', - 'Kind', 'ProvisioningState', 'KeyName', 'UnitType', 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 c476eb892a2b..13bd8adec825 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 @@ -18,14 +18,9 @@ class CheckSkuAvailabilityParameter(Model): 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 + :type skus: list[str] + :param kind: Required. The Kind of the resource. + :type kind: str :param type: Required. The Type of the resource. :type type: str """ 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 index 3deeb3c9c009..216bf214d575 100644 --- 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 @@ -18,14 +18,9 @@ class CheckSkuAvailabilityParameter(Model): 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 + :type skus: list[str] + :param kind: Required. The Kind of the resource. + :type kind: str :param type: Required. The Type of the resource. :type type: str """ @@ -42,7 +37,7 @@ class CheckSkuAvailabilityParameter(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, *, skus, kind, type: str, **kwargs) -> None: + def __init__(self, *, skus, kind: str, type: str, **kwargs) -> None: super(CheckSkuAvailabilityParameter, self).__init__(**kwargs) self.skus = skus self.kind = kind 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 e2ecedea825c..0bf6f25e6345 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 @@ -15,18 +15,12 @@ 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 kind: The Kind of the resource. + :type kind: str :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_name: The SKU of Cognitive Services account. + :type sku_name: str :param sku_available: Indicates the given SKU is available or not. :type sku_available: bool :param reason: Reason why the SKU is not available. 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 index f7700f27a219..d822425dcf1c 100644 --- 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 @@ -15,18 +15,12 @@ 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 kind: The Kind of the resource. + :type kind: str :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_name: The SKU of Cognitive Services account. + :type sku_name: str :param sku_available: Indicates the given SKU is available or not. :type sku_available: bool :param reason: Reason why the SKU is not available. @@ -44,7 +38,7 @@ class CheckSkuAvailabilityResult(Model): '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: + def __init__(self, *, kind: str=None, type: str=None, sku_name: str=None, sku_available: bool=None, reason: str=None, message: str=None, **kwargs) -> None: super(CheckSkuAvailabilityResult, self).__init__(**kwargs) self.kind = kind self.type = type 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 148b30e560b5..e179eb7fc855 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 @@ -38,6 +38,9 @@ class CognitiveServicesAccount(Model): :type endpoint: str :param internal_id: The internal identifier. :type internal_id: str + :param custom_sub_domain_name: Optional subdomain name used for + token-based authentication. + :type custom_sub_domain_name: 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 @@ -66,6 +69,7 @@ class CognitiveServicesAccount(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, + 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, @@ -81,6 +85,7 @@ def __init__(self, **kwargs): self.provisioning_state = None self.endpoint = kwargs.get('endpoint', None) self.internal_id = kwargs.get('internal_id', None) + self.custom_sub_domain_name = kwargs.get('custom_sub_domain_name', 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 c12b8a0eca1e..e3577255672d 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 @@ -20,13 +20,7 @@ class CognitiveServicesAccountCreateParameters(Model): :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 + :type kind: str :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 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 index bce9b69e99ed..619a92743f93 100644 --- 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 @@ -20,13 +20,7 @@ class CognitiveServicesAccountCreateParameters(Model): :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 + :type kind: str :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 @@ -59,7 +53,7 @@ class CognitiveServicesAccountCreateParameters(Model): 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, *, sku, kind, location: str, properties, tags=None, **kwargs) -> None: + def __init__(self, *, sku, kind: str, location: str, properties, tags=None, **kwargs) -> None: super(CognitiveServicesAccountCreateParameters, self).__init__(**kwargs) self.sku = sku self.kind = kind 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 index a249cb7dd2bc..756104162c63 100644 --- 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 @@ -38,6 +38,9 @@ class CognitiveServicesAccount(Model): :type endpoint: str :param internal_id: The internal identifier. :type internal_id: str + :param custom_sub_domain_name: Optional subdomain name used for + token-based authentication. + :type custom_sub_domain_name: 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 @@ -66,12 +69,13 @@ class CognitiveServicesAccount(Model): 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'endpoint': {'key': 'properties.endpoint', 'type': 'str'}, 'internal_id': {'key': 'properties.internalId', 'type': 'str'}, + 'custom_sub_domain_name': {'key': 'properties.customSubDomainName', '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: + def __init__(self, *, etag: str=None, kind: str=None, location: str=None, endpoint: str=None, internal_id: str=None, custom_sub_domain_name: str=None, sku=None, tags=None, **kwargs) -> None: super(CognitiveServicesAccount, self).__init__(**kwargs) self.etag = etag self.id = None @@ -81,6 +85,7 @@ def __init__(self, *, etag: str=None, kind: str=None, location: str=None, endpoi self.provisioning_state = None self.endpoint = endpoint self.internal_id = internal_id + self.custom_sub_domain_name = custom_sub_domain_name 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 5b78b1a13a91..96fd4967867b 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 @@ -23,14 +23,19 @@ class CognitiveServicesAccountUpdateParameters(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: Additional properties for Account. Only provided fields + will be updated. + :type properties: object """ _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, } def __init__(self, **kwargs): super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) self.sku = kwargs.get('sku', 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_update_parameters_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/cognitive_services_account_update_parameters_py3.py index 03cd5ba1328b..798e507da635 100644 --- 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 @@ -23,14 +23,19 @@ class CognitiveServicesAccountUpdateParameters(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: Additional properties for Account. Only provided fields + will be updated. + :type properties: object """ _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, *, sku=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, tags=None, properties=None, **kwargs) -> None: super(CognitiveServicesAccountUpdateParameters, self).__init__(**kwargs) self.sku = sku self.tags = tags + self.properties = properties 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 8d8c7ea8feb1..7e36de1ee434 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,21 +12,6 @@ from enum import Enum -class SkuName(str, Enum): - - f0 = "F0" - p0 = "P0" - p1 = "P1" - p2 = "P2" - s0 = "S0" - s1 = "S1" - s2 = "S2" - s3 = "S3" - s4 = "S4" - s5 = "S5" - s6 = "S6" - - class SkuTier(str, Enum): free = "Free" @@ -34,29 +19,6 @@ class SkuTier(str, Enum): premium = "Premium" -class Kind(str, Enum): - - bing_autosuggestv7 = "Bing.Autosuggest.v7" - bing_custom_search = "Bing.CustomSearch" - bing_searchv7 = "Bing.Search.v7" - bing_speech = "Bing.Speech" - 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" - qn_amaker = "QnAMaker" - speaker_recognition = "SpeakerRecognition" - speech_translation = "SpeechTranslation" - text_analytics = "TextAnalytics" - text_translation = "TextTranslation" - web_lm = "WebLM" - - class ProvisioningState(str, Enum): creating = "Creating" diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py index 4a70094c16e5..182f5238d4de 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku.py @@ -21,9 +21,8 @@ class Sku(Model): 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 + creation, optional for update. + :type name: str :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 diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py index c0ffedc39c29..e474ec999560 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/models/sku_py3.py @@ -21,9 +21,8 @@ class Sku(Model): 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 + creation, optional for update. + :type name: str :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 @@ -39,7 +38,7 @@ class Sku(Model): 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, *, name, **kwargs) -> None: + def __init__(self, *, name: str, **kwargs) -> None: super(Sku, self).__init__(**kwargs) self.name = name self.tier = None 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 3c940500295a..9dbff4be3071 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py @@ -76,6 +76,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -88,9 +89,8 @@ def create( body_content = self._serialize.body(parameters, 'CognitiveServicesAccountCreateParameters') # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201]: raise models.ErrorException(self._deserialize, response) @@ -110,7 +110,7 @@ def create( 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): + self, resource_group_name, account_name, sku=None, tags=None, properties=None, custom_headers=None, raw=False, **operation_config): """Updates a Cognitive Services account. :param resource_group_name: The name of the resource group within the @@ -126,6 +126,9 @@ def update( 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: Additional properties for Account. Only provided + fields will be updated. + :type properties: object :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -137,7 +140,7 @@ def update( :raises: :class:`ErrorException` """ - parameters = models.CognitiveServicesAccountUpdateParameters(sku=sku, tags=tags) + parameters = models.CognitiveServicesAccountUpdateParameters(sku=sku, tags=tags, properties=properties) # Construct URL url = self.update.metadata['url'] @@ -154,6 +157,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -166,9 +170,8 @@ def update( body_content = self._serialize.body(parameters, 'CognitiveServicesAccountUpdateParameters') # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -219,7 +222,6 @@ def delete( # 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: @@ -228,8 +230,8 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 204]: raise models.ErrorException(self._deserialize, response) @@ -274,7 +276,7 @@ def get_properties( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -283,8 +285,8 @@ def get_properties( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -341,7 +343,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -350,9 +352,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -406,7 +407,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -415,9 +416,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -471,7 +471,7 @@ def list_keys( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -480,8 +480,8 @@ def list_keys( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -540,6 +540,7 @@ def regenerate_key( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -552,9 +553,8 @@ def regenerate_key( body_content = self._serialize.body(parameters, 'RegenerateKeyParameters') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -608,7 +608,7 @@ def list_skus( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -617,8 +617,8 @@ def list_skus( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -676,7 +676,7 @@ def get_usages( # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -685,8 +685,8 @@ def get_usages( 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) 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 d0e6a5631ad0..6e0d26613672 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 @@ -44,15 +44,9 @@ def list( :param location: Resource location. :type location: str :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: - '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 + :type skus: list[str] + :param kind: The Kind of the resource. + :type kind: str :param type: The Type of the resource. :type type: str :param dict custom_headers: headers that will be added to the request @@ -83,6 +77,7 @@ def list( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' 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()) @@ -95,9 +90,8 @@ def list( body_content = self._serialize.body(parameters, 'CheckSkuAvailabilityParameter') # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py index 37bc3bc1163b..46be7e37a6fe 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/operations.py @@ -67,7 +67,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -76,9 +76,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) 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 index b719f342c8be..082df141e08f 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/resource_skus_operations.py @@ -72,7 +72,7 @@ def internal_paging(next_link=None, raw=False): # Construct headers header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -81,9 +81,8 @@ def internal_paging(next_link=None, raw=False): 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) + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) diff --git a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/version.py index 7f225c6aab41..20cee28211d4 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 = "3.0.0" +VERSION = "4.0.0" diff --git a/azure-mgmt-cognitiveservices/setup.py b/azure-mgmt-cognitiveservices/setup.py index ff87dc89f78c..b92e8d4114aa 100644 --- a/azure-mgmt-cognitiveservices/setup.py +++ b/azure-mgmt-cognitiveservices/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',