diff --git a/sdk/botservice/azure-mgmt-botservice/_meta.json b/sdk/botservice/azure-mgmt-botservice/_meta.json index 1a49081aec348..2b33c1a06bcb8 100644 --- a/sdk/botservice/azure-mgmt-botservice/_meta.json +++ b/sdk/botservice/azure-mgmt-botservice/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", - "@autorest/modelerfour@4.19.1" + "@autorest/python@5.8.4", + "@autorest/modelerfour@4.19.2" ], - "commit": "e23a53d64f46db42df2886989a3436f7431168f4", + "commit": "bd64220293a403f70ae8beebd56fb86951007acf", "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.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", + "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.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "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 2f436d87a47a2..2c291ccd37b72 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 @@ -25,6 +25,9 @@ from .operations import Operations from .operations import BotConnectionOperations from .operations import HostSettingsOperations +from .operations import OperationResultsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from . import models @@ -43,11 +46,18 @@ class AzureBotService(object): :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations :ivar host_settings: HostSettingsOperations operations :vartype host_settings: azure.mgmt.botservice.operations.HostSettingsOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: azure.mgmt.botservice.operations.OperationResultsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.botservice.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.botservice.operations.PrivateLinkResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -80,6 +90,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.host_settings = HostSettingsOperations( self._client, self._config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): # type: (HttpRequest, Any) -> HttpResponse 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 1ea61826a5b3b..893f909770abe 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 = "2021-03-01" + self.api_version = "2021-05-01-preview" 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 index b0d2e56321705..1e0cd9310167e 100644 --- a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_metadata.json +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-03-01", - "total_api_version_list": ["2021-03-01"], + "chosen_version": "2021-05-01-preview", + "total_api_version_list": ["2021-05-01-preview"], "client": { "name": "AzureBotService", "filename": "_azure_bot_service", @@ -8,7 +8,7 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": false, + "has_lro_operations": true, "client_side_validation": false, "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"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\"]}}}" @@ -103,6 +103,9 @@ "direct_line": "DirectLineOperations", "operations": "Operations", "bot_connection": "BotConnectionOperations", - "host_settings": "HostSettingsOperations" + "host_settings": "HostSettingsOperations", + "operation_results": "OperationResultsOperations", + "private_endpoint_connections": "PrivateEndpointConnectionsOperations", + "private_link_resources": "PrivateLinkResourcesOperations" } } \ 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 c47f66669f1bf..035146e99a22e 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.0" +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 38d15c8325bbb..f9d38276af181 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 @@ -23,6 +23,9 @@ from .operations import Operations from .operations import BotConnectionOperations from .operations import HostSettingsOperations +from .operations import OperationResultsOperations +from .operations import PrivateEndpointConnectionsOperations +from .operations import PrivateLinkResourcesOperations from .. import models @@ -41,11 +44,18 @@ class AzureBotService(object): :vartype bot_connection: azure.mgmt.botservice.aio.operations.BotConnectionOperations :ivar host_settings: HostSettingsOperations operations :vartype host_settings: azure.mgmt.botservice.aio.operations.HostSettingsOperations + :ivar operation_results: OperationResultsOperations operations + :vartype operation_results: azure.mgmt.botservice.aio.operations.OperationResultsOperations + :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations + :vartype private_endpoint_connections: azure.mgmt.botservice.aio.operations.PrivateEndpointConnectionsOperations + :ivar private_link_resources: PrivateLinkResourcesOperations operations + :vartype private_link_resources: azure.mgmt.botservice.aio.operations.PrivateLinkResourcesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ def __init__( @@ -77,6 +87,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.host_settings = HostSettingsOperations( self._client, self._config, self._serialize, self._deserialize) + self.operation_results = OperationResultsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.private_link_resources = PrivateLinkResourcesOperations( + 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. 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 dd20f20ff3cc2..18a1ebb9e0b62 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 = "2021-03-01" + self.api_version = "2021-05-01-preview" 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 57b1265e4d3fc..89604c7b3d530 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 @@ -12,6 +12,9 @@ from ._operations import Operations from ._bot_connection_operations import BotConnectionOperations from ._host_settings_operations import HostSettingsOperations +from ._operation_results_operations import OperationResultsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'BotsOperations', @@ -20,4 +23,7 @@ 'Operations', 'BotConnectionOperations', 'HostSettingsOperations', + 'OperationResultsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] 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 b3f52991b3702..d480838751e42 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 = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -117,7 +117,7 @@ async def list_with_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -183,7 +183,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -258,7 +258,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -330,7 +330,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -393,7 +393,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -450,7 +450,7 @@ def list_by_bot_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 f4aeb496f22e7..216672c23d125 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -222,7 +222,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -278,7 +278,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -334,7 +334,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -402,7 +402,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 a67700e64ffbc..23025697d1421 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -233,7 +233,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -293,7 +293,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -356,7 +356,7 @@ async def list_with_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -416,7 +416,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 8476401cb3d26..fa8623183b774 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 index adb542bfc0810..6be51b02b1dcb 100644 --- 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 @@ -56,7 +56,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operation_results_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operation_results_operations.py new file mode 100644 index 0000000000000..740683a9d8f38 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_operation_results_operations.py @@ -0,0 +1,153 @@ +# 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, Union +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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class OperationResultsOperations: + """OperationResultsOperations 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_initial( + self, + operation_result_id: str, + **kwargs: Any + ) -> Optional["_models.OperationResultsDescription"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationResultsDescription"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._get_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResultsDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}'} # type: ignore + + async def begin_get( + self, + operation_result_id: str, + **kwargs: Any + ) -> AsyncLROPoller["_models.OperationResultsDescription"]: + """Get the operation result for a long running operation. + + :param operation_result_id: The ID of the operation result to get. + :type operation_result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either OperationResultsDescription or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.botservice.models.OperationResultsDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultsDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._get_initial( + operation_result_id=operation_result_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResultsDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}'} # 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 2c6d92928bd59..88de23ccf2f3d 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 = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_endpoint_connections_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..107ff6a0cacf7 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,314 @@ +# 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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +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 PrivateEndpointConnectionsOperations: + """PrivateEndpointConnectionsOperations 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 + + def list( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PrivateEndpointConnectionListResult"]: + """List all the private endpoint connections associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.botservice.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + 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, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections'} # type: ignore + + async def get( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Gets the specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def create( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + properties: "_models.PrivateEndpointConnection", + **kwargs: Any + ) -> "_models.PrivateEndpointConnection": + """Update the state of specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + resource_name: str, + private_endpoint_connection_name: str, + **kwargs: Any + ) -> None: + """Deletes the specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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.delete(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, 204]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_link_resources_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..0b45cdad264db --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/aio/operations/_private_link_resources_operations.py @@ -0,0 +1,100 @@ +# 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 PrivateLinkResourcesOperations: + """PrivateLinkResourcesOperations 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 list_by_bot_resource( + self, + resource_group_name: str, + resource_name: str, + **kwargs: Any + ) -> "_models.PrivateLinkResourceListResult": + """Gets the private link resources that need to be created for a Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_bot_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_bot_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources'} # type: ignore 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 bd46a4fa483c4..4e8beb42fdc2f 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 @@ -45,6 +45,14 @@ from ._models_py3 import OperationDisplayInfo from ._models_py3 import OperationEntity from ._models_py3 import OperationEntityListResult + from ._models_py3 import OperationResultsDescription + from ._models_py3 import PrivateEndpoint + from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionListResult + from ._models_py3 import PrivateLinkResource + from ._models_py3 import PrivateLinkResourceBase + from ._models_py3 import PrivateLinkResourceListResult + from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import Resource from ._models_py3 import ServiceProvider from ._models_py3 import ServiceProviderParameter @@ -102,6 +110,14 @@ from ._models import OperationDisplayInfo # type: ignore from ._models import OperationEntity # type: ignore from ._models import OperationEntityListResult # type: ignore + from ._models import OperationResultsDescription # type: ignore + from ._models import PrivateEndpoint # type: ignore + from ._models import PrivateEndpointConnection # type: ignore + from ._models import PrivateEndpointConnectionListResult # type: ignore + from ._models import PrivateLinkResource # type: ignore + from ._models import PrivateLinkResourceBase # type: ignore + from ._models import PrivateLinkResourceListResult # type: ignore + from ._models import PrivateLinkServiceConnectionState # type: ignore from ._models import Resource # type: ignore from ._models import ServiceProvider # type: ignore from ._models import ServiceProviderParameter # type: ignore @@ -125,6 +141,10 @@ ChannelName, Key, Kind, + MsaAppType, + OperationResultStatus, + PrivateEndpointConnectionProvisioningState, + PrivateEndpointServiceConnectionStatus, RegenerateKeysChannelName, SkuName, SkuTier, @@ -169,6 +189,14 @@ 'OperationDisplayInfo', 'OperationEntity', 'OperationEntityListResult', + 'OperationResultsDescription', + 'PrivateEndpoint', + 'PrivateEndpointConnection', + 'PrivateEndpointConnectionListResult', + 'PrivateLinkResource', + 'PrivateLinkResourceBase', + 'PrivateLinkResourceListResult', + 'PrivateLinkServiceConnectionState', 'Resource', 'ServiceProvider', 'ServiceProviderParameter', @@ -190,6 +218,10 @@ 'ChannelName', 'Key', 'Kind', + 'MsaAppType', + 'OperationResultStatus', + 'PrivateEndpointConnectionProvisioningState', + 'PrivateEndpointServiceConnectionStatus', 'RegenerateKeysChannelName', 'SkuName', 'SkuTier', 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 68217ec6aa3e3..36942b6cdd5a5 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 @@ -59,6 +59,41 @@ class Kind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FUNCTION = "function" AZUREBOT = "azurebot" +class MsaAppType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Microsoft App Type for the bot + """ + + USER_ASSIGNED_MSI = "UserAssignedMSI" + SINGLE_TENANT = "SingleTenant" + MULTI_TENANT = "MultiTenant" + +class OperationResultStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the operation being performed. + """ + + CANCELED = "Canceled" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + REQUESTED = "Requested" + RUNNING = "Running" + +class PrivateEndpointConnectionProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + SUCCEEDED = "Succeeded" + CREATING = "Creating" + DELETING = "Deleting" + FAILED = "Failed" + +class PrivateEndpointServiceConnectionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The private endpoint connection status. + """ + + PENDING = "Pending" + APPROVED = "Approved" + REJECTED = "Rejected" + class RegenerateKeysChannelName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): WEB_CHAT_CHANNEL = "WebChatChannel" 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 e6e002c385136..d784c6c6e2c3d 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 @@ -290,8 +290,15 @@ class BotProperties(msrest.serialization.Model): :type endpoint: str :ivar endpoint_version: The bot's endpoint version. :vartype endpoint_version: str + :param msa_app_type: Microsoft App Type for the bot. Possible values include: + "UserAssignedMSI", "SingleTenant", "MultiTenant". + :type msa_app_type: str or ~azure.mgmt.botservice.models.MsaAppType :param msa_app_id: Required. Microsoft App Id for the bot. :type msa_app_id: str + :param msa_app_tenant_id: Microsoft App Tenant Id for the bot. + :type msa_app_tenant_id: str + :param msa_app_msi_resource_id: Microsoft App Managed Identity Resource Id for the bot. + :type msa_app_msi_resource_id: str :ivar configured_channels: Collection of channels for which the bot is configured. :vartype configured_channels: list[str] :ivar enabled_channels: Collection of channels for which the bot is enabled. @@ -312,8 +319,21 @@ class BotProperties(msrest.serialization.Model): :type cmek_key_vault_url: str :param is_isolated: Whether the bot is in an isolated network. :type is_isolated: bool + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool :param schema_transformation_version: The channel schema transformation version for the bot. :type schema_transformation_version: str + :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the + bot. + :vartype private_endpoint_connections: + list[~azure.mgmt.botservice.models.PrivateEndpointConnection] + :param open_with_hint: The hint to browser (e.g. protocol handler) on how to open the bot for + authoring. + :type open_with_hint: str + :param app_password_hint: The hint (e.g. keyVault secret resourceId) on how to fetch the app + secret. + :type app_password_hint: str """ _validation = { @@ -323,6 +343,7 @@ class BotProperties(msrest.serialization.Model): 'msa_app_id': {'required': True}, 'configured_channels': {'readonly': True}, 'enabled_channels': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -331,7 +352,10 @@ class BotProperties(msrest.serialization.Model): 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'endpoint_version': {'key': 'endpointVersion', 'type': 'str'}, + 'msa_app_type': {'key': 'msaAppType', 'type': 'str'}, 'msa_app_id': {'key': 'msaAppId', 'type': 'str'}, + 'msa_app_tenant_id': {'key': 'msaAppTenantId', 'type': 'str'}, + 'msa_app_msi_resource_id': {'key': 'msaAppMSIResourceId', 'type': 'str'}, 'configured_channels': {'key': 'configuredChannels', 'type': '[str]'}, 'enabled_channels': {'key': 'enabledChannels', 'type': '[str]'}, 'developer_app_insight_key': {'key': 'developerAppInsightKey', 'type': 'str'}, @@ -342,7 +366,11 @@ class BotProperties(msrest.serialization.Model): 'is_cmek_enabled': {'key': 'isCmekEnabled', 'type': 'bool'}, 'cmek_key_vault_url': {'key': 'cmekKeyVaultUrl', 'type': 'str'}, 'is_isolated': {'key': 'isIsolated', 'type': 'bool'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, 'schema_transformation_version': {'key': 'schemaTransformationVersion', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'open_with_hint': {'key': 'openWithHint', 'type': 'str'}, + 'app_password_hint': {'key': 'appPasswordHint', 'type': 'str'}, } def __init__( @@ -355,7 +383,10 @@ def __init__( self.icon_url = kwargs.get('icon_url', None) self.endpoint = kwargs['endpoint'] self.endpoint_version = None + self.msa_app_type = kwargs.get('msa_app_type', None) self.msa_app_id = kwargs['msa_app_id'] + self.msa_app_tenant_id = kwargs.get('msa_app_tenant_id', None) + self.msa_app_msi_resource_id = kwargs.get('msa_app_msi_resource_id', None) self.configured_channels = None self.enabled_channels = None self.developer_app_insight_key = kwargs.get('developer_app_insight_key', None) @@ -366,7 +397,11 @@ def __init__( 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.disable_local_auth = kwargs.get('disable_local_auth', None) self.schema_transformation_version = kwargs.get('schema_transformation_version', None) + self.private_endpoint_connections = None + self.open_with_hint = kwargs.get('open_with_hint', None) + self.app_password_hint = kwargs.get('app_password_hint', None) class BotResponseList(msrest.serialization.Model): @@ -805,9 +840,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). @@ -820,11 +858,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'}, @@ -836,7 +876,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) @@ -1086,7 +1127,7 @@ class HostSettingsResponse(msrest.serialization.Model): :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. + :param bot_open_id_metadata: Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. :type bot_open_id_metadata: str """ @@ -1430,6 +1471,275 @@ def __init__( self.value = kwargs.get('value', None) +class OperationResultsDescription(msrest.serialization.Model): + """The properties indicating the operation result of an operation on a service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values include: "Canceled", + "Succeeded", "Failed", "Requested", "Running". + :vartype status: str or ~azure.mgmt.botservice.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateLinkResourceBase(msrest.serialization.Model): + """Common fields that are returned in the response for all BotService Private Link Resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PrivateEndpointConnection(PrivateLinkResourceBase): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.botservice.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.botservice.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.botservice.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.botservice.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkResource(PrivateLinkResourceBase): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = kwargs.get('required_zone_names', None) + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.botservice.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.botservice.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = kwargs.get('actions_required', None) + + class ServiceProvider(msrest.serialization.Model): """Service Provider Definition. @@ -1771,6 +2081,8 @@ class SlackChannelProperties(msrest.serialization.Model): :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 scopes: The Slack permission scopes. + :type scopes: str :param landing_page_url: The Slack landing page Url. :type landing_page_url: str :ivar redirect_action: The Slack redirect action. @@ -1800,6 +2112,7 @@ class SlackChannelProperties(msrest.serialization.Model): 'client_id': {'key': 'clientId', 'type': 'str'}, 'client_secret': {'key': 'clientSecret', 'type': 'str'}, 'verification_token': {'key': 'verificationToken', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': 'str'}, 'landing_page_url': {'key': 'landingPageUrl', 'type': 'str'}, 'redirect_action': {'key': 'redirectAction', 'type': 'str'}, 'last_submission_id': {'key': 'lastSubmissionId', 'type': 'str'}, @@ -1817,6 +2130,7 @@ def __init__( 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.scopes = kwargs.get('scopes', None) self.landing_page_url = kwargs.get('landing_page_url', None) self.redirect_action = None self.last_submission_id = None 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 cad036e43070c..c970c98465e82 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 @@ -319,8 +319,15 @@ class BotProperties(msrest.serialization.Model): :type endpoint: str :ivar endpoint_version: The bot's endpoint version. :vartype endpoint_version: str + :param msa_app_type: Microsoft App Type for the bot. Possible values include: + "UserAssignedMSI", "SingleTenant", "MultiTenant". + :type msa_app_type: str or ~azure.mgmt.botservice.models.MsaAppType :param msa_app_id: Required. Microsoft App Id for the bot. :type msa_app_id: str + :param msa_app_tenant_id: Microsoft App Tenant Id for the bot. + :type msa_app_tenant_id: str + :param msa_app_msi_resource_id: Microsoft App Managed Identity Resource Id for the bot. + :type msa_app_msi_resource_id: str :ivar configured_channels: Collection of channels for which the bot is configured. :vartype configured_channels: list[str] :ivar enabled_channels: Collection of channels for which the bot is enabled. @@ -341,8 +348,21 @@ class BotProperties(msrest.serialization.Model): :type cmek_key_vault_url: str :param is_isolated: Whether the bot is in an isolated network. :type is_isolated: bool + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool :param schema_transformation_version: The channel schema transformation version for the bot. :type schema_transformation_version: str + :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the + bot. + :vartype private_endpoint_connections: + list[~azure.mgmt.botservice.models.PrivateEndpointConnection] + :param open_with_hint: The hint to browser (e.g. protocol handler) on how to open the bot for + authoring. + :type open_with_hint: str + :param app_password_hint: The hint (e.g. keyVault secret resourceId) on how to fetch the app + secret. + :type app_password_hint: str """ _validation = { @@ -352,6 +372,7 @@ class BotProperties(msrest.serialization.Model): 'msa_app_id': {'required': True}, 'configured_channels': {'readonly': True}, 'enabled_channels': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -360,7 +381,10 @@ class BotProperties(msrest.serialization.Model): 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'endpoint_version': {'key': 'endpointVersion', 'type': 'str'}, + 'msa_app_type': {'key': 'msaAppType', 'type': 'str'}, 'msa_app_id': {'key': 'msaAppId', 'type': 'str'}, + 'msa_app_tenant_id': {'key': 'msaAppTenantId', 'type': 'str'}, + 'msa_app_msi_resource_id': {'key': 'msaAppMSIResourceId', 'type': 'str'}, 'configured_channels': {'key': 'configuredChannels', 'type': '[str]'}, 'enabled_channels': {'key': 'enabledChannels', 'type': '[str]'}, 'developer_app_insight_key': {'key': 'developerAppInsightKey', 'type': 'str'}, @@ -371,7 +395,11 @@ class BotProperties(msrest.serialization.Model): 'is_cmek_enabled': {'key': 'isCmekEnabled', 'type': 'bool'}, 'cmek_key_vault_url': {'key': 'cmekKeyVaultUrl', 'type': 'str'}, 'is_isolated': {'key': 'isIsolated', 'type': 'bool'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, 'schema_transformation_version': {'key': 'schemaTransformationVersion', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'open_with_hint': {'key': 'openWithHint', 'type': 'str'}, + 'app_password_hint': {'key': 'appPasswordHint', 'type': 'str'}, } def __init__( @@ -382,6 +410,9 @@ def __init__( msa_app_id: str, description: Optional[str] = None, icon_url: Optional[str] = None, + msa_app_type: Optional[Union[str, "MsaAppType"]] = None, + msa_app_tenant_id: Optional[str] = None, + msa_app_msi_resource_id: Optional[str] = None, developer_app_insight_key: Optional[str] = None, developer_app_insights_api_key: Optional[str] = None, developer_app_insights_application_id: Optional[str] = None, @@ -390,7 +421,10 @@ def __init__( is_cmek_enabled: Optional[bool] = None, cmek_key_vault_url: Optional[str] = None, is_isolated: Optional[bool] = None, + disable_local_auth: Optional[bool] = None, schema_transformation_version: Optional[str] = None, + open_with_hint: Optional[str] = None, + app_password_hint: Optional[str] = None, **kwargs ): super(BotProperties, self).__init__(**kwargs) @@ -399,7 +433,10 @@ def __init__( self.icon_url = icon_url self.endpoint = endpoint self.endpoint_version = None + self.msa_app_type = msa_app_type self.msa_app_id = msa_app_id + self.msa_app_tenant_id = msa_app_tenant_id + self.msa_app_msi_resource_id = msa_app_msi_resource_id self.configured_channels = None self.enabled_channels = None self.developer_app_insight_key = developer_app_insight_key @@ -410,7 +447,11 @@ def __init__( self.is_cmek_enabled = is_cmek_enabled self.cmek_key_vault_url = cmek_key_vault_url self.is_isolated = is_isolated + self.disable_local_auth = disable_local_auth self.schema_transformation_version = schema_transformation_version + self.private_endpoint_connections = None + self.open_with_hint = open_with_hint + self.app_password_hint = app_password_hint class BotResponseList(msrest.serialization.Model): @@ -891,9 +932,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). @@ -906,11 +950,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'}, @@ -920,7 +966,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, @@ -928,7 +975,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 @@ -1199,7 +1247,7 @@ class HostSettingsResponse(msrest.serialization.Model): :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. + :param bot_open_id_metadata: Same as toBotFromChannelOpenIdMetadataUrl, used by SDK < v4.12. :type bot_open_id_metadata: str """ @@ -1585,6 +1633,288 @@ def __init__( self.value = value +class OperationResultsDescription(msrest.serialization.Model): + """The properties indicating the operation result of an operation on a service. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ID of the operation returned. + :vartype id: str + :ivar name: The name of the operation result. + :vartype name: str + :ivar status: The status of the operation being performed. Possible values include: "Canceled", + "Succeeded", "Failed", "Requested", "Running". + :vartype status: str or ~azure.mgmt.botservice.models.OperationResultStatus + :ivar start_time: The time that the operation was started. + :vartype start_time: ~datetime.datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(OperationResultsDescription, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + + +class PrivateEndpoint(msrest.serialization.Model): + """The Private Endpoint resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The ARM identifier for Private Endpoint. + :vartype id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateEndpoint, self).__init__(**kwargs) + self.id = None + + +class PrivateLinkResourceBase(msrest.serialization.Model): + """Common fields that are returned in the response for all BotService Private Link Resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(PrivateLinkResourceBase, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class PrivateEndpointConnection(PrivateLinkResourceBase): + """The Private Endpoint Connection resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :param private_endpoint: The resource of private end point. + :type private_endpoint: ~azure.mgmt.botservice.models.PrivateEndpoint + :param private_link_service_connection_state: A collection of information about the state of + the connection between service consumer and provider. + :type private_link_service_connection_state: + ~azure.mgmt.botservice.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: The provisioning state of the private endpoint connection resource. + Possible values include: "Succeeded", "Creating", "Deleting", "Failed". + :vartype provisioning_state: str or + ~azure.mgmt.botservice.models.PrivateEndpointConnectionProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + private_endpoint: Optional["PrivateEndpoint"] = None, + private_link_service_connection_state: Optional["PrivateLinkServiceConnectionState"] = None, + **kwargs + ): + super(PrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionListResult(msrest.serialization.Model): + """List of private endpoint connection associated with the specified storage account. + + :param value: Array of private endpoint connections. + :type value: list[~azure.mgmt.botservice.models.PrivateEndpointConnection] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateEndpointConnection]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateEndpointConnection"]] = None, + **kwargs + ): + super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkResource(PrivateLinkResourceBase): + """A private link resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :param required_zone_names: The private link resource Private link DNS zone name. + :type required_zone_names: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'group_id': {'key': 'properties.groupId', 'type': 'str'}, + 'required_members': {'key': 'properties.requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'properties.requiredZoneNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + required_zone_names: Optional[List[str]] = None, + **kwargs + ): + super(PrivateLinkResource, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + self.required_zone_names = required_zone_names + + +class PrivateLinkResourceListResult(msrest.serialization.Model): + """A list of private link resources. + + :param value: Array of private link resources. + :type value: list[~azure.mgmt.botservice.models.PrivateLinkResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PrivateLinkResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["PrivateLinkResource"]] = None, + **kwargs + ): + super(PrivateLinkResourceListResult, self).__init__(**kwargs) + self.value = value + + +class PrivateLinkServiceConnectionState(msrest.serialization.Model): + """A collection of information about the state of the connection between service consumer and provider. + + :param status: Indicates whether the connection has been Approved/Rejected/Removed by the owner + of the service. Possible values include: "Pending", "Approved", "Rejected". + :type status: str or ~azure.mgmt.botservice.models.PrivateEndpointServiceConnectionStatus + :param description: The reason for approval/rejection of the connection. + :type description: str + :param actions_required: A message indicating if changes on the service provider require any + updates on the consumer. + :type actions_required: str + """ + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "PrivateEndpointServiceConnectionStatus"]] = None, + description: Optional[str] = None, + actions_required: Optional[str] = None, + **kwargs + ): + super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = actions_required + + class ServiceProvider(msrest.serialization.Model): """Service Provider Definition. @@ -1951,6 +2281,8 @@ class SlackChannelProperties(msrest.serialization.Model): :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 scopes: The Slack permission scopes. + :type scopes: str :param landing_page_url: The Slack landing page Url. :type landing_page_url: str :ivar redirect_action: The Slack redirect action. @@ -1980,6 +2312,7 @@ class SlackChannelProperties(msrest.serialization.Model): 'client_id': {'key': 'clientId', 'type': 'str'}, 'client_secret': {'key': 'clientSecret', 'type': 'str'}, 'verification_token': {'key': 'verificationToken', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': 'str'}, 'landing_page_url': {'key': 'landingPageUrl', 'type': 'str'}, 'redirect_action': {'key': 'redirectAction', 'type': 'str'}, 'last_submission_id': {'key': 'lastSubmissionId', 'type': 'str'}, @@ -1996,6 +2329,7 @@ def __init__( client_id: Optional[str] = None, client_secret: Optional[str] = None, verification_token: Optional[str] = None, + scopes: Optional[str] = None, landing_page_url: Optional[str] = None, signing_secret: Optional[str] = None, **kwargs @@ -2004,6 +2338,7 @@ def __init__( self.client_id = client_id self.client_secret = client_secret self.verification_token = verification_token + self.scopes = scopes self.landing_page_url = landing_page_url self.redirect_action = None self.last_submission_id = None 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 57b1265e4d3fc..89604c7b3d530 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 @@ -12,6 +12,9 @@ from ._operations import Operations from ._bot_connection_operations import BotConnectionOperations from ._host_settings_operations import HostSettingsOperations +from ._operation_results_operations import OperationResultsOperations +from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations +from ._private_link_resources_operations import PrivateLinkResourcesOperations __all__ = [ 'BotsOperations', @@ -20,4 +23,7 @@ 'Operations', 'BotConnectionOperations', 'HostSettingsOperations', + 'OperationResultsOperations', + 'PrivateEndpointConnectionsOperations', + 'PrivateLinkResourcesOperations', ] 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 c0bfd7861cc79..1b7de2448c162 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 = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -123,7 +123,7 @@ def list_with_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -190,7 +190,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -266,7 +266,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -339,7 +339,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -403,7 +403,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -461,7 +461,7 @@ def list_by_bot_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 ed7fd2484627c..f552093150743 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -229,7 +229,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -286,7 +286,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -343,7 +343,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -412,7 +412,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -484,7 +484,7 @@ def get_check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 8b4d14b367116..0e80bedd1c2cc 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -240,7 +240,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -301,7 +301,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -365,7 +365,7 @@ def list_with_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -426,7 +426,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 4f1f776163b0d..42bc7f1bb15e8 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 = "2021-03-01" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 index 5f893242d0d2c..024f60662b226 100644 --- 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 @@ -61,7 +61,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operation_results_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operation_results_operations.py new file mode 100644 index 0000000000000..952a784a8f1a3 --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_operation_results_operations.py @@ -0,0 +1,159 @@ +# 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.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class OperationResultsOperations(object): + """OperationResultsOperations 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_initial( + self, + operation_result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.OperationResultsDescription"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.OperationResultsDescription"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self._get_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_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, 202]: + 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 = None + if response.status_code == 200: + deserialized = self._deserialize('OperationResultsDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _get_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}'} # type: ignore + + def begin_get( + self, + operation_result_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.OperationResultsDescription"] + """Get the operation result for a long running operation. + + :param operation_result_id: The ID of the operation result to get. + :type operation_result_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either OperationResultsDescription or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.botservice.models.OperationResultsDescription] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultsDescription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._get_initial( + operation_result_id=operation_result_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('OperationResultsDescription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'operationResultId': self._serialize.url("operation_result_id", operation_result_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/operationresults/{operationResultId}'} # 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 70b0dc3766687..bc6fce09db4f2 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 = "2021-03-01" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_endpoint_connections_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_endpoint_connections_operations.py new file mode 100644 index 0000000000000..3dbd927d8ea0e --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_endpoint_connections_operations.py @@ -0,0 +1,322 @@ +# 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.paging import ItemPaged +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, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class PrivateEndpointConnectionsOperations(object): + """PrivateEndpointConnectionsOperations 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 list( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PrivateEndpointConnectionListResult"] + """List all the private endpoint connections associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.botservice.models.PrivateEndpointConnectionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('PrivateEndpointConnectionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + 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, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections'} # type: ignore + + def get( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Gets the specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def create( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + properties, # type: "_models.PrivateEndpointConnection" + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateEndpointConnection" + """Update the state of specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :param properties: The private endpoint connection properties. + :type properties: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateEndpointConnection, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateEndpointConnection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(properties, 'PrivateEndpointConnection') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + 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('PrivateEndpointConnection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + resource_name, # type: str + private_endpoint_connection_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Deletes the specified private endpoint connection associated with the Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection associated + with the Azure resource. + :type private_endpoint_connection_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, '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.delete(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, 204]: + 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) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore diff --git a/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_link_resources_operations.py b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_link_resources_operations.py new file mode 100644 index 0000000000000..80fc8ef5f8f5c --- /dev/null +++ b/sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/operations/_private_link_resources_operations.py @@ -0,0 +1,105 @@ +# 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 PrivateLinkResourcesOperations(object): + """PrivateLinkResourcesOperations 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 list_by_bot_resource( + self, + resource_group_name, # type: str + resource_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PrivateLinkResourceListResult" + """Gets the private link resources that need to be created for a Bot. + + :param resource_group_name: The name of the Bot resource group in the user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PrivateLinkResourceListResult, or the result of cls(response) + :rtype: ~azure.mgmt.botservice.models.PrivateLinkResourceListResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + # Construct URL + url = self.list_by_bot_resource.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # 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('PrivateLinkResourceListResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_bot_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/privateLinkResources'} # type: ignore