Skip to content

Commit e9ca031

Browse files
azclibotSDKAutomsyyc
authored
[AutoRelease] t2-botservice-2022-01-10-71178 (Azure#22404)
* CodeGen from PR 17294 in Azure/azure-rest-api-specs config botservice readme python (Azure#17294) * version,CHANGELOG Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <[email protected]>
1 parent 3c7769a commit e9ca031

39 files changed

+5763
-4088
lines changed

sdk/botservice/azure-mgmt-botservice/CHANGELOG.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,97 @@
11
# Release History
22

3+
## 2.0.0b1 (2022-01-10)
4+
5+
**Features**
6+
7+
- Added operation group OperationResultsOperations
8+
- Added operation group PrivateEndpointConnectionsOperations
9+
- Added operation group PrivateLinkResourcesOperations
10+
- Model AlexaChannel has a new parameter etag
11+
- Model AlexaChannel has a new parameter location
12+
- Model AlexaChannel has a new parameter provisioning_state
13+
- Model Bot has a new parameter zones
14+
- Model BotChannel has a new parameter zones
15+
- Model BotProperties has a new parameter all_settings
16+
- Model BotProperties has a new parameter app_password_hint
17+
- Model BotProperties has a new parameter cmek_encryption_status
18+
- Model BotProperties has a new parameter disable_local_auth
19+
- Model BotProperties has a new parameter is_developer_app_insights_api_key_set
20+
- Model BotProperties has a new parameter is_streaming_supported
21+
- Model BotProperties has a new parameter manifest_url
22+
- Model BotProperties has a new parameter migration_token
23+
- Model BotProperties has a new parameter msa_app_msi_resource_id
24+
- Model BotProperties has a new parameter msa_app_tenant_id
25+
- Model BotProperties has a new parameter msa_app_type
26+
- Model BotProperties has a new parameter open_with_hint
27+
- Model BotProperties has a new parameter parameters
28+
- Model BotProperties has a new parameter private_endpoint_connections
29+
- Model BotProperties has a new parameter provisioning_state
30+
- Model BotProperties has a new parameter public_network_access
31+
- Model BotProperties has a new parameter publishing_credentials
32+
- Model BotProperties has a new parameter storage_resource_id
33+
- Model Channel has a new parameter etag
34+
- Model Channel has a new parameter location
35+
- Model Channel has a new parameter provisioning_state
36+
- Model ConnectionSetting has a new parameter zones
37+
- Model ConnectionSettingProperties has a new parameter id
38+
- Model ConnectionSettingProperties has a new parameter name
39+
- Model ConnectionSettingProperties has a new parameter provisioning_state
40+
- Model DirectLineChannel has a new parameter etag
41+
- Model DirectLineChannel has a new parameter location
42+
- Model DirectLineChannel has a new parameter provisioning_state
43+
- Model DirectLineChannelProperties has a new parameter direct_line_embed_code
44+
- Model DirectLineSite has a new parameter is_block_user_upload_enabled
45+
- Model DirectLineSpeechChannel has a new parameter etag
46+
- Model DirectLineSpeechChannel has a new parameter location
47+
- Model DirectLineSpeechChannel has a new parameter provisioning_state
48+
- Model EmailChannel has a new parameter etag
49+
- Model EmailChannel has a new parameter location
50+
- Model EmailChannel has a new parameter provisioning_state
51+
- Model FacebookChannel has a new parameter etag
52+
- Model FacebookChannel has a new parameter location
53+
- Model FacebookChannel has a new parameter provisioning_state
54+
- Model KikChannel has a new parameter etag
55+
- Model KikChannel has a new parameter location
56+
- Model KikChannel has a new parameter provisioning_state
57+
- Model LineChannel has a new parameter etag
58+
- Model LineChannel has a new parameter location
59+
- Model LineChannel has a new parameter provisioning_state
60+
- Model MsTeamsChannel has a new parameter etag
61+
- Model MsTeamsChannel has a new parameter location
62+
- Model MsTeamsChannel has a new parameter provisioning_state
63+
- Model MsTeamsChannelProperties has a new parameter accepted_terms
64+
- Model MsTeamsChannelProperties has a new parameter deployment_environment
65+
- Model MsTeamsChannelProperties has a new parameter incoming_call_route
66+
- Model Resource has a new parameter zones
67+
- Model ServiceProviderParameter has a new parameter metadata
68+
- Model SkypeChannel has a new parameter etag
69+
- Model SkypeChannel has a new parameter location
70+
- Model SkypeChannel has a new parameter provisioning_state
71+
- Model SkypeChannelProperties has a new parameter incoming_call_route
72+
- Model SlackChannel has a new parameter etag
73+
- Model SlackChannel has a new parameter location
74+
- Model SlackChannel has a new parameter provisioning_state
75+
- Model SlackChannelProperties has a new parameter scopes
76+
- Model SmsChannel has a new parameter etag
77+
- Model SmsChannel has a new parameter location
78+
- Model SmsChannel has a new parameter provisioning_state
79+
- Model TelegramChannel has a new parameter etag
80+
- Model TelegramChannel has a new parameter location
81+
- Model TelegramChannel has a new parameter provisioning_state
82+
- Model WebChatChannel has a new parameter etag
83+
- Model WebChatChannel has a new parameter location
84+
- Model WebChatChannel has a new parameter provisioning_state
85+
86+
**Breaking changes**
87+
88+
- Model BotProperties no longer has parameter is_isolated
89+
- Model DirectLineSpeechChannelProperties has a new required parameter cognitive_service_region
90+
- Model DirectLineSpeechChannelProperties has a new required parameter cognitive_service_subscription_key
91+
- Model DirectLineSpeechChannelProperties no longer has parameter cognitive_services_subscription_id
92+
- Model WebChatSite has a new required parameter is_webchat_preview_enabled
93+
- Model WebChatSite no longer has parameter enable_preview
94+
395
## 1.0.0 (2021-05-20)
496

597
**Features**
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"autorest": "3.4.2",
2+
"autorest": "3.7.2",
33
"use": [
4-
"@autorest/python@5.8.0",
5-
"@autorest/[email protected].1"
4+
"@autorest/python@5.12.0",
5+
"@autorest/[email protected].3"
66
],
7-
"commit": "e23a53d64f46db42df2886989a3436f7431168f4",
7+
"commit": "d8242e83bad59e45d5bb1dad769a185504f5fde3",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"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/[email protected].1 --version=3.4.2",
9+
"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 --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/[email protected].3 --version=3.7.2",
1010
"readme": "specification/botservice/resource-manager/readme.md"
1111
}

sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
__version__ = VERSION
1313
__all__ = ['AzureBotService']
1414

15-
try:
16-
from ._patch import patch_sdk # type: ignore
17-
patch_sdk()
18-
except ImportError:
19-
pass
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_azure_bot_service.py

Lines changed: 59 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,22 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING
1011

12+
from azure.core.rest import HttpRequest, HttpResponse
1113
from azure.mgmt.core import ARMPipelineClient
1214
from msrest import Deserializer, Serializer
1315

16+
from . import models
17+
from ._configuration import AzureBotServiceConfiguration
18+
from .operations import BotConnectionOperations, BotsOperations, ChannelsOperations, DirectLineOperations, HostSettingsOperations, OperationResultsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations
19+
1420
if TYPE_CHECKING:
1521
# pylint: disable=unused-import,ungrouped-imports
16-
from typing import Any, Optional
17-
1822
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-
3023

31-
class AzureBotService(object):
24+
class AzureBotService:
3225
"""Azure Bot Service is a platform for creating smart conversational agents.
3326
3427
:ivar bots: BotsOperations operations
@@ -43,61 +36,74 @@ class AzureBotService(object):
4336
:vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations
4437
:ivar host_settings: HostSettingsOperations operations
4538
:vartype host_settings: azure.mgmt.botservice.operations.HostSettingsOperations
39+
:ivar operation_results: OperationResultsOperations operations
40+
:vartype operation_results: azure.mgmt.botservice.operations.OperationResultsOperations
41+
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
42+
:vartype private_endpoint_connections:
43+
azure.mgmt.botservice.operations.PrivateEndpointConnectionsOperations
44+
:ivar private_link_resources: PrivateLinkResourcesOperations operations
45+
:vartype private_link_resources:
46+
azure.mgmt.botservice.operations.PrivateLinkResourcesOperations
4647
:param credential: Credential needed for the client to connect to Azure.
4748
:type credential: ~azure.core.credentials.TokenCredential
4849
:param subscription_id: Azure Subscription ID.
4950
:type subscription_id: str
50-
:param str base_url: Service URL
51+
:param base_url: Service URL. Default value is 'https://management.azure.com'.
52+
:type base_url: str
53+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
54+
Retry-After header is present.
5155
"""
5256

5357
def __init__(
5458
self,
55-
credential, # type: "TokenCredential"
56-
subscription_id, # type: str
57-
base_url=None, # type: Optional[str]
58-
**kwargs # type: Any
59-
):
60-
# type: (...) -> None
61-
if not base_url:
62-
base_url = 'https://management.azure.com'
63-
self._config = AzureBotServiceConfiguration(credential, subscription_id, **kwargs)
59+
credential: "TokenCredential",
60+
subscription_id: str,
61+
base_url: str = "https://management.azure.com",
62+
**kwargs: Any
63+
) -> None:
64+
self._config = AzureBotServiceConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
6465
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
6566

6667
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
6768
self._serialize = Serializer(client_models)
68-
self._serialize.client_side_validation = False
6969
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
70+
self._serialize.client_side_validation = False
71+
self.bots = BotsOperations(self._client, self._config, self._serialize, self._deserialize)
72+
self.channels = ChannelsOperations(self._client, self._config, self._serialize, self._deserialize)
73+
self.direct_line = DirectLineOperations(self._client, self._config, self._serialize, self._deserialize)
74+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
75+
self.bot_connection = BotConnectionOperations(self._client, self._config, self._serialize, self._deserialize)
76+
self.host_settings = HostSettingsOperations(self._client, self._config, self._serialize, self._deserialize)
77+
self.operation_results = OperationResultsOperations(self._client, self._config, self._serialize, self._deserialize)
78+
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
79+
self.private_link_resources = PrivateLinkResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
80+
81+
82+
def _send_request(
83+
self,
84+
request, # type: HttpRequest
85+
**kwargs: Any
86+
) -> HttpResponse:
8687
"""Runs the network request through the client's chained policies.
8788
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.
89+
>>> from azure.core.rest import HttpRequest
90+
>>> request = HttpRequest("GET", "https://www.example.org/")
91+
<HttpRequest [GET], url: 'https://www.example.org/'>
92+
>>> response = client._send_request(request)
93+
<HttpResponse: 200 OK>
94+
95+
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
96+
97+
:param request: The network request you want to make. Required.
98+
:type request: ~azure.core.rest.HttpRequest
99+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
91100
:return: The response of your network call. Does not do error handling on your response.
92-
:rtype: ~azure.core.pipeline.transport.HttpResponse
101+
:rtype: ~azure.core.rest.HttpResponse
93102
"""
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
103+
104+
request_copy = deepcopy(request)
105+
request_copy.url = self._client.format_url(request_copy.url)
106+
return self._client.send_request(request_copy, **kwargs)
101107

102108
def close(self):
103109
# type: () -> None

sdk/botservice/azure-mgmt-botservice/azure/mgmt/botservice/_configuration.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,16 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING
9+
from typing import Any, TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
13-
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
13+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
1414

1515
from ._version import VERSION
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19-
from typing import Any
20-
2119
from azure.core.credentials import TokenCredential
2220

2321

@@ -35,20 +33,19 @@ class AzureBotServiceConfiguration(Configuration):
3533

3634
def __init__(
3735
self,
38-
credential, # type: "TokenCredential"
39-
subscription_id, # type: str
40-
**kwargs # type: Any
41-
):
42-
# type: (...) -> None
36+
credential: "TokenCredential",
37+
subscription_id: str,
38+
**kwargs: Any
39+
) -> None:
40+
super(AzureBotServiceConfiguration, self).__init__(**kwargs)
4341
if credential is None:
4442
raise ValueError("Parameter 'credential' must not be None.")
4543
if subscription_id is None:
4644
raise ValueError("Parameter 'subscription_id' must not be None.")
47-
super(AzureBotServiceConfiguration, self).__init__(**kwargs)
4845

4946
self.credential = credential
5047
self.subscription_id = subscription_id
51-
self.api_version = "2021-03-01"
48+
self.api_version = "2021-05-01-preview"
5249
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5350
kwargs.setdefault('sdk_moniker', 'mgmt-botservice/{}'.format(VERSION))
5451
self._configure(**kwargs)
@@ -68,4 +65,4 @@ def _configure(
6865
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
6966
self.authentication_policy = kwargs.get('authentication_policy')
7067
if self.credential and not self.authentication_policy:
71-
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
68+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)