diff --git a/sdk/healthbot/azure-mgmt-healthbot/MANIFEST.in b/sdk/healthbot/azure-mgmt-healthbot/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/MANIFEST.in +++ b/sdk/healthbot/azure-mgmt-healthbot/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/healthbot/azure-mgmt-healthbot/_meta.json b/sdk/healthbot/azure-mgmt-healthbot/_meta.json new file mode 100644 index 000000000000..abf97141bad5 --- /dev/null +++ b/sdk/healthbot/azure-mgmt-healthbot/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.5", + "use": [ + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" + ], + "commit": "10873ac628ee703126f82974487d8a290e983f8c", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/healthbot/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", + "readme": "specification/healthbot/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/__init__.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/__init__.py index c9f9ec6a93a4..c151f5dea0d4 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/__init__.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/__init__.py @@ -6,11 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._healthbot import Healthbot +from ._healthbot_client import HealthbotClient from ._version import VERSION __version__ = VERSION -__all__ = ['Healthbot'] +__all__ = ['HealthbotClient'] try: from ._patch import patch_sdk # type: ignore diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_configuration.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_configuration.py index 1954a0c5752d..b18ee3e223fe 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_configuration.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_configuration.py @@ -21,8 +21,8 @@ from azure.core.credentials import TokenCredential -class HealthbotConfiguration(Configuration): - """Configuration for Healthbot. +class HealthbotClientConfiguration(Configuration): + """Configuration for HealthbotClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -44,11 +44,11 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(HealthbotConfiguration, self).__init__(**kwargs) + super(HealthbotClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-08" + self.api_version = "2021-06-10" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-healthbot/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot_client.py similarity index 61% rename from sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot.py rename to sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot_client.py index 0fd3472026a4..c11e097f8fbe 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_healthbot_client.py @@ -16,15 +16,16 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse -from ._configuration import HealthbotConfiguration +from ._configuration import HealthbotClientConfiguration from .operations import BotsOperations from .operations import Operations from . import models -class Healthbot(object): - """Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. +class HealthbotClient(object): + """Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. :ivar bots: BotsOperations operations :vartype bots: azure.mgmt.healthbot.operations.BotsOperations @@ -48,11 +49,12 @@ def __init__( # type: (...) -> None if not base_url: base_url = 'https://management.azure.com' - self._config = HealthbotConfiguration(credential, subscription_id, **kwargs) + self._config = HealthbotClientConfiguration(credential, subscription_id, **kwargs) self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.bots = BotsOperations( @@ -60,12 +62,30 @@ def __init__( self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() def __enter__(self): - # type: () -> Healthbot + # type: () -> HealthbotClient self._client.__enter__() return self diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_metadata.json b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_metadata.json index ee793a70b3a9..acf88803a94b 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_metadata.json +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_metadata.json @@ -1,15 +1,17 @@ { - "chosen_version": "2020-12-08", - "total_api_version_list": ["2020-12-08"], + "chosen_version": "2021-06-10", + "total_api_version_list": ["2021-06-10"], "client": { - "name": "Healthbot", - "filename": "_healthbot", - "description": "Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs.", + "name": "HealthbotClient", + "filename": "_healthbot_client", + "description": "Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs.", "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HealthbotClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"HealthbotClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "Azure Subscription ID.", "docstring_type": "str", "required": true @@ -42,21 +44,61 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "bots": "BotsOperations", "operations": "Operations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + } } \ No newline at end of file diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_version.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_version.py index e5754a47ce68..af172383ece9 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_version.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0b1" +VERSION = "2020-10-20-preview" diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/__init__.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/__init__.py index 4e10e781e564..dbe9e167a47e 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/__init__.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/__init__.py @@ -6,5 +6,5 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._healthbot import Healthbot -__all__ = ['Healthbot'] +from ._healthbot_client import HealthbotClient +__all__ = ['HealthbotClient'] diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_configuration.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_configuration.py index ab6ffbffef70..9937fac15304 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_configuration.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_configuration.py @@ -19,8 +19,8 @@ from azure.core.credentials_async import AsyncTokenCredential -class HealthbotConfiguration(Configuration): - """Configuration for Healthbot. +class HealthbotClientConfiguration(Configuration): + """Configuration for HealthbotClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -41,11 +41,11 @@ def __init__( raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") - super(HealthbotConfiguration, self).__init__(**kwargs) + super(HealthbotClientConfiguration, self).__init__(**kwargs) self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-12-08" + self.api_version = "2021-06-10" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-healthbot/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot_client.py similarity index 60% rename from sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot.py rename to sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot_client.py index 5e41041604bb..d2c2c9b0240e 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/_healthbot_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -15,14 +16,14 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -from ._configuration import HealthbotConfiguration +from ._configuration import HealthbotClientConfiguration from .operations import BotsOperations from .operations import Operations from .. import models -class Healthbot(object): - """Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. +class HealthbotClient(object): + """Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. :ivar bots: BotsOperations operations :vartype bots: azure.mgmt.healthbot.aio.operations.BotsOperations @@ -45,11 +46,12 @@ def __init__( ) -> None: if not base_url: base_url = 'https://management.azure.com' - self._config = HealthbotConfiguration(credential, subscription_id, **kwargs) + self._config = HealthbotClientConfiguration(credential, subscription_id, **kwargs) self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.bots = BotsOperations( @@ -57,10 +59,27 @@ def __init__( self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() - async def __aenter__(self) -> "Healthbot": + async def __aenter__(self) -> "HealthbotClient": await self._client.__aenter__() return self diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_bots_operations.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_bots_operations.py index f49414959593..e452e0b40d1d 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_bots_operations.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_bots_operations.py @@ -48,14 +48,14 @@ async def _create_initial( resource_group_name: str, bot_name: str, parameters: "_models.HealthBot", - **kwargs + **kwargs: Any ) -> "_models.HealthBot": cls = kwargs.pop('cls', None) # type: ClsType["_models.HealthBot"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -86,7 +86,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -106,20 +106,20 @@ async def begin_create( resource_group_name: str, bot_name: str, parameters: "_models.HealthBot", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.HealthBot"]: - """Create a new HealthBot. + """Create a new Azure Health Bot. :param resource_group_name: The name of the Bot resource group in the user subscription. :type resource_group_name: str :param bot_name: The name of the Bot resource. :type bot_name: str - :param parameters: The parameters to provide for the created bot. + :param parameters: The parameters to provide for the created Azure Health Bot. :type parameters: ~azure.mgmt.healthbot.models.HealthBot :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either HealthBot or the result of cls(response) @@ -176,7 +176,7 @@ async def get( self, resource_group_name: str, bot_name: str, - **kwargs + **kwargs: Any ) -> "_models.HealthBot": """Get a HealthBot. @@ -194,7 +194,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" # Construct URL @@ -220,7 +220,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HealthBot', pipeline_response) @@ -236,7 +236,7 @@ async def update( resource_group_name: str, bot_name: str, parameters: "_models.HealthBotUpdateParameters", - **kwargs + **kwargs: Any ) -> "_models.HealthBot": """Patch a HealthBot. @@ -244,7 +244,7 @@ async def update( :type resource_group_name: str :param bot_name: The name of the Bot resource. :type bot_name: str - :param parameters: The parameters to provide for the required bot. + :param parameters: The parameters to provide for the required Azure Health Bot. :type parameters: ~azure.mgmt.healthbot.models.HealthBotUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: HealthBot, or the result of cls(response) @@ -256,7 +256,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -287,7 +287,7 @@ async def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -306,14 +306,14 @@ async def _delete_initial( self, resource_group_name: str, bot_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" # Construct URL @@ -339,7 +339,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -351,7 +351,7 @@ async def begin_delete( self, resource_group_name: str, bot_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete a HealthBot. @@ -361,8 +361,8 @@ async def begin_delete( :type bot_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -414,7 +414,7 @@ def get_long_running_output(pipeline_response): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BotResponseList"]: """Returns all the resources of a particular type belonging to a resource group. @@ -430,7 +430,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -471,7 +471,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -484,7 +484,7 @@ async def get_next(next_link=None): def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.BotResponseList"]: """Returns all the resources of a particular type belonging to a subscription. @@ -498,7 +498,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -538,7 +538,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_operations.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_operations.py index c538c21ad84d..27b50247dd6a 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_operations.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/aio/operations/_operations.py @@ -43,9 +43,9 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AvailableOperations"]: - """Lists all the available HealthBot operations. + """Lists all the available Azure Health Bot operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableOperations or the result of cls(response) @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/__init__.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/__init__.py index 9ef285d1c06a..e4b5a4785454 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/__init__.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/__init__.py @@ -11,36 +11,41 @@ from ._models_py3 import BotResponseList from ._models_py3 import Error from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorAutoGenerated + from ._models_py3 import ErrorError from ._models_py3 import HealthBot from ._models_py3 import HealthBotProperties from ._models_py3 import HealthBotUpdateParameters + from ._models_py3 import Identity from ._models_py3 import OperationDetail from ._models_py3 import OperationDisplay from ._models_py3 import Resource from ._models_py3 import Sku from ._models_py3 import SystemData from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedIdentity from ._models_py3 import ValidationResult except (SyntaxError, ImportError): from ._models import AvailableOperations # type: ignore from ._models import BotResponseList # type: ignore from ._models import Error # type: ignore from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorAutoGenerated # type: ignore + from ._models import ErrorError # type: ignore from ._models import HealthBot # type: ignore from ._models import HealthBotProperties # type: ignore from ._models import HealthBotUpdateParameters # type: ignore + from ._models import Identity # type: ignore from ._models import OperationDetail # type: ignore from ._models import OperationDisplay # type: ignore from ._models import Resource # type: ignore from ._models import Sku # type: ignore from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore + from ._models import UserAssignedIdentity # type: ignore from ._models import ValidationResult # type: ignore -from ._healthbot_enums import ( +from ._healthbot_client_enums import ( IdentityType, + ResourceIdentityType, SkuName, ) @@ -49,17 +54,20 @@ 'BotResponseList', 'Error', 'ErrorAdditionalInfo', - 'ErrorAutoGenerated', + 'ErrorError', 'HealthBot', 'HealthBotProperties', 'HealthBotUpdateParameters', + 'Identity', 'OperationDetail', 'OperationDisplay', 'Resource', 'Sku', 'SystemData', 'TrackedResource', + 'UserAssignedIdentity', 'ValidationResult', 'IdentityType', + 'ResourceIdentityType', 'SkuName', ] diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_enums.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_client_enums.py similarity index 74% rename from sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_enums.py rename to sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_client_enums.py index e08d83568cba..36b83e5d589c 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_enums.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_healthbot_client_enums.py @@ -35,8 +35,19 @@ class IdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): MANAGED_IDENTITY = "ManagedIdentity" KEY = "Key" +class ResourceIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type. The type 'SystemAssigned, UserAssigned' includes both an implicitly created + identity and a set of user assigned identities. The type 'None' will remove any identities from + the Azure Health Bot + """ + + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned" + NONE = "None" + class SkuName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The name of the HealthBot SKU + """The name of the Azure Health Bot SKU """ F0 = "F0" diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models.py index 23bd38faeb77..f35a61625d91 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models.py @@ -35,13 +35,13 @@ def __init__( class BotResponseList(msrest.serialization.Model): - """The list of Healthbot operation response. + """The list of Azure Health Bot operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar next_link: The link used to get the next page of bot service resources. :vartype next_link: str - :ivar value: Gets the list of Healthbot results and their properties. + :ivar value: Gets the list of Azure Health Bot results and their properties. :vartype value: list[~azure.mgmt.healthbot.models.HealthBot] """ @@ -68,11 +68,11 @@ class Error(msrest.serialization.Model): """The resource management error response. :param error: The error object. - :type error: ~azure.mgmt.healthbot.models.ErrorAutoGenerated + :type error: ~azure.mgmt.healthbot.models.ErrorError """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorAutoGenerated'}, + 'error': {'key': 'error', 'type': 'ErrorError'}, } def __init__( @@ -91,7 +91,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -113,7 +113,7 @@ def __init__( self.info = None -class ErrorAutoGenerated(msrest.serialization.Model): +class ErrorError(msrest.serialization.Model): """The error object. Variables are only populated by the server, and will be ignored when sending a request. @@ -150,7 +150,7 @@ def __init__( self, **kwargs ): - super(ErrorAutoGenerated, self).__init__(**kwargs) + super(ErrorError, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -246,7 +246,7 @@ def __init__( class HealthBot(TrackedResource): - """HealthBot resource definition. + """Azure Health Bot resource definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -264,9 +264,11 @@ class HealthBot(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param sku: Required. SKU of the HealthBot. + :param sku: Required. SKU of the Azure Health Bot. :type sku: ~azure.mgmt.healthbot.models.Sku - :param properties: The set of properties specific to Healthbot resource. + :param identity: The identity of the Azure Health Bot. + :type identity: ~azure.mgmt.healthbot.models.Identity + :param properties: The set of properties specific to Azure Health Bot resource. :type properties: ~azure.mgmt.healthbot.models.HealthBotProperties """ @@ -287,6 +289,7 @@ class HealthBot(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'properties': {'key': 'properties', 'type': 'HealthBotProperties'}, } @@ -296,15 +299,16 @@ def __init__( ): super(HealthBot, self).__init__(**kwargs) self.sku = kwargs['sku'] + self.identity = kwargs.get('identity', None) self.properties = kwargs.get('properties', None) class HealthBotProperties(msrest.serialization.Model): - """The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. + """The properties of a Azure Health Bot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar provisioning_state: The provisioning state of the Healthbot resource. + :ivar provisioning_state: The provisioning state of the Azure Health Bot resource. :vartype provisioning_state: str :ivar bot_management_portal_link: The link. :vartype bot_management_portal_link: str @@ -330,17 +334,20 @@ def __init__( class HealthBotUpdateParameters(msrest.serialization.Model): - """Parameters for updating a HealthBot. + """Parameters for updating a Azure Health Bot. - :param tags: A set of tags. Tags for a HealthBot. + :param tags: A set of tags. Tags for a Azure Health Bot. :type tags: dict[str, str] - :param sku: SKU of the HealthBot. + :param sku: SKU of the Azure Health Bot. :type sku: ~azure.mgmt.healthbot.models.Sku + :param identity: The identity of the Azure Health Bot. + :type identity: ~azure.mgmt.healthbot.models.Identity """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, } def __init__( @@ -350,6 +357,52 @@ def __init__( super(HealthBotUpdateParameters, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. This property will only be provided + for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. This property will only be provided for a system + assigned identity. + :vartype tenant_id: str + :param type: The identity type. The type 'SystemAssigned, UserAssigned' includes both an + implicitly created identity and a set of user assigned identities. The type 'None' will remove + any identities from the Azure Health Bot. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.healthbot.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.healthbot.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) class OperationDetail(msrest.serialization.Model): @@ -364,7 +417,7 @@ class OperationDetail(msrest.serialization.Model): :param origin: Origin of the operation. :type origin: str :param properties: Additional properties. - :type properties: object + :type properties: any """ _attribute_map = { @@ -423,8 +476,8 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the HealthBot SKU. Possible values include: "F0", "S1", - "C0". + :param name: Required. The name of the Azure Health Bot SKU. Possible values include: "F0", + "S1", "C0". :type name: str or ~azure.mgmt.healthbot.models.SkuName """ @@ -485,6 +538,36 @@ def __init__( self.last_modified_at = kwargs.get('last_modified_at', None) +class UserAssignedIdentity(msrest.serialization.Model): + """The details of the user assigned managed identity used by the Video Analyzer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class ValidationResult(msrest.serialization.Model): """The response returned from validation process. diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models_py3.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models_py3.py index 714426cbdde6..2e6d19607b28 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models_py3.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/models/_models_py3.py @@ -7,12 +7,12 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization -from ._healthbot_enums import * +from ._healthbot_client_enums import * class AvailableOperations(msrest.serialization.Model): @@ -43,13 +43,13 @@ def __init__( class BotResponseList(msrest.serialization.Model): - """The list of Healthbot operation response. + """The list of Azure Health Bot operation response. Variables are only populated by the server, and will be ignored when sending a request. :ivar next_link: The link used to get the next page of bot service resources. :vartype next_link: str - :ivar value: Gets the list of Healthbot results and their properties. + :ivar value: Gets the list of Azure Health Bot results and their properties. :vartype value: list[~azure.mgmt.healthbot.models.HealthBot] """ @@ -76,17 +76,17 @@ class Error(msrest.serialization.Model): """The resource management error response. :param error: The error object. - :type error: ~azure.mgmt.healthbot.models.ErrorAutoGenerated + :type error: ~azure.mgmt.healthbot.models.ErrorError """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorAutoGenerated'}, + 'error': {'key': 'error', 'type': 'ErrorError'}, } def __init__( self, *, - error: Optional["ErrorAutoGenerated"] = None, + error: Optional["ErrorError"] = None, **kwargs ): super(Error, self).__init__(**kwargs) @@ -101,7 +101,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: any """ _validation = { @@ -123,7 +123,7 @@ def __init__( self.info = None -class ErrorAutoGenerated(msrest.serialization.Model): +class ErrorError(msrest.serialization.Model): """The error object. Variables are only populated by the server, and will be ignored when sending a request. @@ -160,7 +160,7 @@ def __init__( self, **kwargs ): - super(ErrorAutoGenerated, self).__init__(**kwargs) + super(ErrorError, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -259,7 +259,7 @@ def __init__( class HealthBot(TrackedResource): - """HealthBot resource definition. + """Azure Health Bot resource definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -277,9 +277,11 @@ class HealthBot(TrackedResource): :type tags: dict[str, str] :param location: Required. The geo-location where the resource lives. :type location: str - :param sku: Required. SKU of the HealthBot. + :param sku: Required. SKU of the Azure Health Bot. :type sku: ~azure.mgmt.healthbot.models.Sku - :param properties: The set of properties specific to Healthbot resource. + :param identity: The identity of the Azure Health Bot. + :type identity: ~azure.mgmt.healthbot.models.Identity + :param properties: The set of properties specific to Azure Health Bot resource. :type properties: ~azure.mgmt.healthbot.models.HealthBotProperties """ @@ -300,6 +302,7 @@ class HealthBot(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, 'properties': {'key': 'properties', 'type': 'HealthBotProperties'}, } @@ -309,20 +312,22 @@ def __init__( location: str, sku: "Sku", tags: Optional[Dict[str, str]] = None, + identity: Optional["Identity"] = None, properties: Optional["HealthBotProperties"] = None, **kwargs ): super(HealthBot, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku + self.identity = identity self.properties = properties class HealthBotProperties(msrest.serialization.Model): - """The properties of a HealthBot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. + """The properties of a Azure Health Bot. The Health Bot Service is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Variables are only populated by the server, and will be ignored when sending a request. - :ivar provisioning_state: The provisioning state of the Healthbot resource. + :ivar provisioning_state: The provisioning state of the Azure Health Bot resource. :vartype provisioning_state: str :ivar bot_management_portal_link: The link. :vartype bot_management_portal_link: str @@ -348,17 +353,20 @@ def __init__( class HealthBotUpdateParameters(msrest.serialization.Model): - """Parameters for updating a HealthBot. + """Parameters for updating a Azure Health Bot. - :param tags: A set of tags. Tags for a HealthBot. + :param tags: A set of tags. Tags for a Azure Health Bot. :type tags: dict[str, str] - :param sku: SKU of the HealthBot. + :param sku: SKU of the Azure Health Bot. :type sku: ~azure.mgmt.healthbot.models.Sku + :param identity: The identity of the Azure Health Bot. + :type identity: ~azure.mgmt.healthbot.models.Identity """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, } def __init__( @@ -366,11 +374,61 @@ def __init__( *, tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, + identity: Optional["Identity"] = None, **kwargs ): super(HealthBotUpdateParameters, self).__init__(**kwargs) self.tags = tags self.sku = sku + self.identity = identity + + +class Identity(msrest.serialization.Model): + """Identity for the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of resource identity. This property will only be provided + for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of resource. This property will only be provided for a system + assigned identity. + :vartype tenant_id: str + :param type: The identity type. The type 'SystemAssigned, UserAssigned' includes both an + implicitly created identity and a set of user assigned identities. The type 'None' will remove + any identities from the Azure Health Bot. Possible values include: "SystemAssigned", + "UserAssigned", "SystemAssigned, UserAssigned", "None". + :type type: str or ~azure.mgmt.healthbot.models.ResourceIdentityType + :param user_assigned_identities: The list of user identities associated with the resource. The + user identity dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + :type user_assigned_identities: dict[str, ~azure.mgmt.healthbot.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ResourceIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + super(Identity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities class OperationDetail(msrest.serialization.Model): @@ -385,7 +443,7 @@ class OperationDetail(msrest.serialization.Model): :param origin: Origin of the operation. :type origin: str :param properties: Additional properties. - :type properties: object + :type properties: any """ _attribute_map = { @@ -403,7 +461,7 @@ def __init__( is_data_action: Optional[bool] = None, display: Optional["OperationDisplay"] = None, origin: Optional[str] = None, - properties: Optional[object] = None, + properties: Optional[Any] = None, **kwargs ): super(OperationDetail, self).__init__(**kwargs) @@ -455,8 +513,8 @@ class Sku(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param name: Required. The name of the HealthBot SKU. Possible values include: "F0", "S1", - "C0". + :param name: Required. The name of the Azure Health Bot SKU. Possible values include: "F0", + "S1", "C0". :type name: str or ~azure.mgmt.healthbot.models.SkuName """ @@ -526,6 +584,36 @@ def __init__( self.last_modified_at = last_modified_at +class UserAssignedIdentity(msrest.serialization.Model): + """The details of the user assigned managed identity used by the Video Analyzer resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of user assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class ValidationResult(msrest.serialization.Model): """The response returned from validation process. diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_bots_operations.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_bots_operations.py index e993b30526bb..8eeafd237e13 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_bots_operations.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_bots_operations.py @@ -60,7 +60,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -91,7 +91,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -114,18 +114,18 @@ def begin_create( **kwargs # type: Any ): # type: (...) -> LROPoller["_models.HealthBot"] - """Create a new HealthBot. + """Create a new Azure Health Bot. :param resource_group_name: The name of the Bot resource group in the user subscription. :type resource_group_name: str :param bot_name: The name of the Bot resource. :type bot_name: str - :param parameters: The parameters to provide for the created bot. + :param parameters: The parameters to provide for the created Azure Health Bot. :type parameters: ~azure.mgmt.healthbot.models.HealthBot :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either HealthBot or the result of cls(response) @@ -201,7 +201,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" # Construct URL @@ -227,7 +227,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('HealthBot', pipeline_response) @@ -252,7 +252,7 @@ def update( :type resource_group_name: str :param bot_name: The name of the Bot resource. :type bot_name: str - :param parameters: The parameters to provide for the required bot. + :param parameters: The parameters to provide for the required Azure Health Bot. :type parameters: ~azure.mgmt.healthbot.models.HealthBotUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: HealthBot, or the result of cls(response) @@ -264,7 +264,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -295,7 +295,7 @@ def update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -322,7 +322,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" # Construct URL @@ -348,7 +348,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -371,8 +371,8 @@ def begin_delete( :type bot_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -441,7 +441,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -482,7 +482,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -510,7 +510,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -550,7 +550,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_operations.py b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_operations.py index 4d036ab5d71b..b4ee4001fca4 100644 --- a/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_operations.py +++ b/sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/operations/_operations.py @@ -50,7 +50,7 @@ def list( **kwargs # type: Any ): # type: (...) -> Iterable["_models.AvailableOperations"] - """Lists all the available HealthBot operations. + """Lists all the available Azure Health Bot operations. :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AvailableOperations or the result of cls(response) @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-12-08" + api_version = "2021-06-10" accept = "application/json" def prepare_request(next_link=None): @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)