-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add bot service sdk to support microsoft.botservice #2328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c65e6d7
first commit of swagger and tests
98702e1
rename test files as per convention
6d3b042
regenrate recordings
a41d9b5
ran crud tests
ab4c420
test email and teams channels
3f5506e
skype and telegram
019b259
add sms channel test
95a1478
add directline and webchat tests (Failing)
171f5bf
Add resource preparer for crud bots
4ce8c15
final email channel
d4906ed
final tests
ad96ee0
new line after setup.cfg
8b8c0d5
fix failing tests python>3.6
57f5b6d
add cookie cutter template
2ec9c24
address comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "azure-cognitiveservices-language-spellcheck/tests/test_spell_check.py": true, | ||
| "azure-cognitiveservices-vision-face/tests/test_face.py": true, | ||
| "azure-eventgrid/tests/test_azure_eventgrid.py": true, | ||
| "azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/web_test.py": true, | ||
| "azure-mgmt-batchai/tests/test_mgmt_batchai_clusters.py": true, | ||
| "azure-mgmt-batchai/tests/test_mgmt_batchai_file_servers.py": true, | ||
| "azure-mgmt-batchai/tests/test_mgmt_batchai_jobs.py": true, | ||
| "azure-mgmt-batchai/tests/test_mgmt_batchai_quota_and_usage.py": true, | ||
| "azure-mgmt-botservice/tests/test_botservice_channels.py": true, | ||
| "azure-mgmt-botservice/tests/test_mgmt_botservice.py": true, | ||
| "azure-mgmt-botservice/tests/test_mgmt_botservice_channels.py::BotServiceChannelsTestCase::test_directline_channel": true, | ||
| "azure-mgmt-botservice/tests/test_mgmt_botservice_channels.py::BotServiceChannelsTestCase::test_webchat_channel": true, | ||
| "azure-mgmt-compute/tests/test_mgmt_compute.py": true, | ||
| "azure-mgmt-compute/tests/test_mgmt_managed_disks.py": true, | ||
| "azure-mgmt-compute/tests/test_mgmt_msi.py": true, | ||
| "azure-mgmt-containerinstance/tests/test_mgmt_containerinstance.py": true, | ||
| "azure-mgmt-hanaonazure/tests/test_azure_mgmt_hanaonazure.py": true, | ||
| "azure-mgmt-machinelearningcompute/tests/test_mgmt_machinelearningcompute.py": true, | ||
| "azure-mgmt-managementpartner/tests/test_mgmt_managementpartner.py": true, | ||
| "azure-mgmt-media/tests/test_mgmt_media.py": true, | ||
| "azure-mgmt-recoveryservices/tests/test_mgmt_recoveryservices.py": true, | ||
| "azure-mgmt-reservations/tests/test_mgmt_reservations.py": true, | ||
| "azure-mgmt-storage/tests/test_mgmt_storage.py": true, | ||
| "azure-mgmt-subscription/tests/test_mgmt_subscription.py": true, | ||
| "azure-servicebus/tests/test_servicebus_eventhub.py": true, | ||
| "azure-servicebus/tests/test_servicebus_servicebus.py": true, | ||
| "azure-servicefabric/azure/servicefabric/models/test_error_chaos_event.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_affinitygroup.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_managementcertificate.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_misc.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_scheduler.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_servicebus.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_sqldatabase.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_storage.py": true, | ||
| "azure-servicemanagement-legacy/tests/test_legacy_mgmt_website.py": true | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| .. :changelog: | ||
|
|
||
| Release History | ||
| =============== | ||
|
|
||
| 0.1.0 (1970-01-01) | ||
| ++++++++++++++++++ | ||
|
|
||
| * Initial Release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| include *.rst | ||
| include azure_bdist_wheel.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| Microsoft Azure SDK for Python | ||
| ============================== | ||
|
|
||
| This is the Microsoft Azure Bot Service Client Library. | ||
|
|
||
| Azure Resource Manager (ARM) is the next generation of management APIs that | ||
| replace the old Azure Service Management (ASM). | ||
|
|
||
| This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. | ||
|
|
||
| For the older Azure Service Management (ASM) libraries, see | ||
| `azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library. | ||
|
|
||
| For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package. | ||
|
|
||
|
|
||
| Compatibility | ||
| ============= | ||
|
|
||
| **IMPORTANT**: If you have an earlier version of the azure package | ||
| (version < 1.0), you should uninstall it before installing this package. | ||
|
|
||
| You can check the version using pip: | ||
|
|
||
| .. code:: shell | ||
|
|
||
| pip freeze | ||
|
|
||
| If you see azure==0.11.0 (or any version below 1.0), uninstall it first: | ||
|
|
||
| .. code:: shell | ||
|
|
||
| pip uninstall azure | ||
|
|
||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| For code examples, see `Bot Service | ||
| <https://docs.microsoft.com/python/azure/>`__ | ||
| on docs.microsoft.com. | ||
|
|
||
|
|
||
| Provide Feedback | ||
| ================ | ||
|
|
||
| If you encounter any bugs or have suggestions, please file an issue in the | ||
| `Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__ | ||
| section of the project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __import__('pkg_resources').declare_namespace(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| __import__('pkg_resources').declare_namespace(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # 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 .azure_bot_service import AzureBotService | ||
| from .version import VERSION | ||
|
|
||
| __all__ = ['AzureBotService'] | ||
|
|
||
| __version__ = VERSION | ||
|
|
96 changes: 96 additions & 0 deletions
96
azure-mgmt-botservice/azure/mgmt/botservice/azure_bot_service.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| # 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.service_client import ServiceClient | ||
| 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 | ||
|
|
||
|
|
||
| class AzureBotServiceConfiguration(AzureConfiguration): | ||
| """Configuration for AzureBotService | ||
| Note that all parameters used to create this instance are saved as instance | ||
| attributes. | ||
|
|
||
| :param credentials: Credentials needed for the client to connect to Azure. | ||
| :type credentials: :mod:`A msrestazure Credentials | ||
| object<msrestazure.azure_active_directory>` | ||
| :param subscription_id: Azure Subscription ID. | ||
| :type subscription_id: str | ||
| :param str base_url: Service URL | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, credentials, subscription_id, base_url=None): | ||
|
|
||
| if credentials is None: | ||
| raise ValueError("Parameter 'credentials' must not be None.") | ||
| if subscription_id is None: | ||
| raise ValueError("Parameter 'subscription_id' must not be None.") | ||
| if not base_url: | ||
| base_url = 'https://management.azure.com' | ||
|
|
||
| super(AzureBotServiceConfiguration, self).__init__(base_url) | ||
|
|
||
| self.add_user_agent('azure-mgmt-botservice/{}'.format(VERSION)) | ||
| self.add_user_agent('Azure-SDK-For-Python') | ||
|
|
||
| self.credentials = credentials | ||
| self.subscription_id = subscription_id | ||
|
|
||
|
|
||
| class AzureBotService(object): | ||
| """Azure Bot Service is a platform for creating smart conversational agents. | ||
|
|
||
| :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 | ||
|
|
||
| :param credentials: Credentials needed for the client to connect to Azure. | ||
| :type credentials: :mod:`A msrestazure Credentials | ||
| object<msrestazure.azure_active_directory>` | ||
| :param subscription_id: Azure Subscription ID. | ||
| :type subscription_id: str | ||
| :param str base_url: Service URL | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, credentials, subscription_id, base_url=None): | ||
|
|
||
| self.config = AzureBotServiceConfiguration(credentials, subscription_id, base_url) | ||
| self._client = ServiceClient(self.config.credentials, self.config) | ||
|
|
||
| client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} | ||
| self.api_version = '2017-12-01' | ||
| 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) |
98 changes: 98 additions & 0 deletions
98
azure-mgmt-botservice/azure/mgmt/botservice/models/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # 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 .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 | ||
| 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', | ||
| 'ErrorBody', | ||
| 'Error', 'ErrorException', | ||
| 'OperationDisplayInfo', | ||
| 'OperationEntity', | ||
| 'CheckNameAvailabilityRequestBody', | ||
| 'CheckNameAvailabilityResponseBody', | ||
| 'BotPaged', | ||
| 'BotChannelPaged', | ||
| 'OperationEntityPaged', | ||
| 'SkuName', | ||
| 'SkuTier', | ||
| 'Kind', | ||
| 'ChannelName', | ||
| ] |
38 changes: 38 additions & 0 deletions
38
azure-mgmt-botservice/azure/mgmt/botservice/models/azure_bot_service_enums.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # 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 enum import Enum | ||
|
|
||
|
|
||
| class SkuName(Enum): | ||
|
|
||
| f0 = "F0" | ||
| s1 = "S1" | ||
|
|
||
|
|
||
| class SkuTier(Enum): | ||
|
|
||
| free = "Free" | ||
| standard = "Standard" | ||
|
|
||
|
|
||
| class Kind(Enum): | ||
|
|
||
| sdk = "sdk" | ||
| designer = "designer" | ||
| bot = "bot" | ||
| function = "function" | ||
|
|
||
|
|
||
| class ChannelName(Enum): | ||
|
|
||
| facebook_channel = "FacebookChannel" | ||
| email_channel = "EmailChannel" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this file from your PR