From 47f5e968314f6d935a302290a237622155fb4b4c Mon Sep 17 00:00:00 2001 From: Eric Dahlvang Date: Sat, 29 Aug 2020 11:52:26 -0500 Subject: [PATCH 1/3] Add CacheInfo for Teams invoke responses --- .../Teams/Generated/CacheInfo.cs | 52 +++++++++++++++++++ .../MessagingExtensionActionResponse.cs | 9 +++- .../Generated/MessagingExtensionResponse.cs | 11 +++- .../Teams/Generated/TaskModuleResponse.cs | 11 +++- 4 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs new file mode 100644 index 0000000000..c39bf3725e --- /dev/null +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +namespace Microsoft.Bot.Schema.Teams +{ + using Newtonsoft.Json; + + /// + /// A cache info object which notifies Teams how long an object should be cached for. + /// + public partial class CacheInfo + { + /// + /// Initializes a new instance of the CacheInfo class. + /// + public CacheInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CacheInfo class. + /// + /// Type of Cache Info + /// Duration of the Cached Info. + public CacheInfo(string cacheType = default(string), int cacheDuration = default(int)) + { + CacheType = cacheType; + CacheDuration = cacheDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets cache type. + /// + [JsonProperty(PropertyName = "cacheType")] + public string CacheType { get; set; } + + /// + /// Gets or sets cache duration. + /// + [JsonProperty(PropertyName = "cacheDuration")] + public int CacheDuration { get; set; } + + } +} diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs index b0fad4ea7f..d869783af1 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs @@ -34,10 +34,12 @@ public MessagingExtensionActionResponse() /// The JSON for the Adaptive card to appear in the /// task module. /// A that initializes the current object's ComposeExension property. - public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult)) + /// Cache information for this Messaging Extension Action Response. + public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo)) { Task = task; ComposeExtension = composeExtension; + CacheInfo = cacheInfo; CustomInit(); } @@ -59,5 +61,10 @@ public MessagingExtensionActionResponse() [JsonProperty(PropertyName = "composeExtension")] public MessagingExtensionResult ComposeExtension { get; set; } + /// + /// Gets or sets the CacheInfo for this MessagingExtensionActionResponse. + /// + [JsonProperty(PropertyName = "cacheInfo")] + public CacheInfo CacheInfo { get; set; } } } diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs index 978de0e55e..ec2b56dd38 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs @@ -29,9 +29,12 @@ public MessagingExtensionResponse() /// /// Initializes a new instance of the MessagingExtensionResponse class. /// - public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult)) + /// A that initializes the current object's ComposeExension property. + /// Cache information for this Messaging Extension Response. + public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo)) { ComposeExtension = composeExtension; + CacheInfo = cacheInfo; CustomInit(); } @@ -45,5 +48,11 @@ public MessagingExtensionResponse() [JsonProperty(PropertyName = "composeExtension")] public MessagingExtensionResult ComposeExtension { get; set; } + /// + /// Gets or sets the CacheInfo for this MessagingExtensionResponse. + /// module. + /// + [JsonProperty(PropertyName = "cacheInfo")] + public CacheInfo CacheInfo { get; set; } } } diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs index f46b1eefdf..e8e5b1e6c3 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs @@ -1,4 +1,4 @@ -// +// // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -31,7 +31,8 @@ public TaskModuleResponse() /// /// The JSON for the Adaptive card to appear in the /// task module. - public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase)) + /// Cache Information for this Task Module Response. + public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), CacheInfo cacheInfo = default(CacheInfo)) { Task = task; CustomInit(); @@ -49,5 +50,11 @@ public TaskModuleResponse() [JsonProperty(PropertyName = "task")] public TaskModuleResponseBase Task { get; set; } + /// + /// Gets or sets the CacheInfo for this TaskModuleResponse. + /// module. + /// + [JsonProperty(PropertyName = "cacheInfo")] + public CacheInfo CacheInfo { get; set; } } } From 5fd55fe733713df122d569acccf0c2b4d39369c5 Mon Sep 17 00:00:00 2001 From: Eric Dahlvang Date: Sat, 29 Aug 2020 12:13:13 -0500 Subject: [PATCH 2/3] Fix code style rules. --- .../Teams/Generated/CacheInfo.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs index c39bf3725e..58c089aaa3 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs @@ -12,7 +12,7 @@ namespace Microsoft.Bot.Schema.Teams public partial class CacheInfo { /// - /// Initializes a new instance of the CacheInfo class. + /// Initializes a new instance of the class. /// public CacheInfo() { @@ -20,9 +20,9 @@ public CacheInfo() } /// - /// Initializes a new instance of the CacheInfo class. + /// Initializes a new instance of the class. /// - /// Type of Cache Info + /// Type of Cache Info. /// Duration of the Cached Info. public CacheInfo(string cacheType = default(string), int cacheDuration = default(int)) { @@ -31,22 +31,23 @@ public CacheInfo() CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - /// /// Gets or sets cache type. /// + /// The type of cache for this object. [JsonProperty(PropertyName = "cacheType")] public string CacheType { get; set; } /// /// Gets or sets cache duration. /// + /// The time in seconds for which the cached object should remain in the cache. [JsonProperty(PropertyName = "cacheDuration")] public int CacheDuration { get; set; } + /// + /// An initialization method that performs custom operations like setting defaults. + /// + partial void CustomInit(); } } From 64dc53a9bf64112bca2ce3f187adc056a8183e26 Mon Sep 17 00:00:00 2001 From: Eric Dahlvang Date: Thu, 15 Oct 2020 16:24:24 -0700 Subject: [PATCH 3/3] Remove constructor paramters --- .../Teams/Generated/MessagingExtensionActionResponse.cs | 4 +--- .../Teams/Generated/MessagingExtensionResponse.cs | 4 +--- .../Teams/Generated/TaskModuleResponse.cs | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs index d869783af1..11be2b17cf 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionActionResponse.cs @@ -34,12 +34,10 @@ public MessagingExtensionActionResponse() /// The JSON for the Adaptive card to appear in the /// task module. /// A that initializes the current object's ComposeExension property. - /// Cache information for this Messaging Extension Action Response. - public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo)) + public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult)) { Task = task; ComposeExtension = composeExtension; - CacheInfo = cacheInfo; CustomInit(); } diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs index ec2b56dd38..d34c8899fd 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/MessagingExtensionResponse.cs @@ -30,11 +30,9 @@ public MessagingExtensionResponse() /// Initializes a new instance of the MessagingExtensionResponse class. /// /// A that initializes the current object's ComposeExension property. - /// Cache information for this Messaging Extension Response. - public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo)) + public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult)) { ComposeExtension = composeExtension; - CacheInfo = cacheInfo; CustomInit(); } diff --git a/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs b/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs index e8e5b1e6c3..81c4255813 100644 --- a/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs +++ b/libraries/Microsoft.Bot.Schema/Teams/Generated/TaskModuleResponse.cs @@ -31,8 +31,7 @@ public TaskModuleResponse() /// /// The JSON for the Adaptive card to appear in the /// task module. - /// Cache Information for this Task Module Response. - public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), CacheInfo cacheInfo = default(CacheInfo)) + public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase)) { Task = task; CustomInit();