From d165c18d30a9a7d93bee0d50eba65922d00c88c9 Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 15:58:13 -0800 Subject: [PATCH 1/7] adding gen'd files --- .../botbuilder/schema/teams/__init__.py | 187 +- .../botbuilder/schema/teams/_models.py | 1595 ++++++++++++++ .../botbuilder/schema/teams/_models_py3.py | 1875 +++++++++++++++++ .../botbuilder/schema/teams/channel_info.py | 13 - .../schema/teams/notification_info.py | 12 - .../botbuilder/schema/teams/team_info.py | 14 - .../schema/teams/teams_channel_account.py | 31 - .../schema/teams/teams_channel_data.py | 30 - .../botbuilder/schema/teams/tenant_info.py | 12 - .../tests/test_skill_validation.py | 3 +- 10 files changed, 3649 insertions(+), 123 deletions(-) create mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/_models.py create mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/channel_info.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/notification_info.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/team_info.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_account.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_data.py delete mode 100644 libraries/botbuilder-schema/botbuilder/schema/teams/tenant_info.py diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/__init__.py b/libraries/botbuilder-schema/botbuilder/schema/teams/__init__.py index d299ec66c..bae8bf5cf 100644 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/__init__.py +++ b/libraries/botbuilder-schema/botbuilder/schema/teams/__init__.py @@ -1,15 +1,184 @@ -from .team_info import TeamInfo -from .notification_info import NotificationInfo -from .tenant_info import TenantInfo -from .channel_info import ChannelInfo -from .teams_channel_data import TeamsChannelData -from .teams_channel_account import TeamsChannelAccount +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AppBasedLinkQuery + from ._models_py3 import ChannelInfo + from ._models_py3 import ConversationList + from ._models_py3 import FileConsentCard + from ._models_py3 import FileConsentCardResponse + from ._models_py3 import FileDownloadInfo + from ._models_py3 import FileInfoCard + from ._models_py3 import FileUploadInfo + from ._models_py3 import MessageActionsPayload + from ._models_py3 import MessageActionsPayloadApp + from ._models_py3 import MessageActionsPayloadAttachment + from ._models_py3 import MessageActionsPayloadBody + from ._models_py3 import MessageActionsPayloadConversation + from ._models_py3 import MessageActionsPayloadFrom + from ._models_py3 import MessageActionsPayloadMention + from ._models_py3 import MessageActionsPayloadReaction + from ._models_py3 import MessageActionsPayloadUser + from ._models_py3 import MessagingExtensionAction + from ._models_py3 import MessagingExtensionActionResponse + from ._models_py3 import MessagingExtensionAttachment + from ._models_py3 import MessagingExtensionParameter + from ._models_py3 import MessagingExtensionQuery + from ._models_py3 import MessagingExtensionQueryOptions + from ._models_py3 import MessagingExtensionResponse + from ._models_py3 import MessagingExtensionResult + from ._models_py3 import MessagingExtensionSuggestedAction + from ._models_py3 import NotificationInfo + from ._models_py3 import O365ConnectorCard + from ._models_py3 import O365ConnectorCardActionBase + from ._models_py3 import O365ConnectorCardActionCard + from ._models_py3 import O365ConnectorCardActionQuery + from ._models_py3 import O365ConnectorCardDateInput + from ._models_py3 import O365ConnectorCardFact + from ._models_py3 import O365ConnectorCardHttpPOST + from ._models_py3 import O365ConnectorCardImage + from ._models_py3 import O365ConnectorCardInputBase + from ._models_py3 import O365ConnectorCardMultichoiceInput + from ._models_py3 import O365ConnectorCardMultichoiceInputChoice + from ._models_py3 import O365ConnectorCardOpenUri + from ._models_py3 import O365ConnectorCardOpenUriTarget + from ._models_py3 import O365ConnectorCardSection + from ._models_py3 import O365ConnectorCardTextInput + from ._models_py3 import O365ConnectorCardViewAction + from ._models_py3 import SigninStateVerificationQuery + from ._models_py3 import TaskModuleContinueResponse + from ._models_py3 import TaskModuleMessageResponse + from ._models_py3 import TaskModuleRequest + from ._models_py3 import TaskModuleRequestContext + from ._models_py3 import TaskModuleResponse + from ._models_py3 import TaskModuleResponseBase + from ._models_py3 import TaskModuleTaskInfo + from ._models_py3 import TeamDetails + from ._models_py3 import TeamInfo + from ._models_py3 import TeamsChannelAccount + from ._models_py3 import TeamsChannelData + from ._models_py3 import TenantInfo +except (SyntaxError, ImportError): + from ._models import AppBasedLinkQuery + from ._models import ChannelInfo + from ._models import ConversationList + from ._models import FileConsentCard + from ._models import FileConsentCardResponse + from ._models import FileDownloadInfo + from ._models import FileInfoCard + from ._models import FileUploadInfo + from ._models import MessageActionsPayload + from ._models import MessageActionsPayloadApp + from ._models import MessageActionsPayloadAttachment + from ._models import MessageActionsPayloadBody + from ._models import MessageActionsPayloadConversation + from ._models import MessageActionsPayloadFrom + from ._models import MessageActionsPayloadMention + from ._models import MessageActionsPayloadReaction + from ._models import MessageActionsPayloadUser + from ._models import MessagingExtensionAction + from ._models import MessagingExtensionActionResponse + from ._models import MessagingExtensionAttachment + from ._models import MessagingExtensionParameter + from ._models import MessagingExtensionQuery + from ._models import MessagingExtensionQueryOptions + from ._models import MessagingExtensionResponse + from ._models import MessagingExtensionResult + from ._models import MessagingExtensionSuggestedAction + from ._models import NotificationInfo + from ._models import O365ConnectorCard + from ._models import O365ConnectorCardActionBase + from ._models import O365ConnectorCardActionCard + from ._models import O365ConnectorCardActionQuery + from ._models import O365ConnectorCardDateInput + from ._models import O365ConnectorCardFact + from ._models import O365ConnectorCardHttpPOST + from ._models import O365ConnectorCardImage + from ._models import O365ConnectorCardInputBase + from ._models import O365ConnectorCardMultichoiceInput + from ._models import O365ConnectorCardMultichoiceInputChoice + from ._models import O365ConnectorCardOpenUri + from ._models import O365ConnectorCardOpenUriTarget + from ._models import O365ConnectorCardSection + from ._models import O365ConnectorCardTextInput + from ._models import O365ConnectorCardViewAction + from ._models import SigninStateVerificationQuery + from ._models import TaskModuleContinueResponse + from ._models import TaskModuleMessageResponse + from ._models import TaskModuleRequest + from ._models import TaskModuleRequestContext + from ._models import TaskModuleResponse + from ._models import TaskModuleResponseBase + from ._models import TaskModuleTaskInfo + from ._models import TeamDetails + from ._models import TeamInfo + from ._models import TeamsChannelAccount + from ._models import TeamsChannelData + from ._models import TenantInfo __all__ = [ - "TeamInfo", + "AppBasedLinkQuery", "ChannelInfo", - "TeamsChannelData", + "ConversationList", + "FileConsentCard", + "FileConsentCardResponse", + "FileDownloadInfo", + "FileInfoCard", + "FileUploadInfo", + "MessageActionsPayload", + "MessageActionsPayloadApp", + "MessageActionsPayloadAttachment", + "MessageActionsPayloadBody", + "MessageActionsPayloadConversation", + "MessageActionsPayloadFrom", + "MessageActionsPayloadMention", + "MessageActionsPayloadReaction", + "MessageActionsPayloadUser", + "MessagingExtensionAction", + "MessagingExtensionActionResponse", + "MessagingExtensionAttachment", + "MessagingExtensionParameter", + "MessagingExtensionQuery", + "MessagingExtensionQueryOptions", + "MessagingExtensionResponse", + "MessagingExtensionResult", + "MessagingExtensionSuggestedAction", + "NotificationInfo", + "O365ConnectorCard", + "O365ConnectorCardActionBase", + "O365ConnectorCardActionCard", + "O365ConnectorCardActionQuery", + "O365ConnectorCardDateInput", + "O365ConnectorCardFact", + "O365ConnectorCardHttpPOST", + "O365ConnectorCardImage", + "O365ConnectorCardInputBase", + "O365ConnectorCardMultichoiceInput", + "O365ConnectorCardMultichoiceInputChoice", + "O365ConnectorCardOpenUri", + "O365ConnectorCardOpenUriTarget", + "O365ConnectorCardSection", + "O365ConnectorCardTextInput", + "O365ConnectorCardViewAction", + "SigninStateVerificationQuery", + "TaskModuleContinueResponse", + "TaskModuleMessageResponse", + "TaskModuleRequest", + "TaskModuleRequestContext", + "TaskModuleResponse", + "TaskModuleResponseBase", + "TaskModuleTaskInfo", + "TeamDetails", + "TeamInfo", "TeamsChannelAccount", + "TeamsChannelData", "TenantInfo", - "NotificationInfo", ] diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py b/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py new file mode 100644 index 000000000..5e41c6fd4 --- /dev/null +++ b/libraries/botbuilder-schema/botbuilder/schema/teams/_models.py @@ -0,0 +1,1595 @@ +# 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 AppBasedLinkQuery(Model): + """Invoke request body type for app-based link query. + + :param url: Url queried by user + :type url: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + } + + def __init__(self, *, url: str = None, **kwargs) -> None: + super(AppBasedLinkQuery, self).__init__(**kwargs) + self.url = url + + +class ChannelInfo(Model): + """A channel info object which describes the channel. + + :param id: Unique identifier representing a channel + :type id: str + :param name: Name of the channel + :type name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, **kwargs): + super(ChannelInfo, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.name = kwargs.get("name", None) + + +class ConversationList(Model): + """List of channels under a team. + + :param conversations: + :type conversations: + list[~botframework.connector.teams.models.ChannelInfo] + """ + + _attribute_map = { + "conversations": {"key": "conversations", "type": "[ChannelInfo]"}, + } + + def __init__(self, **kwargs): + super(ConversationList, self).__init__(**kwargs) + self.conversations = kwargs.get("conversations", None) + + +class FileConsentCard(Model): + """File consent card attachment. + + :param description: File description. + :type description: str + :param size_in_bytes: Size of the file to be uploaded in Bytes. + :type size_in_bytes: long + :param accept_context: Context sent back to the Bot if user consented to + upload. This is free flow schema and is sent back in Value field of + Activity. + :type accept_context: object + :param decline_context: Context sent back to the Bot if user declined. + This is free flow schema and is sent back in Value field of Activity. + :type decline_context: object + """ + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "size_in_bytes": {"key": "sizeInBytes", "type": "long"}, + "accept_context": {"key": "acceptContext", "type": "object"}, + "decline_context": {"key": "declineContext", "type": "object"}, + } + + def __init__(self, **kwargs): + super(FileConsentCard, self).__init__(**kwargs) + self.description = kwargs.get("description", None) + self.size_in_bytes = kwargs.get("size_in_bytes", None) + self.accept_context = kwargs.get("accept_context", None) + self.decline_context = kwargs.get("decline_context", None) + + +class FileConsentCardResponse(Model): + """Represents the value of the invoke activity sent when the user acts on a + file consent card. + + :param action: The action the user took. Possible values include: + 'accept', 'decline' + :type action: str or ~botframework.connector.teams.models.enum + :param context: The context associated with the action. + :type context: object + :param upload_info: If the user accepted the file, contains information + about the file to be uploaded. + :type upload_info: ~botframework.connector.teams.models.FileUploadInfo + """ + + _attribute_map = { + "action": {"key": "action", "type": "str"}, + "context": {"key": "context", "type": "object"}, + "upload_info": {"key": "uploadInfo", "type": "FileUploadInfo"}, + } + + def __init__(self, **kwargs): + super(FileConsentCardResponse, self).__init__(**kwargs) + self.action = kwargs.get("action", None) + self.context = kwargs.get("context", None) + self.upload_info = kwargs.get("upload_info", None) + + +class FileDownloadInfo(Model): + """File download info attachment. + + :param download_url: File download url. + :type download_url: str + :param unique_id: Unique Id for the file. + :type unique_id: str + :param file_type: Type of file. + :type file_type: str + :param etag: ETag for the file. + :type etag: object + """ + + _attribute_map = { + "download_url": {"key": "downloadUrl", "type": "str"}, + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + "etag": {"key": "etag", "type": "object"}, + } + + def __init__(self, **kwargs): + super(FileDownloadInfo, self).__init__(**kwargs) + self.download_url = kwargs.get("download_url", None) + self.unique_id = kwargs.get("unique_id", None) + self.file_type = kwargs.get("file_type", None) + self.etag = kwargs.get("etag", None) + + +class FileInfoCard(Model): + """File info card. + + :param unique_id: Unique Id for the file. + :type unique_id: str + :param file_type: Type of file. + :type file_type: str + :param etag: ETag for the file. + :type etag: object + """ + + _attribute_map = { + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + "etag": {"key": "etag", "type": "object"}, + } + + def __init__(self, **kwargs): + super(FileInfoCard, self).__init__(**kwargs) + self.unique_id = kwargs.get("unique_id", None) + self.file_type = kwargs.get("file_type", None) + self.etag = kwargs.get("etag", None) + + +class FileUploadInfo(Model): + """Information about the file to be uploaded. + + :param name: Name of the file. + :type name: str + :param upload_url: URL to an upload session that the bot can use to set + the file contents. + :type upload_url: str + :param content_url: URL to file. + :type content_url: str + :param unique_id: ID that uniquely identifies the file. + :type unique_id: str + :param file_type: Type of the file. + :type file_type: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "upload_url": {"key": "uploadUrl", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + } + + def __init__(self, **kwargs): + super(FileUploadInfo, self).__init__(**kwargs) + self.name = kwargs.get("name", None) + self.upload_url = kwargs.get("upload_url", None) + self.content_url = kwargs.get("content_url", None) + self.unique_id = kwargs.get("unique_id", None) + self.file_type = kwargs.get("file_type", None) + + +class MessageActionsPayloadApp(Model): + """Represents an application entity. + + :param application_identity_type: The type of application. Possible values + include: 'aadApplication', 'bot', 'tenantBot', 'office365Connector', + 'webhook' + :type application_identity_type: str or + ~botframework.connector.teams.models.enum + :param id: The id of the application. + :type id: str + :param display_name: The plaintext display name of the application. + :type display_name: str + """ + + _attribute_map = { + "application_identity_type": {"key": "applicationIdentityType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadApp, self).__init__(**kwargs) + self.application_identity_type = kwargs.get("application_identity_type", None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + + +class MessageActionsPayloadAttachment(Model): + """Represents the attachment in a message. + + :param id: The id of the attachment. + :type id: str + :param content_type: The type of the attachment. + :type content_type: str + :param content_url: The url of the attachment, in case of a external link. + :type content_url: str + :param content: The content of the attachment, in case of a code snippet, + email, or file. + :type content: object + :param name: The plaintext display name of the attachment. + :type name: str + :param thumbnail_url: The url of a thumbnail image that might be embedded + in the attachment, in case of a card. + :type thumbnail_url: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "content_type": {"key": "contentType", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "content": {"key": "content", "type": "object"}, + "name": {"key": "name", "type": "str"}, + "thumbnail_url": {"key": "thumbnailUrl", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadAttachment, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.content_type = kwargs.get("content_type", None) + self.content_url = kwargs.get("content_url", None) + self.content = kwargs.get("content", None) + self.name = kwargs.get("name", None) + self.thumbnail_url = kwargs.get("thumbnail_url", None) + + +class MessageActionsPayloadBody(Model): + """Plaintext/HTML representation of the content of the message. + + :param content_type: Type of the content. Possible values include: 'html', + 'text' + :type content_type: str or ~botframework.connector.teams.models.enum + :param content: The content of the body. + :type content: str + """ + + _attribute_map = { + "content_type": {"key": "contentType", "type": "str"}, + "content": {"key": "content", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadBody, self).__init__(**kwargs) + self.content_type = kwargs.get("content_type", None) + self.content = kwargs.get("content", None) + + +class MessageActionsPayloadConversation(Model): + """Represents a team or channel entity. + + :param conversation_identity_type: The type of conversation, whether a + team or channel. Possible values include: 'team', 'channel' + :type conversation_identity_type: str or + ~botframework.connector.teams.models.enum + :param id: The id of the team or channel. + :type id: str + :param display_name: The plaintext display name of the team or channel + entity. + :type display_name: str + """ + + _attribute_map = { + "conversation_identity_type": { + "key": "conversationIdentityType", + "type": "str", + }, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadConversation, self).__init__(**kwargs) + self.conversation_identity_type = kwargs.get("conversation_identity_type", None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + + +class MessageActionsPayloadFrom(Model): + """Represents a user, application, or conversation type that either sent or + was referenced in a message. + + :param user: Represents details of the user. + :type user: ~botframework.connector.teams.models.MessageActionsPayloadUser + :param application: Represents details of the app. + :type application: + ~botframework.connector.teams.models.MessageActionsPayloadApp + :param conversation: Represents details of the converesation. + :type conversation: + ~botframework.connector.teams.models.MessageActionsPayloadConversation + """ + + _attribute_map = { + "user": {"key": "user", "type": "MessageActionsPayloadUser"}, + "application": {"key": "application", "type": "MessageActionsPayloadApp"}, + "conversation": { + "key": "conversation", + "type": "MessageActionsPayloadConversation", + }, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadFrom, self).__init__(**kwargs) + self.user = kwargs.get("user", None) + self.application = kwargs.get("application", None) + self.conversation = kwargs.get("conversation", None) + + +class MessageActionsPayloadMention(Model): + """Represents the entity that was mentioned in the message. + + :param id: The id of the mentioned entity. + :type id: int + :param mention_text: The plaintext display name of the mentioned entity. + :type mention_text: str + :param mentioned: Provides more details on the mentioned entity. + :type mentioned: + ~botframework.connector.teams.models.MessageActionsPayloadFrom + """ + + _attribute_map = { + "id": {"key": "id", "type": "int"}, + "mention_text": {"key": "mentionText", "type": "str"}, + "mentioned": {"key": "mentioned", "type": "MessageActionsPayloadFrom"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadMention, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.mention_text = kwargs.get("mention_text", None) + self.mentioned = kwargs.get("mentioned", None) + + +class MessageActionsPayloadReaction(Model): + """Represents the reaction of a user to a message. + + :param reaction_type: The type of reaction given to the message. Possible + values include: 'like', 'heart', 'laugh', 'surprised', 'sad', 'angry' + :type reaction_type: str or ~botframework.connector.teams.models.enum + :param created_date_time: Timestamp of when the user reacted to the + message. + :type created_date_time: str + :param user: The user with which the reaction is associated. + :type user: ~botframework.connector.teams.models.MessageActionsPayloadFrom + """ + + _attribute_map = { + "reaction_type": {"key": "reactionType", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "str"}, + "user": {"key": "user", "type": "MessageActionsPayloadFrom"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadReaction, self).__init__(**kwargs) + self.reaction_type = kwargs.get("reaction_type", None) + self.created_date_time = kwargs.get("created_date_time", None) + self.user = kwargs.get("user", None) + + +class MessageActionsPayloadUser(Model): + """Represents a user entity. + + :param user_identity_type: The identity type of the user. Possible values + include: 'aadUser', 'onPremiseAadUser', 'anonymousGuest', 'federatedUser' + :type user_identity_type: str or ~botframework.connector.teams.models.enum + :param id: The id of the user. + :type id: str + :param display_name: The plaintext display name of the user. + :type display_name: str + """ + + _attribute_map = { + "user_identity_type": {"key": "userIdentityType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayloadUser, self).__init__(**kwargs) + self.user_identity_type = kwargs.get("user_identity_type", None) + self.id = kwargs.get("id", None) + self.display_name = kwargs.get("display_name", None) + + +class MessageActionsPayload(Model): + """Represents the individual message within a chat or channel where a message + actions is taken. + + :param id: Unique id of the message. + :type id: str + :param reply_to_id: Id of the parent/root message of the thread. + :type reply_to_id: str + :param message_type: Type of message - automatically set to message. + Possible values include: 'message' + :type message_type: str or ~botframework.connector.teams.models.enum + :param created_date_time: Timestamp of when the message was created. + :type created_date_time: str + :param last_modified_date_time: Timestamp of when the message was edited + or updated. + :type last_modified_date_time: str + :param deleted: Indicates whether a message has been soft deleted. + :type deleted: bool + :param subject: Subject line of the message. + :type subject: str + :param summary: Summary text of the message that could be used for + notifications. + :type summary: str + :param importance: The importance of the message. Possible values include: + 'normal', 'high', 'urgent' + :type importance: str or ~botframework.connector.teams.models.enum + :param locale: Locale of the message set by the client. + :type locale: str + :param from_property: Sender of the message. + :type from_property: + ~botframework.connector.teams.models.MessageActionsPayloadFrom + :param body: Plaintext/HTML representation of the content of the message. + :type body: ~botframework.connector.teams.models.MessageActionsPayloadBody + :param attachment_layout: How the attachment(s) are displayed in the + message. + :type attachment_layout: str + :param attachments: Attachments in the message - card, image, file, etc. + :type attachments: + list[~botframework.connector.teams.models.MessageActionsPayloadAttachment] + :param mentions: List of entities mentioned in the message. + :type mentions: + list[~botframework.connector.teams.models.MessageActionsPayloadMention] + :param reactions: Reactions for the message. + :type reactions: + list[~botframework.connector.teams.models.MessageActionsPayloadReaction] + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "reply_to_id": {"key": "replyToId", "type": "str"}, + "message_type": {"key": "messageType", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "str"}, + "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "str"}, + "deleted": {"key": "deleted", "type": "bool"}, + "subject": {"key": "subject", "type": "str"}, + "summary": {"key": "summary", "type": "str"}, + "importance": {"key": "importance", "type": "str"}, + "locale": {"key": "locale", "type": "str"}, + "from_property": {"key": "from", "type": "MessageActionsPayloadFrom"}, + "body": {"key": "body", "type": "MessageActionsPayloadBody"}, + "attachment_layout": {"key": "attachmentLayout", "type": "str"}, + "attachments": { + "key": "attachments", + "type": "[MessageActionsPayloadAttachment]", + }, + "mentions": {"key": "mentions", "type": "[MessageActionsPayloadMention]"}, + "reactions": {"key": "reactions", "type": "[MessageActionsPayloadReaction]"}, + } + + def __init__(self, **kwargs): + super(MessageActionsPayload, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.reply_to_id = kwargs.get("reply_to_id", None) + self.message_type = kwargs.get("message_type", None) + self.created_date_time = kwargs.get("created_date_time", None) + self.last_modified_date_time = kwargs.get("last_modified_date_time", None) + self.deleted = kwargs.get("deleted", None) + self.subject = kwargs.get("subject", None) + self.summary = kwargs.get("summary", None) + self.importance = kwargs.get("importance", None) + self.locale = kwargs.get("locale", None) + self.from_property = kwargs.get("from_property", None) + self.body = kwargs.get("body", None) + self.attachment_layout = kwargs.get("attachment_layout", None) + self.attachments = kwargs.get("attachments", None) + self.mentions = kwargs.get("mentions", None) + self.reactions = kwargs.get("reactions", None) + + +class MessagingExtensionAction(TaskModuleRequest): + """Messaging extension action. + + :param data: User input data. Free payload with key-value pairs. + :type data: object + :param context: Current user context, i.e., the current theme + :type context: + ~botframework.connector.teams.models.TaskModuleRequestContext + :param command_id: Id of the command assigned by Bot + :type command_id: str + :param command_context: The context from which the command originates. + Possible values include: 'message', 'compose', 'commandbox' + :type command_context: str or ~botframework.connector.teams.models.enum + :param bot_message_preview_action: Bot message preview action taken by + user. Possible values include: 'edit', 'send' + :type bot_message_preview_action: str or + ~botframework.connector.teams.models.enum + :param bot_activity_preview: + :type bot_activity_preview: + list[~botframework.connector.teams.models.Activity] + :param message_payload: Message content sent as part of the command + request. + :type message_payload: + ~botframework.connector.teams.models.MessageActionsPayload + """ + + _attribute_map = { + "data": {"key": "data", "type": "object"}, + "context": {"key": "context", "type": "TaskModuleRequestContext"}, + "command_id": {"key": "commandId", "type": "str"}, + "command_context": {"key": "commandContext", "type": "str"}, + "bot_message_preview_action": {"key": "botMessagePreviewAction", "type": "str"}, + "bot_activity_preview": {"key": "botActivityPreview", "type": "[Activity]"}, + "message_payload": {"key": "messagePayload", "type": "MessageActionsPayload"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionAction, self).__init__(**kwargs) + self.command_id = kwargs.get("command_id", None) + self.command_context = kwargs.get("command_context", None) + self.bot_message_preview_action = kwargs.get("bot_message_preview_action", None) + self.bot_activity_preview = kwargs.get("bot_activity_preview", None) + self.message_payload = kwargs.get("message_payload", None) + + +class MessagingExtensionActionResponse(Model): + """Response of messaging extension action. + + :param task: The JSON for the Adaptive card to appear in the task module. + :type task: ~botframework.connector.teams.models.TaskModuleResponseBase + :param compose_extension: + :type compose_extension: + ~botframework.connector.teams.models.MessagingExtensionResult + """ + + _attribute_map = { + "task": {"key": "task", "type": "TaskModuleResponseBase"}, + "compose_extension": { + "key": "composeExtension", + "type": "MessagingExtensionResult", + }, + } + + def __init__(self, **kwargs): + super(MessagingExtensionActionResponse, self).__init__(**kwargs) + self.task = kwargs.get("task", None) + self.compose_extension = kwargs.get("compose_extension", None) + + +class MessagingExtensionAttachment(Attachment): + """Messaging extension attachment. + + :param content_type: mimetype/Contenttype for the file + :type content_type: str + :param content_url: Content Url + :type content_url: str + :param content: Embedded content + :type content: object + :param name: (OPTIONAL) The name of the attachment + :type name: str + :param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment + :type thumbnail_url: str + :param preview: + :type preview: ~botframework.connector.teams.models.Attachment + """ + + _attribute_map = { + "content_type": {"key": "contentType", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "content": {"key": "content", "type": "object"}, + "name": {"key": "name", "type": "str"}, + "thumbnail_url": {"key": "thumbnailUrl", "type": "str"}, + "preview": {"key": "preview", "type": "Attachment"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionAttachment, self).__init__(**kwargs) + self.preview = kwargs.get("preview", None) + + +class MessagingExtensionParameter(Model): + """Messaging extension query parameters. + + :param name: Name of the parameter + :type name: str + :param value: Value of the parameter + :type value: object + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "object"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionParameter, self).__init__(**kwargs) + self.name = kwargs.get("name", None) + self.value = kwargs.get("value", None) + + +class MessagingExtensionQuery(Model): + """Messaging extension query. + + :param command_id: Id of the command assigned by Bot + :type command_id: str + :param parameters: Parameters for the query + :type parameters: + list[~botframework.connector.teams.models.MessagingExtensionParameter] + :param query_options: + :type query_options: + ~botframework.connector.teams.models.MessagingExtensionQueryOptions + :param state: State parameter passed back to the bot after + authentication/configuration flow + :type state: str + """ + + _attribute_map = { + "command_id": {"key": "commandId", "type": "str"}, + "parameters": {"key": "parameters", "type": "[MessagingExtensionParameter]"}, + "query_options": { + "key": "queryOptions", + "type": "MessagingExtensionQueryOptions", + }, + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionQuery, self).__init__(**kwargs) + self.command_id = kwargs.get("command_id", None) + self.parameters = kwargs.get("parameters", None) + self.query_options = kwargs.get("query_options", None) + self.state = kwargs.get("state", None) + + +class MessagingExtensionQueryOptions(Model): + """Messaging extension query options. + + :param skip: Number of entities to skip + :type skip: int + :param count: Number of entities to fetch + :type count: int + """ + + _attribute_map = { + "skip": {"key": "skip", "type": "int"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionQueryOptions, self).__init__(**kwargs) + self.skip = kwargs.get("skip", None) + self.count = kwargs.get("count", None) + + +class MessagingExtensionResponse(Model): + """Messaging extension response. + + :param compose_extension: + :type compose_extension: + ~botframework.connector.teams.models.MessagingExtensionResult + """ + + _attribute_map = { + "compose_extension": { + "key": "composeExtension", + "type": "MessagingExtensionResult", + }, + } + + def __init__(self, **kwargs): + super(MessagingExtensionResponse, self).__init__(**kwargs) + self.compose_extension = kwargs.get("compose_extension", None) + + +class MessagingExtensionResult(Model): + """Messaging extension result. + + :param attachment_layout: Hint for how to deal with multiple attachments. + Possible values include: 'list', 'grid' + :type attachment_layout: str or ~botframework.connector.teams.models.enum + :param type: The type of the result. Possible values include: 'result', + 'auth', 'config', 'message', 'botMessagePreview' + :type type: str or ~botframework.connector.teams.models.enum + :param attachments: (Only when type is result) Attachments + :type attachments: + list[~botframework.connector.teams.models.MessagingExtensionAttachment] + :param suggested_actions: + :type suggested_actions: + ~botframework.connector.teams.models.MessagingExtensionSuggestedAction + :param text: (Only when type is message) Text + :type text: str + :param activity_preview: (Only when type is botMessagePreview) Message + activity to preview + :type activity_preview: ~botframework.connector.teams.models.Activity + """ + + _attribute_map = { + "attachment_layout": {"key": "attachmentLayout", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "attachments": {"key": "attachments", "type": "[MessagingExtensionAttachment]"}, + "suggested_actions": { + "key": "suggestedActions", + "type": "MessagingExtensionSuggestedAction", + }, + "text": {"key": "text", "type": "str"}, + "activity_preview": {"key": "activityPreview", "type": "Activity"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionResult, self).__init__(**kwargs) + self.attachment_layout = kwargs.get("attachment_layout", None) + self.type = kwargs.get("type", None) + self.attachments = kwargs.get("attachments", None) + self.suggested_actions = kwargs.get("suggested_actions", None) + self.text = kwargs.get("text", None) + self.activity_preview = kwargs.get("activity_preview", None) + + +class MessagingExtensionSuggestedAction(Model): + """Messaging extension Actions (Only when type is auth or config). + + :param actions: Actions + :type actions: list[~botframework.connector.teams.models.CardAction] + """ + + _attribute_map = { + "actions": {"key": "actions", "type": "[CardAction]"}, + } + + def __init__(self, **kwargs): + super(MessagingExtensionSuggestedAction, self).__init__(**kwargs) + self.actions = kwargs.get("actions", None) + + +class NotificationInfo(Model): + """Specifies if a notification is to be sent for the mentions. + + :param alert: true if notification is to be sent to the user, false + otherwise. + :type alert: bool + """ + + _attribute_map = { + "alert": {"key": "alert", "type": "bool"}, + } + + def __init__(self, **kwargs): + super(NotificationInfo, self).__init__(**kwargs) + self.alert = kwargs.get("alert", None) + + +class O365ConnectorCard(Model): + """O365 connector card. + + :param title: Title of the item + :type title: str + :param text: Text for the card + :type text: str + :param summary: Summary for the card + :type summary: str + :param theme_color: Theme color for the card + :type theme_color: str + :param sections: Set of sections for the current card + :type sections: + list[~botframework.connector.teams.models.O365ConnectorCardSection] + :param potential_action: Set of actions for the current card + :type potential_action: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "text": {"key": "text", "type": "str"}, + "summary": {"key": "summary", "type": "str"}, + "theme_color": {"key": "themeColor", "type": "str"}, + "sections": {"key": "sections", "type": "[O365ConnectorCardSection]"}, + "potential_action": { + "key": "potentialAction", + "type": "[O365ConnectorCardActionBase]", + }, + } + + def __init__(self, **kwargs): + super(O365ConnectorCard, self).__init__(**kwargs) + self.title = kwargs.get("title", None) + self.text = kwargs.get("text", None) + self.summary = kwargs.get("summary", None) + self.theme_color = kwargs.get("theme_color", None) + self.sections = kwargs.get("sections", None) + self.potential_action = kwargs.get("potential_action", None) + + +class O365ConnectorCardActionBase(Model): + """O365 connector card action base. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardActionBase, self).__init__(**kwargs) + self.type = kwargs.get("type", None) + self.name = kwargs.get("name", None) + self.id = kwargs.get("id", None) + + +class O365ConnectorCardActionCard(O365ConnectorCardActionBase): + """O365 connector card ActionCard action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param inputs: Set of inputs contained in this ActionCard whose each item + can be in any subtype of O365ConnectorCardInputBase + :type inputs: + list[~botframework.connector.teams.models.O365ConnectorCardInputBase] + :param actions: Set of actions contained in this ActionCard whose each + item can be in any subtype of O365ConnectorCardActionBase except + O365ConnectorCardActionCard, as nested ActionCard is forbidden. + :type actions: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "inputs": {"key": "inputs", "type": "[O365ConnectorCardInputBase]"}, + "actions": {"key": "actions", "type": "[O365ConnectorCardActionBase]"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardActionCard, self).__init__(**kwargs) + self.inputs = kwargs.get("inputs", None) + self.actions = kwargs.get("actions", None) + + +class O365ConnectorCardActionQuery(Model): + """O365 connector card HttpPOST invoke query. + + :param body: The results of body string defined in + IO365ConnectorCardHttpPOST with substituted input values + :type body: str + :param action_id: Action Id associated with the HttpPOST action button + triggered, defined in O365ConnectorCardActionBase. + :type action_id: str + """ + + _attribute_map = { + "body": {"key": "body", "type": "str"}, + "action_id": {"key": "actionId", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardActionQuery, self).__init__(**kwargs) + self.body = kwargs.get("body", None) + self.action_id = kwargs.get("action_id", None) + + +class O365ConnectorCardDateInput(O365ConnectorCardInputBase): + """O365 connector card date input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param include_time: Include time input field. Default value is false + (date only). + :type include_time: bool + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "include_time": {"key": "includeTime", "type": "bool"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardDateInput, self).__init__(**kwargs) + self.include_time = kwargs.get("include_time", None) + + +class O365ConnectorCardFact(Model): + """O365 connector card fact. + + :param name: Display name of the fact + :type name: str + :param value: Display value for the fact + :type value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardFact, self).__init__(**kwargs) + self.name = kwargs.get("name", None) + self.value = kwargs.get("value", None) + + +class O365ConnectorCardHttpPOST(O365ConnectorCardActionBase): + """O365 connector card HttpPOST action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param body: Content to be posted back to bots via invoke + :type body: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "body": {"key": "body", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardHttpPOST, self).__init__(**kwargs) + self.body = kwargs.get("body", None) + + +class O365ConnectorCardImage(Model): + """O365 connector card image. + + :param image: URL for the image + :type image: str + :param title: Alternative text for the image + :type title: str + """ + + _attribute_map = { + "image": {"key": "image", "type": "str"}, + "title": {"key": "title", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardImage, self).__init__(**kwargs) + self.image = kwargs.get("image", None) + self.title = kwargs.get("title", None) + + +class O365ConnectorCardInputBase(Model): + """O365 connector card input for ActionCard action. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardInputBase, self).__init__(**kwargs) + self.type = kwargs.get("type", None) + self.id = kwargs.get("id", None) + self.is_required = kwargs.get("is_required", None) + self.title = kwargs.get("title", None) + self.value = kwargs.get("value", None) + + +class O365ConnectorCardMultichoiceInput(O365ConnectorCardInputBase): + """O365 connector card multiple choice input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param choices: Set of choices whose each item can be in any subtype of + O365ConnectorCardMultichoiceInputChoice. + :type choices: + list[~botframework.connector.teams.models.O365ConnectorCardMultichoiceInputChoice] + :param style: Choice item rendering style. Default value is 'compact'. + Possible values include: 'compact', 'expanded' + :type style: str or ~botframework.connector.teams.models.enum + :param is_multi_select: Define if this input field allows multiple + selections. Default value is false. + :type is_multi_select: bool + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "choices": { + "key": "choices", + "type": "[O365ConnectorCardMultichoiceInputChoice]", + }, + "style": {"key": "style", "type": "str"}, + "is_multi_select": {"key": "isMultiSelect", "type": "bool"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardMultichoiceInput, self).__init__(**kwargs) + self.choices = kwargs.get("choices", None) + self.style = kwargs.get("style", None) + self.is_multi_select = kwargs.get("is_multi_select", None) + + +class O365ConnectorCardMultichoiceInputChoice(Model): + """O365O365 connector card multiple choice input item. + + :param display: The text rendered on ActionCard. + :type display: str + :param value: The value received as results. + :type value: str + """ + + _attribute_map = { + "display": {"key": "display", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardMultichoiceInputChoice, self).__init__(**kwargs) + self.display = kwargs.get("display", None) + self.value = kwargs.get("value", None) + + +class O365ConnectorCardOpenUriTarget(Model): + """O365 connector card OpenUri target. + + :param os: Target operating system. Possible values include: 'default', + 'iOS', 'android', 'windows' + :type os: str or ~botframework.connector.teams.models.enum + :param uri: Target url + :type uri: str + """ + + _attribute_map = { + "os": {"key": "os", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardOpenUriTarget, self).__init__(**kwargs) + self.os = kwargs.get("os", None) + self.uri = kwargs.get("uri", None) + + +class O365ConnectorCardOpenUri(O365ConnectorCardActionBase): + """O365 connector card OpenUri action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param targets: Target os / urls + :type targets: + list[~botframework.connector.teams.models.O365ConnectorCardOpenUriTarget] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "targets": {"key": "targets", "type": "[O365ConnectorCardOpenUriTarget]"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardOpenUri, self).__init__(**kwargs) + self.targets = kwargs.get("targets", None) + + +class O365ConnectorCardSection(Model): + """O365 connector card section. + + :param title: Title of the section + :type title: str + :param text: Text for the section + :type text: str + :param activity_title: Activity title + :type activity_title: str + :param activity_subtitle: Activity subtitle + :type activity_subtitle: str + :param activity_text: Activity text + :type activity_text: str + :param activity_image: Activity image + :type activity_image: str + :param activity_image_type: Describes how Activity image is rendered. + Possible values include: 'avatar', 'article' + :type activity_image_type: str or + ~botframework.connector.teams.models.enum + :param markdown: Use markdown for all text contents. Default value is + true. + :type markdown: bool + :param facts: Set of facts for the current section + :type facts: + list[~botframework.connector.teams.models.O365ConnectorCardFact] + :param images: Set of images for the current section + :type images: + list[~botframework.connector.teams.models.O365ConnectorCardImage] + :param potential_action: Set of actions for the current section + :type potential_action: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "text": {"key": "text", "type": "str"}, + "activity_title": {"key": "activityTitle", "type": "str"}, + "activity_subtitle": {"key": "activitySubtitle", "type": "str"}, + "activity_text": {"key": "activityText", "type": "str"}, + "activity_image": {"key": "activityImage", "type": "str"}, + "activity_image_type": {"key": "activityImageType", "type": "str"}, + "markdown": {"key": "markdown", "type": "bool"}, + "facts": {"key": "facts", "type": "[O365ConnectorCardFact]"}, + "images": {"key": "images", "type": "[O365ConnectorCardImage]"}, + "potential_action": { + "key": "potentialAction", + "type": "[O365ConnectorCardActionBase]", + }, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardSection, self).__init__(**kwargs) + self.title = kwargs.get("title", None) + self.text = kwargs.get("text", None) + self.activity_title = kwargs.get("activity_title", None) + self.activity_subtitle = kwargs.get("activity_subtitle", None) + self.activity_text = kwargs.get("activity_text", None) + self.activity_image = kwargs.get("activity_image", None) + self.activity_image_type = kwargs.get("activity_image_type", None) + self.markdown = kwargs.get("markdown", None) + self.facts = kwargs.get("facts", None) + self.images = kwargs.get("images", None) + self.potential_action = kwargs.get("potential_action", None) + + +class O365ConnectorCardTextInput(O365ConnectorCardInputBase): + """O365 connector card text input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param is_multiline: Define if text input is allowed for multiple lines. + Default value is false. + :type is_multiline: bool + :param max_length: Maximum length of text input. Default value is + unlimited. + :type max_length: float + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "is_multiline": {"key": "isMultiline", "type": "bool"}, + "max_length": {"key": "maxLength", "type": "float"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardTextInput, self).__init__(**kwargs) + self.is_multiline = kwargs.get("is_multiline", None) + self.max_length = kwargs.get("max_length", None) + + +class O365ConnectorCardViewAction(O365ConnectorCardActionBase): + """O365 connector card ViewAction action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param target: Target urls, only the first url effective for card button + :type target: list[str] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "target": {"key": "target", "type": "[str]"}, + } + + def __init__(self, **kwargs): + super(O365ConnectorCardViewAction, self).__init__(**kwargs) + self.target = kwargs.get("target", None) + + +class SigninStateVerificationQuery(Model): + """Signin state (part of signin action auth flow) verification invoke query. + + :param state: The state string originally received when the signin web + flow is finished with a state posted back to client via tab SDK + microsoftTeams.authentication.notifySuccess(state) + :type state: str + """ + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, **kwargs): + super(SigninStateVerificationQuery, self).__init__(**kwargs) + self.state = kwargs.get("state", None) + + +class TaskModuleContinueResponse(TaskModuleResponseBase): + """Task Module Response with continue action. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + :param value: The JSON for the Adaptive card to appear in the task module. + :type value: ~botframework.connector.teams.models.TaskModuleTaskInfo + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "TaskModuleTaskInfo"}, + } + + def __init__(self, **kwargs): + super(TaskModuleContinueResponse, self).__init__(**kwargs) + self.value = kwargs.get("value", None) + + +class TaskModuleMessageResponse(TaskModuleResponseBase): + """Task Module response with message action. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + :param value: Teams will display the value of value in a popup message + box. + :type value: str + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TaskModuleMessageResponse, self).__init__(**kwargs) + self.value = kwargs.get("value", None) + + +class TaskModuleRequest(Model): + """Task module invoke request value payload. + + :param data: User input data. Free payload with key-value pairs. + :type data: object + :param context: Current user context, i.e., the current theme + :type context: + ~botframework.connector.teams.models.TaskModuleRequestContext + """ + + _attribute_map = { + "data": {"key": "data", "type": "object"}, + "context": {"key": "context", "type": "TaskModuleRequestContext"}, + } + + def __init__(self, **kwargs): + super(TaskModuleRequest, self).__init__(**kwargs) + self.data = kwargs.get("data", None) + self.context = kwargs.get("context", None) + + +class TaskModuleRequestContext(Model): + """Current user context, i.e., the current theme. + + :param theme: + :type theme: str + """ + + _attribute_map = { + "theme": {"key": "theme", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TaskModuleRequestContext, self).__init__(**kwargs) + self.theme = kwargs.get("theme", None) + + +class TaskModuleResponse(Model): + """Envelope for Task Module Response. + + :param task: The JSON for the Adaptive card to appear in the task module. + :type task: ~botframework.connector.teams.models.TaskModuleResponseBase + """ + + _attribute_map = { + "task": {"key": "task", "type": "TaskModuleResponseBase"}, + } + + def __init__(self, **kwargs): + super(TaskModuleResponse, self).__init__(**kwargs) + self.task = kwargs.get("task", None) + + +class TaskModuleResponseBase(Model): + """Base class for Task Module responses. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TaskModuleResponseBase, self).__init__(**kwargs) + self.type = kwargs.get("type", None) + + +class TaskModuleTaskInfo(Model): + """Metadata for a Task Module. + + :param title: Appears below the app name and to the right of the app icon. + :type title: str + :param height: This can be a number, representing the task module's height + in pixels, or a string, one of: small, medium, large. + :type height: object + :param width: This can be a number, representing the task module's width + in pixels, or a string, one of: small, medium, large. + :type width: object + :param url: The URL of what is loaded as an iframe inside the task module. + One of url or card is required. + :type url: str + :param card: The JSON for the Adaptive card to appear in the task module. + :type card: ~botframework.connector.teams.models.Attachment + :param fallback_url: If a client does not support the task module feature, + this URL is opened in a browser tab. + :type fallback_url: str + :param completion_bot_id: If a client does not support the task module + feature, this URL is opened in a browser tab. + :type completion_bot_id: str + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "height": {"key": "height", "type": "object"}, + "width": {"key": "width", "type": "object"}, + "url": {"key": "url", "type": "str"}, + "card": {"key": "card", "type": "Attachment"}, + "fallback_url": {"key": "fallbackUrl", "type": "str"}, + "completion_bot_id": {"key": "completionBotId", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TaskModuleTaskInfo, self).__init__(**kwargs) + self.title = kwargs.get("title", None) + self.height = kwargs.get("height", None) + self.width = kwargs.get("width", None) + self.url = kwargs.get("url", None) + self.card = kwargs.get("card", None) + self.fallback_url = kwargs.get("fallback_url", None) + self.completion_bot_id = kwargs.get("completion_bot_id", None) + + +class TeamDetails(Model): + """Details related to a team. + + :param id: Unique identifier representing a team + :type id: str + :param name: Name of team. + :type name: str + :param aad_group_id: Azure Active Directory (AAD) Group Id for the team. + :type aad_group_id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "aad_group_id": {"key": "aadGroupId", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TeamDetails, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.name = kwargs.get("name", None) + self.aad_group_id = kwargs.get("aad_group_id", None) + + +class TeamInfo(Model): + """Describes a team. + + :param id: Unique identifier representing a team + :type id: str + :param name: Name of team. + :type name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TeamInfo, self).__init__(**kwargs) + self.id = kwargs.get("id", None) + self.name = kwargs.get("name", None) + + +class TeamsChannelAccount(ChannelAccount): + """Teams channel account detailing user Azure Active Directory details. + + :param id: Channel id for the user or bot on this channel (Example: + joe@smith.com, or @joesmith or 123456) + :type id: str + :param name: Display friendly name + :type name: str + :param given_name: Given name part of the user name. + :type given_name: str + :param surname: Surname part of the user name. + :type surname: str + :param email: Email Id of the user. + :type email: str + :param user_principal_name: Unique user principal name + :type user_principal_name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "given_name": {"key": "givenName", "type": "str"}, + "surname": {"key": "surname", "type": "str"}, + "email": {"key": "email", "type": "str"}, + "user_principal_name": {"key": "userPrincipalName", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TeamsChannelAccount, self).__init__(**kwargs) + self.given_name = kwargs.get("given_name", None) + self.surname = kwargs.get("surname", None) + self.email = kwargs.get("email", None) + self.user_principal_name = kwargs.get("user_principal_name", None) + + +class TeamsChannelData(Model): + """Channel data specific to messages received in Microsoft Teams. + + :param channel: Information about the channel in which the message was + sent + :type channel: ~botframework.connector.teams.models.ChannelInfo + :param event_type: Type of event. + :type event_type: str + :param team: Information about the team in which the message was sent + :type team: ~botframework.connector.teams.models.TeamInfo + :param notification: Notification settings for the message + :type notification: ~botframework.connector.teams.models.NotificationInfo + :param tenant: Information about the tenant in which the message was sent + :type tenant: ~botframework.connector.teams.models.TenantInfo + """ + + _attribute_map = { + "channel": {"key": "channel", "type": "ChannelInfo"}, + "event_type": {"key": "eventType", "type": "str"}, + "team": {"key": "team", "type": "TeamInfo"}, + "notification": {"key": "notification", "type": "NotificationInfo"}, + "tenant": {"key": "tenant", "type": "TenantInfo"}, + } + + def __init__(self, **kwargs): + super(TeamsChannelData, self).__init__(**kwargs) + self.channel = kwargs.get("channel", None) + self.event_type = kwargs.get("event_type", None) + self.team = kwargs.get("team", None) + self.notification = kwargs.get("notification", None) + self.tenant = kwargs.get("tenant", None) + + +class TenantInfo(Model): + """Describes a tenant. + + :param id: Unique identifier representing a tenant + :type id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, **kwargs): + super(TenantInfo, self).__init__(**kwargs) + self.id = kwargs.get("id", None) diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py new file mode 100644 index 000000000..80249f277 --- /dev/null +++ b/libraries/botbuilder-schema/botbuilder/schema/teams/_models_py3.py @@ -0,0 +1,1875 @@ +# 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 botbuilder.schema import Attachment, ChannelAccount + + +class TaskModuleRequest(Model): + """Task module invoke request value payload. + + :param data: User input data. Free payload with key-value pairs. + :type data: object + :param context: Current user context, i.e., the current theme + :type context: + ~botframework.connector.teams.models.TaskModuleRequestContext + """ + + _attribute_map = { + "data": {"key": "data", "type": "object"}, + "context": {"key": "context", "type": "TaskModuleRequestContext"}, + } + + def __init__(self, *, data=None, context=None, **kwargs) -> None: + super(TaskModuleRequest, self).__init__(**kwargs) + self.data = data + self.context = context + + +class AppBasedLinkQuery(Model): + """Invoke request body type for app-based link query. + + :param url: Url queried by user + :type url: str + """ + + _attribute_map = { + "url": {"key": "url", "type": "str"}, + } + + def __init__(self, *, url: str = None, **kwargs) -> None: + super(AppBasedLinkQuery, self).__init__(**kwargs) + self.url = url + + +class ChannelInfo(Model): + """A channel info object which describes the channel. + + :param id: Unique identifier representing a channel + :type id: str + :param name: Name of the channel + :type name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, id: str = None, name: str = None, **kwargs) -> None: + super(ChannelInfo, self).__init__(**kwargs) + self.id = id + self.name = name + + +class ConversationList(Model): + """List of channels under a team. + + :param conversations: + :type conversations: + list[~botframework.connector.teams.models.ChannelInfo] + """ + + _attribute_map = { + "conversations": {"key": "conversations", "type": "[ChannelInfo]"}, + } + + def __init__(self, *, conversations=None, **kwargs) -> None: + super(ConversationList, self).__init__(**kwargs) + self.conversations = conversations + + +class FileConsentCard(Model): + """File consent card attachment. + + :param description: File description. + :type description: str + :param size_in_bytes: Size of the file to be uploaded in Bytes. + :type size_in_bytes: long + :param accept_context: Context sent back to the Bot if user consented to + upload. This is free flow schema and is sent back in Value field of + Activity. + :type accept_context: object + :param decline_context: Context sent back to the Bot if user declined. + This is free flow schema and is sent back in Value field of Activity. + :type decline_context: object + """ + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "size_in_bytes": {"key": "sizeInBytes", "type": "long"}, + "accept_context": {"key": "acceptContext", "type": "object"}, + "decline_context": {"key": "declineContext", "type": "object"}, + } + + def __init__( + self, + *, + description: str = None, + size_in_bytes: int = None, + accept_context=None, + decline_context=None, + **kwargs + ) -> None: + super(FileConsentCard, self).__init__(**kwargs) + self.description = description + self.size_in_bytes = size_in_bytes + self.accept_context = accept_context + self.decline_context = decline_context + + +class FileConsentCardResponse(Model): + """Represents the value of the invoke activity sent when the user acts on a + file consent card. + + :param action: The action the user took. Possible values include: + 'accept', 'decline' + :type action: str or ~botframework.connector.teams.models.enum + :param context: The context associated with the action. + :type context: object + :param upload_info: If the user accepted the file, contains information + about the file to be uploaded. + :type upload_info: ~botframework.connector.teams.models.FileUploadInfo + """ + + _attribute_map = { + "action": {"key": "action", "type": "str"}, + "context": {"key": "context", "type": "object"}, + "upload_info": {"key": "uploadInfo", "type": "FileUploadInfo"}, + } + + def __init__( + self, *, action=None, context=None, upload_info=None, **kwargs + ) -> None: + super(FileConsentCardResponse, self).__init__(**kwargs) + self.action = action + self.context = context + self.upload_info = upload_info + + +class FileDownloadInfo(Model): + """File download info attachment. + + :param download_url: File download url. + :type download_url: str + :param unique_id: Unique Id for the file. + :type unique_id: str + :param file_type: Type of file. + :type file_type: str + :param etag: ETag for the file. + :type etag: object + """ + + _attribute_map = { + "download_url": {"key": "downloadUrl", "type": "str"}, + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + "etag": {"key": "etag", "type": "object"}, + } + + def __init__( + self, + *, + download_url: str = None, + unique_id: str = None, + file_type: str = None, + etag=None, + **kwargs + ) -> None: + super(FileDownloadInfo, self).__init__(**kwargs) + self.download_url = download_url + self.unique_id = unique_id + self.file_type = file_type + self.etag = etag + + +class FileInfoCard(Model): + """File info card. + + :param unique_id: Unique Id for the file. + :type unique_id: str + :param file_type: Type of file. + :type file_type: str + :param etag: ETag for the file. + :type etag: object + """ + + _attribute_map = { + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + "etag": {"key": "etag", "type": "object"}, + } + + def __init__( + self, *, unique_id: str = None, file_type: str = None, etag=None, **kwargs + ) -> None: + super(FileInfoCard, self).__init__(**kwargs) + self.unique_id = unique_id + self.file_type = file_type + self.etag = etag + + +class FileUploadInfo(Model): + """Information about the file to be uploaded. + + :param name: Name of the file. + :type name: str + :param upload_url: URL to an upload session that the bot can use to set + the file contents. + :type upload_url: str + :param content_url: URL to file. + :type content_url: str + :param unique_id: ID that uniquely identifies the file. + :type unique_id: str + :param file_type: Type of the file. + :type file_type: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "upload_url": {"key": "uploadUrl", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "unique_id": {"key": "uniqueId", "type": "str"}, + "file_type": {"key": "fileType", "type": "str"}, + } + + def __init__( + self, + *, + name: str = None, + upload_url: str = None, + content_url: str = None, + unique_id: str = None, + file_type: str = None, + **kwargs + ) -> None: + super(FileUploadInfo, self).__init__(**kwargs) + self.name = name + self.upload_url = upload_url + self.content_url = content_url + self.unique_id = unique_id + self.file_type = file_type + + +class MessageActionsPayloadApp(Model): + """Represents an application entity. + + :param application_identity_type: The type of application. Possible values + include: 'aadApplication', 'bot', 'tenantBot', 'office365Connector', + 'webhook' + :type application_identity_type: str or + ~botframework.connector.teams.models.enum + :param id: The id of the application. + :type id: str + :param display_name: The plaintext display name of the application. + :type display_name: str + """ + + _attribute_map = { + "application_identity_type": {"key": "applicationIdentityType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( + self, + *, + application_identity_type=None, + id: str = None, + display_name: str = None, + **kwargs + ) -> None: + super(MessageActionsPayloadApp, self).__init__(**kwargs) + self.application_identity_type = application_identity_type + self.id = id + self.display_name = display_name + + +class MessageActionsPayloadAttachment(Model): + """Represents the attachment in a message. + + :param id: The id of the attachment. + :type id: str + :param content_type: The type of the attachment. + :type content_type: str + :param content_url: The url of the attachment, in case of a external link. + :type content_url: str + :param content: The content of the attachment, in case of a code snippet, + email, or file. + :type content: object + :param name: The plaintext display name of the attachment. + :type name: str + :param thumbnail_url: The url of a thumbnail image that might be embedded + in the attachment, in case of a card. + :type thumbnail_url: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "content_type": {"key": "contentType", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "content": {"key": "content", "type": "object"}, + "name": {"key": "name", "type": "str"}, + "thumbnail_url": {"key": "thumbnailUrl", "type": "str"}, + } + + def __init__( + self, + *, + id: str = None, + content_type: str = None, + content_url: str = None, + content=None, + name: str = None, + thumbnail_url: str = None, + **kwargs + ) -> None: + super(MessageActionsPayloadAttachment, self).__init__(**kwargs) + self.id = id + self.content_type = content_type + self.content_url = content_url + self.content = content + self.name = name + self.thumbnail_url = thumbnail_url + + +class MessageActionsPayloadBody(Model): + """Plaintext/HTML representation of the content of the message. + + :param content_type: Type of the content. Possible values include: 'html', + 'text' + :type content_type: str or ~botframework.connector.teams.models.enum + :param content: The content of the body. + :type content: str + """ + + _attribute_map = { + "content_type": {"key": "contentType", "type": "str"}, + "content": {"key": "content", "type": "str"}, + } + + def __init__(self, *, content_type=None, content: str = None, **kwargs) -> None: + super(MessageActionsPayloadBody, self).__init__(**kwargs) + self.content_type = content_type + self.content = content + + +class MessageActionsPayloadConversation(Model): + """Represents a team or channel entity. + + :param conversation_identity_type: The type of conversation, whether a + team or channel. Possible values include: 'team', 'channel' + :type conversation_identity_type: str or + ~botframework.connector.teams.models.enum + :param id: The id of the team or channel. + :type id: str + :param display_name: The plaintext display name of the team or channel + entity. + :type display_name: str + """ + + _attribute_map = { + "conversation_identity_type": { + "key": "conversationIdentityType", + "type": "str", + }, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( + self, + *, + conversation_identity_type=None, + id: str = None, + display_name: str = None, + **kwargs + ) -> None: + super(MessageActionsPayloadConversation, self).__init__(**kwargs) + self.conversation_identity_type = conversation_identity_type + self.id = id + self.display_name = display_name + + +class MessageActionsPayloadFrom(Model): + """Represents a user, application, or conversation type that either sent or + was referenced in a message. + + :param user: Represents details of the user. + :type user: ~botframework.connector.teams.models.MessageActionsPayloadUser + :param application: Represents details of the app. + :type application: + ~botframework.connector.teams.models.MessageActionsPayloadApp + :param conversation: Represents details of the converesation. + :type conversation: + ~botframework.connector.teams.models.MessageActionsPayloadConversation + """ + + _attribute_map = { + "user": {"key": "user", "type": "MessageActionsPayloadUser"}, + "application": {"key": "application", "type": "MessageActionsPayloadApp"}, + "conversation": { + "key": "conversation", + "type": "MessageActionsPayloadConversation", + }, + } + + def __init__( + self, *, user=None, application=None, conversation=None, **kwargs + ) -> None: + super(MessageActionsPayloadFrom, self).__init__(**kwargs) + self.user = user + self.application = application + self.conversation = conversation + + +class MessageActionsPayloadMention(Model): + """Represents the entity that was mentioned in the message. + + :param id: The id of the mentioned entity. + :type id: int + :param mention_text: The plaintext display name of the mentioned entity. + :type mention_text: str + :param mentioned: Provides more details on the mentioned entity. + :type mentioned: + ~botframework.connector.teams.models.MessageActionsPayloadFrom + """ + + _attribute_map = { + "id": {"key": "id", "type": "int"}, + "mention_text": {"key": "mentionText", "type": "str"}, + "mentioned": {"key": "mentioned", "type": "MessageActionsPayloadFrom"}, + } + + def __init__( + self, *, id: int = None, mention_text: str = None, mentioned=None, **kwargs + ) -> None: + super(MessageActionsPayloadMention, self).__init__(**kwargs) + self.id = id + self.mention_text = mention_text + self.mentioned = mentioned + + +class MessageActionsPayloadReaction(Model): + """Represents the reaction of a user to a message. + + :param reaction_type: The type of reaction given to the message. Possible + values include: 'like', 'heart', 'laugh', 'surprised', 'sad', 'angry' + :type reaction_type: str or ~botframework.connector.teams.models.enum + :param created_date_time: Timestamp of when the user reacted to the + message. + :type created_date_time: str + :param user: The user with which the reaction is associated. + :type user: ~botframework.connector.teams.models.MessageActionsPayloadFrom + """ + + _attribute_map = { + "reaction_type": {"key": "reactionType", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "str"}, + "user": {"key": "user", "type": "MessageActionsPayloadFrom"}, + } + + def __init__( + self, *, reaction_type=None, created_date_time: str = None, user=None, **kwargs + ) -> None: + super(MessageActionsPayloadReaction, self).__init__(**kwargs) + self.reaction_type = reaction_type + self.created_date_time = created_date_time + self.user = user + + +class MessageActionsPayloadUser(Model): + """Represents a user entity. + + :param user_identity_type: The identity type of the user. Possible values + include: 'aadUser', 'onPremiseAadUser', 'anonymousGuest', 'federatedUser' + :type user_identity_type: str or ~botframework.connector.teams.models.enum + :param id: The id of the user. + :type id: str + :param display_name: The plaintext display name of the user. + :type display_name: str + """ + + _attribute_map = { + "user_identity_type": {"key": "userIdentityType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "display_name": {"key": "displayName", "type": "str"}, + } + + def __init__( + self, + *, + user_identity_type=None, + id: str = None, + display_name: str = None, + **kwargs + ) -> None: + super(MessageActionsPayloadUser, self).__init__(**kwargs) + self.user_identity_type = user_identity_type + self.id = id + self.display_name = display_name + + +class MessageActionsPayload(Model): + """Represents the individual message within a chat or channel where a message + actions is taken. + + :param id: Unique id of the message. + :type id: str + :param reply_to_id: Id of the parent/root message of the thread. + :type reply_to_id: str + :param message_type: Type of message - automatically set to message. + Possible values include: 'message' + :type message_type: str or ~botframework.connector.teams.models.enum + :param created_date_time: Timestamp of when the message was created. + :type created_date_time: str + :param last_modified_date_time: Timestamp of when the message was edited + or updated. + :type last_modified_date_time: str + :param deleted: Indicates whether a message has been soft deleted. + :type deleted: bool + :param subject: Subject line of the message. + :type subject: str + :param summary: Summary text of the message that could be used for + notifications. + :type summary: str + :param importance: The importance of the message. Possible values include: + 'normal', 'high', 'urgent' + :type importance: str or ~botframework.connector.teams.models.enum + :param locale: Locale of the message set by the client. + :type locale: str + :param from_property: Sender of the message. + :type from_property: + ~botframework.connector.teams.models.MessageActionsPayloadFrom + :param body: Plaintext/HTML representation of the content of the message. + :type body: ~botframework.connector.teams.models.MessageActionsPayloadBody + :param attachment_layout: How the attachment(s) are displayed in the + message. + :type attachment_layout: str + :param attachments: Attachments in the message - card, image, file, etc. + :type attachments: + list[~botframework.connector.teams.models.MessageActionsPayloadAttachment] + :param mentions: List of entities mentioned in the message. + :type mentions: + list[~botframework.connector.teams.models.MessageActionsPayloadMention] + :param reactions: Reactions for the message. + :type reactions: + list[~botframework.connector.teams.models.MessageActionsPayloadReaction] + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "reply_to_id": {"key": "replyToId", "type": "str"}, + "message_type": {"key": "messageType", "type": "str"}, + "created_date_time": {"key": "createdDateTime", "type": "str"}, + "last_modified_date_time": {"key": "lastModifiedDateTime", "type": "str"}, + "deleted": {"key": "deleted", "type": "bool"}, + "subject": {"key": "subject", "type": "str"}, + "summary": {"key": "summary", "type": "str"}, + "importance": {"key": "importance", "type": "str"}, + "locale": {"key": "locale", "type": "str"}, + "from_property": {"key": "from", "type": "MessageActionsPayloadFrom"}, + "body": {"key": "body", "type": "MessageActionsPayloadBody"}, + "attachment_layout": {"key": "attachmentLayout", "type": "str"}, + "attachments": { + "key": "attachments", + "type": "[MessageActionsPayloadAttachment]", + }, + "mentions": {"key": "mentions", "type": "[MessageActionsPayloadMention]"}, + "reactions": {"key": "reactions", "type": "[MessageActionsPayloadReaction]"}, + } + + def __init__( + self, + *, + id: str = None, + reply_to_id: str = None, + message_type=None, + created_date_time: str = None, + last_modified_date_time: str = None, + deleted: bool = None, + subject: str = None, + summary: str = None, + importance=None, + locale: str = None, + from_property=None, + body=None, + attachment_layout: str = None, + attachments=None, + mentions=None, + reactions=None, + **kwargs + ) -> None: + super(MessageActionsPayload, self).__init__(**kwargs) + self.id = id + self.reply_to_id = reply_to_id + self.message_type = message_type + self.created_date_time = created_date_time + self.last_modified_date_time = last_modified_date_time + self.deleted = deleted + self.subject = subject + self.summary = summary + self.importance = importance + self.locale = locale + self.from_property = from_property + self.body = body + self.attachment_layout = attachment_layout + self.attachments = attachments + self.mentions = mentions + self.reactions = reactions + + +class MessagingExtensionAction(TaskModuleRequest): + """Messaging extension action. + + :param data: User input data. Free payload with key-value pairs. + :type data: object + :param context: Current user context, i.e., the current theme + :type context: + ~botframework.connector.teams.models.TaskModuleRequestContext + :param command_id: Id of the command assigned by Bot + :type command_id: str + :param command_context: The context from which the command originates. + Possible values include: 'message', 'compose', 'commandbox' + :type command_context: str or ~botframework.connector.teams.models.enum + :param bot_message_preview_action: Bot message preview action taken by + user. Possible values include: 'edit', 'send' + :type bot_message_preview_action: str or + ~botframework.connector.teams.models.enum + :param bot_activity_preview: + :type bot_activity_preview: + list[~botframework.connector.teams.models.Activity] + :param message_payload: Message content sent as part of the command + request. + :type message_payload: + ~botframework.connector.teams.models.MessageActionsPayload + """ + + _attribute_map = { + "data": {"key": "data", "type": "object"}, + "context": {"key": "context", "type": "TaskModuleRequestContext"}, + "command_id": {"key": "commandId", "type": "str"}, + "command_context": {"key": "commandContext", "type": "str"}, + "bot_message_preview_action": {"key": "botMessagePreviewAction", "type": "str"}, + "bot_activity_preview": {"key": "botActivityPreview", "type": "[Activity]"}, + "message_payload": {"key": "messagePayload", "type": "MessageActionsPayload"}, + } + + def __init__( + self, + *, + data=None, + context=None, + command_id: str = None, + command_context=None, + bot_message_preview_action=None, + bot_activity_preview=None, + message_payload=None, + **kwargs + ) -> None: + super(MessagingExtensionAction, self).__init__( + data=data, context=context, **kwargs + ) + self.command_id = command_id + self.command_context = command_context + self.bot_message_preview_action = bot_message_preview_action + self.bot_activity_preview = bot_activity_preview + self.message_payload = message_payload + + +class MessagingExtensionActionResponse(Model): + """Response of messaging extension action. + + :param task: The JSON for the Adaptive card to appear in the task module. + :type task: ~botframework.connector.teams.models.TaskModuleResponseBase + :param compose_extension: + :type compose_extension: + ~botframework.connector.teams.models.MessagingExtensionResult + """ + + _attribute_map = { + "task": {"key": "task", "type": "TaskModuleResponseBase"}, + "compose_extension": { + "key": "composeExtension", + "type": "MessagingExtensionResult", + }, + } + + def __init__(self, *, task=None, compose_extension=None, **kwargs) -> None: + super(MessagingExtensionActionResponse, self).__init__(**kwargs) + self.task = task + self.compose_extension = compose_extension + + +class MessagingExtensionAttachment(Attachment): + """Messaging extension attachment. + + :param content_type: mimetype/Contenttype for the file + :type content_type: str + :param content_url: Content Url + :type content_url: str + :param content: Embedded content + :type content: object + :param name: (OPTIONAL) The name of the attachment + :type name: str + :param thumbnail_url: (OPTIONAL) Thumbnail associated with attachment + :type thumbnail_url: str + :param preview: + :type preview: ~botframework.connector.teams.models.Attachment + """ + + _attribute_map = { + "content_type": {"key": "contentType", "type": "str"}, + "content_url": {"key": "contentUrl", "type": "str"}, + "content": {"key": "content", "type": "object"}, + "name": {"key": "name", "type": "str"}, + "thumbnail_url": {"key": "thumbnailUrl", "type": "str"}, + "preview": {"key": "preview", "type": "Attachment"}, + } + + def __init__( + self, + *, + content_type: str = None, + content_url: str = None, + content=None, + name: str = None, + thumbnail_url: str = None, + preview=None, + **kwargs + ) -> None: + super(MessagingExtensionAttachment, self).__init__( + content_type=content_type, + content_url=content_url, + content=content, + name=name, + thumbnail_url=thumbnail_url, + **kwargs + ) + self.preview = preview + + +class MessagingExtensionParameter(Model): + """Messaging extension query parameters. + + :param name: Name of the parameter + :type name: str + :param value: Value of the parameter + :type value: object + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "object"}, + } + + def __init__(self, *, name: str = None, value=None, **kwargs) -> None: + super(MessagingExtensionParameter, self).__init__(**kwargs) + self.name = name + self.value = value + + +class MessagingExtensionQuery(Model): + """Messaging extension query. + + :param command_id: Id of the command assigned by Bot + :type command_id: str + :param parameters: Parameters for the query + :type parameters: + list[~botframework.connector.teams.models.MessagingExtensionParameter] + :param query_options: + :type query_options: + ~botframework.connector.teams.models.MessagingExtensionQueryOptions + :param state: State parameter passed back to the bot after + authentication/configuration flow + :type state: str + """ + + _attribute_map = { + "command_id": {"key": "commandId", "type": "str"}, + "parameters": {"key": "parameters", "type": "[MessagingExtensionParameter]"}, + "query_options": { + "key": "queryOptions", + "type": "MessagingExtensionQueryOptions", + }, + "state": {"key": "state", "type": "str"}, + } + + def __init__( + self, + *, + command_id: str = None, + parameters=None, + query_options=None, + state: str = None, + **kwargs + ) -> None: + super(MessagingExtensionQuery, self).__init__(**kwargs) + self.command_id = command_id + self.parameters = parameters + self.query_options = query_options + self.state = state + + +class MessagingExtensionQueryOptions(Model): + """Messaging extension query options. + + :param skip: Number of entities to skip + :type skip: int + :param count: Number of entities to fetch + :type count: int + """ + + _attribute_map = { + "skip": {"key": "skip", "type": "int"}, + "count": {"key": "count", "type": "int"}, + } + + def __init__(self, *, skip: int = None, count: int = None, **kwargs) -> None: + super(MessagingExtensionQueryOptions, self).__init__(**kwargs) + self.skip = skip + self.count = count + + +class MessagingExtensionResponse(Model): + """Messaging extension response. + + :param compose_extension: + :type compose_extension: + ~botframework.connector.teams.models.MessagingExtensionResult + """ + + _attribute_map = { + "compose_extension": { + "key": "composeExtension", + "type": "MessagingExtensionResult", + }, + } + + def __init__(self, *, compose_extension=None, **kwargs) -> None: + super(MessagingExtensionResponse, self).__init__(**kwargs) + self.compose_extension = compose_extension + + +class MessagingExtensionResult(Model): + """Messaging extension result. + + :param attachment_layout: Hint for how to deal with multiple attachments. + Possible values include: 'list', 'grid' + :type attachment_layout: str or ~botframework.connector.teams.models.enum + :param type: The type of the result. Possible values include: 'result', + 'auth', 'config', 'message', 'botMessagePreview' + :type type: str or ~botframework.connector.teams.models.enum + :param attachments: (Only when type is result) Attachments + :type attachments: + list[~botframework.connector.teams.models.MessagingExtensionAttachment] + :param suggested_actions: + :type suggested_actions: + ~botframework.connector.teams.models.MessagingExtensionSuggestedAction + :param text: (Only when type is message) Text + :type text: str + :param activity_preview: (Only when type is botMessagePreview) Message + activity to preview + :type activity_preview: ~botframework.connector.teams.models.Activity + """ + + _attribute_map = { + "attachment_layout": {"key": "attachmentLayout", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "attachments": {"key": "attachments", "type": "[MessagingExtensionAttachment]"}, + "suggested_actions": { + "key": "suggestedActions", + "type": "MessagingExtensionSuggestedAction", + }, + "text": {"key": "text", "type": "str"}, + "activity_preview": {"key": "activityPreview", "type": "Activity"}, + } + + def __init__( + self, + *, + attachment_layout=None, + type=None, + attachments=None, + suggested_actions=None, + text: str = None, + activity_preview=None, + **kwargs + ) -> None: + super(MessagingExtensionResult, self).__init__(**kwargs) + self.attachment_layout = attachment_layout + self.type = type + self.attachments = attachments + self.suggested_actions = suggested_actions + self.text = text + self.activity_preview = activity_preview + + +class MessagingExtensionSuggestedAction(Model): + """Messaging extension Actions (Only when type is auth or config). + + :param actions: Actions + :type actions: list[~botframework.connector.teams.models.CardAction] + """ + + _attribute_map = { + "actions": {"key": "actions", "type": "[CardAction]"}, + } + + def __init__(self, *, actions=None, **kwargs) -> None: + super(MessagingExtensionSuggestedAction, self).__init__(**kwargs) + self.actions = actions + + +class NotificationInfo(Model): + """Specifies if a notification is to be sent for the mentions. + + :param alert: true if notification is to be sent to the user, false + otherwise. + :type alert: bool + """ + + _attribute_map = { + "alert": {"key": "alert", "type": "bool"}, + } + + def __init__(self, *, alert: bool = None, **kwargs) -> None: + super(NotificationInfo, self).__init__(**kwargs) + self.alert = alert + + +class O365ConnectorCard(Model): + """O365 connector card. + + :param title: Title of the item + :type title: str + :param text: Text for the card + :type text: str + :param summary: Summary for the card + :type summary: str + :param theme_color: Theme color for the card + :type theme_color: str + :param sections: Set of sections for the current card + :type sections: + list[~botframework.connector.teams.models.O365ConnectorCardSection] + :param potential_action: Set of actions for the current card + :type potential_action: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "text": {"key": "text", "type": "str"}, + "summary": {"key": "summary", "type": "str"}, + "theme_color": {"key": "themeColor", "type": "str"}, + "sections": {"key": "sections", "type": "[O365ConnectorCardSection]"}, + "potential_action": { + "key": "potentialAction", + "type": "[O365ConnectorCardActionBase]", + }, + } + + def __init__( + self, + *, + title: str = None, + text: str = None, + summary: str = None, + theme_color: str = None, + sections=None, + potential_action=None, + **kwargs + ) -> None: + super(O365ConnectorCard, self).__init__(**kwargs) + self.title = title + self.text = text + self.summary = summary + self.theme_color = theme_color + self.sections = sections + self.potential_action = potential_action + + +class O365ConnectorCardInputBase(Model): + """O365 connector card input for ActionCard action. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__( + self, + *, + type=None, + id: str = None, + is_required: bool = None, + title: str = None, + value: str = None, + **kwargs + ) -> None: + super(O365ConnectorCardInputBase, self).__init__(**kwargs) + self.type = type + self.id = id + self.is_required = is_required + self.title = title + self.value = value + + +class O365ConnectorCardActionBase(Model): + """O365 connector card action base. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + } + + def __init__( + self, *, type=None, name: str = None, id: str = None, **kwargs + ) -> None: + super(O365ConnectorCardActionBase, self).__init__(**kwargs) + self.type = type + self.name = name + self.id = id + + +class O365ConnectorCardActionCard(O365ConnectorCardActionBase): + """O365 connector card ActionCard action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param inputs: Set of inputs contained in this ActionCard whose each item + can be in any subtype of O365ConnectorCardInputBase + :type inputs: + list[~botframework.connector.teams.models.O365ConnectorCardInputBase] + :param actions: Set of actions contained in this ActionCard whose each + item can be in any subtype of O365ConnectorCardActionBase except + O365ConnectorCardActionCard, as nested ActionCard is forbidden. + :type actions: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "inputs": {"key": "inputs", "type": "[O365ConnectorCardInputBase]"}, + "actions": {"key": "actions", "type": "[O365ConnectorCardActionBase]"}, + } + + def __init__( + self, + *, + type=None, + name: str = None, + id: str = None, + inputs=None, + actions=None, + **kwargs + ) -> None: + super(O365ConnectorCardActionCard, self).__init__( + type=type, name=name, id=id, **kwargs + ) + self.inputs = inputs + self.actions = actions + + +class O365ConnectorCardActionQuery(Model): + """O365 connector card HttpPOST invoke query. + + :param body: The results of body string defined in + IO365ConnectorCardHttpPOST with substituted input values + :type body: str + :param action_id: Action Id associated with the HttpPOST action button + triggered, defined in O365ConnectorCardActionBase. + :type action_id: str + """ + + _attribute_map = { + "body": {"key": "body", "type": "str"}, + "action_id": {"key": "actionId", "type": "str"}, + } + + def __init__(self, *, body: str = None, action_id: str = None, **kwargs) -> None: + super(O365ConnectorCardActionQuery, self).__init__(**kwargs) + self.body = body + self.action_id = action_id + + +class O365ConnectorCardDateInput(O365ConnectorCardInputBase): + """O365 connector card date input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param include_time: Include time input field. Default value is false + (date only). + :type include_time: bool + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "include_time": {"key": "includeTime", "type": "bool"}, + } + + def __init__( + self, + *, + type=None, + id: str = None, + is_required: bool = None, + title: str = None, + value: str = None, + include_time: bool = None, + **kwargs + ) -> None: + super(O365ConnectorCardDateInput, self).__init__( + type=type, + id=id, + is_required=is_required, + title=title, + value=value, + **kwargs + ) + self.include_time = include_time + + +class O365ConnectorCardFact(Model): + """O365 connector card fact. + + :param name: Display name of the fact + :type name: str + :param value: Display value for the fact + :type value: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, name: str = None, value: str = None, **kwargs) -> None: + super(O365ConnectorCardFact, self).__init__(**kwargs) + self.name = name + self.value = value + + +class O365ConnectorCardHttpPOST(O365ConnectorCardActionBase): + """O365 connector card HttpPOST action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param body: Content to be posted back to bots via invoke + :type body: str + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "body": {"key": "body", "type": "str"}, + } + + def __init__( + self, *, type=None, name: str = None, id: str = None, body: str = None, **kwargs + ) -> None: + super(O365ConnectorCardHttpPOST, self).__init__( + type=type, name=name, id=id, **kwargs + ) + self.body = body + + +class O365ConnectorCardImage(Model): + """O365 connector card image. + + :param image: URL for the image + :type image: str + :param title: Alternative text for the image + :type title: str + """ + + _attribute_map = { + "image": {"key": "image", "type": "str"}, + "title": {"key": "title", "type": "str"}, + } + + def __init__(self, *, image: str = None, title: str = None, **kwargs) -> None: + super(O365ConnectorCardImage, self).__init__(**kwargs) + self.image = image + self.title = title + + +class O365ConnectorCardMultichoiceInput(O365ConnectorCardInputBase): + """O365 connector card multiple choice input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param choices: Set of choices whose each item can be in any subtype of + O365ConnectorCardMultichoiceInputChoice. + :type choices: + list[~botframework.connector.teams.models.O365ConnectorCardMultichoiceInputChoice] + :param style: Choice item rendering style. Default value is 'compact'. + Possible values include: 'compact', 'expanded' + :type style: str or ~botframework.connector.teams.models.enum + :param is_multi_select: Define if this input field allows multiple + selections. Default value is false. + :type is_multi_select: bool + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "choices": { + "key": "choices", + "type": "[O365ConnectorCardMultichoiceInputChoice]", + }, + "style": {"key": "style", "type": "str"}, + "is_multi_select": {"key": "isMultiSelect", "type": "bool"}, + } + + def __init__( + self, + *, + type=None, + id: str = None, + is_required: bool = None, + title: str = None, + value: str = None, + choices=None, + style=None, + is_multi_select: bool = None, + **kwargs + ) -> None: + super(O365ConnectorCardMultichoiceInput, self).__init__( + type=type, + id=id, + is_required=is_required, + title=title, + value=value, + **kwargs + ) + self.choices = choices + self.style = style + self.is_multi_select = is_multi_select + + +class O365ConnectorCardMultichoiceInputChoice(Model): + """O365O365 connector card multiple choice input item. + + :param display: The text rendered on ActionCard. + :type display: str + :param value: The value received as results. + :type value: str + """ + + _attribute_map = { + "display": {"key": "display", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, display: str = None, value: str = None, **kwargs) -> None: + super(O365ConnectorCardMultichoiceInputChoice, self).__init__(**kwargs) + self.display = display + self.value = value + + +class O365ConnectorCardOpenUri(O365ConnectorCardActionBase): + """O365 connector card OpenUri action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param targets: Target os / urls + :type targets: + list[~botframework.connector.teams.models.O365ConnectorCardOpenUriTarget] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "targets": {"key": "targets", "type": "[O365ConnectorCardOpenUriTarget]"}, + } + + def __init__( + self, *, type=None, name: str = None, id: str = None, targets=None, **kwargs + ) -> None: + super(O365ConnectorCardOpenUri, self).__init__( + type=type, name=name, id=id, **kwargs + ) + self.targets = targets + + +class O365ConnectorCardOpenUriTarget(Model): + """O365 connector card OpenUri target. + + :param os: Target operating system. Possible values include: 'default', + 'iOS', 'android', 'windows' + :type os: str or ~botframework.connector.teams.models.enum + :param uri: Target url + :type uri: str + """ + + _attribute_map = { + "os": {"key": "os", "type": "str"}, + "uri": {"key": "uri", "type": "str"}, + } + + def __init__(self, *, os=None, uri: str = None, **kwargs) -> None: + super(O365ConnectorCardOpenUriTarget, self).__init__(**kwargs) + self.os = os + self.uri = uri + + +class O365ConnectorCardSection(Model): + """O365 connector card section. + + :param title: Title of the section + :type title: str + :param text: Text for the section + :type text: str + :param activity_title: Activity title + :type activity_title: str + :param activity_subtitle: Activity subtitle + :type activity_subtitle: str + :param activity_text: Activity text + :type activity_text: str + :param activity_image: Activity image + :type activity_image: str + :param activity_image_type: Describes how Activity image is rendered. + Possible values include: 'avatar', 'article' + :type activity_image_type: str or + ~botframework.connector.teams.models.enum + :param markdown: Use markdown for all text contents. Default value is + true. + :type markdown: bool + :param facts: Set of facts for the current section + :type facts: + list[~botframework.connector.teams.models.O365ConnectorCardFact] + :param images: Set of images for the current section + :type images: + list[~botframework.connector.teams.models.O365ConnectorCardImage] + :param potential_action: Set of actions for the current section + :type potential_action: + list[~botframework.connector.teams.models.O365ConnectorCardActionBase] + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "text": {"key": "text", "type": "str"}, + "activity_title": {"key": "activityTitle", "type": "str"}, + "activity_subtitle": {"key": "activitySubtitle", "type": "str"}, + "activity_text": {"key": "activityText", "type": "str"}, + "activity_image": {"key": "activityImage", "type": "str"}, + "activity_image_type": {"key": "activityImageType", "type": "str"}, + "markdown": {"key": "markdown", "type": "bool"}, + "facts": {"key": "facts", "type": "[O365ConnectorCardFact]"}, + "images": {"key": "images", "type": "[O365ConnectorCardImage]"}, + "potential_action": { + "key": "potentialAction", + "type": "[O365ConnectorCardActionBase]", + }, + } + + def __init__( + self, + *, + title: str = None, + text: str = None, + activity_title: str = None, + activity_subtitle: str = None, + activity_text: str = None, + activity_image: str = None, + activity_image_type=None, + markdown: bool = None, + facts=None, + images=None, + potential_action=None, + **kwargs + ) -> None: + super(O365ConnectorCardSection, self).__init__(**kwargs) + self.title = title + self.text = text + self.activity_title = activity_title + self.activity_subtitle = activity_subtitle + self.activity_text = activity_text + self.activity_image = activity_image + self.activity_image_type = activity_image_type + self.markdown = markdown + self.facts = facts + self.images = images + self.potential_action = potential_action + + +class O365ConnectorCardTextInput(O365ConnectorCardInputBase): + """O365 connector card text input. + + :param type: Input type name. Possible values include: 'textInput', + 'dateInput', 'multichoiceInput' + :type type: str or ~botframework.connector.teams.models.enum + :param id: Input Id. It must be unique per entire O365 connector card. + :type id: str + :param is_required: Define if this input is a required field. Default + value is false. + :type is_required: bool + :param title: Input title that will be shown as the placeholder + :type title: str + :param value: Default value for this input field + :type value: str + :param is_multiline: Define if text input is allowed for multiple lines. + Default value is false. + :type is_multiline: bool + :param max_length: Maximum length of text input. Default value is + unlimited. + :type max_length: float + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "is_required": {"key": "isRequired", "type": "bool"}, + "title": {"key": "title", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "is_multiline": {"key": "isMultiline", "type": "bool"}, + "max_length": {"key": "maxLength", "type": "float"}, + } + + def __init__( + self, + *, + type=None, + id: str = None, + is_required: bool = None, + title: str = None, + value: str = None, + is_multiline: bool = None, + max_length: float = None, + **kwargs + ) -> None: + super(O365ConnectorCardTextInput, self).__init__( + type=type, + id=id, + is_required=is_required, + title=title, + value=value, + **kwargs + ) + self.is_multiline = is_multiline + self.max_length = max_length + + +class O365ConnectorCardViewAction(O365ConnectorCardActionBase): + """O365 connector card ViewAction action. + + :param type: Type of the action. Possible values include: 'ViewAction', + 'OpenUri', 'HttpPOST', 'ActionCard' + :type type: str or ~botframework.connector.teams.models.enum + :param name: Name of the action that will be used as button title + :type name: str + :param id: Action Id + :type id: str + :param target: Target urls, only the first url effective for card button + :type target: list[str] + """ + + _attribute_map = { + "type": {"key": "@type", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "id": {"key": "@id", "type": "str"}, + "target": {"key": "target", "type": "[str]"}, + } + + def __init__( + self, *, type=None, name: str = None, id: str = None, target=None, **kwargs + ) -> None: + super(O365ConnectorCardViewAction, self).__init__( + type=type, name=name, id=id, **kwargs + ) + self.target = target + + +class SigninStateVerificationQuery(Model): + """Signin state (part of signin action auth flow) verification invoke query. + + :param state: The state string originally received when the signin web + flow is finished with a state posted back to client via tab SDK + microsoftTeams.authentication.notifySuccess(state) + :type state: str + """ + + _attribute_map = { + "state": {"key": "state", "type": "str"}, + } + + def __init__(self, *, state: str = None, **kwargs) -> None: + super(SigninStateVerificationQuery, self).__init__(**kwargs) + self.state = state + + +class TaskModuleResponseBase(Model): + """Base class for Task Module responses. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(TaskModuleResponseBase, self).__init__(**kwargs) + self.type = type + + +class TaskModuleContinueResponse(TaskModuleResponseBase): + """Task Module Response with continue action. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + :param value: The JSON for the Adaptive card to appear in the task module. + :type value: ~botframework.connector.teams.models.TaskModuleTaskInfo + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "TaskModuleTaskInfo"}, + } + + def __init__(self, *, type=None, value=None, **kwargs) -> None: + super(TaskModuleContinueResponse, self).__init__(type=type, **kwargs) + self.value = value + + +class TaskModuleMessageResponse(TaskModuleResponseBase): + """Task Module response with message action. + + :param type: Choice of action options when responding to the task/submit + message. Possible values include: 'message', 'continue' + :type type: str or ~botframework.connector.teams.models.enum + :param value: Teams will display the value of value in a popup message + box. + :type value: str + """ + + _attribute_map = { + "type": {"key": "type", "type": "str"}, + "value": {"key": "value", "type": "str"}, + } + + def __init__(self, *, type=None, value: str = None, **kwargs) -> None: + super(TaskModuleMessageResponse, self).__init__(type=type, **kwargs) + self.value = value + + +class TaskModuleRequestContext(Model): + """Current user context, i.e., the current theme. + + :param theme: + :type theme: str + """ + + _attribute_map = { + "theme": {"key": "theme", "type": "str"}, + } + + def __init__(self, *, theme: str = None, **kwargs) -> None: + super(TaskModuleRequestContext, self).__init__(**kwargs) + self.theme = theme + + +class TaskModuleResponse(Model): + """Envelope for Task Module Response. + + :param task: The JSON for the Adaptive card to appear in the task module. + :type task: ~botframework.connector.teams.models.TaskModuleResponseBase + """ + + _attribute_map = { + "task": {"key": "task", "type": "TaskModuleResponseBase"}, + } + + def __init__(self, *, task=None, **kwargs) -> None: + super(TaskModuleResponse, self).__init__(**kwargs) + self.task = task + + +class TaskModuleTaskInfo(Model): + """Metadata for a Task Module. + + :param title: Appears below the app name and to the right of the app icon. + :type title: str + :param height: This can be a number, representing the task module's height + in pixels, or a string, one of: small, medium, large. + :type height: object + :param width: This can be a number, representing the task module's width + in pixels, or a string, one of: small, medium, large. + :type width: object + :param url: The URL of what is loaded as an iframe inside the task module. + One of url or card is required. + :type url: str + :param card: The JSON for the Adaptive card to appear in the task module. + :type card: ~botframework.connector.teams.models.Attachment + :param fallback_url: If a client does not support the task module feature, + this URL is opened in a browser tab. + :type fallback_url: str + :param completion_bot_id: If a client does not support the task module + feature, this URL is opened in a browser tab. + :type completion_bot_id: str + """ + + _attribute_map = { + "title": {"key": "title", "type": "str"}, + "height": {"key": "height", "type": "object"}, + "width": {"key": "width", "type": "object"}, + "url": {"key": "url", "type": "str"}, + "card": {"key": "card", "type": "Attachment"}, + "fallback_url": {"key": "fallbackUrl", "type": "str"}, + "completion_bot_id": {"key": "completionBotId", "type": "str"}, + } + + def __init__( + self, + *, + title: str = None, + height=None, + width=None, + url: str = None, + card=None, + fallback_url: str = None, + completion_bot_id: str = None, + **kwargs + ) -> None: + super(TaskModuleTaskInfo, self).__init__(**kwargs) + self.title = title + self.height = height + self.width = width + self.url = url + self.card = card + self.fallback_url = fallback_url + self.completion_bot_id = completion_bot_id + + +class TeamDetails(Model): + """Details related to a team. + + :param id: Unique identifier representing a team + :type id: str + :param name: Name of team. + :type name: str + :param aad_group_id: Azure Active Directory (AAD) Group Id for the team. + :type aad_group_id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "aad_group_id": {"key": "aadGroupId", "type": "str"}, + } + + def __init__( + self, *, id: str = None, name: str = None, aad_group_id: str = None, **kwargs + ) -> None: + super(TeamDetails, self).__init__(**kwargs) + self.id = id + self.name = name + self.aad_group_id = aad_group_id + + +class TeamInfo(Model): + """Describes a team. + + :param id: Unique identifier representing a team + :type id: str + :param name: Name of team. + :type name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + } + + def __init__(self, *, id: str = None, name: str = None, **kwargs) -> None: + super(TeamInfo, self).__init__(**kwargs) + self.id = id + self.name = name + + +class TeamsChannelAccount(ChannelAccount): + """Teams channel account detailing user Azure Active Directory details. + + :param id: Channel id for the user or bot on this channel (Example: + joe@smith.com, or @joesmith or 123456) + :type id: str + :param name: Display friendly name + :type name: str + :param given_name: Given name part of the user name. + :type given_name: str + :param surname: Surname part of the user name. + :type surname: str + :param email: Email Id of the user. + :type email: str + :param user_principal_name: Unique user principal name + :type user_principal_name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "given_name": {"key": "givenName", "type": "str"}, + "surname": {"key": "surname", "type": "str"}, + "email": {"key": "email", "type": "str"}, + "user_principal_name": {"key": "userPrincipalName", "type": "str"}, + } + + def __init__( + self, + *, + id: str = None, + name: str = None, + given_name: str = None, + surname: str = None, + email: str = None, + user_principal_name: str = None, + **kwargs + ) -> None: + super(TeamsChannelAccount, self).__init__(id=id, name=name, **kwargs) + self.given_name = given_name + self.surname = surname + self.email = email + self.user_principal_name = user_principal_name + + +class TeamsChannelData(Model): + """Channel data specific to messages received in Microsoft Teams. + + :param channel: Information about the channel in which the message was + sent + :type channel: ~botframework.connector.teams.models.ChannelInfo + :param event_type: Type of event. + :type event_type: str + :param team: Information about the team in which the message was sent + :type team: ~botframework.connector.teams.models.TeamInfo + :param notification: Notification settings for the message + :type notification: ~botframework.connector.teams.models.NotificationInfo + :param tenant: Information about the tenant in which the message was sent + :type tenant: ~botframework.connector.teams.models.TenantInfo + """ + + _attribute_map = { + "channel": {"key": "channel", "type": "ChannelInfo"}, + "event_type": {"key": "eventType", "type": "str"}, + "team": {"key": "team", "type": "TeamInfo"}, + "notification": {"key": "notification", "type": "NotificationInfo"}, + "tenant": {"key": "tenant", "type": "TenantInfo"}, + } + + def __init__( + self, + *, + channel=None, + event_type: str = None, + team=None, + notification=None, + tenant=None, + **kwargs + ) -> None: + super(TeamsChannelData, self).__init__(**kwargs) + self.channel = channel + self.event_type = event_type + self.team = team + self.notification = notification + self.tenant = tenant + + +class TenantInfo(Model): + """Describes a tenant. + + :param id: Unique identifier representing a tenant + :type id: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: str = None, **kwargs) -> None: + super(TenantInfo, self).__init__(**kwargs) + self.id = id diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/channel_info.py b/libraries/botbuilder-schema/botbuilder/schema/teams/channel_info.py deleted file mode 100644 index 6125698c3..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/channel_info.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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. - - -class ChannelInfo(object): - def __init__(self, id="", name=""): - self.id = id - self.name = name diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/notification_info.py b/libraries/botbuilder-schema/botbuilder/schema/teams/notification_info.py deleted file mode 100644 index dd55a69c7..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/notification_info.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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. - - -class NotificationInfo: - def __init__(self, alert: bool = False): - self.alert = alert diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/team_info.py b/libraries/botbuilder-schema/botbuilder/schema/teams/team_info.py deleted file mode 100644 index 316ae89c2..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/team_info.py +++ /dev/null @@ -1,14 +0,0 @@ -# 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. - - -class TeamInfo: - def __init__(self, id="", name="", aadGroupId=""): - self.id = id - self.name = name - self.aad_group_id = aadGroupId diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_account.py b/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_account.py deleted file mode 100644 index a2354effd..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_account.py +++ /dev/null @@ -1,31 +0,0 @@ -# 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 botbuilder.schema import ChannelAccount - - -class TeamsChannelAccount(ChannelAccount): - def __init__( - self, - id="", - name="", - aad_object_id="", - role="", - given_name="", - surname="", - email="", - userPrincipalName="", - ): - super().__init__( - **{"id": id, "name": name, "aad_object_id": aad_object_id, "role": role} - ) - self.given_name = given_name - self.surname = surname - self.email = email - # This isn't camel_cased because the JSON that makes this object isn't camel_case - self.user_principal_name = userPrincipalName diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_data.py b/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_data.py deleted file mode 100644 index 24001d00c..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/teams_channel_data.py +++ /dev/null @@ -1,30 +0,0 @@ -# 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 botbuilder.schema.teams import ChannelInfo, TeamInfo, NotificationInfo, TenantInfo - - -class TeamsChannelData: - def __init__( - self, - channel: ChannelInfo = None, - eventType="", - team: TeamInfo = None, - notification: NotificationInfo = None, - tenant: TenantInfo = None, - ): - self.channel = ChannelInfo(**channel) if channel is not None else ChannelInfo() - # This is not camel case because the JSON that makes this object isn't - self.event_type = eventType - self.team = TeamInfo(**team) if team is not None else TeamInfo() - self.notification = ( - NotificationInfo(**notification) - if notification is not None - else NotificationInfo() - ) - self.tenant = TenantInfo(**tenant) if tenant is not None else TenantInfo() diff --git a/libraries/botbuilder-schema/botbuilder/schema/teams/tenant_info.py b/libraries/botbuilder-schema/botbuilder/schema/teams/tenant_info.py deleted file mode 100644 index 2b47e81a0..000000000 --- a/libraries/botbuilder-schema/botbuilder/schema/teams/tenant_info.py +++ /dev/null @@ -1,12 +0,0 @@ -# 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. - - -class TenantInfo: - def __init__(self, id=""): - self._id = id diff --git a/libraries/botframework-connector/tests/test_skill_validation.py b/libraries/botframework-connector/tests/test_skill_validation.py index a32625050..71776bc4f 100644 --- a/libraries/botframework-connector/tests/test_skill_validation.py +++ b/libraries/botframework-connector/tests/test_skill_validation.py @@ -2,8 +2,6 @@ from asyncio import Future from unittest.mock import Mock, DEFAULT import aiounittest -from ddt import data, ddt, unpack - from botframework.connector.auth import ( AuthenticationConstants, ClaimsIdentity, @@ -11,6 +9,7 @@ SkillValidation, ) +from ddt import data, ddt, unpack def future_builder(return_val: object) -> Future: result = Future() From bd62771881e30ef308c057086caec8a8636250fe Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 16:15:06 -0800 Subject: [PATCH 2/7] moving the import back --- .../botframework-connector/tests/test_skill_validation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/botframework-connector/tests/test_skill_validation.py b/libraries/botframework-connector/tests/test_skill_validation.py index 71776bc4f..204d29765 100644 --- a/libraries/botframework-connector/tests/test_skill_validation.py +++ b/libraries/botframework-connector/tests/test_skill_validation.py @@ -2,6 +2,8 @@ from asyncio import Future from unittest.mock import Mock, DEFAULT import aiounittest +from ddt import data, ddt, unpack + from botframework.connector.auth import ( AuthenticationConstants, ClaimsIdentity, @@ -9,8 +11,6 @@ SkillValidation, ) -from ddt import data, ddt, unpack - def future_builder(return_val: object) -> Future: result = Future() result.set_result(return_val) From 9e47e4c1c5cc241b07f874589831338790deff8d Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 16:19:19 -0800 Subject: [PATCH 3/7] trying different import order --- .../botframework-connector/tests/test_skill_validation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/botframework-connector/tests/test_skill_validation.py b/libraries/botframework-connector/tests/test_skill_validation.py index 204d29765..19ced8ae8 100644 --- a/libraries/botframework-connector/tests/test_skill_validation.py +++ b/libraries/botframework-connector/tests/test_skill_validation.py @@ -2,7 +2,6 @@ from asyncio import Future from unittest.mock import Mock, DEFAULT import aiounittest -from ddt import data, ddt, unpack from botframework.connector.auth import ( AuthenticationConstants, @@ -11,6 +10,8 @@ SkillValidation, ) +from ddt import data, ddt, unpack + def future_builder(return_val: object) -> Future: result = Future() result.set_result(return_val) From f9694d93acc683c234f5501680c0ae6cb6b74f0d Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 16:21:49 -0800 Subject: [PATCH 4/7] hard resetting test file --- .../botframework-connector/tests/test_skill_validation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/botframework-connector/tests/test_skill_validation.py b/libraries/botframework-connector/tests/test_skill_validation.py index 19ced8ae8..204d29765 100644 --- a/libraries/botframework-connector/tests/test_skill_validation.py +++ b/libraries/botframework-connector/tests/test_skill_validation.py @@ -2,6 +2,7 @@ from asyncio import Future from unittest.mock import Mock, DEFAULT import aiounittest +from ddt import data, ddt, unpack from botframework.connector.auth import ( AuthenticationConstants, @@ -10,8 +11,6 @@ SkillValidation, ) -from ddt import data, ddt, unpack - def future_builder(return_val: object) -> Future: result = Future() result.set_result(return_val) From 1337b930f6ae86c1c1d0b386fd62e3a30e09c058 Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 16:22:51 -0800 Subject: [PATCH 5/7] pulling file from master --- libraries/botframework-connector/tests/test_skill_validation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/botframework-connector/tests/test_skill_validation.py b/libraries/botframework-connector/tests/test_skill_validation.py index 204d29765..a32625050 100644 --- a/libraries/botframework-connector/tests/test_skill_validation.py +++ b/libraries/botframework-connector/tests/test_skill_validation.py @@ -11,6 +11,7 @@ SkillValidation, ) + def future_builder(return_val: object) -> Future: result = Future() result.set_result(return_val) From 55aa761f03d739f7a891efc4222754875e0ad4b5 Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 16:37:06 -0800 Subject: [PATCH 6/7] adding connector --- .../botframework/connector/teams/__init__.py | 17 ++ .../connector/teams/operations/__init__.py | 16 ++ .../teams/operations/teams_operations.py | 147 ++++++++++++++++++ .../connector/teams/teams_connector_client.py | 82 ++++++++++ .../botframework/connector/teams/version.py | 12 ++ 5 files changed, 274 insertions(+) create mode 100644 libraries/botframework-connector/botframework/connector/teams/__init__.py create mode 100644 libraries/botframework-connector/botframework/connector/teams/operations/__init__.py create mode 100644 libraries/botframework-connector/botframework/connector/teams/operations/teams_operations.py create mode 100644 libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py create mode 100644 libraries/botframework-connector/botframework/connector/teams/version.py diff --git a/libraries/botframework-connector/botframework/connector/teams/__init__.py b/libraries/botframework-connector/botframework/connector/teams/__init__.py new file mode 100644 index 000000000..df0cf0a57 --- /dev/null +++ b/libraries/botframework-connector/botframework/connector/teams/__init__.py @@ -0,0 +1,17 @@ +# 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 .teams_connector_client import TeamsConnectorClient +from .version import VERSION + +__all__ = ["TeamsConnectorClient"] + +__version__ = VERSION diff --git a/libraries/botframework-connector/botframework/connector/teams/operations/__init__.py b/libraries/botframework-connector/botframework/connector/teams/operations/__init__.py new file mode 100644 index 000000000..3e46b2dc2 --- /dev/null +++ b/libraries/botframework-connector/botframework/connector/teams/operations/__init__.py @@ -0,0 +1,16 @@ +# 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 .teams_operations import TeamsOperations + +__all__ = [ + "TeamsOperations", +] diff --git a/libraries/botframework-connector/botframework/connector/teams/operations/teams_operations.py b/libraries/botframework-connector/botframework/connector/teams/operations/teams_operations.py new file mode 100644 index 000000000..73d95e246 --- /dev/null +++ b/libraries/botframework-connector/botframework/connector/teams/operations/teams_operations.py @@ -0,0 +1,147 @@ +# 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.pipeline import ClientRawResponse +from msrest.exceptions import HttpOperationError + +from .. import models + + +class TeamsOperations(object): + """TeamsOperations 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. + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + + self.config = config + + def fetch_channel_list( + self, team_id, custom_headers=None, raw=False, **operation_config + ): + """Fetches channel list for a given team. + + Fetch the channel list. + + :param team_id: Team Id + :type team_id: 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: ConversationList or ClientRawResponse if raw=true + :rtype: ~botframework.connector.teams.models.ConversationList or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fetch_channel_list.metadata["url"] + path_format_arguments = { + "teamId": self._serialize.url("team_id", team_id, "str") + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters["Accept"] = "application/json" + if custom_headers: + header_parameters.update(custom_headers) + + # 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 HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize("ConversationList", response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + fetch_channel_list.metadata = {"url": "/v3/teams/{teamId}/conversations"} + + def fetch_team_details( + self, team_id, custom_headers=None, raw=False, **operation_config + ): + """Fetches details related to a team. + + Fetch details for a team. + + :param team_id: Team Id + :type team_id: 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: TeamDetails or ClientRawResponse if raw=true + :rtype: ~botframework.connector.teams.models.TeamDetails or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`HttpOperationError` + """ + # Construct URL + url = self.fetch_team_details.metadata["url"] + path_format_arguments = { + "teamId": self._serialize.url("team_id", team_id, "str") + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters["Accept"] = "application/json" + if custom_headers: + header_parameters.update(custom_headers) + + # 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 HttpOperationError(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize("TeamDetails", response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + fetch_team_details.metadata = {"url": "/v3/teams/{teamId}"} diff --git a/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py b/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py new file mode 100644 index 000000000..61e7c979e --- /dev/null +++ b/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py @@ -0,0 +1,82 @@ +# 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 SDKClient +from msrest import Configuration, Serializer, Deserializer +from .version import VERSION +from msrest.exceptions import HttpOperationError +from .operations.teams_operations import TeamsOperations +from . import models + + +class TeamsConnectorClientConfiguration(Configuration): + """Configuration for TeamsConnectorClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__(self, credentials, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if not base_url: + base_url = "https://api.botframework.com" + + super(TeamsConnectorClientConfiguration, self).__init__(base_url) + + self.add_user_agent("botframework-connector/{}".format(VERSION)) + + self.credentials = credentials + + +class TeamsConnectorClient(SDKClient): + """The Bot Connector REST API extension for Microsoft Teams allows your bot to perform extended operations on to Microsoft Teams channel configured in the + [Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses industry-standard REST and JSON over HTTPS. + Client libraries for this REST API are available. See below for a list. + Authentication for both the Bot Connector and Bot State REST APIs is accomplished with JWT Bearer tokens, and is + described in detail in the [Connector Authentication](https://docs.botframework.com/en-us/restapi/authentication) document. + # Client Libraries for the Bot Connector REST API + * [Bot Builder for C#](https://docs.botframework.com/en-us/csharp/builder/sdkreference/) + * [Bot Builder for Node.js](https://docs.botframework.com/en-us/node/builder/overview/) + © 2016 Microsoft + + :ivar config: Configuration for client. + :vartype config: TeamsConnectorClientConfiguration + + :ivar teams: Teams operations + :vartype teams: botframework.connector.teams.operations.TeamsOperations + + :param credentials: Subscription credentials which uniquely identify + client subscription. + :type credentials: None + :param str base_url: Service URL + """ + + def __init__(self, credentials, base_url=None): + + self.config = TeamsConnectorClientConfiguration(credentials, base_url) + super(TeamsConnectorClient, self).__init__(self.config.credentials, self.config) + + client_models = { + k: v for k, v in models.__dict__.items() if isinstance(v, type) + } + self.api_version = "v3" + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.teams = TeamsOperations( + self._client, self.config, self._serialize, self._deserialize + ) diff --git a/libraries/botframework-connector/botframework/connector/teams/version.py b/libraries/botframework-connector/botframework/connector/teams/version.py new file mode 100644 index 000000000..e36069e74 --- /dev/null +++ b/libraries/botframework-connector/botframework/connector/teams/version.py @@ -0,0 +1,12 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "v3" From 74bcc5ef086527fcfdb999f0c42ffd1542e9db10 Mon Sep 17 00:00:00 2001 From: virtual-josh Date: Wed, 27 Nov 2019 17:14:38 -0800 Subject: [PATCH 7/7] fixing linting --- .../connector/teams/teams_connector_client.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py b/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py index 61e7c979e..9f75295b3 100644 --- a/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py +++ b/libraries/botframework-connector/botframework/connector/teams/teams_connector_client.py @@ -11,10 +11,9 @@ from msrest.service_client import SDKClient from msrest import Configuration, Serializer, Deserializer +from botbuilder.schema import models from .version import VERSION -from msrest.exceptions import HttpOperationError from .operations.teams_operations import TeamsOperations -from . import models class TeamsConnectorClientConfiguration(Configuration): @@ -43,11 +42,13 @@ def __init__(self, credentials, base_url=None): class TeamsConnectorClient(SDKClient): - """The Bot Connector REST API extension for Microsoft Teams allows your bot to perform extended operations on to Microsoft Teams channel configured in the - [Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses industry-standard REST and JSON over HTTPS. - Client libraries for this REST API are available. See below for a list. + """The Bot Connector REST API extension for Microsoft Teams allows your bot to perform extended + operations on to Microsoft Teams channel configured in the + [Bot Framework Developer Portal](https://dev.botframework.com). The Connector service uses + industry-standard REST and JSON over HTTPS. Client libraries for this REST API are available. See below for a list. Authentication for both the Bot Connector and Bot State REST APIs is accomplished with JWT Bearer tokens, and is - described in detail in the [Connector Authentication](https://docs.botframework.com/en-us/restapi/authentication) document. + described in detail in the [Connector Authentication](https://docs.botframework.com/en-us/restapi/authentication) + document. # Client Libraries for the Bot Connector REST API * [Bot Builder for C#](https://docs.botframework.com/en-us/csharp/builder/sdkreference/) * [Bot Builder for Node.js](https://docs.botframework.com/en-us/node/builder/overview/)