Teams Adaptive Card Tabs by tracyboehrer · Pull Request #963 · microsoft/botbuilder-java · GitHub
Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
Loading