From c9a0e38946f88e984c36cfd9e982ba295a60c693 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Tue, 25 Feb 2020 22:33:50 +0100 Subject: [PATCH 1/6] Add microsoft Teams schema to get team id and channel id. --- .../com/microsoft/bot/schema/Activity.java | 44 +++- .../bot/schema/teams/ChannelInfo.java | 60 ++++++ .../bot/schema/teams/NotificationInfo.java | 37 ++++ .../bot/schema/teams/TeamChannelData.java | 191 ++++++++++++++++++ .../microsoft/bot/schema/teams/TeamInfo.java | 89 ++++++++ .../bot/schema/teams/TenantInfo.java | 38 ++++ .../bot/schema/teams/package-info.java | 8 + 7 files changed, 466 insertions(+), 1 deletion(-) create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java index abcad372c..4603e2e05 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java @@ -3,6 +3,8 @@ package com.microsoft.bot.schema; +import com.microsoft.bot.schema.teams.TeamChannelData; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonFormat; @@ -1504,4 +1506,44 @@ public static String removeMentionTextImmutable(Activity activity, String id) { return text; } -} + + /** + * Check if this actvity is from microsoft teams. + * @return true if the activity is from microsoft teams. + */ + public boolean isTeamsActivity() { + return "msteams".equals(channelId); + } + + /** + * Get unique identifier representing a channel. + * + * @throws JsonProcessingException when channel data can't be parsed to TeamChannelData + * @return Unique identifier representing a channel + */ + public String teamsGetChannelId() throws JsonProcessingException { + TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + String teamsChannelId = teamsChannelData.getTeamsChannelId(); + if (teamsChannelId == null && teamsChannelData.getChannel() != null) { + teamsChannelId = teamsChannelData.getChannel().getId(); + } + + return teamsChannelId; + } + + /** + * Get unique identifier representing a team. + * + * @throws JsonProcessingException when channel data can't be parsed to TeamChannelData + * @return Unique identifier representing a team. + */ + public String teamsGetTeamId() throws JsonProcessingException { + TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + String teamId = teamsChannelData.getTeamsTeamId(); + if (teamId == null && teamsChannelData.getTeam() != null) { + teamId = teamsChannelData.getTeam().getId(); + } + + return teamId; + } +} \ No newline at end of file diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java new file mode 100644 index 000000000..8b57cbf2c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java @@ -0,0 +1,60 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * A channel info object which describes the channel. +*/ +public class ChannelInfo { + @JsonProperty(value = "id") + private String id; + + /** + * name of the channel. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the unique identifier representing a channel. + * @return the unique identifier representing a channel. + */ + public final String getId() { + return id; + } + + /** + * Set unique identifier representing a channel. + * @param withId the unique identifier representing a channel. + */ + public void setId(String withId) { + this.id = withId; + } + + /** + * Get the name of the channel. + * @return name of the channel. + */ + public String getName() { + return name; + } + + /** + * Sets name of the channel. + * @param withName the name of the channel. + */ + public void setName(String withName) { + this.name = withName; + } + + /** + * Initializes a new instance of the ChannelInfo class. + * @param withId identifier representing a channel. + * @param withName Name of the channel. + */ + public ChannelInfo(String withId, String withName) { + this.id = withId; + this.name = withName; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java new file mode 100644 index 000000000..1059498cb --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java @@ -0,0 +1,37 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Specifies if a notification is to be sent for the mentions. + */ +public class NotificationInfo { + /** + * Gets or sets true if notification is to be sent to the user, false. + */ + @JsonProperty(value = "alert") + private Boolean alert; + + /** + * Getter for alert. + * @return return the alter value. + */ + public Boolean getAlert() { + return alert; + } + + /** + * Setter for alert. + * @param withAlert the value to set. + */ + public void setAlert(Boolean withAlert) { + alert = withAlert; + } + + /** + * A new instance of NotificationInfo. + * @param withAlert alert value to set. + */ + public NotificationInfo(Boolean withAlert) { + alert = withAlert; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java new file mode 100644 index 000000000..eb3e4bf2d --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java @@ -0,0 +1,191 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * Channel data specific to messages received in Microsoft Teams. + */ +public class TeamChannelData { + @JsonProperty(value = "teamsChannelId") + private String teamsChannelId; + + @JsonProperty(value = "teamsTeamId") + private String teamsTeamId; + + @JsonProperty(value = "channel") + private ChannelInfo channel; + + /// Gets or sets type of event. + @JsonProperty(value = "eventType") + private String eventType; + + /// Gets or sets information about the team in which the message was + /// sent + @JsonProperty(value = "team") + private TeamInfo team; + + /// Gets or sets notification settings for the message + @JsonProperty(value = "notification") + private NotificationInfo notification; + + /// Gets or sets information about the tenant in which the message was + /// sent + @JsonProperty(value = "tenant") + private TenantInfo tenant; + + /** + * Get unique identifier representing a channel. + * @return Unique identifier representing a channel. + */ + public String getTeamsChannelId() { + return teamsChannelId; + } + + /** + * Set unique identifier representing a channel. + * @param withTeamsChannelId Unique identifier representing a channel. + */ + public void setTeamsChannelId(String withTeamsChannelId) { + this.teamsChannelId = withTeamsChannelId; + } + + /** + * Get unique identifier representing a team. + * @return Unique identifier representing a team. + */ + public String getTeamsTeamId() { + return teamsTeamId; + } + /** + * Set unique identifier representing a team. + * @param withTeamsTeamId Unique identifier representing a team. + */ + public void setTeamsTeamId(String withTeamsTeamId) { + this.teamsTeamId = withTeamsTeamId; + } + + /** + * Gets information about the channel in which the message was + * sent. + * + * @return information about the channel in which the message was + * sent. + */ + public ChannelInfo getChannel() { + return channel; + } + + /** + * Sets information about the channel in which the message was + * sent. + * + * @param withChannel information about the channel in which the message was + * sent. + */ + public void setChannel(ChannelInfo withChannel) { + this.channel = withChannel; + } + + /** + * Gets type of event. + * + * @return type of event. + */ + public String getEventType() { + return eventType; + } + + /** + * Sets type of event. + * + * @param withEventType type of event. + */ + public void setEventType(String withEventType) { + this.eventType = withEventType; + } + + /** + * Gets information about the team in which the message was + * sent. + * + * @return information about the team in which the message was + * sent. + */ + public TeamInfo getTeam() { + return team; + } + + /** + * Sets information about the team in which the message was + * sent. + * + * @param withTeam information about the team in which the message was + * sent. + */ + public void setTeam(TeamInfo withTeam) { + this.team = withTeam; + } + + /** + * Gets notification settings for the message. + * + * @return notification settings for the message. + */ + public NotificationInfo getNotification() { + return notification; + } + + /** + * Sets notification settings for the message. + * + * @param withNotification settings for the message. + */ + public void setNotification(NotificationInfo withNotification) { + this.notification = withNotification; + } + + /** + * Gets information about the tenant in which the message was. + * @return information about the tenant in which the message was. + */ + public TenantInfo getTenant() { + return tenant; + } + + /** + * Sets information about the tenant in which the message was. + * @param withTenant information about the tenant in which the message was. + */ + public void setTenant(TenantInfo withTenant) { + this.tenant = withTenant; + } + + /** + * A new instance of TeamChannelData. + * @param withTeamsChannelId the channelId in Teams + * @param withTeamsTeamId the teamId in Teams + * @param withChannel information about the channel in which the message was sent. + * @param withEventType type of event. + * @param withTeam information about the team in which the message was + * sent. + * @param withNotification Notification settings for the message. + * @param withTenant Information about the tenant in which the message was. + */ + public TeamChannelData(String withTeamsChannelId, + String withTeamsTeamId, + ChannelInfo withChannel, + String withEventType, + TeamInfo withTeam, + NotificationInfo withNotification, + TenantInfo withTenant) { + this.teamsChannelId = withTeamsChannelId; + this.teamsTeamId = withTeamsTeamId; + this.channel = withChannel; + this.eventType = withEventType; + this.team = withTeam; + this.notification = withNotification; + this.tenant = withTenant; + } + +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java new file mode 100644 index 000000000..415ff0fff --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java @@ -0,0 +1,89 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a team. +*/ +public class TeamInfo { + /** + * Unique identifier representing a team. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Name of a team. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Azure Active Directory (AAD) Group Id for the team. + * + * We don't see this C#, but Teams + * definitely sends this to the bot. + */ + @JsonProperty(value = "aadGroupId") + private String aadGroupId; + + /** + * Get unique identifier representing a team. + * @return Unique identifier representing a team. + */ + public String getId() { + return id; + } + + /** + * Set unique identifier representing a team. + * @param withId unique identifier representing a team. + */ + public void setId(String withId) { + id = withId; + } + + /** + * Get the name of the team. + * @return get the name of the team. + */ + public String getName() { + return name; + } + + /** + * Set the name of the team. + * @param withName name of the team. + */ + public void setName(String withName) { + name = withName; + } + + /** + * Get Azure Active Directory (AAD) Group Id for the team. + * @return Azure Active Directory (AAD) Group Id for the team. + */ + public String getAadGroupId() { + return aadGroupId; + } + + /** + * Set Azure Active Directory (AAD) Group Id for the team. + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public void setAadGroupId(String withAadGroupId) { + this.aadGroupId = withAadGroupId; + } + + /** + * A new instance of TeamInfo. + * @param withId unique identifier representing a team. + * @param withName Set the name of the team. + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public TeamInfo(String withId, String withName, String withAadGroupId) { + this.id = withId; + this.name = withName; + this.aadGroupId = withAadGroupId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java new file mode 100644 index 000000000..0b7f201e9 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java @@ -0,0 +1,38 @@ +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a tenant. +*/ +public class TenantInfo { + /** + * Unique identifier representing a tenant. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get Unique identifier representing a tenant. + * @return Unique identifier representing a tenant. + */ + public String getId() { + return id; + } + + /** + * Set Unique identifier representing a tenant. + * @param withId Unique identifier representing a tenant. + */ + public void setId(String withId) { + this.id = withId; + } + + /** + * Set Unique identifier representing a tenant. + * @param withId Unique identifier representing a tenant. + */ + public TenantInfo(String withId) { + this.id = withId; + } +} \ No newline at end of file diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java new file mode 100644 index 000000000..86bf40c5c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/package-info.java @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +/** + * This package contains the models classes for bot-schema. + */ +package com.microsoft.bot.schema.teams; From 9b5ad39e52e46b3b60bab776a96c13c6c7846262 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Tue, 25 Feb 2020 23:55:55 +0100 Subject: [PATCH 2/6] add default constructor and finish the test --- .../bot/schema/teams/ChannelInfo.java | 6 ++ .../bot/schema/teams/NotificationInfo.java | 6 ++ .../bot/schema/teams/TeamChannelData.java | 6 ++ .../microsoft/bot/schema/teams/TeamInfo.java | 6 ++ .../bot/schema/teams/TenantInfo.java | 8 +- .../microsoft/bot/schema/ActivityTest.java | 73 +++++++++++++++++++ 6 files changed, 104 insertions(+), 1 deletion(-) diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java index 8b57cbf2c..61b463f0c 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java @@ -57,4 +57,10 @@ public ChannelInfo(String withId, String withName) { this.id = withId; this.name = withName; } + + /** + * Initializes a new instance of the ChannelInfo class. + */ + public ChannelInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java index 1059498cb..3b05aefe1 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java @@ -34,4 +34,10 @@ public void setAlert(Boolean withAlert) { public NotificationInfo(Boolean withAlert) { alert = withAlert; } + + /** + * A new instance of NotificationInfo. + */ + public NotificationInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java index eb3e4bf2d..39a75615a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java @@ -188,4 +188,10 @@ public TeamChannelData(String withTeamsChannelId, this.tenant = withTenant; } + /** + * A new instance of TeamChannelData. + */ + public TeamChannelData() { + } + } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java index 415ff0fff..f23d01a19 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java @@ -86,4 +86,10 @@ public TeamInfo(String withId, String withName, String withAadGroupId) { this.name = withName; this.aadGroupId = withAadGroupId; } + + /** + * A new instance of TeamInfo. + */ + public TeamInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java index 0b7f201e9..f985f67dd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java @@ -29,10 +29,16 @@ public void setId(String withId) { } /** - * Set Unique identifier representing a tenant. + * New instance of TenantInfo. * @param withId Unique identifier representing a tenant. */ public TenantInfo(String withId) { this.id = withId; } + + /** + * New instance of TenantInfo. + */ + public TenantInfo() { + } } \ No newline at end of file diff --git a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java index 5487aaa8f..4f9b273f1 100644 --- a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java +++ b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java @@ -3,6 +3,8 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.microsoft.bot.schema.teams.TeamChannelData; + import org.junit.Assert; import org.junit.Test; @@ -196,4 +198,75 @@ public void DeserializeActivity() throws IOException { Assert.assertNotNull(activity.getValue()); } + private static final String serializedActivityFromTeams = "{" + + " \"channelData\": {" + + " \"teamsChannelId\": \"19:123cb42aa5a0a7e56f83@thread.skype\"," + + " \"teamsTeamId\": \"19:104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"channel\": {" + + " \"id\": \"19:4104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"name\": \"General\" " + + " }," + + " \"team\": {" + + " \"id\": \"19:aab4104f2cb42aa5a0a7e56f83@thread.skype\"," + + " \"name\": \"Kahoot\", " + + " \"aadGroupId\": \"0ac65971-e8a0-49a1-8d41-26089125ea30\"" + + " }," + + " \"notification\": {" + + " \"alert\": \"true\"" + + " }," + + " \"eventType\":\"teamMemberAdded\", " + + " \"tenant\": {" + + " \"id\": \"0-b827-4bb0-9df1-e02faba7ac20\"" + + " }" + + " }" + + "}"; + + private static final String serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId = "{" + + " \"channelData\": {" + + " \"channel\": {" + + " \"id\": \"channel_id\"," + + " \"name\": \"channel_name\" " + + " }," + + " \"team\": {" + + " \"id\": \"team_id\"," + + " \"name\": \"team_name\", " + + " \"aadGroupId\": \"aad_groupid\"" + + " }," + + " \"notification\": {" + + " \"alert\": \"true\"" + + " }," + + " \"eventType\":\"teamMemberAdded\", " + + " \"tenant\": {" + + " \"id\": \"tenant_id\"" + + " }" + + " }" + + "}"; + + + + @Test + public void GetInformationForMicrosoftTeams() throws JsonProcessingException, IOException { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.findAndRegisterModules(); + Activity activity = objectMapper.readValue(ActivityTest.serializedActivityFromTeams, Activity.class); + Assert.assertEquals("19:123cb42aa5a0a7e56f83@thread.skype", activity.teamsGetChannelId()); + Assert.assertEquals("19:104f2cb42aa5a0a7e56f83@thread.skype", activity.teamsGetTeamId()); + + activity = objectMapper.readValue( + ActivityTest.serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId, Activity.class); + + Assert.assertEquals("channel_id", activity.teamsGetChannelId()); + Assert.assertEquals("team_id", activity.teamsGetTeamId()); + + TeamChannelData teamsChannelData = activity.getChannelData(TeamChannelData.class); + Assert.assertEquals("channel_id", teamsChannelData.getChannel().getId()); + Assert.assertEquals("channel_name", teamsChannelData.getChannel().getName()); + Assert.assertEquals("team_id", teamsChannelData.getTeam().getId()); + Assert.assertEquals("team_name", teamsChannelData.getTeam().getName()); + Assert.assertEquals("aad_groupid", teamsChannelData.getTeam().getAadGroupId()); + Assert.assertEquals(true, teamsChannelData.getNotification().getAlert()); + Assert.assertEquals("teamMemberAdded", teamsChannelData.getEventType()); + Assert.assertEquals("tenant_id", teamsChannelData.getTenant().getId()); + } + } From 588e37be0b0212eedda8cdb462485ad83f897e93 Mon Sep 17 00:00:00 2001 From: fredrikl Date: Wed, 26 Feb 2020 00:03:03 +0100 Subject: [PATCH 3/6] add test for "isTeamsActivity" too --- .../src/test/java/com/microsoft/bot/schema/ActivityTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java index 4f9b273f1..99f2be722 100644 --- a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java +++ b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java @@ -199,6 +199,7 @@ public void DeserializeActivity() throws IOException { } private static final String serializedActivityFromTeams = "{" + + " \"channelId\": \"msteams\"," + " \"channelData\": {" + " \"teamsChannelId\": \"19:123cb42aa5a0a7e56f83@thread.skype\"," + " \"teamsTeamId\": \"19:104f2cb42aa5a0a7e56f83@thread.skype\"," + @@ -222,6 +223,7 @@ public void DeserializeActivity() throws IOException { "}"; private static final String serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId = "{" + + " \"channelId\": \"msteams\"," + " \"channelData\": {" + " \"channel\": {" + " \"id\": \"channel_id\"," + @@ -251,6 +253,7 @@ public void GetInformationForMicrosoftTeams() throws JsonProcessingException, IO Activity activity = objectMapper.readValue(ActivityTest.serializedActivityFromTeams, Activity.class); Assert.assertEquals("19:123cb42aa5a0a7e56f83@thread.skype", activity.teamsGetChannelId()); Assert.assertEquals("19:104f2cb42aa5a0a7e56f83@thread.skype", activity.teamsGetTeamId()); + Assert.assertEquals(true, activity.isTeamsActivity()); activity = objectMapper.readValue( ActivityTest.serializedActivityFromTeamsWithoutTeamsChannelIdorTeamId, Activity.class); From 0e0ec7dda6029f18ad50533e83a218e86a238b15 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Mon, 23 Mar 2020 09:34:26 -0500 Subject: [PATCH 4/6] Teams schema classes --- .../com/microsoft/bot/schema/ActionTypes.java | 7 +- .../com/microsoft/bot/schema/Activity.java | 8 +- .../bot/schema/teams/AppBasedLinkQuery.java | 23 ++ .../schema/teams/AttachmentExtensions.java | 23 ++ .../bot/schema/teams/ChannelInfo.java | 108 ++++----- .../bot/schema/teams/FileConsentCard.java | 57 +++++ .../schema/teams/FileConsentCardResponse.java | 41 ++++ .../bot/schema/teams/FileDownloadInfo.java | 57 +++++ .../bot/schema/teams/FileInfoCard.java | 46 ++++ .../bot/schema/teams/FileUploadInfo.java | 63 ++++++ .../schema/teams/MessageActionsPayload.java | 186 ++++++++++++++++ .../teams/MessageActionsPayloadApp.java | 41 ++++ .../MessageActionsPayloadAttachment.java | 74 +++++++ .../teams/MessageActionsPayloadBody.java | 30 +++ .../MessageActionsPayloadConversation.java | 41 ++++ .../teams/MessageActionsPayloadFrom.java | 41 ++++ .../teams/MessageActionsPayloadMention.java | 41 ++++ .../teams/MessageActionsPayloadReaction.java | 41 ++++ .../teams/MessageActionsPayloadUser.java | 41 ++++ .../teams/MessagingExtensionAction.java | 66 ++++++ .../MessagingExtensionActionResponse.java | 30 +++ .../teams/MessagingExtensionAttachment.java | 20 ++ .../teams/MessagingExtensionParameter.java | 30 +++ .../schema/teams/MessagingExtensionQuery.java | 54 +++++ .../teams/MessagingExtensionQueryOptions.java | 30 +++ .../teams/MessagingExtensionResponse.java | 19 ++ .../teams/MessagingExtensionResult.java | 77 +++++++ .../MessagingExtensionSuggestedAction.java | 22 ++ .../bot/schema/teams/NotificationInfo.java | 69 +++--- .../bot/schema/teams/O365ConnectorCard.java | 81 +++++++ .../teams/O365ConnectorCardActionBase.java | 41 ++++ .../teams/O365ConnectorCardActionCard.java | 37 ++++ .../teams/O365ConnectorCardActionQuery.java | 30 +++ .../teams/O365ConnectorCardDateInput.java | 24 ++ .../schema/teams/O365ConnectorCardFact.java | 30 +++ .../teams/O365ConnectorCardHttpPOST.java | 24 ++ .../schema/teams/O365ConnectorCardImage.java | 30 +++ .../teams/O365ConnectorCardInputBase.java | 63 ++++++ .../O365ConnectorCardMultichoiceInput.java | 48 ++++ ...65ConnectorCardMultichoiceInputChoice.java | 30 +++ .../teams/O365ConnectorCardOpenUri.java | 26 +++ .../teams/O365ConnectorCardOpenUriTarget.java | 30 +++ .../teams/O365ConnectorCardSection.java | 131 +++++++++++ .../teams/O365ConnectorCardTextInput.java | 35 +++ .../teams/O365ConnectorCardViewAction.java | 26 +++ .../teams/SigninStateVerificationQuery.java | 19 ++ .../bot/schema/teams/TaskModuleAction.java | 29 +++ .../teams/TaskModuleContinueResponse.java | 19 ++ .../teams/TaskModuleMessageResponse.java | 19 ++ .../bot/schema/teams/TaskModuleRequest.java | 30 +++ .../teams/TaskModuleRequestContext.java | 19 ++ .../bot/schema/teams/TaskModuleResponse.java | 19 ++ .../schema/teams/TaskModuleResponseBase.java | 19 ++ .../bot/schema/teams/TaskModuleTaskInfo.java | 86 ++++++++ .../bot/schema/teams/TeamChannelData.java | 197 ----------------- .../bot/schema/teams/TeamDetails.java | 63 ++++++ .../microsoft/bot/schema/teams/TeamInfo.java | 164 +++++++------- .../bot/schema/teams/TeamsChannelAccount.java | 63 ++++++ .../bot/schema/teams/TeamsChannelData.java | 208 ++++++++++++++++++ .../schema/teams/TeamsPagedMembersResult.java | 32 +++ .../bot/schema/teams/TenantInfo.java | 72 +++--- .../microsoft/bot/schema/ActivityTest.java | 4 +- 62 files changed, 2739 insertions(+), 395 deletions(-) create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java delete mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelData.java create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java index 71e3871f6..b39f92f2f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java @@ -58,7 +58,12 @@ public enum ActionTypes { /** * Enum value messageBack. */ - MESSAGE_BACK("messageBack"); + MESSAGE_BACK("messageBack"), + + /** + * Enum value invoke + */ + INVOKE("invoke"); /** * The actual serialized value for a ActionTypes instance. diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java index 4603e2e05..d64ecade0 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/Activity.java @@ -3,7 +3,7 @@ package com.microsoft.bot.schema; -import com.microsoft.bot.schema.teams.TeamChannelData; +import com.microsoft.bot.schema.teams.TeamsChannelData; import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; @@ -1522,7 +1522,7 @@ public boolean isTeamsActivity() { * @return Unique identifier representing a channel */ public String teamsGetChannelId() throws JsonProcessingException { - TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + TeamsChannelData teamsChannelData = getChannelData(TeamsChannelData.class); String teamsChannelId = teamsChannelData.getTeamsChannelId(); if (teamsChannelId == null && teamsChannelData.getChannel() != null) { teamsChannelId = teamsChannelData.getChannel().getId(); @@ -1538,7 +1538,7 @@ public String teamsGetChannelId() throws JsonProcessingException { * @return Unique identifier representing a team. */ public String teamsGetTeamId() throws JsonProcessingException { - TeamChannelData teamsChannelData = getChannelData(TeamChannelData.class); + TeamsChannelData teamsChannelData = getChannelData(TeamsChannelData.class); String teamId = teamsChannelData.getTeamsTeamId(); if (teamId == null && teamsChannelData.getTeam() != null) { teamId = teamsChannelData.getTeam().getId(); @@ -1546,4 +1546,4 @@ public String teamsGetTeamId() throws JsonProcessingException { return teamId; } -} \ No newline at end of file +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java new file mode 100644 index 000000000..3d914ec1c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AppBasedLinkQuery { + @JsonProperty(value = "url") + private String url; + + public AppBasedLinkQuery(String withUrl) { + url = withUrl; + } + + public String getUrl() { + return url; + } + + public void setUrl(String withUrl) { + url = withUrl; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java new file mode 100644 index 000000000..b21ad04b9 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.microsoft.bot.schema.Attachment; + +public class AttachmentExtensions { + public static MessagingExtensionAttachment toMessagingExtensionAttachment( + Attachment attachment, + Attachment previewAttachment) { + + MessagingExtensionAttachment messagingAttachment = new MessagingExtensionAttachment(); + messagingAttachment.setContent(attachment.getContent()); + messagingAttachment.setContentType(attachment.getContentType()); + messagingAttachment.setContentUrl(attachment.getContentUrl()); + messagingAttachment.setName(attachment.getName()); + messagingAttachment.setThumbnailUrl(attachment.getThumbnailUrl()); + messagingAttachment.setPreview(previewAttachment == null ? Attachment.clone(attachment) : previewAttachment); + + return messagingAttachment; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java index 61b463f0c..c8bbc97c8 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ChannelInfo.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.bot.schema.teams; import com.fasterxml.jackson.annotation.JsonProperty; @@ -5,62 +8,67 @@ /** * A channel info object which describes the channel. -*/ + */ public class ChannelInfo { - @JsonProperty(value = "id") - private String id; + @JsonProperty(value = "id") + private String id; - /** - * name of the channel. - */ - @JsonProperty(value = "name") - private String name; + /** + * name of the channel. + */ + @JsonProperty(value = "name") + private String name; - /** - * Get the unique identifier representing a channel. - * @return the unique identifier representing a channel. - */ - public final String getId() { - return id; - } + /** + * Get the unique identifier representing a channel. + * + * @return the unique identifier representing a channel. + */ + public final String getId() { + return id; + } - /** - * Set unique identifier representing a channel. - * @param withId the unique identifier representing a channel. - */ - public void setId(String withId) { - this.id = withId; - } + /** + * Set unique identifier representing a channel. + * + * @param withId the unique identifier representing a channel. + */ + public void setId(String withId) { + this.id = withId; + } - /** - * Get the name of the channel. - * @return name of the channel. - */ - public String getName() { - return name; - } + /** + * Get the name of the channel. + * + * @return name of the channel. + */ + public String getName() { + return name; + } - /** - * Sets name of the channel. - * @param withName the name of the channel. - */ - public void setName(String withName) { - this.name = withName; - } + /** + * Sets name of the channel. + * + * @param withName the name of the channel. + */ + public void setName(String withName) { + this.name = withName; + } - /** - * Initializes a new instance of the ChannelInfo class. - * @param withId identifier representing a channel. - * @param withName Name of the channel. - */ - public ChannelInfo(String withId, String withName) { - this.id = withId; - this.name = withName; - } + /** + * Initializes a new instance of the ChannelInfo class. + * + * @param withId identifier representing a channel. + * @param withName Name of the channel. + */ + public ChannelInfo(String withId, String withName) { + this.id = withId; + this.name = withName; + } - /** - * Initializes a new instance of the ChannelInfo class. - */ - public ChannelInfo() { - } + /** + * Initializes a new instance of the ChannelInfo class. + */ + public ChannelInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java new file mode 100644 index 000000000..4018293d9 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FileConsentCard { + /** + * Content type to be used in the type property. + */ + public static final String CONTENT_TYPE = "application/vnd.microsoft.teams.card.file.consent"; + + @JsonProperty(value = "description") + private String description; + + @JsonProperty(value = "sizeInBytes") + private long sizeInBytes; + + @JsonProperty(value = "acceptContext") + private Object acceptContext; + + @JsonProperty(value = "declineContext") + private Object declineContext; + + public String getDescription() { + return description; + } + + public void setDescription(String withDescription) { + description = withDescription; + } + + public long getSizeInBytes() { + return sizeInBytes; + } + + public void setSizeInBytes(long withSizeInBytes) { + sizeInBytes = withSizeInBytes; + } + + public Object getAcceptContext() { + return acceptContext; + } + + public void setAcceptContext(Object acceptContext) { + acceptContext = acceptContext; + } + + public Object getDeclineContext() { + return declineContext; + } + + public void setDeclineContext(Object withDeclineContext) { + declineContext = withDeclineContext; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java new file mode 100644 index 000000000..71b4d542b --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FileConsentCardResponse { + @JsonProperty(value = "action") + private String action; + + @JsonProperty(value = "context") + private Object context; + + @JsonProperty(value = "uploadInfo") + private FileUploadInfo uploadInfo; + + public String getAction() { + return action; + } + + public void setAction(String withAction) { + action = withAction; + } + + public Object getContext() { + return context; + } + + public void setContext(Object withContext) { + context = withContext; + } + + public FileUploadInfo getUploadInfo() { + return uploadInfo; + } + + public void setUploadInfo(FileUploadInfo withUploadInfo) { + uploadInfo = withUploadInfo; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java new file mode 100644 index 000000000..acd2ab003 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FileDownloadInfo { + /** + * Content type to be used in the type property. + */ + public static final String CONTENT_TYPE = "application/vnd.microsoft.teams.file.download.info"; + + @JsonProperty(value = "downloadUrl") + private String downloadUrl; + + @JsonProperty(value = "uniqueId") + private String uniqueId; + + @JsonProperty(value = "fileType") + private String fileType; + + @JsonProperty(value = "etag") + private Object etag; + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String withDownloadUrl) { + downloadUrl = withDownloadUrl; + } + + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String withUniqueId) { + uniqueId = withUniqueId; + } + + public String getFileType() { + return fileType; + } + + public void setFileType(String withFileType) { + fileType = withFileType; + } + + public Object getEtag() { + return etag; + } + + public void setEtag(Object withEtag) { + etag = withEtag; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java new file mode 100644 index 000000000..91c5f55d0 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FileInfoCard { + /** + * Content type to be used in the type property. + */ + public static final String CONTENT_TYPE = "application/vnd.microsoft.teams.card.file.info"; + + @JsonProperty(value = "uniqueId") + private String uniqueId; + + @JsonProperty(value = "fileType") + private String fileType; + + @JsonProperty(value = "etag") + private Object etag; + + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String withUniqueId) { + uniqueId = withUniqueId; + } + + public String getFileType() { + return fileType; + } + + public void setFileType(String withFileType) { + fileType = withFileType; + } + + public Object getEtag() { + return etag; + } + + public void setEtag(Object withEtag) { + etag = withEtag; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java new file mode 100644 index 000000000..c88883434 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FileUploadInfo { + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + @JsonProperty(value = "contentUrl") + private String contentUrl; + + @JsonProperty(value = "uniqueId") + private String uniqueId; + + @JsonProperty(value = "fileType") + private String fileType; + + public String getName() { + return name; + } + + public void setName(String withName) { + name = withName; + } + + public String getUploadUrl() { + return uploadUrl; + } + + public void setUploadUrl(String withUploadUrl) { + uploadUrl = withUploadUrl; + } + + public String getContentUrl() { + return contentUrl; + } + + public void setContentUrl(String withContentUrl) { + contentUrl = withContentUrl; + } + + public String getUniqueId() { + return uniqueId; + } + + public void setUniqueId(String withUniqueId) { + uniqueId = withUniqueId; + } + + public String getFileType() { + return fileType; + } + + public void setFileType(String withFileType) { + fileType = withFileType; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java new file mode 100644 index 000000000..7edab0a70 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class MessageActionsPayload { + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "replyToId") + private String replyToId; + + @JsonProperty(value = "messageType") + private String messageType; + + @JsonProperty(value = "createdDateTime") + private String createdDateTime; + + @JsonProperty(value = "lastModifiedDateTime") + private String lastModifiedDateTime; + + @JsonProperty(value = "deleted") + private Boolean deleted; + + @JsonProperty(value = "subject") + private String subject; + + @JsonProperty(value = "summary") + private String summary; + + @JsonProperty(value = "importance") + private String importance; + + @JsonProperty(value = "locale") + private String locale; + + @JsonProperty(value = "from") + private MessageActionsPayloadFrom from; + + @JsonProperty(value = "body") + private MessageActionsPayloadBody body; + + @JsonProperty(value = "attachmentLayout") + private String attachmentLayout; + + @JsonProperty(value = "attachments") + private List attachments; + + @JsonProperty(value = "mentions") + private List mentions; + + @JsonProperty(value = "reactions") + private List reactions; + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } + + public String getReplyToId() { + return replyToId; + } + + public void setReplyToId(String withReplyToId) { + replyToId = withReplyToId; + } + + public String getMessageType() { + return messageType; + } + + public void setMessageType(String withMessageType) { + messageType = withMessageType; + } + + public String getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(String withCreatedDateTime) { + createdDateTime = withCreatedDateTime; + } + + public String getLastModifiedDateTime() { + return lastModifiedDateTime; + } + + public void setLastModifiedDateTime(String withLastModifiedDateTime) { + lastModifiedDateTime = withLastModifiedDateTime; + } + + public Boolean getDeleted() { + return deleted; + } + + public void setDeleted(Boolean withDeleted) { + deleted = withDeleted; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String withSubject) { + subject = withSubject; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String withSummary) { + summary = withSummary; + } + + public String getImportance() { + return importance; + } + + public void setImportance(String withImportance) { + importance = withImportance; + } + + public String getLocale() { + return locale; + } + + public void setLocale(String withLocale) { + locale = withLocale; + } + + public MessageActionsPayloadFrom getFrom() { + return from; + } + + public void setFrom(MessageActionsPayloadFrom withFrom) { + from = withFrom; + } + + public MessageActionsPayloadBody getBody() { + return body; + } + + public void setBody(MessageActionsPayloadBody withBody) { + body = withBody; + } + + public String getAttachmentLayout() { + return attachmentLayout; + } + + public void setAttachmentLayout(String withAttachmentLayout) { + attachmentLayout = withAttachmentLayout; + } + + public List getAttachments() { + return attachments; + } + + public void setAttachments(List withAttachments) { + attachments = withAttachments; + } + + public List getMentions() { + return mentions; + } + + public void setMentions(List withMentions) { + mentions = withMentions; + } + + public List getReactions() { + return reactions; + } + + public void setReactions(List withReactions) { + reactions = withReactions; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java new file mode 100644 index 000000000..3ca50f8bd --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadApp { + @JsonProperty(value = "applicationIdentityType") + private String applicationIdentityType; + + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "displayName") + private String displayName; + + public String getApplicationIdentityType() { + return applicationIdentityType; + } + + public void setApplicationIdentityType(String withApplicationIdentityType) { + applicationIdentityType = withApplicationIdentityType; + } + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String withDisplayName) { + displayName = withDisplayName; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java new file mode 100644 index 000000000..b35ee6a38 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadAttachment { + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "contentType") + private String contentType; + + @JsonProperty(value = "contentUrl") + private String contentUrl; + + @JsonProperty(value = "content") + public Object content; + + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "thumbnailUrl") + private String thumbnailUrl; + + public String getId() { + return id; + } + + public void setId(String withId) { + id = id; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String withContentType) { + contentType = withContentType; + } + + public String getContentUrl() { + return contentUrl; + } + + public void setContentUrl(String withContentUrl) { + contentUrl = withContentUrl; + } + + public Object getContent() { + return content; + } + + public void setContent(Object withContent) { + content = withContent; + } + + public String getName() { + return name; + } + + public void setName(String withName) { + name = withName; + } + + public String getThumbnailUrl() { + return thumbnailUrl; + } + + public void setThumbnailUrl(String withThumbnailUrl) { + thumbnailUrl = withThumbnailUrl; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java new file mode 100644 index 000000000..8a7845f3e --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadBody { + @JsonProperty(value = "contentType") + private String contentType; + + @JsonProperty(value = "content") + private String content; + + public String getContentType() { + return contentType; + } + + public void setContentType(String withContentType) { + contentType = withContentType; + } + + public String getContent() { + return content; + } + + public void setContent(String withContent) { + content = withContent; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java new file mode 100644 index 000000000..6ec9a15a5 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadConversation { + @JsonProperty(value = "conversationIdentityType") + private String conversationIdentityType; + + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "displayName") + private String displayName; + + public String getConversationIdentityType() { + return conversationIdentityType; + } + + public void setConversationIdentityType(String withConversationIdentityType) { + conversationIdentityType = withConversationIdentityType; + } + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String withDisplayName) { + displayName = withDisplayName; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java new file mode 100644 index 000000000..83b07f719 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadFrom { + @JsonProperty(value = "user") + public MessageActionsPayloadUser user; + + @JsonProperty(value = "application") + public MessageActionsPayloadApp application; + + @JsonProperty(value = "conversation") + public MessageActionsPayloadConversation conversation; + + public MessageActionsPayloadUser getUser() { + return user; + } + + public void setUser(MessageActionsPayloadUser withUser) { + user = withUser; + } + + public MessageActionsPayloadApp getApplication() { + return application; + } + + public void setApplication(MessageActionsPayloadApp withApplication) { + application = withApplication; + } + + public MessageActionsPayloadConversation getConversation() { + return conversation; + } + + public void setConversation(MessageActionsPayloadConversation withConversation) { + conversation = withConversation; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java new file mode 100644 index 000000000..58b004f6a --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadMention { + @JsonProperty(value = "id") + private int id; + + @JsonProperty(value = "mentionText") + private String mentionText; + + @JsonProperty(value = "mentioned") + private MessageActionsPayloadFrom mentioned; + + public int getId() { + return id; + } + + public void setId(int withId) { + id = withId; + } + + public String getMentionText() { + return mentionText; + } + + public void setMentionText(String withMentionText) { + mentionText = withMentionText; + } + + public MessageActionsPayloadFrom getMentioned() { + return mentioned; + } + + public void setMentioned(MessageActionsPayloadFrom withMentioned) { + mentioned = withMentioned; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java new file mode 100644 index 000000000..a520d1232 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadReaction { + @JsonProperty(value = "reactionType") + private String reactionType; + + @JsonProperty(value = "createdDateTime") + private String createdDateTime; + + @JsonProperty(value = "user") + private MessageActionsPayloadFrom user; + + public String getReactionType() { + return reactionType; + } + + public void setReactionType(String withReactionType) { + reactionType = withReactionType; + } + + public String getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(String withCreatedDateTime) { + createdDateTime = withCreatedDateTime; + } + + public MessageActionsPayloadFrom getUser() { + return user; + } + + public void setUser(MessageActionsPayloadFrom withUser) { + user = withUser; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java new file mode 100644 index 000000000..f02cd16a3 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessageActionsPayloadUser { + @JsonProperty(value = "userIdentityType") + private String userIdentityType; + + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "displayName") + private String displayName; + + public String getUserIdentityType() { + return userIdentityType; + } + + public void setUserIdentityType(String withUserIdentityType) { + userIdentityType = withUserIdentityType; + } + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String withDisplayName) { + displayName = withDisplayName; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java new file mode 100644 index 000000000..cbbd2c4fc --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.bot.schema.Activity; + +import java.util.List; + +public class MessagingExtensionAction extends TaskModuleRequest { + @JsonProperty(value = "commandId") + private String commandId; + + @JsonProperty(value = "commandContext") + private String commandContext; + + @JsonProperty(value = "botMessagePreviewAction") + private String botMessagePreviewAction; + + @JsonProperty(value = "botActivityPreview") + public List botActivityPreview; + + @JsonProperty(value = "messagePayload") + public MessageActionsPayload messagePayload; + + public String getCommandId() { + return commandId; + } + + public void setCommandId(String withCommandId) { + commandId = withCommandId; + } + + public String getCommandContext() { + return commandContext; + } + + public void setCommandContext(String withCommandContext) { + commandContext = withCommandContext; + } + + public String getBotMessagePreviewAction() { + return botMessagePreviewAction; + } + + public void setBotMessagePreviewAction(String withBotMessagePreviewAction) { + botMessagePreviewAction = withBotMessagePreviewAction; + } + + public List getBotActivityPreview() { + return botActivityPreview; + } + + public void setBotActivityPreview(List withBotActivityPreview) { + botActivityPreview = withBotActivityPreview; + } + + public MessageActionsPayload getMessagePayload() { + return messagePayload; + } + + public void setMessagePayload(MessageActionsPayload withMessagePayload) { + messagePayload = withMessagePayload; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java new file mode 100644 index 000000000..13f995475 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessagingExtensionActionResponse { + @JsonProperty(value = "task") + public TaskModuleResponseBase task; + + @JsonProperty(value = "composeExtension") + public MessagingExtensionResult composeExtension; + + public TaskModuleResponseBase getTask() { + return task; + } + + public void setTask(TaskModuleResponseBase withTask) { + task = withTask; + } + + public MessagingExtensionResult getComposeExtension() { + return composeExtension; + } + + public void setComposeExtension(MessagingExtensionResult withComposeExtension) { + composeExtension = withComposeExtension; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java new file mode 100644 index 000000000..a9eec9f05 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.bot.schema.Attachment; + +public class MessagingExtensionAttachment extends Attachment { + @JsonProperty(value = "preview") + public Attachment preview; + + public Attachment getPreview() { + return preview; + } + + public void setPreview(Attachment withPreview) { + preview = withPreview; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java new file mode 100644 index 000000000..7f7d6d9bc --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessagingExtensionParameter { + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "value") + private Object value; + + public String getName() { + return name; + } + + public void setName(String withName) { + name = withName; + } + + public Object getValue() { + return value; + } + + public void setValue(Object withValue) { + value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java new file mode 100644 index 000000000..01acc98f4 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class MessagingExtensionQuery { + @JsonProperty(value = "commandId") + private String commandId; + + @JsonProperty(value = "parameters") + public List parameters; + + @JsonProperty(value = "queryOptions") + private MessagingExtensionQueryOptions queryOptions; + + @JsonProperty(value = "state") + private String state; + + public String getCommandId() { + return commandId; + } + + public void setCommandId(String withCommandId) { + commandId = withCommandId; + } + + public List getParameters() { + return parameters; + } + + public void setParameters(List withParameters) { + parameters = withParameters; + } + + public MessagingExtensionQueryOptions getQueryOptions() { + return queryOptions; + } + + public void setQueryOptions(MessagingExtensionQueryOptions withQueryOptions) { + queryOptions = withQueryOptions; + } + + public String getState() { + return state; + } + + public void setState(String withState) { + state = withState; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java new file mode 100644 index 000000000..439eb5927 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessagingExtensionQueryOptions { + @JsonProperty(value = "skip") + private int skip; + + @JsonProperty(value = "count") + private int count; + + public int getSkip() { + return skip; + } + + public void setSkip(int withSkip) { + skip = withSkip; + } + + public int getCount() { + return count; + } + + public void setCount(int withCount) { + count = withCount; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java new file mode 100644 index 000000000..b6859de6e --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class MessagingExtensionResponse { + @JsonProperty(value = "composeExtension") + public MessagingExtensionResult composeExtension; + + public MessagingExtensionResult getComposeExtension() { + return composeExtension; + } + + public void setComposeExtension(MessagingExtensionResult withComposeExtension) { + composeExtension = withComposeExtension; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java new file mode 100644 index 000000000..a4576932f --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.bot.schema.Activity; + +import java.util.List; + +public class MessagingExtensionResult { + @JsonProperty(value = "attachmentLayout") + private String attachmentLayout; + + @JsonProperty(value = "type") + private String type; + + @JsonProperty(value = "attachments") + public List attachments; + + @JsonProperty(value = "suggestedActions") + public MessagingExtensionSuggestedAction suggestedActions; + + @JsonProperty(value = "text") + private String text; + + @JsonProperty(value = "activityPreview") + public Activity activityPreview; + + public String getAttachmentLayout() { + return attachmentLayout; + } + + public void setAttachmentLayout(String withAttachmentLayout) { + attachmentLayout = withAttachmentLayout; + } + + public String getType() { + return type; + } + + public void setType(String withType) { + type = withType; + } + + public List getAttachments() { + return attachments; + } + + public void setAttachments(List withAttachments) { + attachments = withAttachments; + } + + public MessagingExtensionSuggestedAction getSuggestedActions() { + return suggestedActions; + } + + public void setSuggestedActions(MessagingExtensionSuggestedAction withSuggestedActions) { + suggestedActions = withSuggestedActions; + } + + public String getText() { + return text; + } + + public void setText(String withText) { + text = withText; + } + + public Activity getActivityPreview() { + return activityPreview; + } + + public void setActivityPreview(Activity withActivityPreview) { + activityPreview = withActivityPreview; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java new file mode 100644 index 000000000..4368394b8 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.bot.schema.CardAction; + +import java.util.List; + +public class MessagingExtensionSuggestedAction { + @JsonProperty(value = "actions") + public List actions; + + public List getActions() { + return actions; + } + + public void setActions(List withActions) { + actions = withActions; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java index 3b05aefe1..2164f0c57 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/NotificationInfo.java @@ -1,43 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.bot.schema.teams; import com.fasterxml.jackson.annotation.JsonProperty; + /** * Specifies if a notification is to be sent for the mentions. */ public class NotificationInfo { - /** - * Gets or sets true if notification is to be sent to the user, false. - */ - @JsonProperty(value = "alert") - private Boolean alert; + /** + * Gets or sets true if notification is to be sent to the user, false. + */ + @JsonProperty(value = "alert") + private Boolean alert; - /** - * Getter for alert. - * @return return the alter value. - */ - public Boolean getAlert() { - return alert; - } + /** + * Getter for alert. + * + * @return return the alter value. + */ + public Boolean getAlert() { + return alert; + } - /** - * Setter for alert. - * @param withAlert the value to set. - */ - public void setAlert(Boolean withAlert) { - alert = withAlert; - } + /** + * Setter for alert. + * + * @param withAlert the value to set. + */ + public void setAlert(Boolean withAlert) { + alert = withAlert; + } - /** - * A new instance of NotificationInfo. - * @param withAlert alert value to set. - */ - public NotificationInfo(Boolean withAlert) { - alert = withAlert; - } + /** + * A new instance of NotificationInfo. + * + * @param withAlert alert value to set. + */ + public NotificationInfo(Boolean withAlert) { + alert = withAlert; + } - /** - * A new instance of NotificationInfo. - */ - public NotificationInfo() { - } + /** + * A new instance of NotificationInfo. + */ + public NotificationInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java new file mode 100644 index 000000000..ff6747072 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCard { + /** + * Content type to be used in the type property. + */ + public static final String CONTENT_TYPE = "application/vnd.microsoft.teams.card.o365connector"; + + @JsonProperty(value = "title") + private String title; + + @JsonProperty(value = "text") + private String text; + + @JsonProperty(value = "summary") + private String summary; + + @JsonProperty(value = "themeColor") + private String themeColor; + + @JsonProperty(value = "sections") + public List sections; + + @JsonProperty(value = "potentialAction") + public List potentialAction; + + public String getTitle() { + return title; + } + + public void setTitle(String withTitle) { + title = withTitle; + } + + public String getText() { + return text; + } + + public void setText(String withText) { + text = withText; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String withSummary) { + summary = withSummary; + } + + public String getThemeColor() { + return themeColor; + } + + public void setThemeColor(String withThemeColor) { + themeColor = withThemeColor; + } + + public List getSections() { + return sections; + } + + public void setSections(List withSections) { + sections = withSections; + } + + public List getPotentialAction() { + return potentialAction; + } + + public void setPotentialAction(List withPotentialAction) { + potentialAction = withPotentialAction; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java new file mode 100644 index 000000000..ecb3e4908 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardActionBase { + @JsonProperty(value = "@type") + private String type; + + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "@id") + private String id; + + public String getType() { + return type; + } + + public void setType(String withType) { + type = withType; + } + + public String getName() { + return name; + } + + public void setName(String withName) { + name = withName; + } + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java new file mode 100644 index 000000000..c87327f98 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCardActionCard extends O365ConnectorCardActionBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "ActionCard"; + + @JsonProperty(value = "inputs") + private List inputs; + + @JsonProperty(value = "actions") + private List actions; + + public List getInputs() { + return inputs; + } + + public void setInputs(List withInputs) { + inputs = withInputs; + } + + public List getActions() { + return actions; + } + + public void setActions(List withActions) { + actions = withActions; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java new file mode 100644 index 000000000..6e6708efc --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardActionQuery { + @JsonProperty(value = "body") + private String body; + + @JsonProperty(value = "actionId") + private String actionId; + + public String getBody() { + return body; + } + + public void setBody(String withBody) { + this.body = withBody; + } + + public String getActionId() { + return actionId; + } + + public void setActionId(String withActionId) { + this.actionId = withActionId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java new file mode 100644 index 000000000..8a24e2ff4 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardDateInput extends O365ConnectorCardInputBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "DateInput"; + + @JsonProperty(value = "includeTime") + private Boolean includeTime; + + public Boolean getIncludeTime() { + return includeTime; + } + + public void setIncludeTime(Boolean withIncludeTime) { + includeTime = withIncludeTime; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java new file mode 100644 index 000000000..44681ec6e --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardFact { + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "value") + private String value; + + public String getName() { + return name; + } + + public void setName(String withName) { + this.name = withName; + } + + public String getValue() { + return value; + } + + public void setValue(String withValue) { + this.value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java new file mode 100644 index 000000000..58a16307d --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardHttpPOST extends O365ConnectorCardActionBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "HttpPOST"; + + @JsonProperty(value = "body") + private String body; + + public String getBody() { + return body; + } + + public void setBody(String withBody) { + body = body; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java new file mode 100644 index 000000000..d75f6c0ec --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardImage { + @JsonProperty(value = "image") + private String image; + + @JsonProperty(value = "title") + private String title; + + public String getImage() { + return image; + } + + public void setImage(String withImage) { + image = withImage; + } + + public String getTitle() { + return title; + } + + public void setTitle(String withTitle) { + title = withTitle; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java new file mode 100644 index 000000000..cc5d549f1 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardInputBase { + @JsonProperty(value = "@type") + private String type; + + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "isRequired") + private Boolean isRequired; + + @JsonProperty(value = "title") + private String title; + + @JsonProperty(value = "value") + private String value; + + public String getType() { + return type; + } + + public void setType(String withType) { + type = withType; + } + + public String getId() { + return id; + } + + public void setId(String withId) { + id = withId; + } + + public Boolean getRequired() { + return isRequired; + } + + public void setRequired(Boolean withRequired) { + isRequired = withRequired; + } + + public String getTitle() { + return title; + } + + public void setTitle(String withTitle) { + title = withTitle; + } + + public String getValue() { + return value; + } + + public void setValue(String withValue) { + value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java new file mode 100644 index 000000000..6dddb284b --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCardMultichoiceInput { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "MultichoiceInput"; + + @JsonProperty(value = "choices") + private List choices; + + @JsonProperty(value = "style") + private String style; + + @JsonProperty(value = "isMultiSelect") + private Boolean isMultiSelect; + + public List getChoices() { + return choices; + } + + public void setChoices(List withChoices) { + choices = withChoices; + } + + public String getStyle() { + return style; + } + + public void setStyle(String withStyle) { + style = withStyle; + } + + public Boolean getMultiSelect() { + return isMultiSelect; + } + + public void setMultiSelect(Boolean withMultiSelect) { + isMultiSelect = withMultiSelect; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java new file mode 100644 index 000000000..5335ac37c --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardMultichoiceInputChoice { + @JsonProperty(value = "display") + private String display; + + @JsonProperty(value = "value") + private String value; + + public String getDisplay() { + return display; + } + + public void setDisplay(String withDisplay) { + display = withDisplay; + } + + public String getValue() { + return value; + } + + public void setValue(String withValue) { + value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java new file mode 100644 index 000000000..774f5a610 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCardOpenUri extends O365ConnectorCardActionBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "OpenUri"; + + @JsonProperty(value = "targets") + public List targets; + + public List getTargets() { + return targets; + } + + public void setTargets(List withTargets) { + targets = withTargets; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java new file mode 100644 index 000000000..acc8139b3 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardOpenUriTarget { + @JsonProperty(value = "os") + private String os; + + @JsonProperty(value = "uri") + private String uri; + + public String getOs() { + return os; + } + + public void setOs(String withOs) { + os = withOs; + } + + public String getUri() { + return uri; + } + + public void setUri(String withUri) { + uri = withUri; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java new file mode 100644 index 000000000..e16ed445f --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCardSection { + @JsonProperty(value = "title") + private String title; + + @JsonProperty(value = "text") + private String text; + + @JsonProperty(value = "activityTitle") + private String activityTitle; + + @JsonProperty(value = "activitySubtitle") + private String activitySubtitle; + + @JsonProperty(value = "activityText") + private String activityText; + + @JsonProperty(value = "activityImage") + private String activityImage; + + @JsonProperty(value = "activityImageType") + private String activityImageType; + + @JsonProperty(value = "markdown") + public Boolean markdown; + + @JsonProperty(value = "facts") + public List facts; + + @JsonProperty(value = "images") + public List images; + + @JsonProperty(value = "potentialAction") + public List potentialAction; + + public String getTitle() { + return title; + } + + public void setTitle(String withTitle) { + title = withTitle; + } + + public String getText() { + return text; + } + + public void setText(String withText) { + text = withText; + } + + public String getActivityTitle() { + return activityTitle; + } + + public void setActivityTitle(String withActivityTitle) { + activityTitle = withActivityTitle; + } + + public String getActivitySubtitle() { + return activitySubtitle; + } + + public void setActivitySubtitle(String withActivitySubtitle) { + activitySubtitle = withActivitySubtitle; + } + + public String getActivityText() { + return activityText; + } + + public void setActivityText(String withActivityText) { + activityText = withActivityText; + } + + public String getActivityImage() { + return activityImage; + } + + public void setActivityImage(String withActivityImage) { + activityImage = withActivityImage; + } + + public String getActivityImageType() { + return activityImageType; + } + + public void setActivityImageType(String withActivityImageType) { + activityImageType = withActivityImageType; + } + + public Boolean getMarkdown() { + return markdown; + } + + public void setMarkdown(Boolean withMarkdown) { + markdown = withMarkdown; + } + + public List getFacts() { + return facts; + } + + public void setFacts(List withFacts) { + facts = withFacts; + } + + public List getImages() { + return images; + } + + public void setImages(List withImages) { + images = withImages; + } + + public List getPotentialAction() { + return potentialAction; + } + + public void setPotentialAction(List withPotentialAction) { + potentialAction = withPotentialAction; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java new file mode 100644 index 000000000..804d4c960 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class O365ConnectorCardTextInput extends O365ConnectorCardInputBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "TextInput"; + + @JsonProperty(value = "isMultiline") + public Boolean isMultiline; + + @JsonProperty(value = "maxLength") + public double maxLength; + + public Boolean getMultiline() { + return isMultiline; + } + + public void setMultiline(Boolean withMultiline) { + isMultiline = withMultiline; + } + + public double getMaxLength() { + return maxLength; + } + + public void setMaxLength(double withMaxLength) { + maxLength = withMaxLength; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java new file mode 100644 index 000000000..3e45db4b3 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class O365ConnectorCardViewAction extends O365ConnectorCardActionBase { + /** + * Content type to be used in the type property. + */ + public static final String TYPE = "ViewAction"; + + @JsonProperty(value = "target") + public List target; + + public List getTarget() { + return target; + } + + public void setTarget(List withTarget) { + target = withTarget; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java new file mode 100644 index 000000000..369bc7da4 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SigninStateVerificationQuery { + @JsonProperty(value = "state") + private String state; + + public String getState() { + return state; + } + + public void setState(String withState) { + state = withState; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java new file mode 100644 index 000000000..db1b9ad06 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; +import com.microsoft.bot.schema.ActionTypes; +import com.microsoft.bot.schema.CardAction; + +public class TaskModuleAction extends CardAction { + public TaskModuleAction(String withTitle, Object withValue) { + super.setType(ActionTypes.INVOKE); + super.setTitle(withTitle); + + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.findAndRegisterModules(); + + ObjectNode data = objectMapper.valueToTree(withValue); + data.put("type", "task/fetch"); + + try { + super.setValue(objectMapper.writeValueAsString(data)); + } catch (JsonProcessingException e) { + // TODO log it + } + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java new file mode 100644 index 000000000..d6835db00 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleContinueResponse extends TaskModuleResponseBase { + @JsonProperty(value = "value") + private TaskModuleTaskInfo value; + + public TaskModuleTaskInfo getValue() { + return value; + } + + public void setValue(TaskModuleTaskInfo withValue) { + value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java new file mode 100644 index 000000000..1e6b4e858 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleMessageResponse extends TaskModuleResponseBase { + @JsonProperty(value = "value") + private TaskModuleTaskInfo value; + + public TaskModuleTaskInfo getValue() { + return value; + } + + public void setValue(TaskModuleTaskInfo withValue) { + value = withValue; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java new file mode 100644 index 000000000..d57c67e35 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleRequest { + @JsonProperty(value = "data") + private Object data; + + @JsonProperty(value = "context") + private TaskModuleRequestContext context; + + public Object getData() { + return data; + } + + public void setData(Object withData) { + data = withData; + } + + public TaskModuleRequestContext getContext() { + return context; + } + + public void setContext(TaskModuleRequestContext withContext) { + context = withContext; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java new file mode 100644 index 000000000..1381023d2 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleRequestContext { + @JsonProperty(value = "theme") + private String theme; + + public String getTheme() { + return theme; + } + + public void setTheme(String withTheme) { + theme = withTheme; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java new file mode 100644 index 000000000..25e23d3b3 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleResponse { + @JsonProperty(value = "task") + private String task; + + public String getTask() { + return task; + } + + public void setTask(String withTask) { + task = withTask; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java new file mode 100644 index 000000000..e4d672d7a --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TaskModuleResponseBase { + @JsonProperty(value = "type") + private String type; + + public String getType() { + return type; + } + + public void setType(String withType) { + type = withType; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java new file mode 100644 index 000000000..cf4cd78e1 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.bot.schema.Attachment; + +public class TaskModuleTaskInfo { + @JsonProperty(value = "title") + private String title; + + @JsonProperty(value = "height") + private Object height; + + @JsonProperty(value = "width") + private Object width; + + @JsonProperty(value = "url") + private String url; + + @JsonProperty(value = "card") + public Attachment card; + + @JsonProperty(value = "fallbackUrl") + private String fallbackUrl; + + @JsonProperty(value = "completionBotId") + private String completionBotId; + + public String getTitle() { + return title; + } + + public void setTitle(String withTitle) { + title = withTitle; + } + + public Object getHeight() { + return height; + } + + public void setHeight(Object withHeight) { + height = withHeight; + } + + public Object getWidth() { + return width; + } + + public void setWidth(Object withWidth) { + width = withWidth; + } + + public String getUrl() { + return url; + } + + public void setUrl(String withUrl) { + url = withUrl; + } + + public Attachment getCard() { + return card; + } + + public void setCard(Attachment withCard) { + card = withCard; + } + + public String getFallbackUrl() { + return fallbackUrl; + } + + public void setFallbackUrl(String withFallbackUrl) { + fallbackUrl = withFallbackUrl; + } + + public String getCompletionBotId() { + return completionBotId; + } + + public void setCompletionBotId(String withCompletionBotId) { + completionBotId = withCompletionBotId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java deleted file mode 100644 index 39a75615a..000000000 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamChannelData.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.microsoft.bot.schema.teams; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -/** - * Channel data specific to messages received in Microsoft Teams. - */ -public class TeamChannelData { - @JsonProperty(value = "teamsChannelId") - private String teamsChannelId; - - @JsonProperty(value = "teamsTeamId") - private String teamsTeamId; - - @JsonProperty(value = "channel") - private ChannelInfo channel; - - /// Gets or sets type of event. - @JsonProperty(value = "eventType") - private String eventType; - - /// Gets or sets information about the team in which the message was - /// sent - @JsonProperty(value = "team") - private TeamInfo team; - - /// Gets or sets notification settings for the message - @JsonProperty(value = "notification") - private NotificationInfo notification; - - /// Gets or sets information about the tenant in which the message was - /// sent - @JsonProperty(value = "tenant") - private TenantInfo tenant; - - /** - * Get unique identifier representing a channel. - * @return Unique identifier representing a channel. - */ - public String getTeamsChannelId() { - return teamsChannelId; - } - - /** - * Set unique identifier representing a channel. - * @param withTeamsChannelId Unique identifier representing a channel. - */ - public void setTeamsChannelId(String withTeamsChannelId) { - this.teamsChannelId = withTeamsChannelId; - } - - /** - * Get unique identifier representing a team. - * @return Unique identifier representing a team. - */ - public String getTeamsTeamId() { - return teamsTeamId; - } - /** - * Set unique identifier representing a team. - * @param withTeamsTeamId Unique identifier representing a team. - */ - public void setTeamsTeamId(String withTeamsTeamId) { - this.teamsTeamId = withTeamsTeamId; - } - - /** - * Gets information about the channel in which the message was - * sent. - * - * @return information about the channel in which the message was - * sent. - */ - public ChannelInfo getChannel() { - return channel; - } - - /** - * Sets information about the channel in which the message was - * sent. - * - * @param withChannel information about the channel in which the message was - * sent. - */ - public void setChannel(ChannelInfo withChannel) { - this.channel = withChannel; - } - - /** - * Gets type of event. - * - * @return type of event. - */ - public String getEventType() { - return eventType; - } - - /** - * Sets type of event. - * - * @param withEventType type of event. - */ - public void setEventType(String withEventType) { - this.eventType = withEventType; - } - - /** - * Gets information about the team in which the message was - * sent. - * - * @return information about the team in which the message was - * sent. - */ - public TeamInfo getTeam() { - return team; - } - - /** - * Sets information about the team in which the message was - * sent. - * - * @param withTeam information about the team in which the message was - * sent. - */ - public void setTeam(TeamInfo withTeam) { - this.team = withTeam; - } - - /** - * Gets notification settings for the message. - * - * @return notification settings for the message. - */ - public NotificationInfo getNotification() { - return notification; - } - - /** - * Sets notification settings for the message. - * - * @param withNotification settings for the message. - */ - public void setNotification(NotificationInfo withNotification) { - this.notification = withNotification; - } - - /** - * Gets information about the tenant in which the message was. - * @return information about the tenant in which the message was. - */ - public TenantInfo getTenant() { - return tenant; - } - - /** - * Sets information about the tenant in which the message was. - * @param withTenant information about the tenant in which the message was. - */ - public void setTenant(TenantInfo withTenant) { - this.tenant = withTenant; - } - - /** - * A new instance of TeamChannelData. - * @param withTeamsChannelId the channelId in Teams - * @param withTeamsTeamId the teamId in Teams - * @param withChannel information about the channel in which the message was sent. - * @param withEventType type of event. - * @param withTeam information about the team in which the message was - * sent. - * @param withNotification Notification settings for the message. - * @param withTenant Information about the tenant in which the message was. - */ - public TeamChannelData(String withTeamsChannelId, - String withTeamsTeamId, - ChannelInfo withChannel, - String withEventType, - TeamInfo withTeam, - NotificationInfo withNotification, - TenantInfo withTenant) { - this.teamsChannelId = withTeamsChannelId; - this.teamsTeamId = withTeamsTeamId; - this.channel = withChannel; - this.eventType = withEventType; - this.team = withTeam; - this.notification = withNotification; - this.tenant = withTenant; - } - - /** - * A new instance of TeamChannelData. - */ - public TeamChannelData() { - } - -} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java new file mode 100644 index 000000000..79bb84528 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TeamDetails { + @JsonProperty(value = "id") + private String id; + + @JsonProperty(value = "name") + private String name; + + @JsonProperty(value = "aadGroupId") + private String aadGroupId; + + @JsonProperty(value = "channelCount") + private int channelCount; + + @JsonProperty(value = "memberCount") + private int memberCount; + + public String getId() { + return id; + } + + public void setId(String withId) { + this.id = withId; + } + + public String getName() { + return name; + } + + public void setName(String withName) { + name = withName; + } + + public String getAadGroupId() { + return aadGroupId; + } + + public void setAadGroupId(String withAadGroupId) { + aadGroupId = withAadGroupId; + } + + public int getChannelCount() { + return channelCount; + } + + public void setChannelCount(int withChannelCount) { + channelCount = withChannelCount; + } + + public int getMemberCount() { + return memberCount; + } + + public void setMemberCount(int withMemberCount) { + memberCount = withMemberCount; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java index f23d01a19..852b40e94 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamInfo.java @@ -1,95 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.bot.schema.teams; import com.fasterxml.jackson.annotation.JsonProperty; /** * Describes a team. -*/ + */ public class TeamInfo { - /** - * Unique identifier representing a team. - */ - @JsonProperty(value = "id") - private String id; + /** + * Unique identifier representing a team. + */ + @JsonProperty(value = "id") + private String id; - /** - * Name of a team. - */ - @JsonProperty(value = "name") - private String name; + /** + * Name of a team. + */ + @JsonProperty(value = "name") + private String name; - /** - * Azure Active Directory (AAD) Group Id for the team. - * - * We don't see this C#, but Teams - * definitely sends this to the bot. - */ - @JsonProperty(value = "aadGroupId") - private String aadGroupId; + /** + * Azure Active Directory (AAD) Group Id for the team. + *

+ * We don't see this C#, but Teams + * definitely sends this to the bot. + */ + @JsonProperty(value = "aadGroupId") + private String aadGroupId; - /** - * Get unique identifier representing a team. - * @return Unique identifier representing a team. - */ - public String getId() { - return id; - } + /** + * Get unique identifier representing a team. + * + * @return Unique identifier representing a team. + */ + public String getId() { + return id; + } - /** - * Set unique identifier representing a team. - * @param withId unique identifier representing a team. - */ - public void setId(String withId) { - id = withId; - } + /** + * Set unique identifier representing a team. + * + * @param withId unique identifier representing a team. + */ + public void setId(String withId) { + id = withId; + } - /** - * Get the name of the team. - * @return get the name of the team. - */ - public String getName() { - return name; - } + /** + * Get the name of the team. + * + * @return get the name of the team. + */ + public String getName() { + return name; + } - /** - * Set the name of the team. - * @param withName name of the team. - */ - public void setName(String withName) { - name = withName; - } + /** + * Set the name of the team. + * + * @param withName name of the team. + */ + public void setName(String withName) { + name = withName; + } - /** - * Get Azure Active Directory (AAD) Group Id for the team. - * @return Azure Active Directory (AAD) Group Id for the team. - */ - public String getAadGroupId() { - return aadGroupId; - } + /** + * Get Azure Active Directory (AAD) Group Id for the team. + * + * @return Azure Active Directory (AAD) Group Id for the team. + */ + public String getAadGroupId() { + return aadGroupId; + } - /** - * Set Azure Active Directory (AAD) Group Id for the team. - * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team - */ - public void setAadGroupId(String withAadGroupId) { - this.aadGroupId = withAadGroupId; - } + /** + * Set Azure Active Directory (AAD) Group Id for the team. + * + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public void setAadGroupId(String withAadGroupId) { + this.aadGroupId = withAadGroupId; + } - /** - * A new instance of TeamInfo. - * @param withId unique identifier representing a team. - * @param withName Set the name of the team. - * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team - */ - public TeamInfo(String withId, String withName, String withAadGroupId) { - this.id = withId; - this.name = withName; - this.aadGroupId = withAadGroupId; - } + /** + * A new instance of TeamInfo. + * + * @param withId unique identifier representing a team. + * @param withName Set the name of the team. + * @param withAadGroupId Azure Active Directory (AAD) Group Id for the team + */ + public TeamInfo(String withId, String withName, String withAadGroupId) { + this.id = withId; + this.name = withName; + this.aadGroupId = withAadGroupId; + } - /** - * A new instance of TeamInfo. - */ - public TeamInfo() { - } + /** + * A new instance of TeamInfo. + */ + public TeamInfo() { + } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java new file mode 100644 index 000000000..7b4726630 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class TeamsChannelAccount { + @JsonProperty(value = "givenName") + private String givenName; + + @JsonProperty(value = "surname") + private String surname; + + @JsonProperty(value = "email") + private String email; + + @JsonProperty(value = "userPrincipalName") + private String userPrincipalName; + + @JsonProperty(value = "objectId") + private String aadObjectId; + + public String getGivenName() { + return givenName; + } + + public void setGivenName(String withGivenName) { + givenName = withGivenName; + } + + public String getSurname() { + return surname; + } + + public void setSurname(String withSurname) { + surname = withSurname; + } + + public String getEmail() { + return email; + } + + public void setEmail(String withEmail) { + email = withEmail; + } + + public String getUserPrincipalName() { + return userPrincipalName; + } + + public void setUserPrincipalName(String withUserPrincipalName) { + userPrincipalName = withUserPrincipalName; + } + + public String getAadObjectId() { + return aadObjectId; + } + + public void setAadObjectId(String withAadObjectId) { + aadObjectId = withAadObjectId; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelData.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelData.java new file mode 100644 index 000000000..455d84c97 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelData.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + + +/** + * Channel data specific to messages received in Microsoft Teams. + */ +public class TeamsChannelData { + @JsonProperty(value = "teamsChannelId") + private String teamsChannelId; + + @JsonProperty(value = "teamsTeamId") + private String teamsTeamId; + + @JsonProperty(value = "channel") + private ChannelInfo channel; + + /// Gets or sets type of event. + @JsonProperty(value = "eventType") + private String eventType; + + /// Gets or sets information about the team in which the message was + /// sent + @JsonProperty(value = "team") + private TeamInfo team; + + /// Gets or sets notification settings for the message + @JsonProperty(value = "notification") + private NotificationInfo notification; + + /// Gets or sets information about the tenant in which the message was + /// sent + @JsonProperty(value = "tenant") + private TenantInfo tenant; + + /** + * Get unique identifier representing a channel. + * + * @return Unique identifier representing a channel. + */ + public String getTeamsChannelId() { + return teamsChannelId; + } + + /** + * Set unique identifier representing a channel. + * + * @param withTeamsChannelId Unique identifier representing a channel. + */ + public void setTeamsChannelId(String withTeamsChannelId) { + this.teamsChannelId = withTeamsChannelId; + } + + /** + * Get unique identifier representing a team. + * + * @return Unique identifier representing a team. + */ + public String getTeamsTeamId() { + return teamsTeamId; + } + + /** + * Set unique identifier representing a team. + * + * @param withTeamsTeamId Unique identifier representing a team. + */ + public void setTeamsTeamId(String withTeamsTeamId) { + this.teamsTeamId = withTeamsTeamId; + } + + /** + * Gets information about the channel in which the message was + * sent. + * + * @return information about the channel in which the message was + * sent. + */ + public ChannelInfo getChannel() { + return channel; + } + + /** + * Sets information about the channel in which the message was + * sent. + * + * @param withChannel information about the channel in which the message was + * sent. + */ + public void setChannel(ChannelInfo withChannel) { + this.channel = withChannel; + } + + /** + * Gets type of event. + * + * @return type of event. + */ + public String getEventType() { + return eventType; + } + + /** + * Sets type of event. + * + * @param withEventType type of event. + */ + public void setEventType(String withEventType) { + this.eventType = withEventType; + } + + /** + * Gets information about the team in which the message was + * sent. + * + * @return information about the team in which the message was + * sent. + */ + public TeamInfo getTeam() { + return team; + } + + /** + * Sets information about the team in which the message was + * sent. + * + * @param withTeam information about the team in which the message was + * sent. + */ + public void setTeam(TeamInfo withTeam) { + this.team = withTeam; + } + + /** + * Gets notification settings for the message. + * + * @return notification settings for the message. + */ + public NotificationInfo getNotification() { + return notification; + } + + /** + * Sets notification settings for the message. + * + * @param withNotification settings for the message. + */ + public void setNotification(NotificationInfo withNotification) { + this.notification = withNotification; + } + + /** + * Gets information about the tenant in which the message was. + * + * @return information about the tenant in which the message was. + */ + public TenantInfo getTenant() { + return tenant; + } + + /** + * Sets information about the tenant in which the message was. + * + * @param withTenant information about the tenant in which the message was. + */ + public void setTenant(TenantInfo withTenant) { + this.tenant = withTenant; + } + + /** + * A new instance of TeamChannelData. + * + * @param withTeamsChannelId the channelId in Teams + * @param withTeamsTeamId the teamId in Teams + * @param withChannel information about the channel in which the message was sent. + * @param withEventType type of event. + * @param withTeam information about the team in which the message was + * sent. + * @param withNotification Notification settings for the message. + * @param withTenant Information about the tenant in which the message was. + */ + public TeamsChannelData(String withTeamsChannelId, + String withTeamsTeamId, + ChannelInfo withChannel, + String withEventType, + TeamInfo withTeam, + NotificationInfo withNotification, + TenantInfo withTenant) { + this.teamsChannelId = withTeamsChannelId; + this.teamsTeamId = withTeamsTeamId; + this.channel = withChannel; + this.eventType = withEventType; + this.team = withTeam; + this.notification = withNotification; + this.tenant = withTenant; + } + + /** + * A new instance of TeamChannelData. + */ + public TeamsChannelData() { + } + +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java new file mode 100644 index 000000000..3a93e60f1 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +public class TeamsPagedMembersResult { + @JsonProperty(value = "continuationToken") + private String continuationToken; + + @JsonProperty(value = "members") + private List members; + + public String getContinuationToken() { + return continuationToken; + } + + public void setContinuationToken(String withContinuationToken) { + continuationToken = withContinuationToken; + } + + public List getMembers() { + return members; + } + + public void setMembers(List withMembers) { + members = withMembers; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java index f985f67dd..5a2257efd 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TenantInfo.java @@ -1,44 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.bot.schema.teams; import com.fasterxml.jackson.annotation.JsonProperty; /** * Describes a tenant. -*/ + */ public class TenantInfo { - /** - * Unique identifier representing a tenant. - */ - @JsonProperty(value = "id") - private String id; + /** + * Unique identifier representing a tenant. + */ + @JsonProperty(value = "id") + private String id; - /** - * Get Unique identifier representing a tenant. - * @return Unique identifier representing a tenant. - */ - public String getId() { - return id; - } + /** + * Get Unique identifier representing a tenant. + * + * @return Unique identifier representing a tenant. + */ + public String getId() { + return id; + } - /** - * Set Unique identifier representing a tenant. - * @param withId Unique identifier representing a tenant. - */ - public void setId(String withId) { - this.id = withId; - } + /** + * Set Unique identifier representing a tenant. + * + * @param withId Unique identifier representing a tenant. + */ + public void setId(String withId) { + this.id = withId; + } - /** - * New instance of TenantInfo. - * @param withId Unique identifier representing a tenant. - */ - public TenantInfo(String withId) { - this.id = withId; - } + /** + * New instance of TenantInfo. + * + * @param withId Unique identifier representing a tenant. + */ + public TenantInfo(String withId) { + this.id = withId; + } - /** - * New instance of TenantInfo. - */ - public TenantInfo() { - } -} \ No newline at end of file + /** + * New instance of TenantInfo. + */ + public TenantInfo() { + } +} diff --git a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java index 99f2be722..3dbcb86c2 100644 --- a/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java +++ b/libraries/bot-schema/src/test/java/com/microsoft/bot/schema/ActivityTest.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.microsoft.bot.schema.teams.TeamChannelData; +import com.microsoft.bot.schema.teams.TeamsChannelData; import org.junit.Assert; import org.junit.Test; @@ -261,7 +261,7 @@ public void GetInformationForMicrosoftTeams() throws JsonProcessingException, IO Assert.assertEquals("channel_id", activity.teamsGetChannelId()); Assert.assertEquals("team_id", activity.teamsGetTeamId()); - TeamChannelData teamsChannelData = activity.getChannelData(TeamChannelData.class); + TeamsChannelData teamsChannelData = activity.getChannelData(TeamsChannelData.class); Assert.assertEquals("channel_id", teamsChannelData.getChannel().getId()); Assert.assertEquals("channel_name", teamsChannelData.getChannel().getName()); Assert.assertEquals("team_id", teamsChannelData.getTeam().getId()); From eb0fec018455c512613bf8032154c0b8a134874b Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Mon, 23 Mar 2020 09:52:46 -0500 Subject: [PATCH 5/6] Added logging to exception --- .../java/com/microsoft/bot/schema/teams/TaskModuleAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java index db1b9ad06..f8c755e9e 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java @@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.microsoft.bot.schema.ActionTypes; import com.microsoft.bot.schema.CardAction; +import com.sun.org.slf4j.internal.LoggerFactory; public class TaskModuleAction extends CardAction { public TaskModuleAction(String withTitle, Object withValue) { @@ -23,7 +24,7 @@ public TaskModuleAction(String withTitle, Object withValue) { try { super.setValue(objectMapper.writeValueAsString(data)); } catch (JsonProcessingException e) { - // TODO log it + LoggerFactory.getLogger(TaskModuleAction.class).error("TaskModuleAction", e); } } } From 90ba699e79af92d1e246381c5581f9a06d7e1736 Mon Sep 17 00:00:00 2001 From: tracyboehrer Date: Wed, 1 Apr 2020 12:00:15 -0500 Subject: [PATCH 6/6] Added schema class doc comments. --- libraries/bot-schema/pom.xml | 4 + .../com/microsoft/bot/schema/ActionTypes.java | 2 +- .../bot/schema/teams/AppBasedLinkQuery.java | 15 ++ .../schema/teams/AttachmentExtensions.java | 13 +- .../bot/schema/teams/ConversationList.java | 32 +++++ .../bot/schema/teams/FileConsentCard.java | 45 +++++- .../schema/teams/FileConsentCardResponse.java | 30 ++++ .../bot/schema/teams/FileDownloadInfo.java | 35 +++++ .../bot/schema/teams/FileInfoCard.java | 27 ++++ .../bot/schema/teams/FileUploadInfo.java | 45 ++++++ .../schema/teams/MessageActionsPayload.java | 136 ++++++++++++++++++ .../teams/MessageActionsPayloadApp.java | 29 ++++ .../MessageActionsPayloadAttachment.java | 55 ++++++- .../teams/MessageActionsPayloadBody.java | 19 +++ .../MessageActionsPayloadConversation.java | 29 ++++ .../teams/MessageActionsPayloadFrom.java | 34 ++++- .../teams/MessageActionsPayloadMention.java | 27 ++++ .../teams/MessageActionsPayloadReaction.java | 31 ++++ .../teams/MessageActionsPayloadUser.java | 31 ++++ .../teams/MessagingExtensionAction.java | 53 ++++++- .../MessagingExtensionActionResponse.java | 23 ++- .../teams/MessagingExtensionAttachment.java | 13 +- .../teams/MessagingExtensionParameter.java | 19 +++ .../schema/teams/MessagingExtensionQuery.java | 39 ++++- .../teams/MessagingExtensionQueryOptions.java | 19 +++ .../teams/MessagingExtensionResponse.java | 13 +- .../teams/MessagingExtensionResult.java | 63 +++++++- .../MessagingExtensionSuggestedAction.java | 15 +- .../bot/schema/teams/O365ConnectorCard.java | 58 +++++++- .../teams/O365ConnectorCardActionBase.java | 29 ++++ .../teams/O365ConnectorCardActionCard.java | 28 ++++ .../teams/O365ConnectorCardActionQuery.java | 23 +++ .../teams/O365ConnectorCardDateInput.java | 11 ++ .../schema/teams/O365ConnectorCardFact.java | 19 +++ .../teams/O365ConnectorCardHttpPOST.java | 11 ++ .../schema/teams/O365ConnectorCardImage.java | 19 +++ .../teams/O365ConnectorCardInputBase.java | 46 ++++++ .../O365ConnectorCardMultichoiceInput.java | 34 +++++ ...65ConnectorCardMultichoiceInputChoice.java | 19 +++ .../teams/O365ConnectorCardOpenUri.java | 15 +- .../teams/O365ConnectorCardOpenUriTarget.java | 21 +++ .../teams/O365ConnectorCardSection.java | 105 +++++++++++++- .../teams/O365ConnectorCardTextInput.java | 24 +++- .../teams/O365ConnectorCardViewAction.java | 15 +- .../teams/SigninStateVerificationQuery.java | 15 ++ .../bot/schema/teams/TaskModuleAction.java | 11 +- .../teams/TaskModuleContinueResponse.java | 11 ++ .../teams/TaskModuleMessageResponse.java | 11 ++ .../bot/schema/teams/TaskModuleRequest.java | 19 +++ .../teams/TaskModuleRequestContext.java | 11 ++ .../bot/schema/teams/TaskModuleResponse.java | 17 ++- .../schema/teams/TaskModuleResponseBase.java | 13 ++ .../bot/schema/teams/TaskModuleTaskInfo.java | 71 ++++++++- .../bot/schema/teams/TeamDetails.java | 43 ++++++ .../bot/schema/teams/TeamsChannelAccount.java | 43 ++++++ .../schema/teams/TeamsPagedMembersResult.java | 24 ++++ 56 files changed, 1628 insertions(+), 34 deletions(-) create mode 100644 libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ConversationList.java diff --git a/libraries/bot-schema/pom.xml b/libraries/bot-schema/pom.xml index f0e504dfd..793a37b6b 100644 --- a/libraries/bot-schema/pom.xml +++ b/libraries/bot-schema/pom.xml @@ -49,6 +49,10 @@ junit junit + + org.slf4j + slf4j-api + com.fasterxml.jackson.module jackson-module-parameter-names diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java index b39f92f2f..0728c7752 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/ActionTypes.java @@ -61,7 +61,7 @@ public enum ActionTypes { MESSAGE_BACK("messageBack"), /** - * Enum value invoke + * Enum value invoke. */ INVOKE("invoke"); diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java index 3d914ec1c..6deea257f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AppBasedLinkQuery.java @@ -5,18 +5,33 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Invoke request body type for app-based link query. + */ public class AppBasedLinkQuery { @JsonProperty(value = "url") private String url; + /** + * Initializes a new instance of the AppBasedLinkQuery class. + * @param withUrl The query url. + */ public AppBasedLinkQuery(String withUrl) { url = withUrl; } + /** + * Gets url queried by user. + * @return The url + */ public String getUrl() { return url; } + /** + * Sets url queried by user. + * @param withUrl The url. + */ public void setUrl(String withUrl) { url = withUrl; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java index b21ad04b9..522439704 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/AttachmentExtensions.java @@ -5,7 +5,18 @@ import com.microsoft.bot.schema.Attachment; -public class AttachmentExtensions { +/** + * Attachment extensions. + */ +public final class AttachmentExtensions { + private AttachmentExtensions() { } + + /** + * Converts normal attachment into the messaging extension attachment. + * @param attachment The Attachment. + * @param previewAttachment The preview Attachment. + * @return Messaging extension attachment. + */ public static MessagingExtensionAttachment toMessagingExtensionAttachment( Attachment attachment, Attachment previewAttachment) { diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ConversationList.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ConversationList.java new file mode 100644 index 000000000..44e053563 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/ConversationList.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.schema.teams; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * List of channels under a team. + */ +public class ConversationList { + @JsonProperty(value = "conversations") + private List conversations; + + /** + * Gets the list of conversations. + * @return The list of conversations. + */ + public List getConversations() { + return conversations; + } + + /** + * Sets the list of conversations. + * @param withConversations The new list of conversations. + */ + public void setConversations(List withConversations) { + conversations = withConversations; + } +} diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java index 4018293d9..65e91f122 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCard.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * File consent card attachment. + */ public class FileConsentCard { /** * Content type to be used in the type property. @@ -23,34 +26,72 @@ public class FileConsentCard { @JsonProperty(value = "declineContext") private Object declineContext; + /** + * Gets file description. + * @return The file description. + */ public String getDescription() { return description; } + /** + * Sets file description. + * @param withDescription The new file description. + */ public void setDescription(String withDescription) { description = withDescription; } + /** + * Gets size of the file to be uploaded in Bytes. + * @return The size in bytes. + */ public long getSizeInBytes() { return sizeInBytes; } + /** + * Sets size of the file to be uploaded in Bytes. + * @param withSizeInBytes The new size in bytes. + */ public void setSizeInBytes(long withSizeInBytes) { sizeInBytes = withSizeInBytes; } + /** + * Gets 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. + * @return The accept context. + */ public Object getAcceptContext() { return acceptContext; } - public void setAcceptContext(Object acceptContext) { - acceptContext = acceptContext; + /** + * Sets 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. + * @param withAcceptContext The new context. + */ + public void setAcceptContext(Object withAcceptContext) { + acceptContext = withAcceptContext; } + /** + * Gets context sent back to the Bot if user declined. This is + * free flow schema and is sent back in Value field of Activity. + * @return The decline context. + */ public Object getDeclineContext() { return declineContext; } + /** + * Sets context sent back to the Bot if user declined. This is + * free flow schema and is sent back in Value field of Activity. + * @param withDeclineContext The decline context. + */ public void setDeclineContext(Object withDeclineContext) { declineContext = withDeclineContext; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java index 71b4d542b..163b55b4a 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileConsentCardResponse.java @@ -5,6 +5,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents the value of the invoke activity sent when the user acts on + * a file consent card. + */ public class FileConsentCardResponse { @JsonProperty(value = "action") private String action; @@ -15,26 +19,52 @@ public class FileConsentCardResponse { @JsonProperty(value = "uploadInfo") private FileUploadInfo uploadInfo; + /** + * Gets the action the user took. + * @return Possible values include 'accept', 'decline' + */ public String getAction() { return action; } + /** + * Sets the action the user took. + * @param withAction Possible values include 'accept', 'decline' + */ public void setAction(String withAction) { action = withAction; } + /** + * Gets the context associated with the action. + * @return The context value. + */ public Object getContext() { return context; } + /** + * Sets the context associated with the action. + * @param withContext The new context. + */ public void setContext(Object withContext) { context = withContext; } + /** + * Gets if the user accepted the file, contains information + * about the file to be uploaded. + * @return The file upload info. + */ public FileUploadInfo getUploadInfo() { return uploadInfo; } + /** + * Sets if the user accepted the file, contains information + * about the file to be uploaded. + * @param withUploadInfo The file upload info. + */ public void setUploadInfo(FileUploadInfo withUploadInfo) { uploadInfo = withUploadInfo; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java index acd2ab003..75cb2f9fa 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileDownloadInfo.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * File download info attachment. + */ public class FileDownloadInfo { /** * Content type to be used in the type property. @@ -23,34 +26,66 @@ public class FileDownloadInfo { @JsonProperty(value = "etag") private Object etag; + /** + * Gets file download url. + * @return The download url. + */ public String getDownloadUrl() { return downloadUrl; } + /** + * Sets file download url. + * @param withDownloadUrl The new file download url. + */ public void setDownloadUrl(String withDownloadUrl) { downloadUrl = withDownloadUrl; } + /** + * Gets unique Id for the file. + * @return The unique id of the download. + */ public String getUniqueId() { return uniqueId; } + /** + * Sets unique Id for the file. + * @param withUniqueId The unique id of the download. + */ public void setUniqueId(String withUniqueId) { uniqueId = withUniqueId; } + /** + * Gets type of file. + * @return The type of the file. + */ public String getFileType() { return fileType; } + /** + * Sets type of file. + * @param withFileType The type of the file. + */ public void setFileType(String withFileType) { fileType = withFileType; } + /** + * Gets eTag for the file. + * @return The eTag. + */ public Object getEtag() { return etag; } + /** + * Sets eTag for the file. + * @param withEtag The eTag value. + */ public void setEtag(Object withEtag) { etag = withEtag; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java index 91c5f55d0..e7cb62caa 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileInfoCard.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * File info card. + */ public class FileInfoCard { /** * Content type to be used in the type property. @@ -20,26 +23,50 @@ public class FileInfoCard { @JsonProperty(value = "etag") private Object etag; + /** + * Gets unique Id for the file. + * @return The unique id of the download. + */ public String getUniqueId() { return uniqueId; } + /** + * Sets unique Id for the file. + * @param withUniqueId The unique id of the download. + */ public void setUniqueId(String withUniqueId) { uniqueId = withUniqueId; } + /** + * Gets type of file. + * @return The type of the file. + */ public String getFileType() { return fileType; } + /** + * Sets type of file. + * @param withFileType The type of the file. + */ public void setFileType(String withFileType) { fileType = withFileType; } + /** + * Gets eTag for the file. + * @return The eTag. + */ public Object getEtag() { return etag; } + /** + * Sets eTag for the file. + * @param withEtag The eTag value. + */ public void setEtag(Object withEtag) { etag = withEtag; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java index c88883434..4523d72d2 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/FileUploadInfo.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Information about the file to be uploaded. + */ public class FileUploadInfo { @JsonProperty(value = "name") private String name; @@ -21,42 +24,84 @@ public class FileUploadInfo { @JsonProperty(value = "fileType") private String fileType; + /** + * Gets name of the file. + * @return The file name. + */ public String getName() { return name; } + /** + * Sets name of the file. + * @param withName The file name. + */ public void setName(String withName) { name = withName; } + /** + * Gets URL to an upload session that the bot can use to set + * the file contents. + * @return The url to the upload session. + */ public String getUploadUrl() { return uploadUrl; } + /** + * Sets URL to an upload session that the bot can use to set + * the file contents. + * @param withUploadUrl The url to the upload session. + */ public void setUploadUrl(String withUploadUrl) { uploadUrl = withUploadUrl; } + /** + * Gets URL to file. + * @return The url to the file content. + */ public String getContentUrl() { return contentUrl; } + /** + * Sets URL to file. + * @param withContentUrl The url to the file content. + */ public void setContentUrl(String withContentUrl) { contentUrl = withContentUrl; } + /** + * Gets unique Id for the file. + * @return The unique id of the download. + */ public String getUniqueId() { return uniqueId; } + /** + * Sets unique Id for the file. + * @param withUniqueId The unique id of the download. + */ public void setUniqueId(String withUniqueId) { uniqueId = withUniqueId; } + /** + * Gets type of file. + * @return The type of the file. + */ public String getFileType() { return fileType; } + /** + * Sets type of file. + * @param withFileType The type of the file. + */ public void setFileType(String withFileType) { fileType = withFileType; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java index 7edab0a70..84838cbdf 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayload.java @@ -3,10 +3,15 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * Represents the individual message within a chat or channel where a + * message actions is taken. + */ public class MessageActionsPayload { @JsonProperty(value = "id") private String id; @@ -48,138 +53,269 @@ public class MessageActionsPayload { private String attachmentLayout; @JsonProperty(value = "attachments") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List attachments; @JsonProperty(value = "mentions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List mentions; @JsonProperty(value = "reactions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List reactions; + /** + * Gets unique id of the message. + * @return The unique id. + */ public String getId() { return id; } + /** + * Sets unique id of the message. + * @param withId The new id of the message. + */ public void setId(String withId) { id = withId; } + /** + * Gets id of the parent/root message of the thread. + * @return The id of the parent/root message. + */ public String getReplyToId() { return replyToId; } + /** + * Sets id of the parent/root message of the thread. + * @param withReplyToId The id of the parent/root message. + */ public void setReplyToId(String withReplyToId) { replyToId = withReplyToId; } + /** + * Gets type of message - automatically set to message. + * @return Possible values include: 'message' + */ public String getMessageType() { return messageType; } + /** + * Sets type of message. + * @param withMessageType Possible values include: 'message' + */ public void setMessageType(String withMessageType) { messageType = withMessageType; } + /** + * Gets timestamp of when the message was created. + * @return The timestamp of the message. + */ public String getCreatedDateTime() { return createdDateTime; } + /** + * Sets timestamp of when the message was created. + * @param withCreatedDateTime The message timestamp. + */ public void setCreatedDateTime(String withCreatedDateTime) { createdDateTime = withCreatedDateTime; } + /** + * Gets timestamp of when the message was edited or updated. + * @return The timestamp of the message. + */ public String getLastModifiedDateTime() { return lastModifiedDateTime; } + /** + * Sets timestamp of when the message was edited or updated. + * @param withLastModifiedDateTime The message timestamp. + */ public void setLastModifiedDateTime(String withLastModifiedDateTime) { lastModifiedDateTime = withLastModifiedDateTime; } + /** + * Indicates whether a message has been soft deleted. + * @return True if deleted. + */ public Boolean getDeleted() { return deleted; } + /** + * Indicates whether a message has been soft deleted. + * @param withDeleted True if deleted. + */ public void setDeleted(Boolean withDeleted) { deleted = withDeleted; } + /** + * Gets subject line of the message. + * @return The message subject line. + */ public String getSubject() { return subject; } + /** + * Sets subject line of the message. + * @param withSubject The message subject line. + */ public void setSubject(String withSubject) { subject = withSubject; } + /** + * Gets summary text of the message that could be used for notifications. + * @return The summary text. + */ public String getSummary() { return summary; } + /** + * Sets summary text of the message that could be used for notifications. + * @param withSummary The summary text. + */ public void setSummary(String withSummary) { summary = withSummary; } + /** + * Gets the importance of the message. + * @return Possible values include: 'normal', 'high', 'urgent' + */ public String getImportance() { return importance; } + /** + * Sets the importance of the message. + * @param withImportance Possible values include: 'normal', 'high', 'urgent' + */ public void setImportance(String withImportance) { importance = withImportance; } + /** + * Gets locale of the message set by the client. + * @return The message locale. + */ public String getLocale() { return locale; } + /** + * Sets locale of the message set by the client. + * @param withLocale The message locale. + */ public void setLocale(String withLocale) { locale = withLocale; } + /** + * Gets sender of the message. + * @return The message sender. + */ public MessageActionsPayloadFrom getFrom() { return from; } + /** + * Sets sender of the message. + * @param withFrom The message sender. + */ public void setFrom(MessageActionsPayloadFrom withFrom) { from = withFrom; } + /** + * Gets plaintext/HTML representation of the content of the message. + * @return The message body. + */ public MessageActionsPayloadBody getBody() { return body; } + /** + * Sets plaintext/HTML representation of the content of the message. + * @param withBody The message body. + */ public void setBody(MessageActionsPayloadBody withBody) { body = withBody; } + /** + * Gets how the attachment(s) are displayed in the message. + * @return The attachment layout. + */ public String getAttachmentLayout() { return attachmentLayout; } + /** + * Sets how the attachment(s) are displayed in the message. + * @param withAttachmentLayout The attachment layout. + */ public void setAttachmentLayout(String withAttachmentLayout) { attachmentLayout = withAttachmentLayout; } + /** + * Gets attachments in the message - card, image, file, etc. + * @return The message attachments. + */ public List getAttachments() { return attachments; } + /** + * Sets attachments in the message - card, image, file, etc. + * @param withAttachments The message attachments. + */ public void setAttachments(List withAttachments) { attachments = withAttachments; } + /** + * Gets list of entities mentioned in the message. + * @return The list of mentions. + */ public List getMentions() { return mentions; } + /** + * Sets list of entities mentioned in the message. + * @param withMentions The list of mentions. + */ public void setMentions(List withMentions) { mentions = withMentions; } + /** + * Gets reactions for the message. + * @return Message reactions. + */ public List getReactions() { return reactions; } + /** + * Sets reactions for the message. + * @param withReactions Message reactions. + */ public void setReactions(List withReactions) { reactions = withReactions; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java index 3ca50f8bd..2407ed3f7 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadApp.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents an application entity. + */ public class MessageActionsPayloadApp { @JsonProperty(value = "applicationIdentityType") private String applicationIdentityType; @@ -15,26 +18,52 @@ public class MessageActionsPayloadApp { @JsonProperty(value = "displayName") private String displayName; + /** + * Gets the type of application. + * @return Possible values include: 'aadApplication', 'bot', 'tenantBot', 'office365Connector', + * 'webhook' + */ public String getApplicationIdentityType() { return applicationIdentityType; } + /** + * Sets the type of application. + * @param withApplicationIdentityType Possible values include: 'aadApplication', 'bot', 'tenantBot', + * 'office365Connector', 'webhook' + */ public void setApplicationIdentityType(String withApplicationIdentityType) { applicationIdentityType = withApplicationIdentityType; } + /** + * Gets the id of the application. + * @return The application id. + */ public String getId() { return id; } + /** + * Sets the id of the application. + * @param withId The application id. + */ public void setId(String withId) { id = withId; } + /** + * Gets the plaintext display name of the application. + * @return The display name of the application. + */ public String getDisplayName() { return displayName; } + /** + * Sets the plaintext display name of the application. + * @param withDisplayName The display name of the application. + */ public void setDisplayName(String withDisplayName) { displayName = withDisplayName; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java index b35ee6a38..05298ce0f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadAttachment.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents the attachment in a message. + */ public class MessageActionsPayloadAttachment { @JsonProperty(value = "id") private String id; @@ -16,7 +19,7 @@ public class MessageActionsPayloadAttachment { private String contentUrl; @JsonProperty(value = "content") - public Object content; + private Object content; @JsonProperty(value = "name") private String name; @@ -24,50 +27,100 @@ public class MessageActionsPayloadAttachment { @JsonProperty(value = "thumbnailUrl") private String thumbnailUrl; + /** + * Gets the id of the attachment. + * @return The attachment id. + */ public String getId() { return id; } + /** + * Sets the id of the attachment. + * @param withId The attachment id. + */ public void setId(String withId) { id = id; } + /** + * Gets the type of the attachment. + * @return The content type of the attachment. + */ public String getContentType() { return contentType; } + /** + * Sets the type of the attachment. + * @param withContentType The content type of the attachment. + */ public void setContentType(String withContentType) { contentType = withContentType; } + /** + * Gets the url of the attachment, in case of a external link. + * @return The URL of the attachment. + */ public String getContentUrl() { return contentUrl; } + /** + * Sets the url of the attachment, in case of a external link. + * @param withContentUrl The URL of the attachment. + */ public void setContentUrl(String withContentUrl) { contentUrl = withContentUrl; } + /** + * Gets the content of the attachment, in case of a code. + * @return The attachment content. + */ public Object getContent() { return content; } + /** + * Sets the content of the attachment, in case of a code. + * @param withContent The attachment content. + */ public void setContent(Object withContent) { content = withContent; } + /** + * Gets the plaintext display name of the attachment. + * @return The attachment plaintext name. + */ public String getName() { return name; } + /** + * Sets the plaintext display name of the attachment. + * @param withName The attachment plaintext name. + */ public void setName(String withName) { name = withName; } + /** + * Gets the url of a thumbnail image that might be embedded in + * the attachment, in case of a card. + * @return The thumbnail URL. + */ public String getThumbnailUrl() { return thumbnailUrl; } + /** + * Sets the url of a thumbnail image that might be embedded in + * the attachment, in case of a card. + * @param withThumbnailUrl The thumbnail URL. + */ public void setThumbnailUrl(String withThumbnailUrl) { thumbnailUrl = withThumbnailUrl; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java index 8a7845f3e..7791eae91 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadBody.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Plaintext/HTML representation of the content of the message. + */ public class MessageActionsPayloadBody { @JsonProperty(value = "contentType") private String contentType; @@ -12,18 +15,34 @@ public class MessageActionsPayloadBody { @JsonProperty(value = "content") private String content; + /** + * Gets type of the content. Possible values include: 'html', 'text' + * @return The content type of the payload. + */ public String getContentType() { return contentType; } + /** + * Sets type of the content. Possible values include: 'html', + * @param withContentType The content type of the payload. + */ public void setContentType(String withContentType) { contentType = withContentType; } + /** + * Gets the content of the body. + * @return The payload content. + */ public String getContent() { return content; } + /** + * Sets the content of the body. + * @param withContent The payload content. + */ public void setContent(String withContent) { content = withContent; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java index 6ec9a15a5..9ba822427 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadConversation.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents a team or channel entity. + */ public class MessageActionsPayloadConversation { @JsonProperty(value = "conversationIdentityType") private String conversationIdentityType; @@ -15,26 +18,52 @@ public class MessageActionsPayloadConversation { @JsonProperty(value = "displayName") private String displayName; + /** + * Gets the type of conversation, whether a team or channel. + * Possible values include: 'team', 'channel' + * @return The type of conversation. + */ public String getConversationIdentityType() { return conversationIdentityType; } + /** + * Sets the type of conversation, whether a team or channel. + * Possible values include: 'team', 'channel' + * @param withConversationIdentityType The type of the conversation. + */ public void setConversationIdentityType(String withConversationIdentityType) { conversationIdentityType = withConversationIdentityType; } + /** + * Gets the id of the team or channel. + * @return The id of the team or channel. + */ public String getId() { return id; } + /** + * Sets the id of the team or channel. + * @param withId The id of the team or channel. + */ public void setId(String withId) { id = withId; } + /** + * Gets the plaintext display name of the team or channel entity. + * @return The display name. + */ public String getDisplayName() { return displayName; } + /** + * Sets the plaintext display name of the team or channel entity. + * @param withDisplayName The display name. + */ public void setDisplayName(String withDisplayName) { displayName = withDisplayName; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java index 83b07f719..6f9a869a8 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadFrom.java @@ -5,36 +5,64 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents a user, application, or conversation type that either sent + * or was referenced in a message. + */ public class MessageActionsPayloadFrom { @JsonProperty(value = "user") - public MessageActionsPayloadUser user; + private MessageActionsPayloadUser user; @JsonProperty(value = "application") - public MessageActionsPayloadApp application; + private MessageActionsPayloadApp application; @JsonProperty(value = "conversation") - public MessageActionsPayloadConversation conversation; + private MessageActionsPayloadConversation conversation; + /** + * Gets details of the user. + * @return The payload user. + */ public MessageActionsPayloadUser getUser() { return user; } + /** + * Sets details of the user. + * @param withUser The payload user. + */ public void setUser(MessageActionsPayloadUser withUser) { user = withUser; } + /** + * Gets details of the app. + * @return The application details. + */ public MessageActionsPayloadApp getApplication() { return application; } + /** + * Sets details of the app. + * @param withApplication The application details. + */ public void setApplication(MessageActionsPayloadApp withApplication) { application = withApplication; } + /** + * Gets details of the conversation. + * @return The conversation details. + */ public MessageActionsPayloadConversation getConversation() { return conversation; } + /** + * Sets details of the conversation. + * @param withConversation The conversation details. + */ public void setConversation(MessageActionsPayloadConversation withConversation) { conversation = withConversation; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java index 58b004f6a..73293a0b9 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadMention.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents the entity that was mentioned in the message. + */ public class MessageActionsPayloadMention { @JsonProperty(value = "id") private int id; @@ -15,26 +18,50 @@ public class MessageActionsPayloadMention { @JsonProperty(value = "mentioned") private MessageActionsPayloadFrom mentioned; + /** + * Gets the id of the mentioned entity. + * @return The id of the mention. + */ public int getId() { return id; } + /** + * Sets the id of the mentioned entity. + * @param withId The id of the mention. + */ public void setId(int withId) { id = withId; } + /** + * Gets the plaintext display name of the mentioned entity. + * @return The plaintext display name. + */ public String getMentionText() { return mentionText; } + /** + * Sets the plaintext display name of the mentioned entity. + * @param withMentionText The plaintext display name. + */ public void setMentionText(String withMentionText) { mentionText = withMentionText; } + /** + * Gets details on the mentioned entity. + * @return From details. + */ public MessageActionsPayloadFrom getMentioned() { return mentioned; } + /** + * Sets details on the mentioned entity. + * @param withMentioned From details. + */ public void setMentioned(MessageActionsPayloadFrom withMentioned) { mentioned = withMentioned; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java index a520d1232..f4415cb12 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadReaction.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents the reaction of a user to a message. + */ public class MessageActionsPayloadReaction { @JsonProperty(value = "reactionType") private String reactionType; @@ -15,26 +18,54 @@ public class MessageActionsPayloadReaction { @JsonProperty(value = "user") private MessageActionsPayloadFrom user; + /** + * Gets or sets the type of reaction given to the message. Possible + * values include: 'like', 'heart', 'laugh', 'surprised', 'sad', + * 'angry' + * @return The reaction type. + */ public String getReactionType() { return reactionType; } + /** + * Sets Gets or sets the type of reaction given to the message. Possible + * values include: 'like', 'heart', 'laugh', 'surprised', 'sad', + * 'angry' + * @param withReactionType The reaction type. + */ public void setReactionType(String withReactionType) { reactionType = withReactionType; } + /** + * Gets timestamp of when the user reacted to the message. + * @return The created timestamp. + */ public String getCreatedDateTime() { return createdDateTime; } + /** + * Sets timestamp of when the user reacted to the message. + * @param withCreatedDateTime The created timestamp. + */ public void setCreatedDateTime(String withCreatedDateTime) { createdDateTime = withCreatedDateTime; } + /** + * Gets the user with which the reaction is associated. + * @return The From user. + */ public MessageActionsPayloadFrom getUser() { return user; } + /** + * Sets the user with which the reaction is associated. + * @param withUser The From user. + */ public void setUser(MessageActionsPayloadFrom withUser) { user = withUser; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java index f02cd16a3..88b380565 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessageActionsPayloadUser.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Represents a user entity. + */ public class MessageActionsPayloadUser { @JsonProperty(value = "userIdentityType") private String userIdentityType; @@ -15,26 +18,54 @@ public class MessageActionsPayloadUser { @JsonProperty(value = "displayName") private String displayName; + /** + * Gets the identity type of the user. Possible values + * include: 'aadUser', 'onPremiseAadUser', 'anonymousGuest', + * 'federatedUser' + * @return The user type. + */ public String getUserIdentityType() { return userIdentityType; } + /** + * Sets the identity type of the user. Possible values + * include: 'aadUser', 'onPremiseAadUser', 'anonymousGuest', + * 'federatedUser' + * @param withUserIdentityType The user type. + */ public void setUserIdentityType(String withUserIdentityType) { userIdentityType = withUserIdentityType; } + /** + * Gets the id of the user. + * @return The user id. + */ public String getId() { return id; } + /** + * Sets the id of the user. + * @param withId The user id. + */ public void setId(String withId) { id = withId; } + /** + * Gets the plaintext display name of the user. + * @return The plaintext display name. + */ public String getDisplayName() { return displayName; } + /** + * Sets the plaintext display name of the user. + * @param withDisplayName The plaintext display name. + */ public void setDisplayName(String withDisplayName) { displayName = withDisplayName; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java index cbbd2c4fc..a9852a7b3 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAction.java @@ -3,11 +3,15 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.Activity; import java.util.List; +/** + * Messaging extension action. + */ public class MessagingExtensionAction extends TaskModuleRequest { @JsonProperty(value = "commandId") private String commandId; @@ -19,47 +23,92 @@ public class MessagingExtensionAction extends TaskModuleRequest { private String botMessagePreviewAction; @JsonProperty(value = "botActivityPreview") - public List botActivityPreview; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List botActivityPreview; @JsonProperty(value = "messagePayload") - public MessageActionsPayload messagePayload; + private MessageActionsPayload messagePayload; + /** + * Gets id of the command assigned by Bot. + * @return The command id. + */ public String getCommandId() { return commandId; } + /** + * Sets id of the command assigned by Bot. + * @param withCommandId The command id. + */ public void setCommandId(String withCommandId) { commandId = withCommandId; } + /** + * Gets the context from which the command originates. + * Possible values include: 'message', 'compose', 'commandbox' + * @return The command context. + */ public String getCommandContext() { return commandContext; } + /** + * Sets the context from which the command originates. + * Possible values include: 'message', 'compose', 'commandbox' + * @param withCommandContext The command context. + */ public void setCommandContext(String withCommandContext) { commandContext = withCommandContext; } + /** + * Gets bot message preview action taken by user. Possible + * values include: 'edit', 'send' + * @return The preview action. + */ public String getBotMessagePreviewAction() { return botMessagePreviewAction; } + /** + * Sets bot message preview action taken by user. Possible + * values include: 'edit', 'send' + * @param withBotMessagePreviewAction The preview action. + */ public void setBotMessagePreviewAction(String withBotMessagePreviewAction) { botMessagePreviewAction = withBotMessagePreviewAction; } + /** + * Gets the list of preview Activities. + * @return The preview activities. + */ public List getBotActivityPreview() { return botActivityPreview; } + /** + * Sets the list of preview Activities. + * @param withBotActivityPreview The preview activities. + */ public void setBotActivityPreview(List withBotActivityPreview) { botActivityPreview = withBotActivityPreview; } + /** + * Gets message content sent as part of the command request. + * @return The message payload. + */ public MessageActionsPayload getMessagePayload() { return messagePayload; } + /** + * Sets message content sent as part of the command request. + * @param withMessagePayload The message payload. + */ public void setMessagePayload(MessageActionsPayload withMessagePayload) { messagePayload = withMessagePayload; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java index 13f995475..895a99532 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java @@ -5,25 +5,44 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Response of messaging extension action. + */ public class MessagingExtensionActionResponse { @JsonProperty(value = "task") - public TaskModuleResponseBase task; + private TaskModuleResponseBase task; @JsonProperty(value = "composeExtension") - public MessagingExtensionResult composeExtension; + private MessagingExtensionResult composeExtension; + /** + * Gets the Adaptive card to appear in the task module. + * @return The task card. + */ public TaskModuleResponseBase getTask() { return task; } + /** + * Sets the Adaptive card to appear in the task module. + * @param withTask The task card. + */ public void setTask(TaskModuleResponseBase withTask) { task = withTask; } + /** + * Gets the extension result. + * @return The extension result. + */ public MessagingExtensionResult getComposeExtension() { return composeExtension; } + /** + * Sets the extension result. + * @param withComposeExtension The extension result. + */ public void setComposeExtension(MessagingExtensionResult withComposeExtension) { composeExtension = withComposeExtension; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java index a9eec9f05..5b404c512 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionAttachment.java @@ -6,14 +6,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.Attachment; +/** + * Messaging extension attachment. + */ public class MessagingExtensionAttachment extends Attachment { @JsonProperty(value = "preview") - public Attachment preview; + private Attachment preview; + /** + * Gets the preview Attachment. + * @return The Attachment. + */ public Attachment getPreview() { return preview; } + /** + * Sets the preview attachment. + * @param withPreview The Attachment. + */ public void setPreview(Attachment withPreview) { preview = withPreview; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java index 7f7d6d9bc..f9cb83548 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionParameter.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Messaging extension query parameters. + */ public class MessagingExtensionParameter { @JsonProperty(value = "name") private String name; @@ -12,18 +15,34 @@ public class MessagingExtensionParameter { @JsonProperty(value = "value") private Object value; + /** + * Gets name of the parameter. + * @return The parameter name. + */ public String getName() { return name; } + /** + * Sets name of the parameter. + * @param withName The parameter name. + */ public void setName(String withName) { name = withName; } + /** + * Gets value of the parameter. + * @return The parameter value. + */ public Object getValue() { return value; } + /** + * Sets value of the parameter. + * @param withValue The parameter value. + */ public void setValue(Object withValue) { value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java index 01acc98f4..37f159006 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQuery.java @@ -3,16 +3,21 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * Messaging extension query. + */ public class MessagingExtensionQuery { @JsonProperty(value = "commandId") private String commandId; @JsonProperty(value = "parameters") - public List parameters; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List parameters; @JsonProperty(value = "queryOptions") private MessagingExtensionQueryOptions queryOptions; @@ -20,34 +25,66 @@ public class MessagingExtensionQuery { @JsonProperty(value = "state") private String state; + /** + * Gets id of the command assigned by Bot. + * @return The command id. + */ public String getCommandId() { return commandId; } + /** + * Sets id of the command assigned by Bot. + * @param withCommandId The command id. + */ public void setCommandId(String withCommandId) { commandId = withCommandId; } + /** + * Gets parameters for the query. + * @return The query parameters. + */ public List getParameters() { return parameters; } + /** + * Sets parameters for the query. + * @param withParameters The query parameters. + */ public void setParameters(List withParameters) { parameters = withParameters; } + /** + * Gets the query options. + * @return The query options. + */ public MessagingExtensionQueryOptions getQueryOptions() { return queryOptions; } + /** + * Sets the query options. + * @param withQueryOptions The query options. + */ public void setQueryOptions(MessagingExtensionQueryOptions withQueryOptions) { queryOptions = withQueryOptions; } + /** + * Gets state parameter passed back to the bot after authentication/configuration flow. + * @return The state parameter. + */ public String getState() { return state; } + /** + * Sets state parameter passed back to the bot after authentication/configuration flow. + * @param withState The state parameter. + */ public void setState(String withState) { state = withState; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java index 439eb5927..fc9314480 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionQueryOptions.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Messaging extension query options. + */ public class MessagingExtensionQueryOptions { @JsonProperty(value = "skip") private int skip; @@ -12,18 +15,34 @@ public class MessagingExtensionQueryOptions { @JsonProperty(value = "count") private int count; + /** + * Gets number of entities to skip. + * @return The number of entities to skip. + */ public int getSkip() { return skip; } + /** + * Sets number of entities to skip. + * @param withSkip The number of entities to skip. + */ public void setSkip(int withSkip) { skip = withSkip; } + /** + * Gets number of entities to fetch. + * @return The number of entities to fetch. + */ public int getCount() { return count; } + /** + * Sets number of entities to fetch. + * @param withCount The number of entities to fetch. + */ public void setCount(int withCount) { count = withCount; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java index b6859de6e..5f4d94661 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java @@ -5,14 +5,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Messaging extension response. + */ public class MessagingExtensionResponse { @JsonProperty(value = "composeExtension") - public MessagingExtensionResult composeExtension; + private MessagingExtensionResult composeExtension; + /** + * Gets the response result. + * @return The result. + */ public MessagingExtensionResult getComposeExtension() { return composeExtension; } + /** + * Sets the response result. + * @param withComposeExtension The result. + */ public void setComposeExtension(MessagingExtensionResult withComposeExtension) { composeExtension = withComposeExtension; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java index a4576932f..a0ac6a49f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResult.java @@ -3,11 +3,15 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.Activity; import java.util.List; +/** + * Messaging extension result. + */ public class MessagingExtensionResult { @JsonProperty(value = "attachmentLayout") private String attachmentLayout; @@ -16,61 +20,114 @@ public class MessagingExtensionResult { private String type; @JsonProperty(value = "attachments") - public List attachments; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List attachments; @JsonProperty(value = "suggestedActions") - public MessagingExtensionSuggestedAction suggestedActions; + private MessagingExtensionSuggestedAction suggestedActions; @JsonProperty(value = "text") private String text; @JsonProperty(value = "activityPreview") - public Activity activityPreview; + private Activity activityPreview; + /** + * Gets hint for how to deal with multiple attachments. + * Possible values include: 'list', 'grid' + * @return The attachment layout hint. + */ public String getAttachmentLayout() { return attachmentLayout; } + /** + * Sets hint for how to deal with multiple attachments. + * Possible values include: 'list', 'grid' + * @param withAttachmentLayout The attachment layout hint. + */ public void setAttachmentLayout(String withAttachmentLayout) { attachmentLayout = withAttachmentLayout; } + /** + * Gets the type of the result. Possible values include: + * 'result', 'auth', 'config', 'message', 'botMessagePreview' + * @return The result type. + */ public String getType() { return type; } + /** + * Sets the type of the result. Possible values include: + * 'result', 'auth', 'config', 'message', 'botMessagePreview' + * @param withType The result type. + */ public void setType(String withType) { type = withType; } + /** + * Gets (Only when type is result) Attachments. + * @return The result attachments. + */ public List getAttachments() { return attachments; } + /** + * Sets (Only when type is result) Attachments. + * @param withAttachments The result attachments. + */ public void setAttachments(List withAttachments) { attachments = withAttachments; } + /** + * Gets (Only when type is auth or config) suggested actions. + * @return The suggested actions. + */ public MessagingExtensionSuggestedAction getSuggestedActions() { return suggestedActions; } + /** + * Sets (Only when type is auth or config) suggested actions. + * @param withSuggestedActions The suggested actions. + */ public void setSuggestedActions(MessagingExtensionSuggestedAction withSuggestedActions) { suggestedActions = withSuggestedActions; } + /** + * Gets (Only when type is message) Text. + * @return The result text. + */ public String getText() { return text; } + /** + * Sets (Only when type is message) Text. + * @param withText The result text. + */ public void setText(String withText) { text = withText; } + /** + * Gets (Only when type is botMessagePreview) Message activity. + * @return The preview Activity. + */ public Activity getActivityPreview() { return activityPreview; } + /** + * Sets (Only when type is botMessagePreview) Message activity. + * @param withActivityPreview The preview Activity. + */ public void setActivityPreview(Activity withActivityPreview) { activityPreview = withActivityPreview; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java index 4368394b8..732ba8d2e 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionSuggestedAction.java @@ -3,19 +3,32 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.CardAction; import java.util.List; +/** + * Messaging extension Actions (Only when type is auth or config). + */ public class MessagingExtensionSuggestedAction { @JsonProperty(value = "actions") - public List actions; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List actions; + /** + * Gets the actions. + * @return The list of CardActions. + */ public List getActions() { return actions; } + /** + * Sets the actions. + * @param withActions The list of CardActions. + */ public void setActions(List withActions) { actions = withActions; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java index ff6747072..749b3f7e4 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCard.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card. + */ public class O365ConnectorCard { /** * Content type to be used in the type property. @@ -26,55 +30,105 @@ public class O365ConnectorCard { private String themeColor; @JsonProperty(value = "sections") - public List sections; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List sections; @JsonProperty(value = "potentialAction") - public List potentialAction; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List potentialAction; + /** + * Gets the title of the card. + * @return The card title. + */ public String getTitle() { return title; } + /** + * Sets the title of the card. + * @param withTitle The card title. + */ public void setTitle(String withTitle) { title = withTitle; } + /** + * Gets the text for the card. + * @return The card text. + */ public String getText() { return text; } + /** + * Sets the text for the card. + * @param withText The card text. + */ public void setText(String withText) { text = withText; } + /** + * Gets the summary for the card. + * @return The card summary. + */ public String getSummary() { return summary; } + /** + * Sets the summary for the card. + * @param withSummary The card summary. + */ public void setSummary(String withSummary) { summary = withSummary; } + /** + * Gets the theme color for the card. + * @return The card color. + */ public String getThemeColor() { return themeColor; } + /** + * Sets the theme color for the card. + * @param withThemeColor The card color. + */ public void setThemeColor(String withThemeColor) { themeColor = withThemeColor; } + /** + * Gets the list of sections for the current card. + * @return The card sections. + */ public List getSections() { return sections; } + /** + * Sets the of sections for the current card. + * @param withSections The card sections. + */ public void setSections(List withSections) { sections = withSections; } + /** + * Gets the of actions for the current card. + * @return The card actions. + */ public List getPotentialAction() { return potentialAction; } + /** + * Sets the of actions for the current card. + * @param withPotentialAction The card actions. + */ public void setPotentialAction(List withPotentialAction) { potentialAction = withPotentialAction; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java index ecb3e4908..a6cfbb098 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionBase.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card action base. + */ public class O365ConnectorCardActionBase { @JsonProperty(value = "@type") private String type; @@ -15,26 +18,52 @@ public class O365ConnectorCardActionBase { @JsonProperty(value = "@id") private String id; + /** + * Gets the type of the action. Possible values include: + * 'ViewAction', 'OpenUri', 'HttpPOST', 'ActionCard' + * @return The action type. + */ public String getType() { return type; } + /** + * Sets the type of the action. Possible values include: + * 'ViewAction', 'OpenUri', 'HttpPOST', 'ActionCard' + * @param withType The action type. + */ public void setType(String withType) { type = withType; } + /** + * Gets the name of the action that will be used as button title. + * @return The action name. + */ public String getName() { return name; } + /** + * Sets the name of the action that will be used as button title. + * @param withName The action name. + */ public void setName(String withName) { name = withName; } + /** + * Gets the action id. + * @return The action id. + */ public String getId() { return id; } + /** + * Sets the action id. + * @param withId The action id. + */ public void setId(String withId) { id = withId; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java index c87327f98..07d0d3299 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionCard.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card ActionCard action. + */ public class O365ConnectorCardActionCard extends O365ConnectorCardActionBase { /** * Content type to be used in the type property. @@ -14,23 +18,47 @@ public class O365ConnectorCardActionCard extends O365ConnectorCardActionBase { public static final String TYPE = "ActionCard"; @JsonProperty(value = "inputs") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List inputs; @JsonProperty(value = "actions") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List actions; + /** + * Gets list of inputs contained in this ActionCard whose each + * item can be in any subtype of O365ConnectorCardInputBase. + * @return The card inputs. + */ public List getInputs() { return inputs; } + /** + * Sets list of inputs contained in this ActionCard whose each + * item can be in any subtype of O365ConnectorCardInputBase. + * @param withInputs The card inputs. + */ public void setInputs(List withInputs) { inputs = withInputs; } + /** + * Gets list of actions contained in this ActionCard whose each + * item can be in any subtype of O365ConnectorCardActionBase except + * O365ConnectorCardActionCard, as nested ActionCard is forbidden. + * @return The card actions. + */ public List getActions() { return actions; } + /** + * Sets list of actions contained in this ActionCard whose each + * item can be in any subtype of O365ConnectorCardActionBase except + * O365ConnectorCardActionCard, as nested ActionCard is forbidden. + * @param withActions The card actions. + */ public void setActions(List withActions) { actions = withActions; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java index 6e6708efc..9295d7ba8 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardActionQuery.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * 365 connector card HttpPOST invoke query. + */ public class O365ConnectorCardActionQuery { @JsonProperty(value = "body") private String body; @@ -12,18 +15,38 @@ public class O365ConnectorCardActionQuery { @JsonProperty(value = "actionId") private String actionId; + /** + * Gets the results of body string defined in + * O365ConnectorCardHttpPOST with substituted input values. + * @return The query body. + */ public String getBody() { return body; } + /** + * Sets the results of body string defined in + * O365ConnectorCardHttpPOST with substituted input values. + * @param withBody The query body. + */ public void setBody(String withBody) { this.body = withBody; } + /** + * Gets the action Id associated with the HttpPOST action button + * triggered, defined in O365ConnectorCardActionBase. + * @return The action id. + */ public String getActionId() { return actionId; } + /** + * Sets the action Id associated with the HttpPOST action button + * triggered, defined in O365ConnectorCardActionBase. + * @param withActionId The action id. + */ public void setActionId(String withActionId) { this.actionId = withActionId; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java index 8a24e2ff4..796ccde9d 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardDateInput.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card date input. + */ public class O365ConnectorCardDateInput extends O365ConnectorCardInputBase { /** * Content type to be used in the type property. @@ -14,10 +17,18 @@ public class O365ConnectorCardDateInput extends O365ConnectorCardInputBase { @JsonProperty(value = "includeTime") private Boolean includeTime; + /** + * Gets include time input field. Default value is false (date only). + * @return True to include time. + */ public Boolean getIncludeTime() { return includeTime; } + /** + * Sets include time input field. Default value is false (date only). + * @param withIncludeTime True to include time. + */ public void setIncludeTime(Boolean withIncludeTime) { includeTime = withIncludeTime; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java index 44681ec6e..b9ee9336d 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardFact.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card fact. + */ public class O365ConnectorCardFact { @JsonProperty(value = "name") private String name; @@ -12,18 +15,34 @@ public class O365ConnectorCardFact { @JsonProperty(value = "value") private String value; + /** + * Gets the display name of the fact. + * @return The display name. + */ public String getName() { return name; } + /** + * Sets the display name of the fact. + * @param withName The display name. + */ public void setName(String withName) { this.name = withName; } + /** + * Gets the display value for the fact. + * @return The display value. + */ public String getValue() { return value; } + /** + * Sets the display value for the fact. + * @param withValue The display value. + */ public void setValue(String withValue) { this.value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java index 58a16307d..1dfe85187 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardHttpPOST.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card HttpPOST action. + */ public class O365ConnectorCardHttpPOST extends O365ConnectorCardActionBase { /** * Content type to be used in the type property. @@ -14,10 +17,18 @@ public class O365ConnectorCardHttpPOST extends O365ConnectorCardActionBase { @JsonProperty(value = "body") private String body; + /** + * Gets the content to be posted back to bots via invoke. + * @return The post content. + */ public String getBody() { return body; } + /** + * Set the content to be posted back to bots via invoke. + * @param withBody The post content. + */ public void setBody(String withBody) { body = body; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java index d75f6c0ec..c9c74f895 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardImage.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card image. + */ public class O365ConnectorCardImage { @JsonProperty(value = "image") private String image; @@ -12,18 +15,34 @@ public class O365ConnectorCardImage { @JsonProperty(value = "title") private String title; + /** + * Gets the URL for the image. + * @return The image url. + */ public String getImage() { return image; } + /** + * Sets the URL for the image. + * @param withImage The image url. + */ public void setImage(String withImage) { image = withImage; } + /** + * Gets the alternative text for the image. + * @return The image alt text. + */ public String getTitle() { return title; } + /** + * Sets the alternative text for the image. + * @param withTitle The image alt text. + */ public void setTitle(String withTitle) { title = withTitle; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java index cc5d549f1..3b4cbbff4 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardInputBase.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card input for ActionCard action. + */ public class O365ConnectorCardInputBase { @JsonProperty(value = "@type") private String type; @@ -21,42 +24,85 @@ public class O365ConnectorCardInputBase { @JsonProperty(value = "value") private String value; + /** + * Gets input type name. Possible values include: 'textInput', + * 'dateInput', 'multichoiceInput' + * @return The input type. + */ public String getType() { return type; } + /** + * Sets input type name. Possible values include: 'textInput', + * 'dateInput', 'multichoiceInput' + * @param withType The input type. + */ public void setType(String withType) { type = withType; } + /** + * Gets the input Id. It must be unique per entire O365 connector card. + * @return The card id. + */ public String getId() { return id; } + /** + * Sets the input Id. It must be unique per entire O365 connector card. + * @param withId The card id. + */ public void setId(String withId) { id = withId; } + /** + * Gets whether this input is a required field. Default + * value is false. + * @return True if required input. + */ public Boolean getRequired() { return isRequired; } + /** + * Sets whether this input is a required field. + * @param withRequired True if required input. + */ public void setRequired(Boolean withRequired) { isRequired = withRequired; } + /** + * Gets input title that will be shown as the placeholder. + * @return The input title. + */ public String getTitle() { return title; } + /** + * Sets input title that will be shown as the placeholder. + * @param withTitle The input title. + */ public void setTitle(String withTitle) { title = withTitle; } + /** + * Gets default value for this input field. + * @return The default input value. + */ public String getValue() { return value; } + /** + * Sets default value for this input field. + * @param withValue The default input value. + */ public void setValue(String withValue) { value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java index 6dddb284b..133fbdb5c 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInput.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card multiple choice input. + */ public class O365ConnectorCardMultichoiceInput { /** * Content type to be used in the type property. @@ -14,6 +18,7 @@ public class O365ConnectorCardMultichoiceInput { public static final String TYPE = "MultichoiceInput"; @JsonProperty(value = "choices") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List choices; @JsonProperty(value = "style") @@ -22,26 +27,55 @@ public class O365ConnectorCardMultichoiceInput { @JsonProperty(value = "isMultiSelect") private Boolean isMultiSelect; + /** + * Gets list of choices whose each item can be in any subtype + * of O365ConnectorCardMultichoiceInputChoice. + * @return List of choices. + */ public List getChoices() { return choices; } + /** + * Sets list of choices whose each item can be in any subtype + * of O365ConnectorCardMultichoiceInputChoice. + * @param withChoices List of choices. + */ public void setChoices(List withChoices) { choices = withChoices; } + /** + * Gets choice item rendering style. Default value is + * 'compact'. Possible values include: 'compact', 'expanded' + * @return The choice style. + */ public String getStyle() { return style; } + /** + * Sets choice item rendering style. Default value is + * 'compact'. Possible values include: 'compact', 'expanded' + * @param withStyle The choice style. + */ public void setStyle(String withStyle) { style = withStyle; } + /** + * Defines if this input field allows multiple selections. + * Default value is false. + * @return True if the choice allows multiple selections. + */ public Boolean getMultiSelect() { return isMultiSelect; } + /** + * Sets if this input field allows multiple selections. + * @param withMultiSelect True if the choice allows multiple selections. + */ public void setMultiSelect(Boolean withMultiSelect) { isMultiSelect = withMultiSelect; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java index 5335ac37c..5bcd6ed5d 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardMultichoiceInputChoice.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365O365 connector card multiple choice input item. + */ public class O365ConnectorCardMultichoiceInputChoice { @JsonProperty(value = "display") private String display; @@ -12,18 +15,34 @@ public class O365ConnectorCardMultichoiceInputChoice { @JsonProperty(value = "value") private String value; + /** + * Gets the text rendered on ActionCard. + * @return The ActionCard text. + */ public String getDisplay() { return display; } + /** + * Sets the text rendered on ActionCard. + * @param withDisplay The ActionCard text. + */ public void setDisplay(String withDisplay) { display = withDisplay; } + /** + * Gets the value received as results. + * @return The result value. + */ public String getValue() { return value; } + /** + * Sets the value received as results. + * @param withValue The result value. + */ public void setValue(String withValue) { value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java index 774f5a610..29c2f00c5 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUri.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card OpenUri action. + */ public class O365ConnectorCardOpenUri extends O365ConnectorCardActionBase { /** * Content type to be used in the type property. @@ -14,12 +18,21 @@ public class O365ConnectorCardOpenUri extends O365ConnectorCardActionBase { public static final String TYPE = "OpenUri"; @JsonProperty(value = "targets") - public List targets; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List targets; + /** + * Gets target os / urls. + * @return List of target urls. + */ public List getTargets() { return targets; } + /** + * Sets target os / urls. + * @param withTargets List of target urls. + */ public void setTargets(List withTargets) { targets = withTargets; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java index acc8139b3..aae7ae04f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardOpenUriTarget.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card OpenUri target. + */ public class O365ConnectorCardOpenUriTarget { @JsonProperty(value = "os") private String os; @@ -12,18 +15,36 @@ public class O365ConnectorCardOpenUriTarget { @JsonProperty(value = "uri") private String uri; + /** + * Gets target operating system. Possible values include: + * 'default', 'iOS', 'android', 'windows' + * @return The target os. + */ public String getOs() { return os; } + /** + * Sets target operating system. Possible values include: + * 'default', 'iOS', 'android', 'windows' + * @param withOs The target os. + */ public void setOs(String withOs) { os = withOs; } + /** + * Gets the target uri. + * @return The target uri. + */ public String getUri() { return uri; } + /** + * Sets the target uri. + * @param withUri The target uri. + */ public void setUri(String withUri) { uri = withUri; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java index e16ed445f..2e55961e4 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardSection.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card section. + */ public class O365ConnectorCardSection { @JsonProperty(value = "title") private String title; @@ -30,101 +34,194 @@ public class O365ConnectorCardSection { private String activityImageType; @JsonProperty(value = "markdown") - public Boolean markdown; + private Boolean markdown; @JsonProperty(value = "facts") - public List facts; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List facts; @JsonProperty(value = "images") - public List images; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List images; @JsonProperty(value = "potentialAction") - public List potentialAction; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List potentialAction; + /** + * Gets title of the section. + * @return The section title. + */ public String getTitle() { return title; } + /** + * Sets title of the section. + * @param withTitle The section title. + */ public void setTitle(String withTitle) { title = withTitle; } + /** + * Gets text for the section. + * @return The section text. + */ public String getText() { return text; } + /** + * Sets text for the section. + * @param withText The section text. + */ public void setText(String withText) { text = withText; } + /** + * Gets the activity title. + * @return The activity title. + */ public String getActivityTitle() { return activityTitle; } + /** + * Set the activity title. + * @param withActivityTitle The activity title. + */ public void setActivityTitle(String withActivityTitle) { activityTitle = withActivityTitle; } + /** + * Gets the activity subtitle. + * @return The activity subtitle. + */ public String getActivitySubtitle() { return activitySubtitle; } + /** + * Sets the activity subtitle. + * @param withActivitySubtitle The activity subtitle. + */ public void setActivitySubtitle(String withActivitySubtitle) { activitySubtitle = withActivitySubtitle; } + /** + * Gets the activity text. + * @return The activity text. + */ public String getActivityText() { return activityText; } + /** + * Sets the activity text. + * @param withActivityText The activity text. + */ public void setActivityText(String withActivityText) { activityText = withActivityText; } + /** + * Gets the activity image. + * @return The activity image. + */ public String getActivityImage() { return activityImage; } + /** + * Sets the activity image. + * @param withActivityImage The activity image. + */ public void setActivityImage(String withActivityImage) { activityImage = withActivityImage; } + /** + * Describes how Activity image is rendered. Possible + * values include: 'avatar', 'article' + * @return The activity image type. + */ public String getActivityImageType() { return activityImageType; } + /** + * Sets how Activity image is rendered. Possible + * values include: 'avatar', 'article' + * @param withActivityImageType The activity image type. + */ public void setActivityImageType(String withActivityImageType) { activityImageType = withActivityImageType; } + /** + * Indicates markdown for all text contents. Default value is true. + * @return True if text is markdown. + */ public Boolean getMarkdown() { return markdown; } + /** + * Sets markdown for all text contents. + * @param withMarkdown True to use markdown for text content. + */ public void setMarkdown(Boolean withMarkdown) { markdown = withMarkdown; } + /** + * List of facts for the current section. + * @return Facts for the section. + */ public List getFacts() { return facts; } + /** + * Set list of facts for the current section. + * @param withFacts Facts for the section. + */ public void setFacts(List withFacts) { facts = withFacts; } + /** + * List of images for the current section. + * @return Images for the section. + */ public List getImages() { return images; } + /** + * Set list of images for the current section. + * @param withImages Images for the section. + */ public void setImages(List withImages) { images = withImages; } + /** + * List of actions for the current section. + * @return Actions for the section. + */ public List getPotentialAction() { return potentialAction; } + /** + * Sets list of actions for the current section. + * @param withPotentialAction Actions for the section. + */ public void setPotentialAction(List withPotentialAction) { potentialAction = withPotentialAction; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java index 804d4c960..fb92bb151 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardTextInput.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * O365 connector card text input. + */ public class O365ConnectorCardTextInput extends O365ConnectorCardInputBase { /** * Content type to be used in the type property. @@ -12,23 +15,40 @@ public class O365ConnectorCardTextInput extends O365ConnectorCardInputBase { public static final String TYPE = "TextInput"; @JsonProperty(value = "isMultiline") - public Boolean isMultiline; + private Boolean isMultiline; @JsonProperty(value = "maxLength") - public double maxLength; + private double maxLength; + /** + * Indicates if text input is allowed for multiple lines. + * Default value is false. + * @return True if multiline input is allowed. + */ public Boolean getMultiline() { return isMultiline; } + /** + * Sets if text input is allowed for multiple lines. + * @param withMultiline True if multiline input is allowed. + */ public void setMultiline(Boolean withMultiline) { isMultiline = withMultiline; } + /** + * Gets maximum length of text input. Default value is unlimited. + * @return Max line length. + */ public double getMaxLength() { return maxLength; } + /** + * Sets maximum length of text input. Default value is unlimited. + * @param withMaxLength Max line length. + */ public void setMaxLength(double withMaxLength) { maxLength = withMaxLength; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java index 3e45db4b3..8be3bad1f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/O365ConnectorCardViewAction.java @@ -3,10 +3,14 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * O365 connector card ViewAction action. + */ public class O365ConnectorCardViewAction extends O365ConnectorCardActionBase { /** * Content type to be used in the type property. @@ -14,12 +18,21 @@ public class O365ConnectorCardViewAction extends O365ConnectorCardActionBase { public static final String TYPE = "ViewAction"; @JsonProperty(value = "target") - public List target; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List target; + /** + * Gets target urls, only the first url effective for card button. + * @return List of button targets. + */ public List getTarget() { return target; } + /** + * Sets target urls, only the first url effective for card button. + * @param withTarget List of button targets. + */ public void setTarget(List withTarget) { target = withTarget; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java index 369bc7da4..57b301b9f 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/SigninStateVerificationQuery.java @@ -5,14 +5,29 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Signin state (part of signin action auth flow) verification invoke query. + */ public class SigninStateVerificationQuery { @JsonProperty(value = "state") private String 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). + * @return The sign-in state. + */ public String getState() { return 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). + * @param withState The sign-in state. + */ public void setState(String withState) { state = withState; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java index f8c755e9e..f51fe7901 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleAction.java @@ -8,9 +8,18 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.microsoft.bot.schema.ActionTypes; import com.microsoft.bot.schema.CardAction; -import com.sun.org.slf4j.internal.LoggerFactory; +import org.slf4j.LoggerFactory; +/** + * Adapter class to represent BotBuilder card action as adaptive card action (in type of Action.Submit). + */ public class TaskModuleAction extends CardAction { + /** + * Initializes a new instance. + * @param withTitle Button title. + * @param withValue Free hidden value binding with button. The value will be sent out with + * "task/fetch" invoke event. + */ public TaskModuleAction(String withTitle, Object withValue) { super.setType(ActionTypes.INVOKE); super.setTitle(withTitle); diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java index d6835db00..156d747d7 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleContinueResponse.java @@ -5,14 +5,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Task Module Response with continue action. + */ public class TaskModuleContinueResponse extends TaskModuleResponseBase { @JsonProperty(value = "value") private TaskModuleTaskInfo value; + /** + * Gets the Adaptive card to appear in the task module. + * @return The value info. + */ public TaskModuleTaskInfo getValue() { return value; } + /** + * Sets the Adaptive card to appear in the task module. + * @param withValue The value info. + */ public void setValue(TaskModuleTaskInfo withValue) { value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java index 1e6b4e858..f1bdd2212 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleMessageResponse.java @@ -5,14 +5,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Task Module response with message action. + */ public class TaskModuleMessageResponse extends TaskModuleResponseBase { @JsonProperty(value = "value") private TaskModuleTaskInfo value; + /** + * Gets info teams will display the value of value in a popup message box. + * @return The popup info. + */ public TaskModuleTaskInfo getValue() { return value; } + /** + * Sets info teams will display the value of value in a popup message box. + * @param withValue The popup info. + */ public void setValue(TaskModuleTaskInfo withValue) { value = withValue; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java index d57c67e35..85223f916 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequest.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Task module invoke request value payload. + */ public class TaskModuleRequest { @JsonProperty(value = "data") private Object data; @@ -12,18 +15,34 @@ public class TaskModuleRequest { @JsonProperty(value = "context") private TaskModuleRequestContext context; + /** + * Gets user input data. Free payload with key-value pairs. + * @return The input data. + */ public Object getData() { return data; } + /** + * Sets user input data. Free payload with key-value pairs. + * @param withData The input data. + */ public void setData(Object withData) { data = withData; } + /** + * Gets current user context, i.e., the current theme. + * @return The user context. + */ public TaskModuleRequestContext getContext() { return context; } + /** + * Sets current user context, i.e., the current theme. + * @param withContext The user context. + */ public void setContext(TaskModuleRequestContext withContext) { context = withContext; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java index 1381023d2..b75432574 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleRequestContext.java @@ -5,14 +5,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Current user context, i.e., the current theme. + */ public class TaskModuleRequestContext { @JsonProperty(value = "theme") private String theme; + /** + * Gets the theme value. + * @return The theme. + */ public String getTheme() { return theme; } + /** + * Sets the theme value. + * @param withTheme The theme. + */ public void setTheme(String withTheme) { theme = withTheme; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java index 25e23d3b3..a68b85c61 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java @@ -5,15 +5,26 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Envelope for Task Module Response. + */ public class TaskModuleResponse { @JsonProperty(value = "task") - private String task; + private TaskModuleResponseBase task; - public String getTask() { + /** + * Gets the response task. + * @return The response task. + */ + public TaskModuleResponseBase getTask() { return task; } - public void setTask(String withTask) { + /** + * Sets the response task. + * @param withTask The response task. + */ + public void setTask(TaskModuleResponseBase withTask) { task = withTask; } } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java index e4d672d7a..bc71710c2 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponseBase.java @@ -5,14 +5,27 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Base class for Task Module responses. + */ public class TaskModuleResponseBase { @JsonProperty(value = "type") private String type; + /** + * Gets choice of action options when responding to the + * task/submit message. Possible values include: 'message', 'continue' + * @return The response type. + */ public String getType() { return type; } + /** + * Sets choice of action options when responding to the + * task/submit message. Possible values include: 'message', 'continue' + * @param withType The response type. + */ public void setType(String withType) { type = withType; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java index cf4cd78e1..0c780fdaf 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleTaskInfo.java @@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.Attachment; +/** + * Metadata for a Task Module. + */ public class TaskModuleTaskInfo { @JsonProperty(value = "title") private String title; @@ -20,7 +23,7 @@ public class TaskModuleTaskInfo { private String url; @JsonProperty(value = "card") - public Attachment card; + private Attachment card; @JsonProperty(value = "fallbackUrl") private String fallbackUrl; @@ -28,58 +31,124 @@ public class TaskModuleTaskInfo { @JsonProperty(value = "completionBotId") private String completionBotId; + /** + * Gets the text that appears below the app name and to the right of the app icon. + * @return The title text. + */ public String getTitle() { return title; } + /** + * Sets the text that appears below the app name and to the right of the app icon. + * @param withTitle The title text. + */ public void setTitle(String withTitle) { title = withTitle; } + /** + * Gets title height. This can be a number, representing the task module's + * height in pixels, or a string, one of: small, medium, large. + * @return The title height. + */ public Object getHeight() { return height; } + /** + * Sets title height. This can be a number, representing the task module's + * height in pixels, or a string, one of: small, medium, large. + * @param withHeight The title height. + */ public void setHeight(Object withHeight) { height = withHeight; } + /** + * Gets title width. This can be a number, representing the task module's + * width in pixels, or a string, one of: small, medium, large. + * @return The title width. + */ public Object getWidth() { return width; } + /** + * Sets title width. This can be a number, representing the task module's + * width in pixels, or a string, one of: small, medium, large. + * @param withWidth The title width. + */ public void setWidth(Object withWidth) { width = withWidth; } + /** + * Gets the URL of what is loaded as an iframe inside the task + * module. One of url or card is required. + * @return The module url. + */ public String getUrl() { return url; } + /** + * Sets the URL of what is loaded as an iframe inside the task + * module. One of url or card is required. + * @param withUrl The module url. + */ public void setUrl(String withUrl) { url = withUrl; } + /** + * Gets the Adaptive card to appear in the task module. + * @return The module task card. + */ public Attachment getCard() { return card; } + /** + * Sets the Adaptive card to appear in the task module. + * @param withCard The module task card. + */ public void setCard(Attachment withCard) { card = withCard; } + /** + * Gets the URL if a client does not support the task module feature, + * this URL is opened in a browser tab. + * @return The fallback url. + */ public String getFallbackUrl() { return fallbackUrl; } + /** + * Sets the URL if a client does not support the task module feature, + * this URL is opened in a browser tab. + * @param withFallbackUrl The fallback url. + */ public void setFallbackUrl(String withFallbackUrl) { fallbackUrl = withFallbackUrl; } + /** + * Gets id if a client does not support the task module feature, + * this URL is opened in a browser tab. + * @return The completion id. + */ public String getCompletionBotId() { return completionBotId; } + /** + * Sets id if a client does not support the task module feature, + * this URL is opened in a browser tab. + * @param withCompletionBotId The completion id. + */ public void setCompletionBotId(String withCompletionBotId) { completionBotId = withCompletionBotId; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java index 79bb84528..5131363bf 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamDetails.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Details related to a team. + */ public class TeamDetails { @JsonProperty(value = "id") private String id; @@ -21,42 +24,82 @@ public class TeamDetails { @JsonProperty(value = "memberCount") private int memberCount; + /** + * Gets unique identifier representing a team. + * @return The teams id. + */ public String getId() { return id; } + /** + * Sets unique identifier representing a team. + * @param withId The teams id. + */ public void setId(String withId) { this.id = withId; } + /** + * Gets name of team. + * @return The team name. + */ public String getName() { return name; } + /** + * Sets name of team. + * @param withName The team name. + */ public void setName(String withName) { name = withName; } + /** + * Gets Azure Active Directory (AAD) Group Id for the team. + * @return The Azure group id. + */ public String getAadGroupId() { return aadGroupId; } + /** + * Sets Azure Active Directory (AAD) Group Id for the team. + * @param withAadGroupId The Azure group id. + */ public void setAadGroupId(String withAadGroupId) { aadGroupId = withAadGroupId; } + /** + * Gets the number of channels in the team. + * @return The number of channels. + */ public int getChannelCount() { return channelCount; } + /** + * Sets the number of channels in the team. + * @param withChannelCount The number of channels. + */ public void setChannelCount(int withChannelCount) { channelCount = withChannelCount; } + /** + * Gets the number of members in the team. + * @return The number of memebers. + */ public int getMemberCount() { return memberCount; } + /** + * Sets the number of members in the team. + * @param withMemberCount The number of members. + */ public void setMemberCount(int withMemberCount) { memberCount = withMemberCount; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java index 7b4726630..0edc064bf 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsChannelAccount.java @@ -5,6 +5,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; +/** + * Teams channel account detailing user Azure Active Directory details. + */ public class TeamsChannelAccount { @JsonProperty(value = "givenName") private String givenName; @@ -21,42 +24,82 @@ public class TeamsChannelAccount { @JsonProperty(value = "objectId") private String aadObjectId; + /** + * Gets given name part of the user name. + * @return The users given name. + */ public String getGivenName() { return givenName; } + /** + * Sets given name part of the user name. + * @param withGivenName The users given name. + */ public void setGivenName(String withGivenName) { givenName = withGivenName; } + /** + * Gets surname part of the user name. + * @return The users surname. + */ public String getSurname() { return surname; } + /** + * Sets surname part of the user name. + * @param withSurname The users surname. + */ public void setSurname(String withSurname) { surname = withSurname; } + /** + * Gets email Id of the user. + * @return The users email address. + */ public String getEmail() { return email; } + /** + * Sets email Id of the user. + * @param withEmail The users email address. + */ public void setEmail(String withEmail) { email = withEmail; } + /** + * Gets unique user principal name. + * @return The users principal name. + */ public String getUserPrincipalName() { return userPrincipalName; } + /** + * Sets unique user principal name. + * @param withUserPrincipalName The users principal name. + */ public void setUserPrincipalName(String withUserPrincipalName) { userPrincipalName = withUserPrincipalName; } + /** + * Gets the AAD Object Id. + * @return The AAD object id. + */ public String getAadObjectId() { return aadObjectId; } + /** + * Sets the AAD Object Id. + * @param withAadObjectId The AAD object id. + */ public void setAadObjectId(String withAadObjectId) { aadObjectId = withAadObjectId; } diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java index 3a93e60f1..704e1cb41 100644 --- a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TeamsPagedMembersResult.java @@ -3,29 +3,53 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; +/** + * Teams page of members. + */ public class TeamsPagedMembersResult { @JsonProperty(value = "continuationToken") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private String continuationToken; @JsonProperty(value = "members") + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List members; + /** + * Gets paging token. + * @return The continuation token to be used in the next call. + */ public String getContinuationToken() { return continuationToken; } + /** + * Sets paging token. + * @param withContinuationToken The continuation token. + */ public void setContinuationToken(String withContinuationToken) { continuationToken = withContinuationToken; } + /** + * Gets the Channel Accounts. + * + * @return the members value + */ public List getMembers() { return members; } + /** + * Sets the Channel Accounts. + * + * @param withMembers the members value to set + */ public void setMembers(List withMembers) { members = withMembers; }