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 a3b1f8e9e3b6..56e6db6efaeb 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py @@ -13,9 +13,7 @@ from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION -from .operations.bots_operations import BotsOperations from .operations.bot_services_operations import BotServicesOperations -from .operations.channels_operations import ChannelsOperations from .operations.operations import Operations from . import models @@ -58,12 +56,8 @@ class AzureBotService(object): :ivar config: Configuration for client. :vartype config: AzureBotServiceConfiguration - :ivar bots: Bots operations - :vartype bots: azure.mgmt.botservice.operations.BotsOperations :ivar bot_services: BotServices operations :vartype bot_services: azure.mgmt.botservice.operations.BotServicesOperations - :ivar channels: Channels operations - :vartype channels: azure.mgmt.botservice.operations.ChannelsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.botservice.operations.Operations @@ -86,11 +80,7 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.bots = BotsOperations( - self._client, self.config, self._serialize, self._deserialize) self.bot_services = BotServicesOperations( self._client, self.config, self._serialize, self._deserialize) - self.channels = ChannelsOperations( - self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( 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 5f741876394b..f38cd530ce1d 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py @@ -9,90 +9,50 @@ # regenerated. # -------------------------------------------------------------------------- -from .sku import Sku -from .resource import Resource -from .bot_properties import BotProperties -from .bot import Bot -from .channel import Channel -from .bot_channel import BotChannel -from .facebook_channel_properties import FacebookChannelProperties -from .facebook_channel import FacebookChannel -from .email_channel_properties import EmailChannelProperties -from .email_channel import EmailChannel -from .ms_teams_channel_properties import MsTeamsChannelProperties -from .ms_teams_channel import MsTeamsChannel -from .skype_channel_properties import SkypeChannelProperties -from .skype_channel import SkypeChannel -from .kik_channel_properties import KikChannelProperties -from .kik_channel import KikChannel -from .web_chat_site import WebChatSite -from .web_chat_channel_properties import WebChatChannelProperties -from .web_chat_channel import WebChatChannel -from .direct_line_site import DirectLineSite -from .direct_line_channel_properties import DirectLineChannelProperties -from .direct_line_channel import DirectLineChannel -from .telegram_channel_properties import TelegramChannelProperties -from .telegram_channel import TelegramChannel -from .sms_channel_properties import SmsChannelProperties -from .sms_channel import SmsChannel -from .slack_channel_properties import SlackChannelProperties -from .slack_channel import SlackChannel -from .error_body import ErrorBody -from .error import Error, ErrorException -from .operation_display_info import OperationDisplayInfo -from .operation_entity import OperationEntity -from .check_name_availability_request_body import CheckNameAvailabilityRequestBody -from .check_name_availability_response_body import CheckNameAvailabilityResponseBody -from .bot_paged import BotPaged -from .bot_channel_paged import BotChannelPaged +try: + from .sku_py3 import Sku + from .resource_py3 import Resource + from .bot_resource_properties_py3 import BotResourceProperties + from .bot_resource_py3 import BotResource + from .error_body_py3 import ErrorBody + from .error_py3 import Error, ErrorException + from .operation_display_info_py3 import OperationDisplayInfo + from .operation_entity_py3 import OperationEntity + from .check_name_availability_response_body_py3 import CheckNameAvailabilityResponseBody + from .check_name_avaialability_request_body_py3 import CheckNameAvaialabilityRequestBody +except (SyntaxError, ImportError): + from .sku import Sku + from .resource import Resource + from .bot_resource_properties import BotResourceProperties + from .bot_resource import BotResource + from .error_body import ErrorBody + from .error import Error, ErrorException + from .operation_display_info import OperationDisplayInfo + from .operation_entity import OperationEntity + from .check_name_availability_response_body import CheckNameAvailabilityResponseBody + from .check_name_avaialability_request_body import CheckNameAvaialabilityRequestBody +from .bot_resource_paged import BotResourcePaged from .operation_entity_paged import OperationEntityPaged from .azure_bot_service_enums import ( SkuName, SkuTier, Kind, - ChannelName, ) __all__ = [ 'Sku', 'Resource', - 'BotProperties', - 'Bot', - 'Channel', - 'BotChannel', - 'FacebookChannelProperties', - 'FacebookChannel', - 'EmailChannelProperties', - 'EmailChannel', - 'MsTeamsChannelProperties', - 'MsTeamsChannel', - 'SkypeChannelProperties', - 'SkypeChannel', - 'KikChannelProperties', - 'KikChannel', - 'WebChatSite', - 'WebChatChannelProperties', - 'WebChatChannel', - 'DirectLineSite', - 'DirectLineChannelProperties', - 'DirectLineChannel', - 'TelegramChannelProperties', - 'TelegramChannel', - 'SmsChannelProperties', - 'SmsChannel', - 'SlackChannelProperties', - 'SlackChannel', + 'BotResourceProperties', + 'BotResource', 'ErrorBody', 'Error', 'ErrorException', 'OperationDisplayInfo', 'OperationEntity', - 'CheckNameAvailabilityRequestBody', 'CheckNameAvailabilityResponseBody', - 'BotPaged', - 'BotChannelPaged', + 'CheckNameAvaialabilityRequestBody', + 'BotResourcePaged', 'OperationEntityPaged', 'SkuName', 'SkuTier', 'Kind', - 'ChannelName', ] diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py index 7c7077a9a3a2..7ff4004ce34d 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py @@ -12,27 +12,22 @@ from enum import Enum -class SkuName(Enum): +class SkuName(str, Enum): f0 = "F0" s1 = "S1" -class SkuTier(Enum): +class SkuTier(str, Enum): free = "Free" standard = "Standard" + premium = "Premium" -class Kind(Enum): +class Kind(str, Enum): sdk = "sdk" designer = "designer" bot = "bot" function = "function" - - -class ChannelName(Enum): - - facebook_channel = "FacebookChannel" - email_channel = "EmailChannel" diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_paged.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_paged.py deleted file mode 100644 index 410e37eb94b0..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_paged.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class BotPaged(Paged): - """ - A paging container for iterating over a list of :class:`Bot ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Bot]'} - } - - def __init__(self, *args, **kwargs): - - super(BotPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource.py similarity index 83% rename from azure-mgmt-botservice/azure/mgmt/botservice/models/bot.py rename to azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource.py index ec00bdc15815..a57092cb10aa 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource.py @@ -12,7 +12,7 @@ from .resource import Resource -class Bot(Resource): +class BotResource(Resource): """Bot resource definition. Variables are only populated by the server, and will be ignored when @@ -36,7 +36,7 @@ class Bot(Resource): :param etag: Entity Tag :type etag: str :param properties: The set of properties specific to bot resource - :type properties: ~azure.mgmt.botservice.models.BotProperties + :type properties: ~azure.mgmt.botservice.models.BotResourceProperties """ _validation = { @@ -54,9 +54,9 @@ class Bot(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'kind': {'key': 'kind', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'BotProperties'}, + 'properties': {'key': 'properties', 'type': 'BotResourceProperties'}, } - def __init__(self, location=None, tags=None, sku=None, kind=None, etag=None, properties=None): - super(Bot, self).__init__(location=location, tags=tags, sku=sku, kind=kind, etag=etag) - self.properties = properties + def __init__(self, **kwargs): + super(BotResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_paged.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_paged.py similarity index 69% rename from azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_paged.py rename to azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_paged.py index 7cf0ca710405..4c74ffa4ffb1 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel_paged.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_paged.py @@ -12,16 +12,16 @@ from msrest.paging import Paged -class BotChannelPaged(Paged): +class BotResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`BotChannel ` object + A paging container for iterating over a list of :class:`BotResource ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BotChannel]'} + 'current_page': {'key': 'value', 'type': '[BotResource]'} } def __init__(self, *args, **kwargs): - super(BotChannelPaged, self).__init__(*args, **kwargs) + super(BotResourcePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties.py new file mode 100644 index 000000000000..7cbed2a44a5c --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties.py @@ -0,0 +1,93 @@ +# 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 BotResourceProperties(Model): + """The parameters to provide for the Bot. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. The Name of the bot + :type display_name: str + :param description: The description of the bot + :type description: str + :param icon_url: The Icon Url of the bot + :type icon_url: str + :param endpoint: Required. The bot's endpoint + :type endpoint: str + :ivar endpoint_version: The bot's endpoint version + :vartype endpoint_version: str + :param msa_app_id: Required. Microsoft App Id for the bot + :type msa_app_id: str + :ivar configured_channels: Collection of channels for which the bot is + configured + :vartype configured_channels: list[str] + :ivar enabled_channels: Collection of channels for which the bot is + enabled + :vartype enabled_channels: list[str] + :param developer_app_insight_key: The Application Insights key + :type developer_app_insight_key: str + :param developer_app_insights_api_key: The Application Insights Api Key + :type developer_app_insights_api_key: str + :param developer_app_insights_application_id: The Application Insights App + Id + :type developer_app_insights_application_id: str + :param luis_app_ids: Collection of LUIS App Ids + :type luis_app_ids: list[str] + :param luis_key: The LUIS Key + :type luis_key: str + """ + + _validation = { + 'display_name': {'required': True}, + 'endpoint': {'required': True}, + 'endpoint_version': {'readonly': True}, + 'msa_app_id': {'required': True}, + 'configured_channels': {'readonly': True}, + 'enabled_channels': {'readonly': True}, + } + + _attribute_map = { + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'icon_url': {'key': 'iconUrl', 'type': 'str'}, + 'endpoint': {'key': 'endpoint', 'type': 'str'}, + 'endpoint_version': {'key': 'endpointVersion', 'type': 'str'}, + 'msa_app_id': {'key': 'msaAppId', 'type': 'str'}, + 'configured_channels': {'key': 'configuredChannels', 'type': '[str]'}, + 'enabled_channels': {'key': 'enabledChannels', 'type': '[str]'}, + 'developer_app_insight_key': {'key': 'developerAppInsightKey', 'type': 'str'}, + 'developer_app_insights_api_key': {'key': 'developerAppInsightsApiKey', 'type': 'str'}, + 'developer_app_insights_application_id': {'key': 'developerAppInsightsApplicationId', 'type': 'str'}, + 'luis_app_ids': {'key': 'luisAppIds', 'type': '[str]'}, + 'luis_key': {'key': 'luisKey', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BotResourceProperties, self).__init__(**kwargs) + self.display_name = kwargs.get('display_name', None) + self.description = kwargs.get('description', None) + self.icon_url = kwargs.get('icon_url', None) + self.endpoint = kwargs.get('endpoint', None) + self.endpoint_version = None + self.msa_app_id = kwargs.get('msa_app_id', None) + self.configured_channels = None + self.enabled_channels = None + self.developer_app_insight_key = kwargs.get('developer_app_insight_key', None) + self.developer_app_insights_api_key = kwargs.get('developer_app_insights_api_key', None) + self.developer_app_insights_application_id = kwargs.get('developer_app_insights_application_id', None) + self.luis_app_ids = kwargs.get('luis_app_ids', None) + self.luis_key = kwargs.get('luis_key', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties_py3.py similarity index 84% rename from azure-mgmt-botservice/azure/mgmt/botservice/models/bot_properties.py rename to azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties_py3.py index 4b7e4251db5e..729d0aedef5c 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_properties.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_properties_py3.py @@ -12,23 +12,25 @@ from msrest.serialization import Model -class BotProperties(Model): +class BotResourceProperties(Model): """The parameters to provide for the Bot. Variables are only populated by the server, and will be ignored when sending a request. - :param display_name: The Name of the bot + All required parameters must be populated in order to send to Azure. + + :param display_name: Required. The Name of the bot :type display_name: str :param description: The description of the bot :type description: str :param icon_url: The Icon Url of the bot :type icon_url: str - :param endpoint: The bot's endpoint + :param endpoint: Required. The bot's endpoint :type endpoint: str :ivar endpoint_version: The bot's endpoint version :vartype endpoint_version: str - :param msa_app_id: Microsoft App Id for the bot + :param msa_app_id: Required. Microsoft App Id for the bot :type msa_app_id: str :ivar configured_channels: Collection of channels for which the bot is configured @@ -74,7 +76,8 @@ class BotProperties(Model): 'luis_key': {'key': 'luisKey', 'type': 'str'}, } - def __init__(self, display_name, endpoint, msa_app_id, description=None, icon_url=None, developer_app_insight_key=None, developer_app_insights_api_key=None, developer_app_insights_application_id=None, luis_app_ids=None, luis_key=None): + def __init__(self, *, display_name: str, endpoint: str, msa_app_id: str, description: str=None, icon_url: str=None, developer_app_insight_key: str=None, developer_app_insights_api_key: str=None, developer_app_insights_application_id: str=None, luis_app_ids=None, luis_key: str=None, **kwargs) -> None: + super(BotResourceProperties, self).__init__(**kwargs) self.display_name = display_name self.description = description self.icon_url = icon_url diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_py3.py similarity index 78% rename from azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel.py rename to azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_py3.py index 78b6439dcb7f..eea7b3190540 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_channel.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/bot_resource_py3.py @@ -12,8 +12,8 @@ from .resource import Resource -class BotChannel(Resource): - """Bot channel resource definition. +class BotResource(Resource): + """Bot resource definition. Variables are only populated by the server, and will be ignored when sending a request. @@ -35,8 +35,8 @@ class BotChannel(Resource): :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.Channel + :param properties: The set of properties specific to bot resource + :type properties: ~azure.mgmt.botservice.models.BotResourceProperties """ _validation = { @@ -54,9 +54,9 @@ class BotChannel(Resource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'kind': {'key': 'kind', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'Channel'}, + 'properties': {'key': 'properties', 'type': 'BotResourceProperties'}, } - def __init__(self, location=None, tags=None, sku=None, kind=None, etag=None, properties=None): - super(BotChannel, self).__init__(location=location, tags=tags, sku=sku, kind=kind, etag=etag) + def __init__(self, *, location: str=None, tags=None, sku=None, kind=None, etag: str=None, properties=None, **kwargs) -> None: + super(BotResource, 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/channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/channel.py deleted file mode 100644 index d6b04cf2f463..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/channel.py +++ /dev/null @@ -1,40 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class Channel(Model): - """Channel definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: FacebookChannel, EmailChannel, MsTeamsChannel, - SkypeChannel, KikChannel, WebChatChannel, DirectLineChannel, - TelegramChannel, SmsChannel, SlackChannel - - :param channel_name: Constant filled by server. - :type channel_name: str - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - } - - _subtype_map = { - 'channel_name': {'FacebookChannel': 'FacebookChannel', 'EmailChannel': 'EmailChannel', 'MsTeamsChannel': 'MsTeamsChannel', 'SkypeChannel': 'SkypeChannel', 'KikChannel': 'KikChannel', 'WebChatChannel': 'WebChatChannel', 'DirectLineChannel': 'DirectLineChannel', 'TelegramChannel': 'TelegramChannel', 'SmsChannel': 'SmsChannel', 'SlackChannel': 'SlackChannel'} - } - - def __init__(self): - self.channel_name = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body.py new file mode 100644 index 000000000000..abf946407f52 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body.py @@ -0,0 +1,33 @@ +# 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 CheckNameAvaialabilityRequestBody(Model): + """The request body for a check bot name availability request to Bot Service + Management. + + :param name: name of the bot, that needs to be checked for availability. + :type name: str + :param type: resource type for the bot. + :type type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvaialabilityRequestBody, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_request_body.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body_py3.py similarity index 63% rename from azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_request_body.py rename to azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body_py3.py index 7c78f2e00d5a..d9485a72df31 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_request_body.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_avaialability_request_body_py3.py @@ -12,15 +12,13 @@ from msrest.serialization import Model -class CheckNameAvailabilityRequestBody(Model): - """The request body for a request to Bot Service Management to check - availability of a bot name. +class CheckNameAvaialabilityRequestBody(Model): + """The request body for a check bot name availability request to Bot Service + Management. - :param name: the name of the bot for which availability needs to be - checked. + :param name: name of the bot, that needs to be checked for availability. :type name: str - :param type: the type of the bot for which availability needs to be - checked + :param type: resource type for the bot. :type type: str """ @@ -29,6 +27,7 @@ class CheckNameAvailabilityRequestBody(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self, name=None, type=None): + def __init__(self, *, name: str=None, type: str=None, **kwargs) -> None: + super(CheckNameAvaialabilityRequestBody, self).__init__(**kwargs) self.name = name self.type = type diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body.py index 4e1313f2f5e3..d124d52a6980 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body.py @@ -13,13 +13,14 @@ class CheckNameAvailabilityResponseBody(Model): - """The response body returned for a request to Bot Service Management to check - availability of a bot name. + """The response returned on a check bot name availability request by Bot + Service Management. - :param valid: indicates if the bot name is valid. + :param valid: boolean indicating whether the bot name is available for + use. :type valid: bool - :param message: additional message from the bot management api showing why - a bot name is not available + :param message: description indicating why the bot name is invalid, if it + is not available. :type message: str """ @@ -28,6 +29,7 @@ class CheckNameAvailabilityResponseBody(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, valid=None, message=None): - self.valid = valid - self.message = message + def __init__(self, **kwargs): + super(CheckNameAvailabilityResponseBody, self).__init__(**kwargs) + self.valid = kwargs.get('valid', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body_py3.py new file mode 100644 index 000000000000..d5b398532afb --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/check_name_availability_response_body_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 CheckNameAvailabilityResponseBody(Model): + """The response returned on a check bot name availability request by Bot + Service Management. + + :param valid: boolean indicating whether the bot name is available for + use. + :type valid: bool + :param message: description indicating why the bot name is invalid, if it + is not available. + :type message: str + """ + + _attribute_map = { + 'valid': {'key': 'valid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, valid: bool=None, message: str=None, **kwargs) -> None: + super(CheckNameAvailabilityResponseBody, self).__init__(**kwargs) + self.valid = valid + self.message = message diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel.py deleted file mode 100644 index 43af144b6f01..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel.py +++ /dev/null @@ -1,38 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class DirectLineChannel(Channel): - """Direct Line channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Direct Line channel - resource - :type properties: - ~azure.mgmt.botservice.models.DirectLineChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'DirectLineChannelProperties'}, - } - - def __init__(self, properties=None): - super(DirectLineChannel, self).__init__() - self.properties = properties - self.channel_name = 'DirectLineChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_properties.py deleted file mode 100644 index 537e8b44ea9c..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_channel_properties.py +++ /dev/null @@ -1,27 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DirectLineChannelProperties(Model): - """The parameters to provide for the Direct Line channel. - - :param sites: The list of Direct Line sites - :type sites: list[~azure.mgmt.botservice.models.DirectLineSite] - """ - - _attribute_map = { - 'sites': {'key': 'sites', 'type': '[DirectLineSite]'}, - } - - def __init__(self, sites=None): - self.sites = sites diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_site.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_site.py deleted file mode 100644 index 3cf031dbf261..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/direct_line_site.py +++ /dev/null @@ -1,66 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class DirectLineSite(Model): - """A site for the Direct Line channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar site_id: Site Id - :vartype site_id: str - :param site_name: Site name - :type site_name: str - :ivar key: Primary key - :vartype key: str - :ivar key2: Secondary key - :vartype key2: str - :param is_enabled: Whether this site is enabled for DirectLine channel - :type is_enabled: bool - :param is_v1_enabled: Whether this site is enabled for Bot Framework V1 - protocol - :type is_v1_enabled: bool - :param is_v3_enabled: Whether this site is enabled for Bot Framework V1 - protocol - :type is_v3_enabled: bool - """ - - _validation = { - 'site_id': {'readonly': True}, - 'site_name': {'required': True}, - 'key': {'readonly': True}, - 'key2': {'readonly': True}, - 'is_enabled': {'required': True}, - 'is_v1_enabled': {'required': True}, - 'is_v3_enabled': {'required': True}, - } - - _attribute_map = { - 'site_id': {'key': 'siteId', 'type': 'str'}, - 'site_name': {'key': 'siteName', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'is_v1_enabled': {'key': 'isV1Enabled', 'type': 'bool'}, - 'is_v3_enabled': {'key': 'isV3Enabled', 'type': 'bool'}, - } - - def __init__(self, site_name, is_enabled, is_v1_enabled, is_v3_enabled): - self.site_id = None - self.site_name = site_name - self.key = None - self.key2 = None - self.is_enabled = is_enabled - self.is_v1_enabled = is_v1_enabled - self.is_v3_enabled = is_v3_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel.py deleted file mode 100644 index d8b1cf9f46a9..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class EmailChannel(Channel): - """Email channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to email channel - resource - :type properties: ~azure.mgmt.botservice.models.EmailChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'EmailChannelProperties'}, - } - - def __init__(self, properties=None): - super(EmailChannel, self).__init__() - self.properties = properties - self.channel_name = 'EmailChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_properties.py deleted file mode 100644 index cbf2197c474b..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/email_channel_properties.py +++ /dev/null @@ -1,41 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class EmailChannelProperties(Model): - """The parameters to provide for the Email channel. - - :param email_address: The email address - :type email_address: str - :param password: The password for the email address - :type password: str - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'email_address': {'required': True}, - 'password': {'required': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'email_address': {'key': 'emailAddress', 'type': 'str'}, - 'password': {'key': 'password', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, email_address, password, is_enabled): - self.email_address = email_address - self.password = password - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/error.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/error.py index 019e466cd621..5e0c7ee93e3f 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/error.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/error.py @@ -24,8 +24,9 @@ class Error(Model): 'error': {'key': 'error', 'type': 'ErrorBody'}, } - def __init__(self, error=None): - self.error = error + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.error = kwargs.get('error', None) class ErrorException(HttpOperationError): diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body.py index 926be9c3b948..f10254873280 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body.py @@ -15,9 +15,11 @@ class ErrorBody(Model): """Bot Service error body. - :param code: error code + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code :type code: str - :param message: error message + :param message: Required. error message :type message: str """ @@ -31,6 +33,7 @@ class ErrorBody(Model): 'message': {'key': 'message', 'type': 'str'}, } - def __init__(self, code, message): - self.code = code - self.message = message + def __init__(self, **kwargs): + super(ErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body_py3.py new file mode 100644 index 000000000000..3b3f878af285 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_body_py3.py @@ -0,0 +1,39 @@ +# 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 ErrorBody(Model): + """Bot Service error body. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. error code + :type code: str + :param message: Required. error message + :type message: str + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str, **kwargs) -> None: + super(ErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/error_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_py3.py new file mode 100644 index 000000000000..cee9d2eb7904 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/error_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 +from msrest.exceptions import HttpOperationError + + +class Error(Model): + """Bot Service error object. + + :param error: The error body. + :type error: ~azure.mgmt.botservice.models.ErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.error = error + + +class ErrorException(HttpOperationError): + """Server responsed with exception of type: 'Error'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(ErrorException, self).__init__(deserialize, response, 'Error', *args) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel.py deleted file mode 100644 index b253e2fb1f49..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel.py +++ /dev/null @@ -1,36 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class FacebookChannel(Channel): - """Facebook channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to bot facebook channel - :type properties: ~azure.mgmt.botservice.models.FacebookChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'FacebookChannelProperties'}, - } - - def __init__(self, properties=None): - super(FacebookChannel, self).__init__() - self.properties = properties - self.channel_name = 'FacebookChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_properties.py deleted file mode 100644 index d37ace5ab6aa..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/facebook_channel_properties.py +++ /dev/null @@ -1,63 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class FacebookChannelProperties(Model): - """The parameters to provide for the Facebook channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar verify_token: Verify token - :vartype verify_token: str - :param page_id: Page id - :type page_id: str - :param app_id: Facebook application id - :type app_id: str - :param app_secret: Facebook application secret - :type app_secret: str - :param access_token: Facebook application access token - :type access_token: str - :ivar callback_url: Callback Url - :vartype callback_url: str - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'verify_token': {'readonly': True}, - 'page_id': {'required': True}, - 'app_id': {'required': True}, - 'app_secret': {'required': True}, - 'callback_url': {'readonly': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'verify_token': {'key': 'verifyToken', 'type': 'str'}, - 'page_id': {'key': 'pageId', 'type': 'str'}, - 'app_id': {'key': 'appId', 'type': 'str'}, - 'app_secret': {'key': 'appSecret', 'type': 'str'}, - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'callback_url': {'key': 'callbackUrl', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, page_id, app_id, app_secret, is_enabled, access_token=None): - self.verify_token = None - self.page_id = page_id - self.app_id = app_id - self.app_secret = app_secret - self.access_token = access_token - self.callback_url = None - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel.py deleted file mode 100644 index e3fe47a1b214..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel.py +++ /dev/null @@ -1,36 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class KikChannel(Channel): - """Kik channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Kik channel resource - :type properties: ~azure.mgmt.botservice.models.KikChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'KikChannelProperties'}, - } - - def __init__(self, properties=None): - super(KikChannel, self).__init__() - self.properties = properties - self.channel_name = 'KikChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_properties.py deleted file mode 100644 index 8a12161f37c1..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/kik_channel_properties.py +++ /dev/null @@ -1,45 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class KikChannelProperties(Model): - """The parameters to provide for the Kik channel. - - :param user_name: The Kik user name - :type user_name: str - :param api_key: Kik API key - :type api_key: str - :param is_validated: Whether this channel is validated for the bot - :type is_validated: bool - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'user_name': {'required': True}, - 'api_key': {'required': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'user_name': {'key': 'userName', 'type': 'str'}, - 'api_key': {'key': 'apiKey', 'type': 'str'}, - 'is_validated': {'key': 'isValidated', 'type': 'bool'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, user_name, api_key, is_enabled, is_validated=None): - self.user_name = user_name - self.api_key = api_key - self.is_validated = is_validated - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel.py deleted file mode 100644 index c5a9c0b932e0..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class MsTeamsChannel(Channel): - """Microsoft Teams channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Microsoft Teams - channel resource - :type properties: ~azure.mgmt.botservice.models.MsTeamsChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'MsTeamsChannelProperties'}, - } - - def __init__(self, properties=None): - super(MsTeamsChannel, self).__init__() - self.properties = properties - self.channel_name = 'MsTeamsChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_properties.py deleted file mode 100644 index 51bbe2bbed2f..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/ms_teams_channel_properties.py +++ /dev/null @@ -1,51 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class MsTeamsChannelProperties(Model): - """The parameters to provide for the Microsoft Teams channel. - - :param enable_messaging: Enable messaging for Microsoft Teams channel - :type enable_messaging: bool - :param enable_media_cards: Enable media cards for Microsoft Teams channel - :type enable_media_cards: bool - :param enable_video: Enable video for Microsoft Teams channel - :type enable_video: bool - :param enable_calling: Enable calling for Microsoft Teams channel - :type enable_calling: bool - :param call_mode: Enable messaging for Microsoft Teams channel - :type call_mode: str - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'enable_messaging': {'key': 'enableMessaging', 'type': 'bool'}, - 'enable_media_cards': {'key': 'enableMediaCards', 'type': 'bool'}, - 'enable_video': {'key': 'enableVideo', 'type': 'bool'}, - 'enable_calling': {'key': 'enableCalling', 'type': 'bool'}, - 'call_mode': {'key': 'callMode', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, is_enabled, enable_messaging=None, enable_media_cards=None, enable_video=None, enable_calling=None, call_mode=None): - self.enable_messaging = enable_messaging - self.enable_media_cards = enable_media_cards - self.enable_video = enable_video - self.enable_calling = enable_calling - self.call_mode = call_mode - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info.py index 4be59cd2d4b6..33cad37365ce 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info.py @@ -33,8 +33,9 @@ class OperationDisplayInfo(Model): 'resource': {'key': 'resource', 'type': 'str'}, } - def __init__(self, description=None, operation=None, provider=None, resource=None): - self.description = description - self.operation = operation - self.provider = provider - self.resource = resource + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info_py3.py new file mode 100644 index 000000000000..b136b8bdccf0 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_display_info_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 OperationDisplayInfo(Model): + """The operation supported by Bot Service Management. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft Bot Service. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity.py index 37922e24676b..bb886b0f762b 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity.py @@ -32,8 +32,9 @@ class OperationEntity(Model): 'properties': {'key': 'properties', 'type': 'object'}, } - def __init__(self, name=None, display=None, origin=None, properties=None): - self.name = name - self.display = display - self.origin = origin - self.properties = properties + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity_py3.py new file mode 100644 index 000000000000..95bff1f76590 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/operation_entity_py3.py @@ -0,0 +1,40 @@ +# 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 OperationEntity(Model): + """The operations supported by Bot Service Management. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Bot Service Management. + :type display: ~azure.mgmt.botservice.models.OperationDisplayInfo + :param origin: The origin of the operation. + :type origin: str + :param properties: Additional properties. + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/resource.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/resource.py index 668f18a1c16c..cf9218331460 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/resource.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/resource.py @@ -54,12 +54,13 @@ class Resource(Model): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, location=None, tags=None, sku=None, kind=None, etag=None): + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None - self.location = location + self.location = kwargs.get('location', None) self.type = None - self.tags = tags - self.sku = sku - self.kind = kind - self.etag = etag + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + self.kind = kwargs.get('kind', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/resource_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/resource_py3.py new file mode 100644 index 000000000000..ee1377c1ce4b --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/resource_py3.py @@ -0,0 +1,66 @@ +# 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 Resource(Model): + """Azure resource. + + 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 + """ + + _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'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, kind=None, etag: str=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.location = location + self.type = None + self.tags = tags + self.sku = sku + self.kind = kind + self.etag = etag diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/sku.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/sku.py index 35fa9c142249..ead78bbd533b 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/sku.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/sku.py @@ -18,10 +18,12 @@ class Sku(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param name: The sku name. Possible values include: 'F0', 'S1' + All required parameters must be populated in order to send to Azure. + + :param name: Required. The sku name. Possible values include: 'F0', 'S1' :type name: str or ~azure.mgmt.botservice.models.SkuName :ivar tier: Gets the sku tier. This is based on the SKU name. Possible - values include: 'Free', 'Standard' + values include: 'Free', 'Standard', 'Premium' :vartype tier: str or ~azure.mgmt.botservice.models.SkuTier """ @@ -32,9 +34,10 @@ class Sku(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, - 'tier': {'key': 'tier', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, } - def __init__(self, name): - self.name = name + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) self.tier = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/sku_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/sku_py3.py new file mode 100644 index 000000000000..badb4d851189 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/sku_py3.py @@ -0,0 +1,43 @@ +# 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 Sku(Model): + """The SKU of the cognitive services account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The sku name. Possible values include: 'F0', 'S1' + :type name: str or ~azure.mgmt.botservice.models.SkuName + :ivar tier: Gets the sku tier. This is based on the SKU name. Possible + values include: 'Free', 'Standard', 'Premium' + :vartype tier: str or ~azure.mgmt.botservice.models.SkuTier + """ + + _validation = { + 'name': {'required': True}, + 'tier': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'SkuTier'}, + } + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = None diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel.py deleted file mode 100644 index f9c12c31dd01..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class SkypeChannel(Channel): - """Skype channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Skype channel - resource - :type properties: ~azure.mgmt.botservice.models.SkypeChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'SkypeChannelProperties'}, - } - - def __init__(self, properties=None): - super(SkypeChannel, self).__init__() - self.properties = properties - self.channel_name = 'SkypeChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_properties.py deleted file mode 100644 index 582d94c48697..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/skype_channel_properties.py +++ /dev/null @@ -1,63 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SkypeChannelProperties(Model): - """The parameters to provide for the Microsoft Teams channel. - - :param enable_messaging: Enable messaging for Skype channel - :type enable_messaging: bool - :param enable_media_cards: Enable media cards for Skype channel - :type enable_media_cards: bool - :param enable_video: Enable video for Skype channel - :type enable_video: bool - :param enable_calling: Enable calling for Skype channel - :type enable_calling: bool - :param enable_screen_sharing: Enable screen sharing for Skype channel - :type enable_screen_sharing: bool - :param enable_groups: Enable groups for Skype channel - :type enable_groups: bool - :param groups_mode: Group mode for Skype channel - :type groups_mode: str - :param calling_web_hook: Calling web hook for Skype channel - :type calling_web_hook: str - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'enable_messaging': {'key': 'enableMessaging', 'type': 'bool'}, - 'enable_media_cards': {'key': 'enableMediaCards', 'type': 'bool'}, - 'enable_video': {'key': 'enableVideo', 'type': 'bool'}, - 'enable_calling': {'key': 'enableCalling', 'type': 'bool'}, - 'enable_screen_sharing': {'key': 'enableScreenSharing', 'type': 'bool'}, - 'enable_groups': {'key': 'enableGroups', 'type': 'bool'}, - 'groups_mode': {'key': 'groupsMode', 'type': 'str'}, - 'calling_web_hook': {'key': 'callingWebHook', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, is_enabled, enable_messaging=None, enable_media_cards=None, enable_video=None, enable_calling=None, enable_screen_sharing=None, enable_groups=None, groups_mode=None, calling_web_hook=None): - self.enable_messaging = enable_messaging - self.enable_media_cards = enable_media_cards - self.enable_video = enable_video - self.enable_calling = enable_calling - self.enable_screen_sharing = enable_screen_sharing - self.enable_groups = enable_groups - self.groups_mode = groups_mode - self.calling_web_hook = calling_web_hook - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel.py deleted file mode 100644 index 7be5bd512b2e..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class SlackChannel(Channel): - """Slack channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Slack channel - resource - :type properties: ~azure.mgmt.botservice.models.SlackChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'SlackChannelProperties'}, - } - - def __init__(self, properties=None): - super(SlackChannel, self).__init__() - self.properties = properties - self.channel_name = 'SlackChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_properties.py deleted file mode 100644 index 7c0f60cb0b5c..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/slack_channel_properties.py +++ /dev/null @@ -1,74 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SlackChannelProperties(Model): - """The parameters to provide for the Slack channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param client_id: The Slack client id - :type client_id: str - :param client_secret: The Slack client secret - :type client_secret: str - :param verification_token: The Slack verification token - :type verification_token: str - :param landing_page_url: The Slack landing page Url - :type landing_page_url: str - :ivar redirect_action: The Slack redirect action - :vartype redirect_action: str - :ivar last_submission_id: The Sms auth token - :vartype last_submission_id: str - :ivar register_before_oauth_flow: Whether to register the settings before - OAuth validation is performed. Recommended to True. - :vartype register_before_oauth_flow: bool - :ivar is_validated: Whether this channel is validated for the bot - :vartype is_validated: bool - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'client_id': {'required': True}, - 'client_secret': {'required': True}, - 'verification_token': {'required': True}, - 'redirect_action': {'readonly': True}, - 'last_submission_id': {'readonly': True}, - 'register_before_oauth_flow': {'readonly': True}, - 'is_validated': {'readonly': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'client_id': {'key': 'clientId', 'type': 'str'}, - 'client_secret': {'key': 'clientSecret', 'type': 'str'}, - 'verification_token': {'key': 'verificationToken', 'type': 'str'}, - 'landing_page_url': {'key': 'landingPageUrl', 'type': 'str'}, - 'redirect_action': {'key': 'redirectAction', 'type': 'str'}, - 'last_submission_id': {'key': 'lastSubmissionId', 'type': 'str'}, - 'register_before_oauth_flow': {'key': 'registerBeforeOAuthFlow', 'type': 'bool'}, - 'is_validated': {'key': 'isValidated', 'type': 'bool'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, client_id, client_secret, verification_token, is_enabled, landing_page_url=None): - self.client_id = client_id - self.client_secret = client_secret - self.verification_token = verification_token - self.landing_page_url = landing_page_url - self.redirect_action = None - self.last_submission_id = None - self.register_before_oauth_flow = None - self.is_validated = None - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel.py deleted file mode 100644 index dba9ebc83637..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel.py +++ /dev/null @@ -1,36 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class SmsChannel(Channel): - """Sms channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Sms channel resource - :type properties: ~azure.mgmt.botservice.models.SmsChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'SmsChannelProperties'}, - } - - def __init__(self, properties=None): - super(SmsChannel, self).__init__() - self.properties = properties - self.channel_name = 'SmsChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_properties.py deleted file mode 100644 index 45898f7a9e30..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/sms_channel_properties.py +++ /dev/null @@ -1,50 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class SmsChannelProperties(Model): - """The parameters to provide for the Sms channel. - - :param phone: The Sms phone - :type phone: str - :param account_sid: The Sms account SID - :type account_sid: str - :param auth_token: The Sms auth token - :type auth_token: str - :param is_validated: Whether this channel is validated for the bot - :type is_validated: bool - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'phone': {'required': True}, - 'account_sid': {'required': True}, - 'auth_token': {'required': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'phone': {'key': 'phone', 'type': 'str'}, - 'account_sid': {'key': 'accountSID', 'type': 'str'}, - 'auth_token': {'key': 'authToken', 'type': 'str'}, - 'is_validated': {'key': 'isValidated', 'type': 'bool'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, phone, account_sid, auth_token, is_enabled, is_validated=None): - self.phone = phone - self.account_sid = account_sid - self.auth_token = auth_token - self.is_validated = is_validated - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel.py deleted file mode 100644 index eb2afc7e87bd..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class TelegramChannel(Channel): - """Telegram channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Telegram channel - resource - :type properties: ~azure.mgmt.botservice.models.TelegramChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'TelegramChannelProperties'}, - } - - def __init__(self, properties=None): - super(TelegramChannel, self).__init__() - self.properties = properties - self.channel_name = 'TelegramChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_properties.py deleted file mode 100644 index 9430466c7a60..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/telegram_channel_properties.py +++ /dev/null @@ -1,40 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TelegramChannelProperties(Model): - """The parameters to provide for the Telegram channel. - - :param access_token: The Telegram access token - :type access_token: str - :param is_validated: Whether this channel is validated for the bot - :type is_validated: bool - :param is_enabled: Whether this channel is enabled for the bot - :type is_enabled: bool - """ - - _validation = { - 'access_token': {'required': True}, - 'is_enabled': {'required': True}, - } - - _attribute_map = { - 'access_token': {'key': 'accessToken', 'type': 'str'}, - 'is_validated': {'key': 'isValidated', 'type': 'bool'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - } - - def __init__(self, access_token, is_enabled, is_validated=None): - self.access_token = access_token - self.is_validated = is_validated - self.is_enabled = is_enabled diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel.py deleted file mode 100644 index e2fc362fdb69..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel.py +++ /dev/null @@ -1,37 +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. -# -------------------------------------------------------------------------- - -from .channel import Channel - - -class WebChatChannel(Channel): - """Web Chat channel definition. - - :param channel_name: Constant filled by server. - :type channel_name: str - :param properties: The set of properties specific to Web Chat channel - resource - :type properties: ~azure.mgmt.botservice.models.WebChatChannelProperties - """ - - _validation = { - 'channel_name': {'required': True}, - } - - _attribute_map = { - 'channel_name': {'key': 'channelName', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'WebChatChannelProperties'}, - } - - def __init__(self, properties=None): - super(WebChatChannel, self).__init__() - self.properties = properties - self.channel_name = 'WebChatChannel' diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_properties.py deleted file mode 100644 index 144b64707a65..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_channel_properties.py +++ /dev/null @@ -1,38 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WebChatChannelProperties(Model): - """The parameters to provide for the Web Chat channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar web_chat_embed_code: Web chat control embed code - :vartype web_chat_embed_code: str - :param sites: The list of Web Chat sites - :type sites: list[~azure.mgmt.botservice.models.WebChatSite] - """ - - _validation = { - 'web_chat_embed_code': {'readonly': True}, - } - - _attribute_map = { - 'web_chat_embed_code': {'key': 'webChatEmbedCode', 'type': 'str'}, - 'sites': {'key': 'sites', 'type': '[WebChatSite]'}, - } - - def __init__(self, sites=None): - self.web_chat_embed_code = None - self.sites = sites diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_site.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_site.py deleted file mode 100644 index bcee7b9bddc5..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/web_chat_site.py +++ /dev/null @@ -1,60 +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. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class WebChatSite(Model): - """A site for the Webchat channel. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar site_id: Site Id - :vartype site_id: str - :param site_name: Site name - :type site_name: str - :ivar key: Primary key - :vartype key: str - :ivar key2: Secondary key - :vartype key2: str - :param is_enabled: Whether this site is enabled for DirectLine channel - :type is_enabled: bool - :param enable_preview: Whether this site is enabled for preview versions - of Webchat - :type enable_preview: bool - """ - - _validation = { - 'site_id': {'readonly': True}, - 'site_name': {'required': True}, - 'key': {'readonly': True}, - 'key2': {'readonly': True}, - 'is_enabled': {'required': True}, - 'enable_preview': {'required': True}, - } - - _attribute_map = { - 'site_id': {'key': 'siteId', 'type': 'str'}, - 'site_name': {'key': 'siteName', 'type': 'str'}, - 'key': {'key': 'key', 'type': 'str'}, - 'key2': {'key': 'key2', 'type': 'str'}, - 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, - 'enable_preview': {'key': 'enablePreview', 'type': 'bool'}, - } - - def __init__(self, site_name, is_enabled, enable_preview): - self.site_id = None - self.site_name = site_name - self.key = None - self.key2 = None - self.is_enabled = is_enabled - self.enable_preview = enable_preview diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py index f36f516ecc3f..0537d16eda3d 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py @@ -9,14 +9,10 @@ # regenerated. # -------------------------------------------------------------------------- -from .bots_operations import BotsOperations from .bot_services_operations import BotServicesOperations -from .channels_operations import ChannelsOperations from .operations import Operations __all__ = [ - 'BotsOperations', 'BotServicesOperations', - 'ChannelsOperations', 'Operations', ] diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_services_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_services_operations.py index 2902f7951ec6..fd108128b978 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_services_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_services_operations.py @@ -21,7 +21,7 @@ class BotServicesOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :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". """ @@ -36,6 +36,345 @@ 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): + """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.BotResource + :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: BotResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.BotResource 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_.-]*$'), + '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, 'BotResource') + + # 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('BotResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BotResource', 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}'} + + 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): + """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. + :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 resource + :type properties: ~azure.mgmt.botservice.models.BotResourceProperties + :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: BotResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.BotResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + parameters = models.BotResource(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) + + # 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_.-]*$'), + '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, 'BotResource') + + # 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('BotResource', response) + if response.status_code == 201: + deserialized = self._deserialize('BotResource', 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}'} + + def delete( + 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 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: 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_.-]*$'), + '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}'} + + def get( + 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 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: BotResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.BotResource 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_.-]*$'), + '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('BotResource', 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}'} + + def list_by_resource_group( + 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 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: An iterator like instance of BotResource + :rtype: + ~azure.mgmt.botservice.models.BotResourcePaged[~azure.mgmt.botservice.models.BotResource] + :raises: + :class:`ErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.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') + + 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.BotResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.BotResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices'} + def list( self, custom_headers=None, raw=False, **operation_config): """Returns all the resources of a particular type belonging to a @@ -46,9 +385,9 @@ def list( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of Bot + :return: An iterator like instance of BotResource :rtype: - ~azure.mgmt.botservice.models.BotPaged[~azure.mgmt.botservice.models.Bot] + ~azure.mgmt.botservice.models.BotResourcePaged[~azure.mgmt.botservice.models.BotResource] :raises: :class:`ErrorException` """ @@ -56,7 +395,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -83,7 +422,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: raise models.ErrorException(self._deserialize, response) @@ -91,11 +430,80 @@ def internal_paging(next_link=None, raw=False): return response # Deserialize response - deserialized = models.BotPaged(internal_paging, self._deserialize.dependencies) + deserialized = models.BotResourcePaged(internal_paging, self._deserialize.dependencies) if raw: header_dict = {} - client_raw_response = models.BotPaged(internal_paging, self._deserialize.dependencies, header_dict) + client_raw_response = models.BotResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/botServices'} + + def get_check_name_availability( + self, name=None, type=None, custom_headers=None, raw=False, **operation_config): + """Check whether a bot name is available. + + :param name: name of the bot, that needs to be checked for + availability. + :type name: str + :param type: resource type for the bot. + :type type: 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: CheckNameAvailabilityResponseBody or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.botservice.models.CheckNameAvailabilityResponseBody or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + parameters = models.CheckNameAvaialabilityRequestBody(name=name, type=type) + + # Construct URL + url = self.get_check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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, 'CheckNameAvaialabilityRequestBody') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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('CheckNameAvailabilityResponseBody', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized + get_check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.BotService/checkNameAvailability'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py deleted file mode 100644 index 5ad70b3168b3..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py +++ /dev/null @@ -1,435 +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 BotsOperations(object): - """BotsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec 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 create( - 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 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 - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Bot or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.Bot or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}' - 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') - - # 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, 'Bot') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **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('Bot', response) - if response.status_code == 201: - deserialized = self._deserialize('Bot', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - 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): - """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. - :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 resource - :type properties: ~azure.mgmt.botservice.models.BotProperties - :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: Bot or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.Bot or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - parameters = models.Bot(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}' - 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') - - # 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, 'Bot') - - # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **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('Bot', response) - if response.status_code == 201: - deserialized = self._deserialize('Bot', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def delete( - 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 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: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}' - 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') - - # 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, **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 - - def get( - 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 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: Bot or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.Bot or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}' - 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') - - # 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, **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('Bot', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_resource_group( - 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 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: An iterator like instance of Bot - :rtype: - ~azure.mgmt.botservice.models.BotPaged[~azure.mgmt.botservice.models.Bot] - :raises: - :class:`ErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices' - 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') - - 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, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.BotPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BotPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - - def get_check_name_availability( - self, name=None, type=None, custom_headers=None, raw=False, **operation_config): - """Check whether a bot name is available. - - :param name: the name of the bot for which availability needs to be - checked. - :type name: str - :param type: the type of the bot for which availability needs to be - checked - :type type: 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: CheckNameAvailabilityResponseBody or ClientRawResponse if - raw=true - :rtype: - ~azure.mgmt.botservice.models.CheckNameAvailabilityResponseBody or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - parameters = models.CheckNameAvailabilityRequestBody(name=name, type=type) - - # Construct URL - url = '/providers/Microsoft.BotService/botServices/checkNameAvailability' - - # 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, 'CheckNameAvailabilityRequestBody') - - # Construct and send request - request = self._client.get(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **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('CheckNameAvailabilityResponseBody', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py deleted file mode 100644 index 4c17ba4c21d7..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py +++ /dev/null @@ -1,390 +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 ChannelsOperations(object): - """ChannelsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An objec 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 create( - 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 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. Possible values - include: 'FacebookChannel', 'EmailChannel', 'KikChannel', - 'TelegramChannel', 'SlackChannel' - :type channel_name: str - :param parameters: The parameters to provide for the created bot. - :type parameters: ~azure.mgmt.botservice.models.BotChannel - :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: BotChannel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.BotChannel or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}' - 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_.-]*$'), - 'channelName': self._serialize.url("channel_name", channel_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, 'BotChannel') - - # Construct and send request - request = self._client.put(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **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('BotChannel', response) - if response.status_code == 201: - deserialized = self._deserialize('BotChannel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - 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): - """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 Bot resource. Possible values - include: 'FacebookChannel', 'EmailChannel', 'KikChannel', - 'TelegramChannel', 'SlackChannel' - :type channel_name: str - :param location: Specifies the location of the resource. - :type location: 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.Channel - :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: BotChannel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.BotChannel or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - parameters = models.BotChannel(location=location, tags=tags, sku=sku, kind=kind, etag=etag, properties=properties) - - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}' - 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_.-]*$'), - 'channelName': self._serialize.url("channel_name", channel_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, 'BotChannel') - - # Construct and send request - request = self._client.patch(url, query_parameters) - response = self._client.send( - request, header_parameters, body_content, **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('BotChannel', response) - if response.status_code == 201: - deserialized = self._deserialize('BotChannel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def delete( - 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 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 - :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 = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}' - 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_.-]*$'), - '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') - } - 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, **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 - - def get( - 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 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 - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: BotChannel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.botservice.models.BotChannel or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorException` - """ - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels/{channelName}' - 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_.-]*$'), - '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') - } - 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, **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('BotChannel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def list_by_resource_group( - 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 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 BotChannel - :rtype: - ~azure.mgmt.botservice.models.BotChannelPaged[~azure.mgmt.botservice.models.BotChannel] - :raises: - :class:`ErrorException` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/botServices/{resourceName}/channels' - 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, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorException(self._deserialize, response) - - return response - - # Deserialize response - deserialized = models.BotChannelPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.BotChannelPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py index 87663ae547e2..e5243768c120 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :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". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.BotService/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -78,7 +78,7 @@ def internal_paging(next_link=None, raw=False): # Construct and send request request = self._client.get(url, query_parameters) response = self._client.send( - request, header_parameters, **operation_config) + request, header_parameters, stream=False, **operation_config) if response.status_code not in [200]: exp = CloudError(response) @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.BotService/operations'}