Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Commit f79a831

Browse files
authored
Merge pull request #827 from microsoft/trboehre/cacheinfo
Teams CacheInfo
2 parents c9dcdce + e58bc6f commit f79a831

File tree

4 files changed

+113
-1
lines changed

4 files changed

+113
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
package com.microsoft.bot.schema.teams;
5+
6+
import com.fasterxml.jackson.annotation.JsonProperty;
7+
8+
/**
9+
* A cache info object which notifies Teams how long an object should be cached for.
10+
*/
11+
public class CacheInfo {
12+
@JsonProperty(value = "cacheType")
13+
private String cacheType;
14+
15+
@JsonProperty(value = "cacheDuration")
16+
private int cacheDuration;
17+
18+
/**
19+
* Gets cache type.
20+
* @return The type of cache for this object.
21+
*/
22+
public String getCacheType() {
23+
return cacheType;
24+
}
25+
26+
/**
27+
* Sets cache type.
28+
* @param withCacheType The type of cache for this object.
29+
*/
30+
public void setCacheType(String withCacheType) {
31+
cacheType = withCacheType;
32+
}
33+
34+
/**
35+
* Gets cache duration.
36+
* @return The time in seconds for which the cached object should remain in the cache.
37+
*/
38+
public int getCacheDuration() {
39+
return cacheDuration;
40+
}
41+
42+
/**
43+
* Sets cache duration.
44+
* @param withCacheDuration The time in seconds for which the cached object should
45+
* remain in the cache.
46+
*/
47+
public void setCacheDuration(int withCacheDuration) {
48+
cacheDuration = withCacheDuration;
49+
}
50+
}

libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionActionResponse.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public class MessagingExtensionActionResponse {
1818
@JsonInclude(JsonInclude.Include.NON_EMPTY)
1919
private MessagingExtensionResult composeExtension;
2020

21+
@JsonProperty(value = "cacheInfo")
22+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
23+
private CacheInfo cacheInfo;
24+
2125
/**
2226
* Gets the Adaptive card to appear in the task module.
2327
*
@@ -53,4 +57,20 @@ public MessagingExtensionResult getComposeExtension() {
5357
public void setComposeExtension(MessagingExtensionResult withComposeExtension) {
5458
composeExtension = withComposeExtension;
5559
}
60+
61+
/**
62+
* Gets the CacheInfo for this MessagingExtensionActionResponse.
63+
* @return CacheInfo
64+
*/
65+
public CacheInfo getCacheInfo() {
66+
return cacheInfo;
67+
}
68+
69+
/**
70+
* Sets the CacheInfo for this MessagingExtensionActionResponse.
71+
* @param withCacheInfo CacheInfo
72+
*/
73+
public void setCacheInfo(CacheInfo withCacheInfo) {
74+
cacheInfo = withCacheInfo;
75+
}
5676
}

libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/MessagingExtensionResponse.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package com.microsoft.bot.schema.teams;
55

6+
import com.fasterxml.jackson.annotation.JsonInclude;
67
import com.fasterxml.jackson.annotation.JsonProperty;
78

89
/**
@@ -12,8 +13,12 @@ public class MessagingExtensionResponse {
1213
@JsonProperty(value = "composeExtension")
1314
private MessagingExtensionResult composeExtension;
1415

16+
@JsonProperty(value = "cacheInfo")
17+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
18+
private CacheInfo cacheInfo;
19+
1520
/**
16-
* Creates a new empty response with the specified result.
21+
* Creates a new empty response.
1722
*/
1823
public MessagingExtensionResponse() {
1924

@@ -45,4 +50,20 @@ public MessagingExtensionResult getComposeExtension() {
4550
public void setComposeExtension(MessagingExtensionResult withComposeExtension) {
4651
composeExtension = withComposeExtension;
4752
}
53+
54+
/**
55+
* Gets the CacheInfo for this MessagingExtensionResponse.
56+
* @return CacheInfo
57+
*/
58+
public CacheInfo getCacheInfo() {
59+
return cacheInfo;
60+
}
61+
62+
/**
63+
* Sets the CacheInfo for this MessagingExtensionResponse.
64+
* @param withCacheInfo CacheInfo
65+
*/
66+
public void setCacheInfo(CacheInfo withCacheInfo) {
67+
cacheInfo = withCacheInfo;
68+
}
4869
}

libraries/bot-schema/src/main/java/com/microsoft/bot/schema/teams/TaskModuleResponse.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package com.microsoft.bot.schema.teams;
55

6+
import com.fasterxml.jackson.annotation.JsonInclude;
67
import com.fasterxml.jackson.annotation.JsonProperty;
78

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

16+
@JsonProperty(value = "cacheInfo")
17+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
18+
private CacheInfo cacheInfo;
19+
1520
/**
1621
* Gets the response task.
1722
*
@@ -29,4 +34,20 @@ public TaskModuleResponseBase getTask() {
2934
public void setTask(TaskModuleResponseBase withTask) {
3035
task = withTask;
3136
}
37+
38+
/**
39+
* Gets the CacheInfo for this MessagingExtensionActionResponse.
40+
* @return CacheInfo
41+
*/
42+
public CacheInfo getCacheInfo() {
43+
return cacheInfo;
44+
}
45+
46+
/**
47+
* Sets the CacheInfo for this MessagingExtensionActionResponse.
48+
* @param withCacheInfo CacheInfo
49+
*/
50+
public void setCacheInfo(CacheInfo withCacheInfo) {
51+
cacheInfo = withCacheInfo;
52+
}
3253
}

0 commit comments

Comments
 (0)