66# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77# --------------------------------------------------------------------------
88
9+ from copy import deepcopy
910from typing import TYPE_CHECKING
1011
1112from azure .mgmt .core import ARMPipelineClient
1213from msrest import Deserializer , Serializer
1314
15+ from . import models
16+ from ._configuration import AzureBotServiceConfiguration
17+ from .operations import BotConnectionOperations , BotsOperations , ChannelsOperations , DirectLineOperations , HostSettingsOperations , OperationResultsOperations , Operations , PrivateEndpointConnectionsOperations , PrivateLinkResourcesOperations
18+
1419if TYPE_CHECKING :
1520 # pylint: disable=unused-import,ungrouped-imports
1621 from typing import Any , Optional
1722
1823 from azure .core .credentials import TokenCredential
19- from azure .core .pipeline .transport import HttpRequest , HttpResponse
20-
21- from ._configuration import AzureBotServiceConfiguration
22- from .operations import BotsOperations
23- from .operations import ChannelsOperations
24- from .operations import DirectLineOperations
25- from .operations import Operations
26- from .operations import BotConnectionOperations
27- from .operations import HostSettingsOperations
28- from . import models
29-
24+ from azure .core .rest import HttpRequest , HttpResponse
3025
3126class AzureBotService (object ):
3227 """Azure Bot Service is a platform for creating smart conversational agents.
@@ -43,61 +38,76 @@ class AzureBotService(object):
4338 :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations
4439 :ivar host_settings: HostSettingsOperations operations
4540 :vartype host_settings: azure.mgmt.botservice.operations.HostSettingsOperations
41+ :ivar operation_results: OperationResultsOperations operations
42+ :vartype operation_results: azure.mgmt.botservice.operations.OperationResultsOperations
43+ :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
44+ :vartype private_endpoint_connections:
45+ azure.mgmt.botservice.operations.PrivateEndpointConnectionsOperations
46+ :ivar private_link_resources: PrivateLinkResourcesOperations operations
47+ :vartype private_link_resources:
48+ azure.mgmt.botservice.operations.PrivateLinkResourcesOperations
4649 :param credential: Credential needed for the client to connect to Azure.
4750 :type credential: ~azure.core.credentials.TokenCredential
4851 :param subscription_id: Azure Subscription ID.
4952 :type subscription_id: str
50- :param str base_url: Service URL
53+ :param base_url: Service URL. Default value is 'https://management.azure.com'.
54+ :type base_url: str
55+ :keyword int polling_interval: Default waiting time between two polls for LRO operations if no
56+ Retry-After header is present.
5157 """
5258
5359 def __init__ (
5460 self ,
5561 credential , # type: "TokenCredential"
5662 subscription_id , # type: str
57- base_url = None , # type: Optional[ str]
63+ base_url = "https://management.azure.com" , # type: str
5864 ** kwargs # type: Any
5965 ):
6066 # type: (...) -> None
61- if not base_url :
62- base_url = 'https://management.azure.com'
63- self ._config = AzureBotServiceConfiguration (credential , subscription_id , ** kwargs )
67+ self ._config = AzureBotServiceConfiguration (credential = credential , subscription_id = subscription_id , ** kwargs )
6468 self ._client = ARMPipelineClient (base_url = base_url , config = self ._config , ** kwargs )
6569
6670 client_models = {k : v for k , v in models .__dict__ .items () if isinstance (v , type )}
6771 self ._serialize = Serializer (client_models )
68- self ._serialize .client_side_validation = False
6972 self ._deserialize = Deserializer (client_models )
70-
71- self .bots = BotsOperations (
72- self ._client , self ._config , self ._serialize , self ._deserialize )
73- self .channels = ChannelsOperations (
74- self ._client , self ._config , self ._serialize , self ._deserialize )
75- self .direct_line = DirectLineOperations (
76- self ._client , self ._config , self ._serialize , self ._deserialize )
77- self .operations = Operations (
78- self ._client , self ._config , self ._serialize , self ._deserialize )
79- self .bot_connection = BotConnectionOperations (
80- self ._client , self ._config , self ._serialize , self ._deserialize )
81- self .host_settings = HostSettingsOperations (
82- self ._client , self ._config , self ._serialize , self ._deserialize )
83-
84- def _send_request (self , http_request , ** kwargs ):
85- # type: (HttpRequest, Any) -> HttpResponse
73+ self ._serialize .client_side_validation = False
74+ self .bots = BotsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
75+ self .channels = ChannelsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
76+ self .direct_line = DirectLineOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
77+ self .operations = Operations (self ._client , self ._config , self ._serialize , self ._deserialize )
78+ self .bot_connection = BotConnectionOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
79+ self .host_settings = HostSettingsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
80+ self .operation_results = OperationResultsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
81+ self .private_endpoint_connections = PrivateEndpointConnectionsOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
82+ self .private_link_resources = PrivateLinkResourcesOperations (self ._client , self ._config , self ._serialize , self ._deserialize )
83+
84+
85+ def _send_request (
86+ self ,
87+ request , # type: HttpRequest
88+ ** kwargs # type: Any
89+ ):
90+ # type: (...) -> HttpResponse
8691 """Runs the network request through the client's chained policies.
8792
88- :param http_request: The network request you want to make. Required.
89- :type http_request: ~azure.core.pipeline.transport.HttpRequest
90- :keyword bool stream: Whether the response payload will be streamed. Defaults to True.
93+ >>> from azure.core.rest import HttpRequest
94+ >>> request = HttpRequest("GET", "https://www.example.org/")
95+ <HttpRequest [GET], url: 'https://www.example.org/'>
96+ >>> response = client._send_request(request)
97+ <HttpResponse: 200 OK>
98+
99+ For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
100+
101+ :param request: The network request you want to make. Required.
102+ :type request: ~azure.core.rest.HttpRequest
103+ :keyword bool stream: Whether the response payload will be streamed. Defaults to False.
91104 :return: The response of your network call. Does not do error handling on your response.
92- :rtype: ~azure.core.pipeline.transport .HttpResponse
105+ :rtype: ~azure.core.rest .HttpResponse
93106 """
94- path_format_arguments = {
95- 'subscriptionId' : self ._serialize .url ("self._config.subscription_id" , self ._config .subscription_id , 'str' ),
96- }
97- http_request .url = self ._client .format_url (http_request .url , ** path_format_arguments )
98- stream = kwargs .pop ("stream" , True )
99- pipeline_response = self ._client ._pipeline .run (http_request , stream = stream , ** kwargs )
100- return pipeline_response .http_response
107+
108+ request_copy = deepcopy (request )
109+ request_copy .url = self ._client .format_url (request_copy .url )
110+ return self ._client .send_request (request_copy , ** kwargs )
101111
102112 def close (self ):
103113 # type: () -> None
0 commit comments