diff --git a/sdk/botservice/azure-mgmt-botservice/MANIFEST.in b/sdk/botservice/azure-mgmt-botservice/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/botservice/azure-mgmt-botservice/MANIFEST.in +++ b/sdk/botservice/azure-mgmt-botservice/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/botservice/azure-mgmt-botservice/_meta.json b/sdk/botservice/azure-mgmt-botservice/_meta.json new file mode 100644 index 000000000000..c611ce88f4e8 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.3.0", + "use": "@autorest/python@5.6.6", + "commit": "3666dd3310a263377b2857a7b4c0cb0bdb8536c3", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/botservice/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.6.6 --version=3.3.0", + "readme": "specification/botservice/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_azure_bot_service.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_azure_bot_service.py index fa4b4aa47fe6..2f436d87a47a 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_azure_bot_service.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_azure_bot_service.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import AzureBotServiceConfiguration from .operations import BotsOperations @@ -23,6 +24,7 @@ from .operations import DirectLineOperations from .operations import Operations from .operations import BotConnectionOperations +from .operations import HostSettingsOperations from . import models @@ -39,6 +41,8 @@ class AzureBotService(object): :vartype operations: azure.mgmt.botservice.operations.Operations :ivar bot_connection: BotConnectionOperations operations :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations + :ivar host_settings: HostSettingsOperations operations + :vartype host_settings: azure.mgmt.botservice.operations.HostSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure Subscription ID. @@ -74,6 +78,26 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.bot_connection = BotConnectionOperations( self._client, self._config, self._serialize, self._deserialize) + self.host_settings = HostSettingsOperations( + 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 diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_configuration.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_configuration.py index 59c926361691..1ea61826a5b3 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_configuration.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-06-02" + self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-botservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_metadata.json b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_metadata.json new file mode 100644 index 000000000000..b0d2e5632170 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_metadata.json @@ -0,0 +1,108 @@ +{ + "chosen_version": "2021-03-01", + "total_api_version_list": ["2021-03-01"], + "client": { + "name": "AzureBotService", + "filename": "_azure_bot_service", + "description": "Azure Bot Service is a platform for creating smart conversational agents.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "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\": [\"AzureBotServiceConfiguration\"]}}, \"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\": [\"AzureBotServiceConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "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: str,", + "description": "Azure Subscription ID.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "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, + "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", + "channels": "ChannelsOperations", + "direct_line": "DirectLineOperations", + "operations": "Operations", + "bot_connection": "BotConnectionOperations", + "host_settings": "HostSettingsOperations" + } +} \ No newline at end of file diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_version.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_version.py index e5754a47ce68..035146e99a22 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_version.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_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 = "0.2.0" diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_azure_bot_service.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_azure_bot_service.py index 5653b12abf9d..38d15c8325bb 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_azure_bot_service.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_azure_bot_service.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 @@ -21,6 +22,7 @@ from .operations import DirectLineOperations from .operations import Operations from .operations import BotConnectionOperations +from .operations import HostSettingsOperations from .. import models @@ -37,6 +39,8 @@ class AzureBotService(object): :vartype operations: azure.mgmt.botservice.aio.operations.Operations :ivar bot_connection: BotConnectionOperations operations :vartype bot_connection: azure.mgmt.botservice.aio.operations.BotConnectionOperations + :ivar host_settings: HostSettingsOperations operations + :vartype host_settings: azure.mgmt.botservice.aio.operations.HostSettingsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure Subscription ID. @@ -71,6 +75,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.bot_connection = BotConnectionOperations( self._client, self._config, self._serialize, self._deserialize) + self.host_settings = HostSettingsOperations( + 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() diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_configuration.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_configuration.py index f5294ae8651c..dd20f20ff3cc 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_configuration.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-06-02" + self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-botservice/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/__init__.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/__init__.py index 950d1a0906a2..57b1265e4d3f 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/__init__.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/__init__.py @@ -11,6 +11,7 @@ from ._direct_line_operations import DirectLineOperations from ._operations import Operations from ._bot_connection_operations import BotConnectionOperations +from ._host_settings_operations import HostSettingsOperations __all__ = [ 'BotsOperations', @@ -18,4 +19,5 @@ 'DirectLineOperations', 'Operations', 'BotConnectionOperations', + 'HostSettingsOperations', ] diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bot_connection_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bot_connection_operations.py index 4c907167a88d..c59d0184bd59 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bot_connection_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bot_connection_operations.py @@ -57,7 +57,7 @@ async def list_service_providers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -81,7 +81,7 @@ async def list_service_providers( 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('ServiceProviderResponseList', pipeline_response) @@ -117,7 +117,7 @@ async def list_with_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -144,7 +144,7 @@ async def list_with_secrets( 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('ConnectionSetting', pipeline_response) @@ -153,7 +153,7 @@ async def list_with_secrets( return cls(pipeline_response, deserialized, {}) return deserialized - list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} # type: ignore + list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets'} # type: ignore async def create( self, @@ -183,7 +183,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -215,7 +215,7 @@ async def create( 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: @@ -228,7 +228,7 @@ async def create( return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore async def update( self, @@ -258,7 +258,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -290,7 +290,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: @@ -303,7 +303,7 @@ async def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore async def get( self, @@ -330,7 +330,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -357,7 +357,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('ConnectionSetting', pipeline_response) @@ -366,7 +366,7 @@ async def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore async def delete( self, @@ -393,7 +393,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -420,13 +420,13 @@ async def delete( if response.status_code not in [200, 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: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore def list_by_bot_service( self, @@ -450,7 +450,7 @@ def list_by_bot_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -492,7 +492,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/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bots_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bots_operations.py index 287b98782792..1ef269529035 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bots_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_bots_operations.py @@ -66,7 +66,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -97,7 +97,7 @@ async def create( 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: @@ -154,7 +154,7 @@ async def update( error_map.update(kwargs.pop('error_map', {})) _parameters = _models.Bot(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -185,7 +185,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: @@ -222,7 +222,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -248,7 +248,7 @@ async def delete( if response.status_code not in [200, 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: @@ -278,7 +278,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -304,7 +304,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('Bot', pipeline_response) @@ -334,7 +334,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -375,7 +375,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) @@ -402,7 +402,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -442,7 +442,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) @@ -473,7 +473,7 @@ async def get_check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -498,7 +498,7 @@ async def get_check_name_availability( 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('CheckNameAvailabilityResponseBody', pipeline_response) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_channels_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_channels_operations.py index 209681e912e2..2d68ad0906e1 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_channels_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_channels_operations.py @@ -69,7 +69,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -101,7 +101,7 @@ async def create( 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: @@ -161,7 +161,7 @@ async def update( error_map.update(kwargs.pop('error_map', {})) _parameters = _models.BotChannel(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -193,7 +193,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: @@ -233,7 +233,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -260,7 +260,7 @@ async def delete( if response.status_code not in [200, 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: @@ -293,7 +293,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -320,7 +320,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('BotChannel', pipeline_response) @@ -356,7 +356,7 @@ async def list_with_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -383,7 +383,7 @@ async def list_with_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BotChannel', pipeline_response) @@ -416,7 +416,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -458,7 +458,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/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_direct_line_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_direct_line_operations.py index 82665a080b1c..80f21a29a72a 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_direct_line_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_direct_line_operations.py @@ -69,7 +69,7 @@ async def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -101,7 +101,7 @@ async def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BotChannel', pipeline_response) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_host_settings_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_host_settings_operations.py new file mode 100644 index 000000000000..c7ee28b5df3f --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_host_settings_operations.py @@ -0,0 +1,92 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HostSettingsOperations: + """HostSettingsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.botservice.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def get( + self, + **kwargs + ) -> "_models.HostSettingsResponse": + """Get per subscription settings needed to host bot in compute resource such as Azure App Service. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostSettingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.HostSettingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostSettingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostSettingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings'} # type: ignore diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operations.py index 0ea2eeb269d2..a9e7cec85282 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -93,8 +93,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py index 04f410757db6..bd46a4fa483c 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py @@ -34,6 +34,7 @@ from ._models_py3 import FacebookChannel from ._models_py3 import FacebookChannelProperties from ._models_py3 import FacebookPage + from ._models_py3 import HostSettingsResponse from ._models_py3 import KikChannel from ._models_py3 import KikChannelProperties from ._models_py3 import LineChannel @@ -90,6 +91,7 @@ from ._models import FacebookChannel # type: ignore from ._models import FacebookChannelProperties # type: ignore from ._models import FacebookPage # type: ignore + from ._models import HostSettingsResponse # type: ignore from ._models import KikChannel # type: ignore from ._models import KikChannelProperties # type: ignore from ._models import LineChannel # type: ignore @@ -156,6 +158,7 @@ 'FacebookChannel', 'FacebookChannelProperties', 'FacebookPage', + 'HostSettingsResponse', 'KikChannel', 'KikChannelProperties', 'LineChannel', diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_azure_bot_service_enums.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_azure_bot_service_enums.py index f2ca4a486567..68217ec6aa3e 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_azure_bot_service_enums.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_azure_bot_service_enums.py @@ -57,6 +57,7 @@ class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DESIGNER = "designer" BOT = "bot" FUNCTION = "function" + AZUREBOT = "azurebot" class RegenerateKeysChannelName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models.py index c43e5e0734f0..b6f2a6caadb7 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models.py @@ -131,7 +131,7 @@ class Resource(msrest.serialization.Model): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -187,7 +187,7 @@ class Bot(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -239,7 +239,7 @@ class BotChannel(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -306,6 +306,14 @@ class BotProperties(msrest.serialization.Model): :type luis_app_ids: list[str] :param luis_key: The LUIS Key. :type luis_key: str + :param is_cmek_enabled: Whether Cmek is enabled. + :type is_cmek_enabled: bool + :param cmek_key_vault_url: The CMK Url. + :type cmek_key_vault_url: str + :param is_isolated: Whether the bot is in an isolated network. + :type is_isolated: bool + :param schema_transformation_version: The channel schema transformation version for the bot. + :type schema_transformation_version: str """ _validation = { @@ -331,6 +339,10 @@ class BotProperties(msrest.serialization.Model): 'developer_app_insights_application_id': {'key': 'developerAppInsightsApplicationId', 'type': 'str'}, 'luis_app_ids': {'key': 'luisAppIds', 'type': '[str]'}, 'luis_key': {'key': 'luisKey', 'type': 'str'}, + 'is_cmek_enabled': {'key': 'isCmekEnabled', 'type': 'bool'}, + 'cmek_key_vault_url': {'key': 'cmekKeyVaultUrl', 'type': 'str'}, + 'is_isolated': {'key': 'isIsolated', 'type': 'bool'}, + 'schema_transformation_version': {'key': 'schemaTransformationVersion', 'type': 'str'}, } def __init__( @@ -351,6 +363,10 @@ def __init__( self.developer_app_insights_application_id = kwargs.get('developer_app_insights_application_id', None) self.luis_app_ids = kwargs.get('luis_app_ids', None) self.luis_key = kwargs.get('luis_key', None) + self.is_cmek_enabled = kwargs.get('is_cmek_enabled', None) + self.cmek_key_vault_url = kwargs.get('cmek_key_vault_url', None) + self.is_isolated = kwargs.get('is_isolated', None) + self.schema_transformation_version = kwargs.get('schema_transformation_version', None) class BotResponseList(msrest.serialization.Model): @@ -501,7 +517,7 @@ class ConnectionSetting(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -789,9 +805,12 @@ class DirectLineSpeechChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param cognitive_services_subscription_id: Required. The cognitive service subscription ID to + :param cognitive_service_region: Required. The cognitive service region with this channel + registration. + :type cognitive_service_region: str + :param cognitive_service_subscription_key: Required. The cognitive service subscription key to use with this channel registration. - :type cognitive_services_subscription_id: str + :type cognitive_service_subscription_key: str :param is_enabled: Whether this channel is enabled or not. :type is_enabled: bool :param custom_voice_deployment_id: Custom speech model id (optional). @@ -804,11 +823,13 @@ class DirectLineSpeechChannelProperties(msrest.serialization.Model): """ _validation = { - 'cognitive_services_subscription_id': {'required': True}, + 'cognitive_service_region': {'required': True}, + 'cognitive_service_subscription_key': {'required': True}, } _attribute_map = { - 'cognitive_services_subscription_id': {'key': 'cognitiveServicesSubscriptionId', 'type': 'str'}, + 'cognitive_service_region': {'key': 'cognitiveServiceRegion', 'type': 'str'}, + 'cognitive_service_subscription_key': {'key': 'cognitiveServiceSubscriptionKey', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'custom_voice_deployment_id': {'key': 'customVoiceDeploymentId', 'type': 'str'}, 'custom_speech_model_id': {'key': 'customSpeechModelId', 'type': 'str'}, @@ -820,7 +841,8 @@ def __init__( **kwargs ): super(DirectLineSpeechChannelProperties, self).__init__(**kwargs) - self.cognitive_services_subscription_id = kwargs['cognitive_services_subscription_id'] + self.cognitive_service_region = kwargs['cognitive_service_region'] + self.cognitive_service_subscription_key = kwargs['cognitive_service_subscription_key'] self.is_enabled = kwargs.get('is_enabled', None) self.custom_voice_deployment_id = kwargs.get('custom_voice_deployment_id', None) self.custom_speech_model_id = kwargs.get('custom_speech_model_id', None) @@ -863,8 +885,8 @@ class EmailChannelProperties(msrest.serialization.Model): :param email_address: Required. The email address. :type email_address: str - :param password: Required. The password for the email address. Value only returned through POST - to the action Channel List API, otherwise empty. + :param password: The password for the email address. Value only returned through POST to the + action Channel List API, otherwise empty. :type password: str :param is_enabled: Required. Whether this channel is enabled for the bot. :type is_enabled: bool @@ -872,7 +894,6 @@ class EmailChannelProperties(msrest.serialization.Model): _validation = { 'email_address': {'required': True}, - 'password': {'required': True}, 'is_enabled': {'required': True}, } @@ -888,7 +909,7 @@ def __init__( ): super(EmailChannelProperties, self).__init__(**kwargs) self.email_address = kwargs['email_address'] - self.password = kwargs['password'] + self.password = kwargs.get('password', None) self.is_enabled = kwargs['is_enabled'] @@ -984,8 +1005,8 @@ class FacebookChannelProperties(msrest.serialization.Model): :type pages: list[~azure.mgmt.botservice.models.FacebookPage] :param app_id: Required. Facebook application id. :type app_id: str - :param app_secret: Required. Facebook application secret. Value only returned through POST to - the action Channel List API, otherwise empty. + :param app_secret: Facebook application secret. Value only returned through POST to the action + Channel List API, otherwise empty. :type app_secret: str :ivar callback_url: Callback Url. :vartype callback_url: str @@ -996,7 +1017,6 @@ class FacebookChannelProperties(msrest.serialization.Model): _validation = { 'verify_token': {'readonly': True}, 'app_id': {'required': True}, - 'app_secret': {'required': True}, 'callback_url': {'readonly': True}, 'is_enabled': {'required': True}, } @@ -1018,7 +1038,7 @@ def __init__( self.verify_token = None self.pages = kwargs.get('pages', None) self.app_id = kwargs['app_id'] - self.app_secret = kwargs['app_secret'] + self.app_secret = kwargs.get('app_secret', None) self.callback_url = None self.is_enabled = kwargs['is_enabled'] @@ -1030,14 +1050,13 @@ class FacebookPage(msrest.serialization.Model): :param id: Required. Page id. :type id: str - :param access_token: Required. Facebook application access token. Value only returned through - POST to the action Channel List API, otherwise empty. + :param access_token: Facebook application access token. Value only returned through POST to the + action Channel List API, otherwise empty. :type access_token: str """ _validation = { 'id': {'required': True}, - 'access_token': {'required': True}, } _attribute_map = { @@ -1051,7 +1070,56 @@ def __init__( ): super(FacebookPage, self).__init__(**kwargs) self.id = kwargs['id'] - self.access_token = kwargs['access_token'] + self.access_token = kwargs.get('access_token', None) + + +class HostSettingsResponse(msrest.serialization.Model): + """The response body returned for a request to Bot Service Management to check per subscription hostSettings. + + :param o_auth_url: For in-conversation bot user authentication. + :type o_auth_url: str + :param to_bot_from_channel_open_id_metadata_url: For verifying incoming tokens from the + channels. + :type to_bot_from_channel_open_id_metadata_url: str + :param to_bot_from_channel_token_issuer: For verifying incoming tokens from the channels. + :type to_bot_from_channel_token_issuer: str + :param to_bot_from_emulator_open_id_metadata_url: For verifying incoming tokens from bot + emulator. + :type to_bot_from_emulator_open_id_metadata_url: str + :param to_channel_from_bot_login_url: For getting access token to channels from bot host. + :type to_channel_from_bot_login_url: str + :param to_channel_from_bot_o_auth_scope: For getting access token to channels from bot host. + :type to_channel_from_bot_o_auth_scope: str + :param validate_authority: Per cloud OAuth setting on whether authority is validated. + :type validate_authority: bool + :param bot_open_id_metadata: Same as ToBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. + :type bot_open_id_metadata: str + """ + + _attribute_map = { + 'o_auth_url': {'key': 'OAuthUrl', 'type': 'str'}, + 'to_bot_from_channel_open_id_metadata_url': {'key': 'ToBotFromChannelOpenIdMetadataUrl', 'type': 'str'}, + 'to_bot_from_channel_token_issuer': {'key': 'ToBotFromChannelTokenIssuer', 'type': 'str'}, + 'to_bot_from_emulator_open_id_metadata_url': {'key': 'ToBotFromEmulatorOpenIdMetadataUrl', 'type': 'str'}, + 'to_channel_from_bot_login_url': {'key': 'ToChannelFromBotLoginUrl', 'type': 'str'}, + 'to_channel_from_bot_o_auth_scope': {'key': 'ToChannelFromBotOAuthScope', 'type': 'str'}, + 'validate_authority': {'key': 'ValidateAuthority', 'type': 'bool'}, + 'bot_open_id_metadata': {'key': 'BotOpenIdMetadata', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(HostSettingsResponse, self).__init__(**kwargs) + self.o_auth_url = kwargs.get('o_auth_url', None) + self.to_bot_from_channel_open_id_metadata_url = kwargs.get('to_bot_from_channel_open_id_metadata_url', None) + self.to_bot_from_channel_token_issuer = kwargs.get('to_bot_from_channel_token_issuer', None) + self.to_bot_from_emulator_open_id_metadata_url = kwargs.get('to_bot_from_emulator_open_id_metadata_url', None) + self.to_channel_from_bot_login_url = kwargs.get('to_channel_from_bot_login_url', None) + self.to_channel_from_bot_o_auth_scope = kwargs.get('to_channel_from_bot_o_auth_scope', None) + self.validate_authority = kwargs.get('validate_authority', None) + self.bot_open_id_metadata = kwargs.get('bot_open_id_metadata', None) class KikChannel(Channel): @@ -1090,8 +1158,8 @@ class KikChannelProperties(msrest.serialization.Model): :param user_name: Required. The Kik user name. :type user_name: str - :param api_key: Required. Kik API key. Value only returned through POST to the action Channel - List API, otherwise empty. + :param api_key: Kik API key. Value only returned through POST to the action Channel List API, + otherwise empty. :type api_key: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -1101,7 +1169,6 @@ class KikChannelProperties(msrest.serialization.Model): _validation = { 'user_name': {'required': True}, - 'api_key': {'required': True}, 'is_enabled': {'required': True}, } @@ -1118,7 +1185,7 @@ def __init__( ): super(KikChannelProperties, self).__init__(**kwargs) self.user_name = kwargs['user_name'] - self.api_key = kwargs['api_key'] + self.api_key = kwargs.get('api_key', None) self.is_validated = kwargs.get('is_validated', None) self.is_enabled = kwargs['is_enabled'] @@ -1325,14 +1392,14 @@ class OperationEntity(msrest.serialization.Model): :param origin: The origin of the operation. :type origin: str :param properties: Additional properties. - :type properties: object + :type properties: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'str'}, } def __init__( @@ -1702,13 +1769,13 @@ class SlackChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The Slack client id. + :param client_id: The Slack client id. :type client_id: str - :param client_secret: Required. The Slack client secret. Value only returned through POST to - the action Channel List API, otherwise empty. + :param client_secret: The Slack client secret. Value only returned through POST to the action + Channel List API, otherwise empty. :type client_secret: str - :param verification_token: Required. The Slack verification token. Value only returned through - POST to the action Channel List API, otherwise empty. + :param verification_token: The Slack verification token. Value only returned through POST to + the action Channel List API, otherwise empty. :type verification_token: str :param landing_page_url: The Slack landing page Url. :type landing_page_url: str @@ -1728,9 +1795,6 @@ class SlackChannelProperties(msrest.serialization.Model): """ _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, - 'verification_token': {'required': True}, 'redirect_action': {'readonly': True}, 'last_submission_id': {'readonly': True}, 'register_before_o_auth_flow': {'readonly': True}, @@ -1756,9 +1820,9 @@ def __init__( **kwargs ): super(SlackChannelProperties, self).__init__(**kwargs) - self.client_id = kwargs['client_id'] - self.client_secret = kwargs['client_secret'] - self.verification_token = kwargs['verification_token'] + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.verification_token = kwargs.get('verification_token', None) self.landing_page_url = kwargs.get('landing_page_url', None) self.redirect_action = None self.last_submission_id = None @@ -1807,8 +1871,8 @@ class SmsChannelProperties(msrest.serialization.Model): :param account_sid: Required. The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. :type account_sid: str - :param auth_token: Required. The Sms auth token. Value only returned through POST to the action - Channel List API, otherwise empty. + :param auth_token: The Sms auth token. Value only returned through POST to the action Channel + List API, otherwise empty. :type auth_token: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -1819,7 +1883,6 @@ class SmsChannelProperties(msrest.serialization.Model): _validation = { 'phone': {'required': True}, 'account_sid': {'required': True}, - 'auth_token': {'required': True}, 'is_enabled': {'required': True}, } @@ -1838,7 +1901,7 @@ def __init__( super(SmsChannelProperties, self).__init__(**kwargs) self.phone = kwargs['phone'] self.account_sid = kwargs['account_sid'] - self.auth_token = kwargs['auth_token'] + self.auth_token = kwargs.get('auth_token', None) self.is_validated = kwargs.get('is_validated', None) self.is_enabled = kwargs['is_enabled'] @@ -1877,8 +1940,8 @@ class TelegramChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param access_token: Required. The Telegram access token. Value only returned through POST to - the action Channel List API, otherwise empty. + :param access_token: The Telegram access token. Value only returned through POST to the action + Channel List API, otherwise empty. :type access_token: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -1887,7 +1950,6 @@ class TelegramChannelProperties(msrest.serialization.Model): """ _validation = { - 'access_token': {'required': True}, 'is_enabled': {'required': True}, } @@ -1902,7 +1964,7 @@ def __init__( **kwargs ): super(TelegramChannelProperties, self).__init__(**kwargs) - self.access_token = kwargs['access_token'] + self.access_token = kwargs.get('access_token', None) self.is_validated = kwargs.get('is_validated', None) self.is_enabled = kwargs['is_enabled'] diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models_py3.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models_py3.py index ffcc04f4de47..f9c407170456 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models_py3.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/models/_models_py3.py @@ -140,7 +140,7 @@ class Resource(msrest.serialization.Model): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -202,7 +202,7 @@ class Bot(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -261,7 +261,7 @@ class BotChannel(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -335,6 +335,14 @@ class BotProperties(msrest.serialization.Model): :type luis_app_ids: list[str] :param luis_key: The LUIS Key. :type luis_key: str + :param is_cmek_enabled: Whether Cmek is enabled. + :type is_cmek_enabled: bool + :param cmek_key_vault_url: The CMK Url. + :type cmek_key_vault_url: str + :param is_isolated: Whether the bot is in an isolated network. + :type is_isolated: bool + :param schema_transformation_version: The channel schema transformation version for the bot. + :type schema_transformation_version: str """ _validation = { @@ -360,6 +368,10 @@ class BotProperties(msrest.serialization.Model): 'developer_app_insights_application_id': {'key': 'developerAppInsightsApplicationId', 'type': 'str'}, 'luis_app_ids': {'key': 'luisAppIds', 'type': '[str]'}, 'luis_key': {'key': 'luisKey', 'type': 'str'}, + 'is_cmek_enabled': {'key': 'isCmekEnabled', 'type': 'bool'}, + 'cmek_key_vault_url': {'key': 'cmekKeyVaultUrl', 'type': 'str'}, + 'is_isolated': {'key': 'isIsolated', 'type': 'bool'}, + 'schema_transformation_version': {'key': 'schemaTransformationVersion', 'type': 'str'}, } def __init__( @@ -375,6 +387,10 @@ def __init__( developer_app_insights_application_id: Optional[str] = None, luis_app_ids: Optional[List[str]] = None, luis_key: Optional[str] = None, + is_cmek_enabled: Optional[bool] = None, + cmek_key_vault_url: Optional[str] = None, + is_isolated: Optional[bool] = None, + schema_transformation_version: Optional[str] = None, **kwargs ): super(BotProperties, self).__init__(**kwargs) @@ -391,6 +407,10 @@ def __init__( self.developer_app_insights_application_id = developer_app_insights_application_id self.luis_app_ids = luis_app_ids self.luis_key = luis_key + self.is_cmek_enabled = is_cmek_enabled + self.cmek_key_vault_url = cmek_key_vault_url + self.is_isolated = is_isolated + self.schema_transformation_version = schema_transformation_version class BotResponseList(msrest.serialization.Model): @@ -551,7 +571,7 @@ class ConnectionSetting(Resource): :param sku: Gets or sets the SKU of the resource. :type sku: ~azure.mgmt.botservice.models.Sku :param kind: Required. Gets or sets the Kind of the resource. Possible values include: "sdk", - "designer", "bot", "function". + "designer", "bot", "function", "azurebot". :type kind: str or ~azure.mgmt.botservice.models.Kind :param etag: Entity Tag. :type etag: str @@ -871,9 +891,12 @@ class DirectLineSpeechChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param cognitive_services_subscription_id: Required. The cognitive service subscription ID to + :param cognitive_service_region: Required. The cognitive service region with this channel + registration. + :type cognitive_service_region: str + :param cognitive_service_subscription_key: Required. The cognitive service subscription key to use with this channel registration. - :type cognitive_services_subscription_id: str + :type cognitive_service_subscription_key: str :param is_enabled: Whether this channel is enabled or not. :type is_enabled: bool :param custom_voice_deployment_id: Custom speech model id (optional). @@ -886,11 +909,13 @@ class DirectLineSpeechChannelProperties(msrest.serialization.Model): """ _validation = { - 'cognitive_services_subscription_id': {'required': True}, + 'cognitive_service_region': {'required': True}, + 'cognitive_service_subscription_key': {'required': True}, } _attribute_map = { - 'cognitive_services_subscription_id': {'key': 'cognitiveServicesSubscriptionId', 'type': 'str'}, + 'cognitive_service_region': {'key': 'cognitiveServiceRegion', 'type': 'str'}, + 'cognitive_service_subscription_key': {'key': 'cognitiveServiceSubscriptionKey', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'custom_voice_deployment_id': {'key': 'customVoiceDeploymentId', 'type': 'str'}, 'custom_speech_model_id': {'key': 'customSpeechModelId', 'type': 'str'}, @@ -900,7 +925,8 @@ class DirectLineSpeechChannelProperties(msrest.serialization.Model): def __init__( self, *, - cognitive_services_subscription_id: str, + cognitive_service_region: str, + cognitive_service_subscription_key: str, is_enabled: Optional[bool] = None, custom_voice_deployment_id: Optional[str] = None, custom_speech_model_id: Optional[str] = None, @@ -908,7 +934,8 @@ def __init__( **kwargs ): super(DirectLineSpeechChannelProperties, self).__init__(**kwargs) - self.cognitive_services_subscription_id = cognitive_services_subscription_id + self.cognitive_service_region = cognitive_service_region + self.cognitive_service_subscription_key = cognitive_service_subscription_key self.is_enabled = is_enabled self.custom_voice_deployment_id = custom_voice_deployment_id self.custom_speech_model_id = custom_speech_model_id @@ -953,8 +980,8 @@ class EmailChannelProperties(msrest.serialization.Model): :param email_address: Required. The email address. :type email_address: str - :param password: Required. The password for the email address. Value only returned through POST - to the action Channel List API, otherwise empty. + :param password: The password for the email address. Value only returned through POST to the + action Channel List API, otherwise empty. :type password: str :param is_enabled: Required. Whether this channel is enabled for the bot. :type is_enabled: bool @@ -962,7 +989,6 @@ class EmailChannelProperties(msrest.serialization.Model): _validation = { 'email_address': {'required': True}, - 'password': {'required': True}, 'is_enabled': {'required': True}, } @@ -976,8 +1002,8 @@ def __init__( self, *, email_address: str, - password: str, is_enabled: bool, + password: Optional[str] = None, **kwargs ): super(EmailChannelProperties, self).__init__(**kwargs) @@ -1085,8 +1111,8 @@ class FacebookChannelProperties(msrest.serialization.Model): :type pages: list[~azure.mgmt.botservice.models.FacebookPage] :param app_id: Required. Facebook application id. :type app_id: str - :param app_secret: Required. Facebook application secret. Value only returned through POST to - the action Channel List API, otherwise empty. + :param app_secret: Facebook application secret. Value only returned through POST to the action + Channel List API, otherwise empty. :type app_secret: str :ivar callback_url: Callback Url. :vartype callback_url: str @@ -1097,7 +1123,6 @@ class FacebookChannelProperties(msrest.serialization.Model): _validation = { 'verify_token': {'readonly': True}, 'app_id': {'required': True}, - 'app_secret': {'required': True}, 'callback_url': {'readonly': True}, 'is_enabled': {'required': True}, } @@ -1115,9 +1140,9 @@ def __init__( self, *, app_id: str, - app_secret: str, is_enabled: bool, pages: Optional[List["FacebookPage"]] = None, + app_secret: Optional[str] = None, **kwargs ): super(FacebookChannelProperties, self).__init__(**kwargs) @@ -1136,14 +1161,13 @@ class FacebookPage(msrest.serialization.Model): :param id: Required. Page id. :type id: str - :param access_token: Required. Facebook application access token. Value only returned through - POST to the action Channel List API, otherwise empty. + :param access_token: Facebook application access token. Value only returned through POST to the + action Channel List API, otherwise empty. :type access_token: str """ _validation = { 'id': {'required': True}, - 'access_token': {'required': True}, } _attribute_map = { @@ -1155,7 +1179,7 @@ def __init__( self, *, id: str, - access_token: str, + access_token: Optional[str] = None, **kwargs ): super(FacebookPage, self).__init__(**kwargs) @@ -1163,6 +1187,64 @@ def __init__( self.access_token = access_token +class HostSettingsResponse(msrest.serialization.Model): + """The response body returned for a request to Bot Service Management to check per subscription hostSettings. + + :param o_auth_url: For in-conversation bot user authentication. + :type o_auth_url: str + :param to_bot_from_channel_open_id_metadata_url: For verifying incoming tokens from the + channels. + :type to_bot_from_channel_open_id_metadata_url: str + :param to_bot_from_channel_token_issuer: For verifying incoming tokens from the channels. + :type to_bot_from_channel_token_issuer: str + :param to_bot_from_emulator_open_id_metadata_url: For verifying incoming tokens from bot + emulator. + :type to_bot_from_emulator_open_id_metadata_url: str + :param to_channel_from_bot_login_url: For getting access token to channels from bot host. + :type to_channel_from_bot_login_url: str + :param to_channel_from_bot_o_auth_scope: For getting access token to channels from bot host. + :type to_channel_from_bot_o_auth_scope: str + :param validate_authority: Per cloud OAuth setting on whether authority is validated. + :type validate_authority: bool + :param bot_open_id_metadata: Same as ToBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. + :type bot_open_id_metadata: str + """ + + _attribute_map = { + 'o_auth_url': {'key': 'OAuthUrl', 'type': 'str'}, + 'to_bot_from_channel_open_id_metadata_url': {'key': 'ToBotFromChannelOpenIdMetadataUrl', 'type': 'str'}, + 'to_bot_from_channel_token_issuer': {'key': 'ToBotFromChannelTokenIssuer', 'type': 'str'}, + 'to_bot_from_emulator_open_id_metadata_url': {'key': 'ToBotFromEmulatorOpenIdMetadataUrl', 'type': 'str'}, + 'to_channel_from_bot_login_url': {'key': 'ToChannelFromBotLoginUrl', 'type': 'str'}, + 'to_channel_from_bot_o_auth_scope': {'key': 'ToChannelFromBotOAuthScope', 'type': 'str'}, + 'validate_authority': {'key': 'ValidateAuthority', 'type': 'bool'}, + 'bot_open_id_metadata': {'key': 'BotOpenIdMetadata', 'type': 'str'}, + } + + def __init__( + self, + *, + o_auth_url: Optional[str] = None, + to_bot_from_channel_open_id_metadata_url: Optional[str] = None, + to_bot_from_channel_token_issuer: Optional[str] = None, + to_bot_from_emulator_open_id_metadata_url: Optional[str] = None, + to_channel_from_bot_login_url: Optional[str] = None, + to_channel_from_bot_o_auth_scope: Optional[str] = None, + validate_authority: Optional[bool] = None, + bot_open_id_metadata: Optional[str] = None, + **kwargs + ): + super(HostSettingsResponse, self).__init__(**kwargs) + self.o_auth_url = o_auth_url + self.to_bot_from_channel_open_id_metadata_url = to_bot_from_channel_open_id_metadata_url + self.to_bot_from_channel_token_issuer = to_bot_from_channel_token_issuer + self.to_bot_from_emulator_open_id_metadata_url = to_bot_from_emulator_open_id_metadata_url + self.to_channel_from_bot_login_url = to_channel_from_bot_login_url + self.to_channel_from_bot_o_auth_scope = to_channel_from_bot_o_auth_scope + self.validate_authority = validate_authority + self.bot_open_id_metadata = bot_open_id_metadata + + class KikChannel(Channel): """Kik channel definition. @@ -1201,8 +1283,8 @@ class KikChannelProperties(msrest.serialization.Model): :param user_name: Required. The Kik user name. :type user_name: str - :param api_key: Required. Kik API key. Value only returned through POST to the action Channel - List API, otherwise empty. + :param api_key: Kik API key. Value only returned through POST to the action Channel List API, + otherwise empty. :type api_key: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -1212,7 +1294,6 @@ class KikChannelProperties(msrest.serialization.Model): _validation = { 'user_name': {'required': True}, - 'api_key': {'required': True}, 'is_enabled': {'required': True}, } @@ -1227,8 +1308,8 @@ def __init__( self, *, user_name: str, - api_key: str, is_enabled: bool, + api_key: Optional[str] = None, is_validated: Optional[bool] = None, **kwargs ): @@ -1459,14 +1540,14 @@ class OperationEntity(msrest.serialization.Model): :param origin: The origin of the operation. :type origin: str :param properties: Additional properties. - :type properties: object + :type properties: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, 'origin': {'key': 'origin', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'object'}, + 'properties': {'key': 'properties', 'type': 'str'}, } def __init__( @@ -1475,7 +1556,7 @@ def __init__( name: Optional[str] = None, display: Optional["OperationDisplayInfo"] = None, origin: Optional[str] = None, - properties: Optional[object] = None, + properties: Optional[str] = None, **kwargs ): super(OperationEntity, self).__init__(**kwargs) @@ -1869,13 +1950,13 @@ class SlackChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_id: Required. The Slack client id. + :param client_id: The Slack client id. :type client_id: str - :param client_secret: Required. The Slack client secret. Value only returned through POST to - the action Channel List API, otherwise empty. + :param client_secret: The Slack client secret. Value only returned through POST to the action + Channel List API, otherwise empty. :type client_secret: str - :param verification_token: Required. The Slack verification token. Value only returned through - POST to the action Channel List API, otherwise empty. + :param verification_token: The Slack verification token. Value only returned through POST to + the action Channel List API, otherwise empty. :type verification_token: str :param landing_page_url: The Slack landing page Url. :type landing_page_url: str @@ -1895,9 +1976,6 @@ class SlackChannelProperties(msrest.serialization.Model): """ _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, - 'verification_token': {'required': True}, 'redirect_action': {'readonly': True}, 'last_submission_id': {'readonly': True}, 'register_before_o_auth_flow': {'readonly': True}, @@ -1921,10 +1999,10 @@ class SlackChannelProperties(msrest.serialization.Model): def __init__( self, *, - client_id: str, - client_secret: str, - verification_token: str, is_enabled: bool, + client_id: Optional[str] = None, + client_secret: Optional[str] = None, + verification_token: Optional[str] = None, landing_page_url: Optional[str] = None, signing_secret: Optional[str] = None, **kwargs @@ -1983,8 +2061,8 @@ class SmsChannelProperties(msrest.serialization.Model): :param account_sid: Required. The Sms account SID. Value only returned through POST to the action Channel List API, otherwise empty. :type account_sid: str - :param auth_token: Required. The Sms auth token. Value only returned through POST to the action - Channel List API, otherwise empty. + :param auth_token: The Sms auth token. Value only returned through POST to the action Channel + List API, otherwise empty. :type auth_token: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -1995,7 +2073,6 @@ class SmsChannelProperties(msrest.serialization.Model): _validation = { 'phone': {'required': True}, 'account_sid': {'required': True}, - 'auth_token': {'required': True}, 'is_enabled': {'required': True}, } @@ -2012,8 +2089,8 @@ def __init__( *, phone: str, account_sid: str, - auth_token: str, is_enabled: bool, + auth_token: Optional[str] = None, is_validated: Optional[bool] = None, **kwargs ): @@ -2061,8 +2138,8 @@ class TelegramChannelProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param access_token: Required. The Telegram access token. Value only returned through POST to - the action Channel List API, otherwise empty. + :param access_token: The Telegram access token. Value only returned through POST to the action + Channel List API, otherwise empty. :type access_token: str :param is_validated: Whether this channel is validated for the bot. :type is_validated: bool @@ -2071,7 +2148,6 @@ class TelegramChannelProperties(msrest.serialization.Model): """ _validation = { - 'access_token': {'required': True}, 'is_enabled': {'required': True}, } @@ -2084,8 +2160,8 @@ class TelegramChannelProperties(msrest.serialization.Model): def __init__( self, *, - access_token: str, is_enabled: bool, + access_token: Optional[str] = None, is_validated: Optional[bool] = None, **kwargs ): diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py index 950d1a0906a2..57b1265e4d3f 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py @@ -11,6 +11,7 @@ from ._direct_line_operations import DirectLineOperations from ._operations import Operations from ._bot_connection_operations import BotConnectionOperations +from ._host_settings_operations import HostSettingsOperations __all__ = [ 'BotsOperations', @@ -18,4 +19,5 @@ 'DirectLineOperations', 'Operations', 'BotConnectionOperations', + 'HostSettingsOperations', ] diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bot_connection_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bot_connection_operations.py index bb5900d46dd8..c0bfd7861cc7 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bot_connection_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bot_connection_operations.py @@ -62,7 +62,7 @@ def list_service_providers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -86,7 +86,7 @@ def list_service_providers( 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('ServiceProviderResponseList', pipeline_response) @@ -123,7 +123,7 @@ def list_with_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -150,7 +150,7 @@ def list_with_secrets( 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('ConnectionSetting', pipeline_response) @@ -159,7 +159,7 @@ def list_with_secrets( return cls(pipeline_response, deserialized, {}) return deserialized - list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} # type: ignore + list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}/listWithSecrets'} # type: ignore def create( self, @@ -190,7 +190,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -222,7 +222,7 @@ def create( 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: @@ -235,7 +235,7 @@ def create( return cls(pipeline_response, deserialized, {}) return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore def update( self, @@ -266,7 +266,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -298,7 +298,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: @@ -311,7 +311,7 @@ def update( return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore def get( self, @@ -339,7 +339,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -366,7 +366,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('ConnectionSetting', pipeline_response) @@ -375,7 +375,7 @@ def get( return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore def delete( self, @@ -403,7 +403,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -430,13 +430,13 @@ def delete( if response.status_code not in [200, 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: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} # type: ignore + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections/{connectionName}'} # type: ignore def list_by_bot_service( self, @@ -461,7 +461,7 @@ def list_by_bot_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -503,7 +503,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/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bots_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bots_operations.py index 2ad17d041e73..ed7fd2484627 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bots_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_bots_operations.py @@ -71,7 +71,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -102,7 +102,7 @@ def create( 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: @@ -160,7 +160,7 @@ def update( error_map.update(kwargs.pop('error_map', {})) _parameters = _models.Bot(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -191,7 +191,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: @@ -229,7 +229,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -255,7 +255,7 @@ def delete( if response.status_code not in [200, 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: @@ -286,7 +286,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -312,7 +312,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('Bot', pipeline_response) @@ -343,7 +343,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -384,7 +384,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) @@ -412,7 +412,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -452,7 +452,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) @@ -484,7 +484,7 @@ def get_check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -509,7 +509,7 @@ def get_check_name_availability( 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('CheckNameAvailabilityResponseBody', pipeline_response) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_channels_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_channels_operations.py index 7a8c954c4b50..8b4d14b36711 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_channels_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_channels_operations.py @@ -74,7 +74,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -106,7 +106,7 @@ def create( 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: @@ -167,7 +167,7 @@ def update( error_map.update(kwargs.pop('error_map', {})) _parameters = _models.BotChannel(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -199,7 +199,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: @@ -240,7 +240,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -267,7 +267,7 @@ def delete( if response.status_code not in [200, 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: @@ -301,7 +301,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -328,7 +328,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('BotChannel', pipeline_response) @@ -365,7 +365,7 @@ def list_with_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -392,7 +392,7 @@ def list_with_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BotChannel', pipeline_response) @@ -426,7 +426,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -468,7 +468,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/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_direct_line_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_direct_line_operations.py index c12c09676583..4f1f776163b0 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_direct_line_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_direct_line_operations.py @@ -74,7 +74,7 @@ def regenerate_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -106,7 +106,7 @@ def regenerate_keys( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.Error, response) + error = self._deserialize.failsafe_deserialize(_models.Error, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('BotChannel', pipeline_response) diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_host_settings_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_host_settings_operations.py new file mode 100644 index 000000000000..5f893242d0d2 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_host_settings_operations.py @@ -0,0 +1,97 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class HostSettingsOperations(object): + """HostSettingsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.botservice.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def get( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.HostSettingsResponse" + """Get per subscription settings needed to host bot in compute resource such as Azure App Service. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: HostSettingsResponse, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.HostSettingsResponse + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.HostSettingsResponse"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.Error, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('HostSettingsResponse', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/hostSettings'} # type: ignore diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operations.py index 27ee58aab60a..70b0dc376668 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operations.py +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-02" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -98,8 +98,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + 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, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response