From b4d63a980d13d3b1c7607df90db4d2e592d246eb Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 23 Apr 2019 12:33:53 -0700 Subject: [PATCH] [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 --- azure-mgmt-cognitiveservices/MANIFEST.in | 1 + azure-mgmt-cognitiveservices/README.rst | 22 +++---------------- ...tive_services_account_update_parameters.py | 5 +++++ ..._services_account_update_parameters_py3.py | 7 +++++- .../operations/accounts_operations.py | 7 ++++-- azure-mgmt-cognitiveservices/setup.py | 1 + 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/azure-mgmt-cognitiveservices/MANIFEST.in b/azure-mgmt-cognitiveservices/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-cognitiveservices/MANIFEST.in +++ b/azure-mgmt-cognitiveservices/MANIFEST.in @@ -1,3 +1,4 @@ +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 70de0c6a776f..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 ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-cognitiveservices%2FREADME.png 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/operations/accounts_operations.py b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py index 64e01742ae3d..9dbff4be3071 100644 --- a/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py +++ b/azure-mgmt-cognitiveservices/azure/mgmt/cognitiveservices/operations/accounts_operations.py @@ -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'] 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',