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,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;

/**
* A cache info object which notifies Teams how long an object should be cached for.
*/
public class CacheInfo {
@JsonProperty(value = "cacheType")
private String cacheType;

@JsonProperty(value = "cacheDuration")
private int cacheDuration;

/**
* Gets cache type.
* @return The type of cache for this object.
*/
public String getCacheType() {
return cacheType;
}

/**
* Sets cache type.
* @param withCacheType The type of cache for this object.
*/
public void setCacheType(String withCacheType) {
cacheType = withCacheType;
}

/**
* Gets cache duration.
* @return The time in seconds for which the cached object should remain in the cache.
*/
public int getCacheDuration() {
return cacheDuration;
}

/**
* Sets cache duration.
* @param withCacheDuration The time in seconds for which the cached object should
* remain in the cache.
*/
public void setCacheDuration(int withCacheDuration) {
cacheDuration = withCacheDuration;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ public class MessagingExtensionActionResponse {
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private MessagingExtensionResult composeExtension;

@JsonProperty(value = "cacheInfo")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private CacheInfo cacheInfo;

/**
* Gets the Adaptive card to appear in the task module.
*
Expand Down Expand Up @@ -53,4 +57,20 @@ public MessagingExtensionResult getComposeExtension() {
public void setComposeExtension(MessagingExtensionResult withComposeExtension) {
composeExtension = withComposeExtension;
}

/**
* Gets the CacheInfo for this MessagingExtensionActionResponse.
* @return CacheInfo
*/
public CacheInfo getCacheInfo() {
return cacheInfo;
}

/**
* Sets the CacheInfo for this MessagingExtensionActionResponse.
* @param withCacheInfo CacheInfo
*/
public void setCacheInfo(CacheInfo withCacheInfo) {
cacheInfo = withCacheInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.microsoft.bot.schema.teams;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand All @@ -12,8 +13,12 @@ public class MessagingExtensionResponse {
@JsonProperty(value = "composeExtension")
private MessagingExtensionResult composeExtension;

@JsonProperty(value = "cacheInfo")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private CacheInfo cacheInfo;

/**
* Creates a new empty response with the specified result.
* Creates a new empty response.
*/
public MessagingExtensionResponse() {

Expand Down Expand Up @@ -45,4 +50,20 @@ public MessagingExtensionResult getComposeExtension() {
public void setComposeExtension(MessagingExtensionResult withComposeExtension) {
composeExtension = withComposeExtension;
}

/**
* Gets the CacheInfo for this MessagingExtensionResponse.
* @return CacheInfo
*/
public CacheInfo getCacheInfo() {
return cacheInfo;
}

/**
* Sets the CacheInfo for this MessagingExtensionResponse.
* @param withCacheInfo CacheInfo
*/
public void setCacheInfo(CacheInfo withCacheInfo) {
cacheInfo = withCacheInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.microsoft.bot.schema.teams;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand All @@ -12,6 +13,10 @@ public class TaskModuleResponse {
@JsonProperty(value = "task")
private TaskModuleResponseBase task;

@JsonProperty(value = "cacheInfo")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private CacheInfo cacheInfo;

/**
* Gets the response task.
*
Expand All @@ -29,4 +34,20 @@ public TaskModuleResponseBase getTask() {
public void setTask(TaskModuleResponseBase withTask) {
task = withTask;
}

/**
* Gets the CacheInfo for this MessagingExtensionActionResponse.
* @return CacheInfo
*/
public CacheInfo getCacheInfo() {
return cacheInfo;
}

/**
* Sets the CacheInfo for this MessagingExtensionActionResponse.
* @param withCacheInfo CacheInfo
*/
public void setCacheInfo(CacheInfo withCacheInfo) {
cacheInfo = withCacheInfo;
}
}