This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Teams Adaptive Cards model classes * Teams Adaptive Cars, TeamsActivityHandler Co-authored-by: Lee Parrish <[email protected]>
- Loading branch information
1 parent
d224f55
commit f24b0b9
Showing
12 changed files
with
623 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.bot.schema.teams; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Current tab request context, i.e., the current theme. | ||
*/ | ||
public class TabContext { | ||
@JsonProperty(value = "theme") | ||
private String theme; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabContext() { | ||
|
||
} | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
* @param withTheme The current user's theme. | ||
*/ | ||
public TabContext(String withTheme) { | ||
theme = withTheme; | ||
} | ||
|
||
/** | ||
* Gets the current user's theme. | ||
* @return The current user's theme. | ||
*/ | ||
public String getTheme() { | ||
return theme; | ||
} | ||
|
||
/** | ||
* Sets the current user's theme. | ||
* @param withTheme The current user's theme. | ||
*/ | ||
public void setTheme(String withTheme) { | ||
theme = withTheme; | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabEntityContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.bot.schema.teams; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Current TabRequest entity context, or 'tabEntityId'. | ||
*/ | ||
public class TabEntityContext { | ||
@JsonProperty(value = "tabEntityId") | ||
private String tabEntityId; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabEntityContext() { | ||
|
||
} | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
* @param withTabEntityId The entity id of the tab. | ||
*/ | ||
public TabEntityContext(String withTabEntityId) { | ||
tabEntityId = withTabEntityId; | ||
} | ||
|
||
/** | ||
* Gets the entity id of the tab. | ||
* @return The entity id of the tab. | ||
*/ | ||
public String getTabEntityId() { | ||
return tabEntityId; | ||
} | ||
|
||
/** | ||
* Sets the entity id of the tab. | ||
* @param withTabEntityId The entity id of the tab. | ||
*/ | ||
public void setTabEntityId(String withTabEntityId) { | ||
tabEntityId = withTabEntityId; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.bot.schema.teams; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Invoke ('tab/fetch') request value payload. | ||
*/ | ||
public class TabRequest { | ||
@JsonProperty(value = "tabContext") | ||
private TabEntityContext tabContext; | ||
|
||
@JsonProperty(value = "context") | ||
private TabContext context; | ||
|
||
@JsonProperty(value = "state") | ||
private String state; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabRequest() { | ||
|
||
} | ||
|
||
/** | ||
* Gets current tab entity request context. | ||
* @return Tab context | ||
*/ | ||
public TabEntityContext getTabContext() { | ||
return tabContext; | ||
} | ||
|
||
/** | ||
* Sets current tab entity request context. | ||
* @param withTabContext Tab context | ||
*/ | ||
public void setTabContext(TabEntityContext withTabContext) { | ||
tabContext = withTabContext; | ||
} | ||
|
||
/** | ||
* Gets current user context, i.e., the current theme. | ||
* @return Current user context, i.e., the current theme. | ||
*/ | ||
public TabContext getContext() { | ||
return context; | ||
} | ||
|
||
/** | ||
* Sets current user context, i.e., the current theme. | ||
* @param withContext Current user context, i.e., the current theme. | ||
*/ | ||
public void setContext(TabContext withContext) { | ||
context = withContext; | ||
} | ||
|
||
/** | ||
* Gets state, which is the magic code for OAuth Flow. | ||
* @return State, which is the magic code for OAuth Flow. | ||
*/ | ||
public String getState() { | ||
return state; | ||
} | ||
|
||
/** | ||
* Sets state, which is the magic code for OAuth Flow. | ||
* @param withState State, which is the magic code for OAuth Flow. | ||
*/ | ||
public void setState(String withState) { | ||
state = withState; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
|
||
/** | ||
* Envelope for Card Tab Response Payload. | ||
*/ | ||
public class TabResponse { | ||
@JsonProperty(value = "tab") | ||
private TabResponsePayload tab; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabResponse() { | ||
|
||
} | ||
|
||
/** | ||
* Gets the response to the tab/fetch message. | ||
* @return Cards in response to a TabRequest. | ||
*/ | ||
public TabResponsePayload getTab() { | ||
return tab; | ||
} | ||
|
||
/** | ||
* Sets the response to the tab/fetch message. | ||
* @param withTab Cards in response to a TabRequest. | ||
*/ | ||
public void setTab(TabResponsePayload withTab) { | ||
tab = withTab; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabResponseCard.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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; | ||
|
||
/** | ||
* Envelope for cards for a Tab request. | ||
*/ | ||
public class TabResponseCard { | ||
@JsonProperty(value = "card") | ||
private Object card; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabResponseCard() { | ||
|
||
} | ||
|
||
/** | ||
* Gets adaptive card for this card tab response. | ||
* @return Cards for this TabResponse. | ||
*/ | ||
public Object getCard() { | ||
return card; | ||
} | ||
|
||
/** | ||
* Sets adaptive card for this card tab response. | ||
* @param withCard Cards for this TabResponse. | ||
*/ | ||
public void setCard(Object withCard) { | ||
card = withCard; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TabResponseCards.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// 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; | ||
|
||
/** | ||
* Envelope for cards for a TabResponse. | ||
*/ | ||
public class TabResponseCards { | ||
@JsonProperty(value = "cards") | ||
private List<Object> cards; | ||
|
||
/** | ||
* Initializes a new instance of the class. | ||
*/ | ||
public TabResponseCards() { | ||
|
||
} | ||
|
||
/** | ||
* Gets adaptive cards for this card tab response. | ||
* @return Cards for the TabResponse. | ||
*/ | ||
public List<Object> getCards() { | ||
return cards; | ||
} | ||
|
||
/** | ||
* Sets adaptive cards for this card tab response. | ||
* @param withCards Cards for the TabResponse. | ||
*/ | ||
public void setCards(List<Object> withCards) { | ||
cards = withCards; | ||
} | ||
} |
Oops, something went wrong.