-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLGN-391] - Microsoft Teams -adding in new actions for getting messa…
…ges from a chat and creating a chat (#2106) * PLG-391-adding in new actions for getting messages from a chat and creating a chat * PLG-391-adding in new actions for getting messages from a chat and creating a chat * PLG-391-updating return types to corretc types, better handling of errors in list_messages_from_chat * PLGN-391-Adding in schema validation to unit tests * PLGN-391-Bumping validators from 0.17.0 to 0.21.0 * PLGN-391-Adding better error handling for non json response, fixing type of members * PLGN-391-black formatter
- Loading branch information
1 parent
b30d584
commit 77d7294
Showing
38 changed files
with
1,212 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
plugins/microsoft_teams/icon_microsoft_teams/actions/create_teams_chat/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT | ||
from .action import CreateTeamsChat |
25 changes: 25 additions & 0 deletions
25
plugins/microsoft_teams/icon_microsoft_teams/actions/create_teams_chat/action.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import insightconnect_plugin_runtime | ||
from .schema import CreateTeamsChatInput, CreateTeamsChatOutput, Input, Output, Component | ||
|
||
|
||
# Custom imports below | ||
from icon_microsoft_teams.util.komand_clean_with_nulls import remove_null_and_clean | ||
from icon_microsoft_teams.util.teams_utils import create_chat | ||
|
||
|
||
class CreateTeamsChat(insightconnect_plugin_runtime.Action): | ||
def __init__(self): | ||
super(self.__class__, self).__init__( | ||
name="create_teams_chat", | ||
description=Component.DESCRIPTION, | ||
input=CreateTeamsChatInput(), | ||
output=CreateTeamsChatOutput(), | ||
) | ||
|
||
def run(self, params={}): | ||
members = params.get(Input.MEMBERS) | ||
topic = params.get(Input.TOPIC) | ||
|
||
group_result = create_chat(self.connection, members, topic) | ||
|
||
return {Output.CHAT: remove_null_and_clean(group_result)} |
Oops, something went wrong.