diff --git a/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/CacheInfo.java b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/CacheInfo.java new file mode 100644 index 000000000..2c8b5e913 --- /dev/null +++ b/libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/CacheInfo.java @@ -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; + } +} 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 221d727b1..c12ef85ed 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 @@ -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. * @@ -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; + } } 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 df81bd703..3c3d2675a 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 @@ -3,6 +3,7 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -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() { @@ -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; + } } 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 48072a989..13ab132cd 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 @@ -3,6 +3,7 @@ package com.microsoft.bot.schema.teams; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -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. * @@ -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; + } }