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 7264c073950a..e4ed47896874 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py @@ -17,6 +17,7 @@ from .operations.channels_operations import ChannelsOperations from .operations.operations import Operations from .operations.bot_connection_operations import BotConnectionOperations +from .operations.enterprise_channels_operations import EnterpriseChannelsOperations from . import models @@ -66,6 +67,8 @@ class AzureBotService(SDKClient): :vartype operations: azure.mgmt.botservice.operations.Operations :ivar bot_connection: BotConnection operations :vartype bot_connection: azure.mgmt.botservice.operations.BotConnectionOperations + :ivar enterprise_channels: EnterpriseChannels operations + :vartype enterprise_channels: azure.mgmt.botservice.operations.EnterpriseChannelsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -94,3 +97,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.bot_connection = BotConnectionOperations( self._client, self.config, self._serialize, self._deserialize) + self.enterprise_channels = EnterpriseChannelsOperations( + 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 d1d07d8093e7..8091b3656229 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py @@ -53,6 +53,11 @@ from .operation_entity_py3 import OperationEntity from .check_name_availability_request_body_py3 import CheckNameAvailabilityRequestBody from .check_name_availability_response_body_py3 import CheckNameAvailabilityResponseBody + from .enterprise_channel_check_name_availability_request_py3 import EnterpriseChannelCheckNameAvailabilityRequest + from .enterprise_channel_check_name_availability_response_py3 import EnterpriseChannelCheckNameAvailabilityResponse + from .enterprise_channel_node_py3 import EnterpriseChannelNode + from .enterprise_channel_properties_py3 import EnterpriseChannelProperties + from .enterprise_channel_py3 import EnterpriseChannel except (SyntaxError, ImportError): from .sku import Sku from .resource import Resource @@ -97,14 +102,22 @@ from .operation_entity import OperationEntity from .check_name_availability_request_body import CheckNameAvailabilityRequestBody from .check_name_availability_response_body import CheckNameAvailabilityResponseBody + from .enterprise_channel_check_name_availability_request import EnterpriseChannelCheckNameAvailabilityRequest + from .enterprise_channel_check_name_availability_response import EnterpriseChannelCheckNameAvailabilityResponse + from .enterprise_channel_node import EnterpriseChannelNode + from .enterprise_channel_properties import EnterpriseChannelProperties + from .enterprise_channel import EnterpriseChannel from .bot_paged import BotPaged from .bot_channel_paged import BotChannelPaged from .operation_entity_paged import OperationEntityPaged from .connection_setting_paged import ConnectionSettingPaged +from .enterprise_channel_paged import EnterpriseChannelPaged from .azure_bot_service_enums import ( SkuName, SkuTier, Kind, + EnterpriseChannelState, + EnterpriseChannelNodeState, ChannelName, ) @@ -152,12 +165,20 @@ 'OperationEntity', 'CheckNameAvailabilityRequestBody', 'CheckNameAvailabilityResponseBody', + 'EnterpriseChannelCheckNameAvailabilityRequest', + 'EnterpriseChannelCheckNameAvailabilityResponse', + 'EnterpriseChannelNode', + 'EnterpriseChannelProperties', + 'EnterpriseChannel', 'BotPaged', 'BotChannelPaged', 'OperationEntityPaged', 'ConnectionSettingPaged', + 'EnterpriseChannelPaged', 'SkuName', 'SkuTier', 'Kind', + 'EnterpriseChannelState', + 'EnterpriseChannelNodeState', '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 5e38bd762700..4c195bfc0f8f 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 @@ -32,6 +32,34 @@ class Kind(str, Enum): function = "function" +class EnterpriseChannelState(str, Enum): + + creating = "Creating" + create_failed = "CreateFailed" + started = "Started" + starting = "Starting" + start_failed = "StartFailed" + stopped = "Stopped" + stopping = "Stopping" + stop_failed = "StopFailed" + deleting = "Deleting" + delete_failed = "DeleteFailed" + + +class EnterpriseChannelNodeState(str, Enum): + + creating = "Creating" + create_failed = "CreateFailed" + started = "Started" + starting = "Starting" + start_failed = "StartFailed" + stopped = "Stopped" + stopping = "Stopping" + stop_failed = "StopFailed" + deleting = "Deleting" + delete_failed = "DeleteFailed" + + class ChannelName(str, Enum): facebook_channel = "FacebookChannel" diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel.py new file mode 100644 index 000000000000..82ace9ff145b --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class EnterpriseChannel(Resource): + """Enterprise Channel resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.botservice.models.Sku + :param kind: Required. Gets or sets the Kind of the resource. Possible + values include: 'sdk', 'designer', 'bot', 'function' + :type kind: str or ~azure.mgmt.botservice.models.Kind + :param etag: Entity Tag + :type etag: str + :param properties: The set of properties specific to an Enterprise Channel + resource. + :type properties: + ~azure.mgmt.botservice.models.EnterpriseChannelProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'EnterpriseChannelProperties'}, + } + + def __init__(self, **kwargs): + super(EnterpriseChannel, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request.py new file mode 100644 index 000000000000..01499b6d32b3 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request.py @@ -0,0 +1,30 @@ +# 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 EnterpriseChannelCheckNameAvailabilityRequest(Model): + """A request to Bot Service Management to check availability of an Enterprise + Channel name. + + :param name: The name of the Enterprise Channel for which availability + needs to be checked. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnterpriseChannelCheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request_py3.py new file mode 100644 index 000000000000..996cf96c1ee9 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_request_py3.py @@ -0,0 +1,30 @@ +# 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 EnterpriseChannelCheckNameAvailabilityRequest(Model): + """A request to Bot Service Management to check availability of an Enterprise + Channel name. + + :param name: The name of the Enterprise Channel for which availability + needs to be checked. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(EnterpriseChannelCheckNameAvailabilityRequest, self).__init__(**kwargs) + self.name = name diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_response.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_response.py new file mode 100644 index 000000000000..2c063c6f37fc --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_response.py @@ -0,0 +1,34 @@ +# 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 EnterpriseChannelCheckNameAvailabilityResponse(Model): + """A request to Bot Service Management to check availability of an Enterprise + Channel name. + + :param valid: Indicates if the Enterprise Channel name is valid. + :type valid: bool + :param message: Additional information about why a bot name is not + available. + :type message: str + """ + + _attribute_map = { + 'valid': {'key': 'valid', 'type': 'bool'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnterpriseChannelCheckNameAvailabilityResponse, 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/enterprise_channel_check_name_availability_response_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_response_py3.py new file mode 100644 index 000000000000..d23be097c57c --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_check_name_availability_response_py3.py @@ -0,0 +1,34 @@ +# 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 EnterpriseChannelCheckNameAvailabilityResponse(Model): + """A request to Bot Service Management to check availability of an Enterprise + Channel name. + + :param valid: Indicates if the Enterprise Channel name is valid. + :type valid: bool + :param message: Additional information about why a bot name 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(EnterpriseChannelCheckNameAvailabilityResponse, self).__init__(**kwargs) + self.valid = valid + self.message = message diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node.py new file mode 100644 index 000000000000..44b4bd2578b1 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node.py @@ -0,0 +1,62 @@ +# 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 EnterpriseChannelNode(Model): + """The properties specific to an Enterprise Channel Node. + + 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. + + :ivar id: Id of Enterprise Channel Node. This is generated by the Bot + Framework. + :vartype id: str + :param state: The current state of the Enterprise Channel Node. Possible + values include: 'Creating', 'CreateFailed', 'Started', 'Starting', + 'StartFailed', 'Stopped', 'Stopping', 'StopFailed', 'Deleting', + 'DeleteFailed' + :type state: str or + ~azure.mgmt.botservice.models.EnterpriseChannelNodeState + :param name: Required. The name of the Enterprise Channel Node. + :type name: str + :param azure_sku: Required. The sku of the Enterprise Channel Node. + :type azure_sku: str + :param azure_location: Required. The location of the Enterprise Channel + Node. + :type azure_location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'azure_sku': {'required': True}, + 'azure_location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'azure_sku': {'key': 'azureSku', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(EnterpriseChannelNode, self).__init__(**kwargs) + self.id = None + self.state = kwargs.get('state', None) + self.name = kwargs.get('name', None) + self.azure_sku = kwargs.get('azure_sku', None) + self.azure_location = kwargs.get('azure_location', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node_py3.py new file mode 100644 index 000000000000..d43c220b0e04 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_node_py3.py @@ -0,0 +1,62 @@ +# 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 EnterpriseChannelNode(Model): + """The properties specific to an Enterprise Channel Node. + + 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. + + :ivar id: Id of Enterprise Channel Node. This is generated by the Bot + Framework. + :vartype id: str + :param state: The current state of the Enterprise Channel Node. Possible + values include: 'Creating', 'CreateFailed', 'Started', 'Starting', + 'StartFailed', 'Stopped', 'Stopping', 'StopFailed', 'Deleting', + 'DeleteFailed' + :type state: str or + ~azure.mgmt.botservice.models.EnterpriseChannelNodeState + :param name: Required. The name of the Enterprise Channel Node. + :type name: str + :param azure_sku: Required. The sku of the Enterprise Channel Node. + :type azure_sku: str + :param azure_location: Required. The location of the Enterprise Channel + Node. + :type azure_location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'required': True}, + 'azure_sku': {'required': True}, + 'azure_location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'azure_sku': {'key': 'azureSku', 'type': 'str'}, + 'azure_location': {'key': 'azureLocation', 'type': 'str'}, + } + + def __init__(self, *, name: str, azure_sku: str, azure_location: str, state=None, **kwargs) -> None: + super(EnterpriseChannelNode, self).__init__(**kwargs) + self.id = None + self.state = state + self.name = name + self.azure_sku = azure_sku + self.azure_location = azure_location diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_paged.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_paged.py new file mode 100644 index 000000000000..b54c425b681b --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class EnterpriseChannelPaged(Paged): + """ + A paging container for iterating over a list of :class:`EnterpriseChannel ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[EnterpriseChannel]'} + } + + def __init__(self, *args, **kwargs): + + super(EnterpriseChannelPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties.py new file mode 100644 index 000000000000..87802c47dac5 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties.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 EnterpriseChannelProperties(Model): + """The parameters to provide for the Enterprise Channel. + + All required parameters must be populated in order to send to Azure. + + :param state: The current state of the Enterprise Channel. Possible values + include: 'Creating', 'CreateFailed', 'Started', 'Starting', 'StartFailed', + 'Stopped', 'Stopping', 'StopFailed', 'Deleting', 'DeleteFailed' + :type state: str or ~azure.mgmt.botservice.models.EnterpriseChannelState + :param nodes: Required. The nodes associated with the Enterprise Channel. + :type nodes: list[~azure.mgmt.botservice.models.EnterpriseChannelNode] + """ + + _validation = { + 'nodes': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[EnterpriseChannelNode]'}, + } + + def __init__(self, **kwargs): + super(EnterpriseChannelProperties, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.nodes = kwargs.get('nodes', None) diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties_py3.py new file mode 100644 index 000000000000..0093bc6b1d68 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_properties_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 EnterpriseChannelProperties(Model): + """The parameters to provide for the Enterprise Channel. + + All required parameters must be populated in order to send to Azure. + + :param state: The current state of the Enterprise Channel. Possible values + include: 'Creating', 'CreateFailed', 'Started', 'Starting', 'StartFailed', + 'Stopped', 'Stopping', 'StopFailed', 'Deleting', 'DeleteFailed' + :type state: str or ~azure.mgmt.botservice.models.EnterpriseChannelState + :param nodes: Required. The nodes associated with the Enterprise Channel. + :type nodes: list[~azure.mgmt.botservice.models.EnterpriseChannelNode] + """ + + _validation = { + 'nodes': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[EnterpriseChannelNode]'}, + } + + def __init__(self, *, nodes, state=None, **kwargs) -> None: + super(EnterpriseChannelProperties, self).__init__(**kwargs) + self.state = state + self.nodes = nodes diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_py3.py b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_py3.py new file mode 100644 index 000000000000..d1b884c6d999 --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/models/enterprise_channel_py3.py @@ -0,0 +1,64 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource_py3 import Resource + + +class EnterpriseChannel(Resource): + """Enterprise Channel resource definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Specifies the resource ID. + :vartype id: str + :ivar name: Specifies the name of the resource. + :vartype name: str + :param location: Specifies the location of the resource. + :type location: str + :ivar type: Specifies the type of the resource. + :vartype type: str + :param tags: Contains resource tags defined as key/value pairs. + :type tags: dict[str, str] + :param sku: Gets or sets the SKU of the resource. + :type sku: ~azure.mgmt.botservice.models.Sku + :param kind: Required. Gets or sets the Kind of the resource. Possible + values include: 'sdk', 'designer', 'bot', 'function' + :type kind: str or ~azure.mgmt.botservice.models.Kind + :param etag: Entity Tag + :type etag: str + :param properties: The set of properties specific to an Enterprise Channel + resource. + :type properties: + ~azure.mgmt.botservice.models.EnterpriseChannelProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'EnterpriseChannelProperties'}, + } + + def __init__(self, *, location: str=None, tags=None, sku=None, kind=None, etag: str=None, properties=None, **kwargs) -> None: + super(EnterpriseChannel, 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/operations/__init__.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py index c52c36afa15f..42d85b8ebd4a 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/__init__.py @@ -13,10 +13,12 @@ from .channels_operations import ChannelsOperations from .operations import Operations from .bot_connection_operations import BotConnectionOperations +from .enterprise_channels_operations import EnterpriseChannelsOperations __all__ = [ 'BotsOperations', 'ChannelsOperations', 'Operations', 'BotConnectionOperations', + 'EnterpriseChannelsOperations', ] diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py index b2c010012ba3..d532a6e8e937 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_connection_operations.py @@ -22,7 +22,7 @@ class BotConnectionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2018-07-12". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-07-12". """ models = models 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 deleted file mode 100644 index 2902f7951ec6..000000000000 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bot_services_operations.py +++ /dev/null @@ -1,101 +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 BotServicesOperations(object): - """BotServicesOperations 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 list( - self, custom_headers=None, raw=False, **operation_config): - """Returns all the resources of a particular type belonging to a - subscription. - - :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}/providers/Microsoft.BotService/botServices' - 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') - - 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 diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py index e3daba7bbe6e..e9041d0cb11a 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/bots_operations.py @@ -22,7 +22,7 @@ class BotsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2018-07-12". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-07-12". """ models = models @@ -484,7 +484,7 @@ def get_check_name_availability( body_content = self._serialize.body(parameters, 'CheckNameAvailabilityRequestBody') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py index 961b8d39f311..036204f3602b 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/channels_operations.py @@ -22,7 +22,7 @@ class ChannelsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2018-07-12". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-07-12". """ models = models diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/enterprise_channels_operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/enterprise_channels_operations.py new file mode 100644 index 000000000000..9e7190a2a59a --- /dev/null +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/enterprise_channels_operations.py @@ -0,0 +1,535 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class EnterpriseChannelsOperations(object): + """EnterpriseChannelsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-07-12". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-07-12" + + self.config = config + + def check_name_availability( + self, name=None, custom_headers=None, raw=False, **operation_config): + """Check whether an Enterprise Channel name is available. + + :param name: The name of the Enterprise Channel for which availability + needs to be checked. + :type 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: EnterpriseChannelCheckNameAvailabilityResponse or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.botservice.models.EnterpriseChannelCheckNameAvailabilityResponse + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorException` + """ + parameters = models.EnterpriseChannelCheckNameAvailabilityRequest(name=name) + + # Construct URL + url = self.check_name_availability.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'EnterpriseChannelCheckNameAvailabilityRequest') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('EnterpriseChannelCheckNameAvailabilityResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/providers/Microsoft.BotService/checkEnterpriseChannelNameAvailability'} + + 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 Bot resource group in the + user subscription. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of EnterpriseChannel + :rtype: + ~azure.mgmt.botservice.models.EnterpriseChannelPaged[~azure.mgmt.botservice.models.EnterpriseChannel] + :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', 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.EnterpriseChannelPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.EnterpriseChannelPaged(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/enterpriseChannels'} + + + def _create_initial( + self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'EnterpriseChannel') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('EnterpriseChannel', response) + if response.status_code == 201: + deserialized = self._deserialize('EnterpriseChannel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, resource_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates an Enterprise Channel. + + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param parameters: The parameters to provide for the new Enterprise + Channel. + :type parameters: ~azure.mgmt.botservice.models.EnterpriseChannel + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EnterpriseChannel or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.botservice.models.EnterpriseChannel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.botservice.models.EnterpriseChannel]] + :raises: + :class:`ErrorException` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnterpriseChannel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}'} + + + def _update_initial( + 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): + parameters = models.EnterpriseChannel(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', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'EnterpriseChannel') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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('EnterpriseChannel', response) + if response.status_code == 201: + deserialized = self._deserialize('EnterpriseChannel', 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, polling=True, **operation_config): + """Updates an Enterprise Channel. + + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param location: Specifies the location of the resource. + :type location: str + :param tags: Contains resource tags defined as key/value pairs. + :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 an Enterprise + Channel resource. + :type properties: + ~azure.mgmt.botservice.models.EnterpriseChannelProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns EnterpriseChannel or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.botservice.models.EnterpriseChannel] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.botservice.models.EnterpriseChannel]] + :raises: + :class:`ErrorException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + location=location, + tags=tags, + sku=sku, + kind=kind, + etag=etag, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('EnterpriseChannel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}'} + + + def _delete_initial( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, 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 + + def delete( + self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an Enterprise Channel from the resource group. + + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: + :class:`ErrorException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + resource_name=resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BotService/enterpriseChannels/{resourceName}'} + + def get( + self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): + """Returns an Enterprise Channel specified by the parameters. + + :param resource_group_name: The name of the Bot resource group in the + user subscription. + :type resource_group_name: str + :param resource_name: The name of the Bot resource. + :type resource_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: EnterpriseChannel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.botservice.models.EnterpriseChannel 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', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=64, min_length=2, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_.-]*$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('EnterpriseChannel', 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/enterpriseChannels/{resourceName}'} diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py b/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py index d0d7a9bd632f..8dc578d119eb 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Current version is 2017-12-01. Constant value: "2018-07-12". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2018-07-12". """ models = models diff --git a/azure-mgmt-botservice/azure/mgmt/botservice/version.py b/azure-mgmt-botservice/azure/mgmt/botservice/version.py index fb0159ed93d7..3e682bbd5fb1 100644 --- a/azure-mgmt-botservice/azure/mgmt/botservice/version.py +++ b/azure-mgmt-botservice/azure/mgmt/botservice/version.py @@ -9,4 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.1.0" +VERSION = "0.3.0" +