From b4c2ed8d40e90f6b6e557ba28ae8d975e087064b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 16 May 2018 20:08:06 +0000 Subject: [PATCH 1/4] Generated from 19bc3acda18e2e1ff91b2b04ec96a9fbff0bf97b addressed comments --- .../mgmt/botservice/azure_bot_service.py | 20 ++ .../azure/mgmt/botservice/models/__init__.py | 26 ++ .../mgmt/botservice/models/bot_channel_py3.py | 2 +- .../azure/mgmt/botservice/models/bot_py3.py | 2 +- .../botservice/models/connection_item_name.py | 35 +++ .../models/connection_item_name_py3.py | 35 +++ .../botservice/models/connection_setting.py | 63 +++++ .../models/connection_setting_paged.py | 27 ++ .../models/connection_setting_parameter.py | 41 +++ .../connection_setting_parameter_py3.py | 41 +++ .../models/connection_setting_properties.py | 52 ++++ .../connection_setting_properties_py3.py | 52 ++++ .../models/connection_setting_py3.py | 63 +++++ .../models/direct_line_channel_py3.py | 2 +- .../botservice/models/email_channel_py3.py | 2 +- .../botservice/models/facebook_channel_py3.py | 2 +- .../mgmt/botservice/models/kik_channel_py3.py | 2 +- .../botservice/models/ms_teams_channel_py3.py | 2 +- .../botservice/models/service_provider.py | 28 ++ .../models/service_provider_parameter.py | 60 +++++ .../models/service_provider_parameter_py3.py | 60 +++++ .../models/service_provider_properties.py | 60 +++++ .../models/service_provider_properties_py3.py | 60 +++++ .../botservice/models/service_provider_py3.py | 28 ++ .../models/service_provider_response_list.py | 41 +++ .../service_provider_response_list_py3.py | 41 +++ .../botservice/models/skype_channel_py3.py | 2 +- .../botservice/models/slack_channel_py3.py | 2 +- .../mgmt/botservice/models/sms_channel_py3.py | 2 +- .../botservice/models/telegram_channel_py3.py | 2 +- .../botservice/models/web_chat_channel_py3.py | 2 +- .../mgmt/botservice/operations/__init__.py | 8 + .../operations/bot_connection_operations.py | 244 ++++++++++++++++++ .../operations/bot_connections_operations.py | 171 ++++++++++++ .../operations/bot_token_operations.py | 95 +++++++ .../operations/connections_operations.py | 109 ++++++++ 36 files changed, 1472 insertions(+), 12 deletions(-) create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_paged.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list_py3.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py create mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py index 607e1471272c..b151d218ad00 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py @@ -16,6 +16,10 @@ from .operations.bots_operations import BotsOperations from .operations.channels_operations import ChannelsOperations from .operations.operations import Operations +from .operations.bot_connections_operations import BotConnectionsOperations +from .operations.bot_connection_operations import BotConnectionOperations +from .operations.bot_token_operations import BotTokenOperations +from .operations.connections_operations import ConnectionsOperations from . import models @@ -63,6 +67,14 @@ class AzureBotService(SDKClient): :vartype channels: azure.mgmt.botservice.operations.ChannelsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.botservice.operations.Operations + :ivar bot_connections: BotConnections operations + :vartype bot_connections: azure.mgmt.botservice.operations.BotConnectionsOperations + :ivar bot_connection: BotConnection operations + :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations + :ivar bot_token: BotToken operations + :vartype bot_token: azure.mgmt.botservice.operations.BotTokenOperations + :ivar connections: Connections operations + :vartype connections: azure.mgmt.botservice.operations.ConnectionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -89,3 +101,11 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) + self.bot_connections = BotConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.bot_connection = BotConnectionOperations( + self._client, self.config, self._serialize, self._deserialize) + self.bot_token = BotTokenOperations( + self._client, self.config, self._serialize, self._deserialize) + self.connections = ConnectionsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py index 31a67242dbe7..d1d07d8093e7 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py @@ -39,6 +39,14 @@ from .sms_channel_py3 import SmsChannel from .slack_channel_properties_py3 import SlackChannelProperties from .slack_channel_py3 import SlackChannel + from .connection_item_name_py3 import ConnectionItemName + from .connection_setting_parameter_py3 import ConnectionSettingParameter + from .connection_setting_properties_py3 import ConnectionSettingProperties + from .connection_setting_py3 import ConnectionSetting + from .service_provider_parameter_py3 import ServiceProviderParameter + from .service_provider_properties_py3 import ServiceProviderProperties + from .service_provider_py3 import ServiceProvider + from .service_provider_response_list_py3 import ServiceProviderResponseList from .error_body_py3 import ErrorBody from .error_py3 import Error, ErrorException from .operation_display_info_py3 import OperationDisplayInfo @@ -75,6 +83,14 @@ from .sms_channel import SmsChannel from .slack_channel_properties import SlackChannelProperties from .slack_channel import SlackChannel + from .connection_item_name import ConnectionItemName + from .connection_setting_parameter import ConnectionSettingParameter + from .connection_setting_properties import ConnectionSettingProperties + from .connection_setting import ConnectionSetting + from .service_provider_parameter import ServiceProviderParameter + from .service_provider_properties import ServiceProviderProperties + from .service_provider import ServiceProvider + from .service_provider_response_list import ServiceProviderResponseList from .error_body import ErrorBody from .error import Error, ErrorException from .operation_display_info import OperationDisplayInfo @@ -84,6 +100,7 @@ from .bot_paged import BotPaged from .bot_channel_paged import BotChannelPaged from .operation_entity_paged import OperationEntityPaged +from .connection_setting_paged import ConnectionSettingPaged from .azure_bot_service_enums import ( SkuName, SkuTier, @@ -121,6 +138,14 @@ 'SmsChannel', 'SlackChannelProperties', 'SlackChannel', + 'ConnectionItemName', + 'ConnectionSettingParameter', + 'ConnectionSettingProperties', + 'ConnectionSetting', + 'ServiceProviderParameter', + 'ServiceProviderProperties', + 'ServiceProvider', + 'ServiceProviderResponseList', 'ErrorBody', 'Error', 'ErrorException', 'OperationDisplayInfo', @@ -130,6 +155,7 @@ 'BotPaged', 'BotChannelPaged', 'OperationEntityPaged', + 'ConnectionSettingPaged', 'SkuName', 'SkuTier', 'Kind', diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_py3.py index dc113608f8f9..430d49a369de 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class BotChannel(Resource): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_py3.py index 398ab7c4e295..c68447077439 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class Bot(Resource): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name.py new file mode 100644 index 000000000000..bcf5c18f0e66 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ConnectionItemName(Model): + """The display name of a connection Item Setting registered with the Bot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Connection Item name that has been added in the API + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionItemName, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name_py3.py new file mode 100644 index 000000000000..90a58e610be9 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_item_name_py3.py @@ -0,0 +1,35 @@ +# 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 msrest.serialization import Model + + +class ConnectionItemName(Model): + """The display name of a connection Item Setting registered with the Bot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Connection Item name that has been added in the API + :vartype name: str + """ + + _validation = { + 'name': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectionItemName, self).__init__(**kwargs) + self.name = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting.py new file mode 100644 index 000000000000..dec1cdc63118 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting.py @@ -0,0 +1,63 @@ +# 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 .resource import Resource + + +class ConnectionSetting(Resource): + """Bot channel resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.botservice.models.Sku + :param kind: Required. Gets or sets the Kind of the resource. Possible + values include: 'sdk', 'designer', 'bot', 'function' + :type kind: str or ~azure.mgmt.botservice.models.Kind + :param etag: Entity Tag + :type etag: str + :param properties: The set of properties specific to bot channel resource + :type properties: + ~azure.mgmt.botservice.models.ConnectionSettingProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConnectionSettingProperties'}, + } + + def __init__(self, **kwargs): + super(ConnectionSetting, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_paged.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_paged.py new file mode 100644 index 000000000000..5708e4ee7ee3 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_paged.py @@ -0,0 +1,27 @@ +# 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 msrest.paging import Paged + + +class ConnectionSettingPaged(Paged): + """ + A paging container for iterating over a list of :class:`ConnectionSetting ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ConnectionSetting]'} + } + + def __init__(self, *args, **kwargs): + + super(ConnectionSettingPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter.py new file mode 100644 index 000000000000..6ee221e51c04 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ConnectionSettingParameter(Model): + """Extra Parameter in a Connection Setting Properties to indicate service + provider specific properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key: Key for the Connection Setting Parameter. + :vartype key: str + :ivar value: Value associated with the Connection Setting Parameter. + :vartype value: str + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ConnectionSettingParameter, self).__init__(**kwargs) + self.key = None + self.value = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter_py3.py new file mode 100644 index 000000000000..428387c42272 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_parameter_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ConnectionSettingParameter(Model): + """Extra Parameter in a Connection Setting Properties to indicate service + provider specific properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar key: Key for the Connection Setting Parameter. + :vartype key: str + :ivar value: Value associated with the Connection Setting Parameter. + :vartype value: str + """ + + _validation = { + 'key': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ConnectionSettingParameter, self).__init__(**kwargs) + self.key = None + self.value = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties.py new file mode 100644 index 000000000000..50099ba956e6 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class ConnectionSettingProperties(Model): + """Properties for a Connection Setting Item. + + :param client_id: Client Id associated with the Connection Setting. + :type client_id: str + :param client_secret: Client Secret associated with the Connection Setting + :type client_secret: str + :param scopes: Scopes associated with the Connection Setting + :type scopes: str + :param service_provider_id: Service Provider Id associated with the + Connection Setting + :type service_provider_id: str + :param service_provider_display_name: Service Provider Display Name + associated with the Connection Setting + :type service_provider_display_name: str + :param parameters: Service Provider Parameters associated with the + Connection Setting + :type parameters: + list[~azure.mgmt.botservice.models.ConnectionSettingParameter] + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': 'str'}, + 'service_provider_id': {'key': 'serviceProviderId', 'type': 'str'}, + 'service_provider_display_name': {'key': 'serviceProviderDisplayName', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ConnectionSettingParameter]'}, + } + + def __init__(self, **kwargs): + super(ConnectionSettingProperties, self).__init__(**kwargs) + self.client_id = kwargs.get('client_id', None) + self.client_secret = kwargs.get('client_secret', None) + self.scopes = kwargs.get('scopes', None) + self.service_provider_id = kwargs.get('service_provider_id', None) + self.service_provider_display_name = kwargs.get('service_provider_display_name', None) + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties_py3.py new file mode 100644 index 000000000000..e6952cde3595 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_properties_py3.py @@ -0,0 +1,52 @@ +# 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 msrest.serialization import Model + + +class ConnectionSettingProperties(Model): + """Properties for a Connection Setting Item. + + :param client_id: Client Id associated with the Connection Setting. + :type client_id: str + :param client_secret: Client Secret associated with the Connection Setting + :type client_secret: str + :param scopes: Scopes associated with the Connection Setting + :type scopes: str + :param service_provider_id: Service Provider Id associated with the + Connection Setting + :type service_provider_id: str + :param service_provider_display_name: Service Provider Display Name + associated with the Connection Setting + :type service_provider_display_name: str + :param parameters: Service Provider Parameters associated with the + Connection Setting + :type parameters: + list[~azure.mgmt.botservice.models.ConnectionSettingParameter] + """ + + _attribute_map = { + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'scopes': {'key': 'scopes', 'type': 'str'}, + 'service_provider_id': {'key': 'serviceProviderId', 'type': 'str'}, + 'service_provider_display_name': {'key': 'serviceProviderDisplayName', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ConnectionSettingParameter]'}, + } + + def __init__(self, *, client_id: str=None, client_secret: str=None, scopes: str=None, service_provider_id: str=None, service_provider_display_name: str=None, parameters=None, **kwargs) -> None: + super(ConnectionSettingProperties, self).__init__(**kwargs) + self.client_id = client_id + self.client_secret = client_secret + self.scopes = scopes + self.service_provider_id = service_provider_id + self.service_provider_display_name = service_provider_display_name + self.parameters = parameters diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_py3.py new file mode 100644 index 000000000000..12ab93de6219 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/connection_setting_py3.py @@ -0,0 +1,63 @@ +# 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 .resource_py3 import Resource + + +class ConnectionSetting(Resource): + """Bot channel resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.botservice.models.Sku + :param kind: Required. Gets or sets the Kind of the resource. Possible + values include: 'sdk', 'designer', 'bot', 'function' + :type kind: str or ~azure.mgmt.botservice.models.Kind + :param etag: Entity Tag + :type etag: str + :param properties: The set of properties specific to bot channel resource + :type properties: + ~azure.mgmt.botservice.models.ConnectionSettingProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConnectionSettingProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, kind=None, etag: str=None, properties=None, **kwargs) -> None: + super(ConnectionSetting, self).__init__(location=location, tags=tags, sku=sku, kind=kind, etag=etag, **kwargs) + self.properties = properties diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_py3.py index 18a849fb23fb..069885574a54 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class DirectLineChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_py3.py index 7dafa6d4da85..7a9e9af59e74 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class EmailChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_py3.py index a87d7e711186..ec43910d6288 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class FacebookChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_py3.py index 0897c1561482..9cfbff1611bf 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class KikChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_py3.py index b735e3c60791..b683d051282b 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class MsTeamsChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider.py new file mode 100644 index 000000000000..cf50bec2ae1f --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ServiceProvider(Model): + """Service Provider Definition. + + :param properties: The Properties of a Service Provider Object + :type properties: ~azure.mgmt.botservice.models.ServiceProviderProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ServiceProviderProperties'}, + } + + def __init__(self, **kwargs): + super(ServiceProvider, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter.py new file mode 100644 index 000000000000..e72f95f1b8e8 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderParameter(Model): + """Extra Parameters specific to each Service Provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Service Provider + :vartype name: str + :ivar type: Type of the Service Provider + :vartype type: str + :ivar display_name: Display Name of the Service Provider + :vartype display_name: str + :ivar description: Description of the Service Provider + :vartype description: str + :ivar help_url: Help Url for the Service Provider + :vartype help_url: str + :ivar default: Default Name for the Service Provider + :vartype default: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'help_url': {'readonly': True}, + 'default': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ServiceProviderParameter, self).__init__(**kwargs) + self.name = None + self.type = None + self.display_name = None + self.description = None + self.help_url = None + self.default = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter_py3.py new file mode 100644 index 000000000000..7d1f5664af8c --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_parameter_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderParameter(Model): + """Extra Parameters specific to each Service Provider. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the Service Provider + :vartype name: str + :ivar type: Type of the Service Provider + :vartype type: str + :ivar display_name: Display Name of the Service Provider + :vartype display_name: str + :ivar description: Description of the Service Provider + :vartype description: str + :ivar help_url: Help Url for the Service Provider + :vartype help_url: str + :ivar default: Default Name for the Service Provider + :vartype default: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'display_name': {'readonly': True}, + 'description': {'readonly': True}, + 'help_url': {'readonly': True}, + 'default': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'help_url': {'key': 'helpUrl', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ServiceProviderParameter, self).__init__(**kwargs) + self.name = None + self.type = None + self.display_name = None + self.description = None + self.help_url = None + self.default = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties.py new file mode 100644 index 000000000000..4062224d5c7d --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderProperties(Model): + """The Object used to describe a Service Provider supported by Bot Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id for Service Provider + :vartype id: str + :ivar display_name: Diplay Name of the Service Provider + :vartype display_name: str + :ivar service_provider_name: Diplay Name of the Service Provider + :vartype service_provider_name: str + :ivar dev_portal_url: Diplay Name of the Service Provider + :vartype dev_portal_url: str + :ivar icon_url: Diplay Name of the Service Provider + :vartype icon_url: str + :param parameters: The list of parameters for the Service Provider + :type parameters: + list[~azure.mgmt.botservice.models.ServiceProviderParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'service_provider_name': {'readonly': True}, + 'dev_portal_url': {'readonly': True}, + 'icon_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'dev_portal_url': {'key': 'devPortalUrl', 'type': 'str'}, + 'icon_url': {'key': 'iconUrl', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ServiceProviderParameter]'}, + } + + def __init__(self, **kwargs): + super(ServiceProviderProperties, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.service_provider_name = None + self.dev_portal_url = None + self.icon_url = None + self.parameters = kwargs.get('parameters', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties_py3.py new file mode 100644 index 000000000000..7272cb31422f --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_properties_py3.py @@ -0,0 +1,60 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderProperties(Model): + """The Object used to describe a Service Provider supported by Bot Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Id for Service Provider + :vartype id: str + :ivar display_name: Diplay Name of the Service Provider + :vartype display_name: str + :ivar service_provider_name: Diplay Name of the Service Provider + :vartype service_provider_name: str + :ivar dev_portal_url: Diplay Name of the Service Provider + :vartype dev_portal_url: str + :ivar icon_url: Diplay Name of the Service Provider + :vartype icon_url: str + :param parameters: The list of parameters for the Service Provider + :type parameters: + list[~azure.mgmt.botservice.models.ServiceProviderParameter] + """ + + _validation = { + 'id': {'readonly': True}, + 'display_name': {'readonly': True}, + 'service_provider_name': {'readonly': True}, + 'dev_portal_url': {'readonly': True}, + 'icon_url': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'service_provider_name': {'key': 'serviceProviderName', 'type': 'str'}, + 'dev_portal_url': {'key': 'devPortalUrl', 'type': 'str'}, + 'icon_url': {'key': 'iconUrl', 'type': 'str'}, + 'parameters': {'key': 'parameters', 'type': '[ServiceProviderParameter]'}, + } + + def __init__(self, *, parameters=None, **kwargs) -> None: + super(ServiceProviderProperties, self).__init__(**kwargs) + self.id = None + self.display_name = None + self.service_provider_name = None + self.dev_portal_url = None + self.icon_url = None + self.parameters = parameters diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_py3.py new file mode 100644 index 000000000000..86ee2d94e5d0 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_py3.py @@ -0,0 +1,28 @@ +# 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 msrest.serialization import Model + + +class ServiceProvider(Model): + """Service Provider Definition. + + :param properties: The Properties of a Service Provider Object + :type properties: ~azure.mgmt.botservice.models.ServiceProviderProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ServiceProviderProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ServiceProvider, self).__init__(**kwargs) + self.properties = properties diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list.py new file mode 100644 index 000000000000..4d2ab214edb0 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderResponseList(Model): + """The list of bot service service providers response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param next_link: The link used to get the next page of bot service + service providers. + :type next_link: str + :ivar value: Gets the list of bot service service providers and their + properties. + :vartype value: list[~azure.mgmt.botservice.models.ServiceProvider] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ServiceProvider]'}, + } + + def __init__(self, **kwargs): + super(ServiceProviderResponseList, self).__init__(**kwargs) + self.next_link = kwargs.get('next_link', None) + self.value = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list_py3.py new file mode 100644 index 000000000000..207afd213bc6 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/service_provider_response_list_py3.py @@ -0,0 +1,41 @@ +# 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 msrest.serialization import Model + + +class ServiceProviderResponseList(Model): + """The list of bot service service providers response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param next_link: The link used to get the next page of bot service + service providers. + :type next_link: str + :ivar value: Gets the list of bot service service providers and their + properties. + :vartype value: list[~azure.mgmt.botservice.models.ServiceProvider] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'value': {'key': 'value', 'type': '[ServiceProvider]'}, + } + + def __init__(self, *, next_link: str=None, **kwargs) -> None: + super(ServiceProviderResponseList, self).__init__(**kwargs) + self.next_link = next_link + self.value = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_py3.py index bf517d5fb950..e14a4d01fffb 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class SkypeChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_py3.py index 3a36188d290f..0b3f5af0c1fc 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class SlackChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_py3.py index 4cd117dc982b..2e5589ec2dba 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class SmsChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_py3.py index 84c5613aad37..8928c50d2958 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class TelegramChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_py3.py index 129c38688c41..dd3564eac32b 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_py3.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .channel import Channel +from .channel_py3 import Channel class WebChatChannel(Channel): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py index a587b5bcc9fd..7b05b42049b5 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py @@ -12,9 +12,17 @@ from .bots_operations import BotsOperations from .channels_operations import ChannelsOperations from .operations import Operations +from .bot_connections_operations import BotConnectionsOperations +from .bot_connection_operations import BotConnectionOperations +from .bot_token_operations import BotTokenOperations +from .connections_operations import ConnectionsOperations __all__ = [ 'BotsOperations', 'ChannelsOperations', 'Operations', + 'BotConnectionsOperations', + 'BotConnectionOperations', + 'BotTokenOperations', + 'ConnectionsOperations', ] diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py new file mode 100644 index 000000000000..804763d043bc --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py @@ -0,0 +1,244 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BotConnectionOperations(object): + """BotConnectionOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def get( + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Get a Connection Setting registration for a Bot Service. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param connection_name: The name of the Bot Connection Setting + resource. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} + + def create( + self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Register a new Auth Connection for a Bot Service. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param connection_name: The name of the Bot Service Connection Setting + resource + :type connection_name: str + :param parameters: The parameters to provide for creating the + Connection Setting. + :type parameters: ~azure.mgmt.botservice.models.ConnectionSetting + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionSetting') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSetting', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + + def get1( + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Get a Connection Setting registration for a Bot Service. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param connection_name: The name of the Bot Connection Setting + resource. + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.get1.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py new file mode 100644 index 000000000000..940c1e4464cf --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py @@ -0,0 +1,171 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BotConnectionsOperations(object): + """BotConnectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def list_service_providers( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists the available Service Providers for creating Connection Settings. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServiceProviderResponseList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ServiceProviderResponseList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.list_service_providers.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServiceProviderResponseList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/BotServices/listServiceProviders'} + + def update( + self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a Connection Setting registration for a Bot Service. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param connection_name: The name of the Bot Service Connection Setting + resource + :type connection_name: str + :param parameters: The parameters to provide for updating the + Connection Setting. + :type parameters: ~azure.mgmt.botservice.models.ConnectionSetting + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionSetting') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSetting', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py new file mode 100644 index 000000000000..b7c7f02a871b --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py @@ -0,0 +1,95 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class BotTokenOperations(object): + """BotTokenOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def delete( + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Connection Setting registration for a Bot Service. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param connection_name: The name of the Bot Service Connection Setting + resource + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py new file mode 100644 index 000000000000..cb6bbbc4e0fe --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ConnectionsOperations(object): + """ConnectionsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-12-01" + + self.config = config + + def list_by_bot_service( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns all the Connection Settings registered to a particular + BotService resource. + + :param resource_group_name: The name of the resource group within the + user's subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectionSetting + :rtype: + ~azure.mgmt.botservice.models.ConnectionSettingPaged[~azure.mgmt.botservice.models.ConnectionSetting] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_bot_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_bot_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections'} From 673c8a20c0c2a6b5d391562d7e5450360b08bc9f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 16 May 2018 23:12:17 +0000 Subject: [PATCH 2/4] Generated from 82c95c7d88bc41b29a382ed5192ecce2448bd938 fix duplicate operationid --- .../operations/bot_connection_operations.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py index 804763d043bc..9ed38a5ce5b9 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( + def list_with_secrets( self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. @@ -60,7 +60,7 @@ def get( :class:`ErrorException` """ # Construct URL - url = self.get.metadata['url'] + url = self.list_with_secrets.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), '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_.-]*$'), @@ -100,7 +100,7 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} + list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} def create( self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): @@ -177,7 +177,7 @@ def create( return deserialized create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} - def get1( + def get( self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. @@ -201,7 +201,7 @@ def get1( :class:`ErrorException` """ # Construct URL - url = self.get1.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), '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_.-]*$'), @@ -241,4 +241,4 @@ def get1( return client_raw_response return deserialized - get1.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} From c43b874c9ae9c7e527136479d177f4a6c462bd2f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 23 May 2018 20:14:37 +0000 Subject: [PATCH 3/4] Generated from 74ff143a0316bee4e287a6ab4e591d4c4246f7eb fixed validation errors --- .../mgmt/botservice/azure_bot_service.py | 37 +-- .../mgmt/botservice/operations/__init__.py | 6 - .../operations/bot_connection_operations.py | 289 ++++++++++++++++-- .../operations/bot_connections_operations.py | 171 ----------- .../operations/bot_token_operations.py | 95 ------ .../botservice/operations/bots_operations.py | 51 +--- .../operations/channels_operations.py | 66 ++-- .../operations/connections_operations.py | 109 ------- 8 files changed, 311 insertions(+), 513 deletions(-) delete mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py delete mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py delete mode 100644 azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py index b151d218ad00..eb161250a927 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py @@ -16,10 +16,7 @@ from .operations.bots_operations import BotsOperations from .operations.channels_operations import ChannelsOperations from .operations.operations import Operations -from .operations.bot_connections_operations import BotConnectionsOperations from .operations.bot_connection_operations import BotConnectionOperations -from .operations.bot_token_operations import BotTokenOperations -from .operations.connections_operations import ConnectionsOperations from . import models @@ -31,16 +28,25 @@ class AzureBotServiceConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :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 subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, resource_group_name, resource_name, subscription_id, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") + if resource_group_name is None: + raise ValueError("Parameter 'resource_group_name' must not be None.") + if resource_name is None: + raise ValueError("Parameter 'resource_name' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: @@ -52,6 +58,8 @@ def __init__( self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials + self.resource_group_name = resource_group_name + self.resource_name = resource_name self.subscription_id = subscription_id @@ -67,27 +75,26 @@ class AzureBotService(SDKClient): :vartype channels: azure.mgmt.botservice.operations.ChannelsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.botservice.operations.Operations - :ivar bot_connections: BotConnections operations - :vartype bot_connections: azure.mgmt.botservice.operations.BotConnectionsOperations :ivar bot_connection: BotConnection operations :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations - :ivar bot_token: BotToken operations - :vartype bot_token: azure.mgmt.botservice.operations.BotTokenOperations - :ivar connections: Connections operations - :vartype connections: azure.mgmt.botservice.operations.ConnectionsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` + :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 subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, subscription_id, base_url=None): + self, credentials, resource_group_name, resource_name, subscription_id, base_url=None): - self.config = AzureBotServiceConfiguration(credentials, subscription_id, base_url) + self.config = AzureBotServiceConfiguration(credentials, resource_group_name, resource_name, subscription_id, base_url) super(AzureBotService, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} @@ -101,11 +108,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.bot_connections = BotConnectionsOperations( - self._client, self.config, self._serialize, self._deserialize) self.bot_connection = BotConnectionOperations( self._client, self.config, self._serialize, self._deserialize) - self.bot_token = BotTokenOperations( - self._client, self.config, self._serialize, self._deserialize) - self.connections = ConnectionsOperations( - self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py index 7b05b42049b5..c52c36afa15f 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py @@ -12,17 +12,11 @@ from .bots_operations import BotsOperations from .channels_operations import ChannelsOperations from .operations import Operations -from .bot_connections_operations import BotConnectionsOperations from .bot_connection_operations import BotConnectionOperations -from .bot_token_operations import BotTokenOperations -from .connections_operations import ConnectionsOperations __all__ = [ 'BotsOperations', 'ChannelsOperations', 'Operations', - 'BotConnectionsOperations', 'BotConnectionOperations', - 'BotTokenOperations', - 'ConnectionsOperations', ] diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py index 9ed38a5ce5b9..0635ef7dd04a 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py @@ -36,17 +36,68 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list_service_providers( + self, custom_headers=None, raw=False, **operation_config): + """Lists the available Service Providers for creating Connection Settings. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServiceProviderResponseList or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ServiceProviderResponseList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.list_service_providers.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServiceProviderResponseList', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_service_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/BotServices/listServiceProviders'} + def list_with_secrets( - self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): + self, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str - :param connection_name: The name of the Bot Connection Setting - resource. + :param connection_name: The name of the Bot Service Connection Setting + resource :type connection_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -62,8 +113,8 @@ def list_with_secrets( # Construct URL url = self.list_with_secrets.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -103,14 +154,9 @@ def list_with_secrets( list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} def create( - self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, connection_name, parameters, custom_headers=None, raw=False, **operation_config): """Register a new Auth Connection for a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -131,9 +177,9 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), - 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_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) @@ -177,17 +223,82 @@ def create( return deserialized create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + def update( + self, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + """Updates a Connection Setting registration for a Bot Service. + + :param connection_name: The name of the Bot Service Connection Setting + resource + :type connection_name: str + :param parameters: The parameters to provide for updating the + Connection Setting. + :type parameters: ~azure.mgmt.botservice.models.ConnectionSetting + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ConnectionSetting or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ConnectionSetting') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ConnectionSetting', response) + if response.status_code == 201: + deserialized = self._deserialize('ConnectionSetting', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + def get( - self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): + self, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str - :param connection_name: The name of the Bot Connection Setting - resource. + :param connection_name: The name of the Bot Service Connection Setting + resource :type connection_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -203,8 +314,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -242,3 +353,123 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + + def delete( + self, connection_name, custom_headers=None, raw=False, **operation_config): + """Deletes a Connection Setting registration for a Bot Service. + + :param connection_name: The name of the Bot Service Connection Setting + resource + :type connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'connectionName': self._serialize.url("connection_name", connection_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} + + def list_by_bot_service( + self, custom_headers=None, raw=False, **operation_config): + """Returns all the Connection Settings registered to a particular + BotService resource. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ConnectionSetting + :rtype: + ~azure.mgmt.botservice.models.ConnectionSettingPaged[~azure.mgmt.botservice.models.ConnectionSetting] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_bot_service.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_bot_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py deleted file mode 100644 index 940c1e4464cf..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connections_operations.py +++ /dev/null @@ -1,171 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BotConnectionsOperations(object): - """BotConnectionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01" - - self.config = config - - def list_service_providers( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Lists the available Service Providers for creating Connection Settings. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ServiceProviderResponseList or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.ServiceProviderResponseList or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = self.list_service_providers.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ServiceProviderResponseList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_service_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/BotServices/listServiceProviders'} - - def update( - self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): - """Updates a Connection Setting registration for a Bot Service. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str - :param connection_name: The name of the Bot Service Connection Setting - resource - :type connection_name: str - :param parameters: The parameters to provide for updating the - Connection Setting. - :type parameters: ~azure.mgmt.botservice.models.ConnectionSetting - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ConnectionSetting or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.ConnectionSetting or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), - 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ConnectionSetting') - - # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - raise models.ErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ConnectionSetting', response) - if response.status_code == 201: - deserialized = self._deserialize('ConnectionSetting', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py deleted file mode 100644 index b7c7f02a871b..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_token_operations.py +++ /dev/null @@ -1,95 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class BotTokenOperations(object): - """BotTokenOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01" - - self.config = config - - def delete( - self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): - """Deletes a Connection Setting registration for a Bot Service. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str - :param connection_name: The name of the Bot Service Connection Setting - resource - :type connection_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), - 'connectionName': self._serialize.url("connection_name", connection_name, 'str'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 204]: - raise models.ErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py index 6218f6ba9617..c641f360dc50 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py @@ -37,15 +37,10 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def create( - self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + self, parameters, custom_headers=None, raw=False, **operation_config): """Creates a Bot Service. Bot Service is a resource group wide resource type. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param parameters: The parameters to provide for the created bot. :type parameters: ~azure.mgmt.botservice.models.Bot :param dict custom_headers: headers that will be added to the request @@ -62,8 +57,8 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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) @@ -108,14 +103,9 @@ def create( create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def update( - self, resource_group_name, resource_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + self, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): """Updates a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param location: Specifies the location of the resource. :type location: str :param tags: Contains resource tags defined as key/value pairs. @@ -145,8 +135,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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) @@ -191,14 +181,9 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def delete( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Deletes a Bot Service from the resource group. . - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -212,8 +197,8 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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) @@ -245,14 +230,9 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def get( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Returns a BotService specified by the parameters. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -267,8 +247,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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) @@ -307,13 +287,10 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Returns all the resources of a particular type belonging to a resource group. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -331,7 +308,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_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) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py index c818c4937b05..dd772c694052 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py @@ -37,14 +37,9 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def create( - self, resource_group_name, resource_name, channel_name, parameters, custom_headers=None, raw=False, **operation_config): + self, channel_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates a Channel registration for a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -66,8 +61,8 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -113,14 +108,9 @@ def create( create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def update( - self, resource_group_name, resource_name, channel_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + self, channel_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): """Updates a Channel registration for a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -156,8 +146,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -203,14 +193,9 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def delete( - self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): + self, channel_name, custom_headers=None, raw=False, **operation_config): """Deletes a Channel registration from a Bot Service. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param channel_name: The name of the Bot resource. :type channel_name: str :param dict custom_headers: headers that will be added to the request @@ -226,8 +211,8 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_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') } @@ -260,14 +245,9 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def get( - self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): + self, channel_name, custom_headers=None, raw=False, **operation_config): """Returns a BotService Channel registration specified by the parameters. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param channel_name: The name of the Bot resource. :type channel_name: str :param dict custom_headers: headers that will be added to the request @@ -284,8 +264,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_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') } @@ -325,14 +305,9 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def list_with_keys( - self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): + self, channel_name, custom_headers=None, raw=False, **operation_config): """Lists a Channel registration for a Bot Service including secrets. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -352,8 +327,8 @@ def list_with_keys( # Construct URL url = self.list_with_keys.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -393,15 +368,10 @@ def list_with_keys( list_with_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys'} def list_by_resource_group( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + self, custom_headers=None, raw=False, **operation_config): """Returns all the Channel registrations of a particular BotService resource. - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -419,8 +389,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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_.-]*$'), + 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("self.config.resource_name", self.config.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) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py deleted file mode 100644 index cb6bbbc4e0fe..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/connections_operations.py +++ /dev/null @@ -1,109 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class ConnectionsOperations(object): - """ConnectionsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2017-12-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-12-01" - - self.config = config - - def list_by_bot_service( - self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): - """Returns all the Connection Settings registered to a particular - BotService resource. - - :param resource_group_name: The name of the resource group within the - user's subscription. - :type resource_group_name: str - :param resource_name: The name of the Bot resource. - :type resource_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ConnectionSetting - :rtype: - ~azure.mgmt.botservice.models.ConnectionSettingPaged[~azure.mgmt.botservice.models.ConnectionSetting] - :raises: - :class:`ErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_bot_service.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ConnectionSettingPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_bot_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/connections'} From 82bfa0122d02a917b560bf3ac3dea73d973e23ae Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 23 May 2018 21:26:24 +0000 Subject: [PATCH 4/4] Generated from baa318aab490cc124021dcb8d320190a3efdf75d add ms parameter location to resource group and resource parameter definitions --- .../mgmt/botservice/azure_bot_service.py | 22 +----- .../operations/bot_connection_operations.py | 73 ++++++++++++++----- .../botservice/operations/bots_operations.py | 51 +++++++++---- .../operations/channels_operations.py | 66 ++++++++++++----- 4 files changed, 141 insertions(+), 71 deletions(-) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py index eb161250a927..8facb940856d 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py @@ -28,25 +28,16 @@ class AzureBotServiceConfiguration(AzureConfiguration): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :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 subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, resource_group_name, resource_name, subscription_id, base_url=None): + self, credentials, subscription_id, base_url=None): if credentials is None: raise ValueError("Parameter 'credentials' must not be None.") - if resource_group_name is None: - raise ValueError("Parameter 'resource_group_name' must not be None.") - if resource_name is None: - raise ValueError("Parameter 'resource_name' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") if not base_url: @@ -58,8 +49,6 @@ def __init__( self.add_user_agent('Azure-SDK-For-Python') self.credentials = credentials - self.resource_group_name = resource_group_name - self.resource_name = resource_name self.subscription_id = subscription_id @@ -81,20 +70,15 @@ class AzureBotService(SDKClient): :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials object` - :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 subscription_id: Azure Subscription ID. :type subscription_id: str :param str base_url: Service URL """ def __init__( - self, credentials, resource_group_name, resource_name, subscription_id, base_url=None): + self, credentials, subscription_id, base_url=None): - self.config = AzureBotServiceConfiguration(credentials, resource_group_name, resource_name, subscription_id, base_url) + self.config = AzureBotServiceConfiguration(credentials, subscription_id, base_url) super(AzureBotService, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py index 0635ef7dd04a..833d572a97ea 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py @@ -37,9 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def list_service_providers( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Lists the available Service Providers for creating Connection Settings. + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -54,7 +57,7 @@ def list_service_providers( # Construct URL url = self.list_service_providers.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -93,9 +96,14 @@ def list_service_providers( list_service_providers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/BotServices/listServiceProviders'} def list_with_secrets( - self, connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. + :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 connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -113,8 +121,8 @@ def list_with_secrets( # Construct URL url = self.list_with_secrets.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -154,9 +162,14 @@ def list_with_secrets( list_with_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}/listWithSecrets'} def create( - self, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): """Register a new Auth Connection for a Bot Service. + :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 connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -177,8 +190,8 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -224,9 +237,14 @@ def create( create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} def update( - self, connection_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, connection_name, parameters, custom_headers=None, raw=False, **operation_config): """Updates a Connection Setting registration for a Bot Service. + :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 connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -247,8 +265,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -294,9 +312,14 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} def get( - self, connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): """Get a Connection Setting registration for a Bot Service. + :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 connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -314,8 +337,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -355,9 +378,14 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} def delete( - self, connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, connection_name, custom_headers=None, raw=False, **operation_config): """Deletes a Connection Setting registration for a Bot Service. + :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 connection_name: The name of the Bot Service Connection Setting resource :type connection_name: str @@ -374,8 +402,8 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'connectionName': self._serialize.url("connection_name", connection_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') } @@ -408,10 +436,15 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/Connections/{connectionName}'} def list_by_bot_service( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns all the Connection Settings registered to a particular BotService resource. + :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -429,8 +462,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_bot_service.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py index c641f360dc50..905081bd1444 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py @@ -37,10 +37,15 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def create( - self, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates a Bot Service. Bot Service is a resource group wide resource type. + :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 parameters: The parameters to provide for the created bot. :type parameters: ~azure.mgmt.botservice.models.Bot :param dict custom_headers: headers that will be added to the request @@ -57,8 +62,8 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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) @@ -103,9 +108,14 @@ def create( create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def update( - self, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): """Updates a Bot Service. + :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 location: Specifies the location of the resource. :type location: str :param tags: Contains resource tags defined as key/value pairs. @@ -135,8 +145,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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) @@ -181,9 +191,14 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def delete( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Deletes a Bot Service from the resource group. . + :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -197,8 +212,8 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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) @@ -230,9 +245,14 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def get( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns a BotService specified by the parameters. + :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -247,8 +267,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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) @@ -287,10 +307,13 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}'} def list_by_resource_group( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Returns all the resources of a particular type belonging to a resource group. + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -308,7 +331,7 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py index dd772c694052..9921abb15cc1 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py @@ -37,9 +37,14 @@ def __init__(self, client, config, serializer, deserializer): self.config = config def create( - self, channel_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, channel_name, parameters, custom_headers=None, raw=False, **operation_config): """Creates a Channel registration for a Bot Service. + :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 channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -61,8 +66,8 @@ def create( # Construct URL url = self.create.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -108,9 +113,14 @@ def create( create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def update( - self, channel_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, channel_name, location=None, tags=None, sku=None, kind=None, etag=None, properties=None, custom_headers=None, raw=False, **operation_config): """Updates a Channel registration for a Bot Service. + :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 channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -146,8 +156,8 @@ def update( # Construct URL url = self.update.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -193,9 +203,14 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def delete( - self, channel_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): """Deletes a Channel registration from a Bot Service. + :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 channel_name: The name of the Bot resource. :type channel_name: str :param dict custom_headers: headers that will be added to the request @@ -211,8 +226,8 @@ def delete( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_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') } @@ -245,9 +260,14 @@ def delete( delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def get( - self, channel_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): """Returns a BotService Channel registration specified by the parameters. + :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 channel_name: The name of the Bot resource. :type channel_name: str :param dict custom_headers: headers that will be added to the request @@ -264,8 +284,8 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_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') } @@ -305,9 +325,14 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}'} def list_with_keys( - self, channel_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, channel_name, custom_headers=None, raw=False, **operation_config): """Lists a Channel registration for a Bot Service including secrets. + :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 channel_name: The name of the Channel resource. Possible values include: 'FacebookChannel', 'EmailChannel', 'KikChannel', 'TelegramChannel', 'SlackChannel', 'MsTeamsChannel', 'SkypeChannel', @@ -327,8 +352,8 @@ def list_with_keys( # Construct URL url = self.list_with_keys.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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_.-]*$'), 'channelName': self._serialize.url("channel_name", channel_name, 'ChannelName'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -368,10 +393,15 @@ def list_with_keys( list_with_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}/listChannelWithKeys'} def list_by_resource_group( - self, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Returns all the Channel registrations of a particular BotService resource. + :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 dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -389,8 +419,8 @@ def internal_paging(next_link=None, raw=False): # Construct URL url = self.list_by_resource_group.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("self.config.resource_group_name", self.config.resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), - 'resourceName': self._serialize.url("self.config.resource_name", self.config.resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + '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)