Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CacheInfo for Teams invoke responses #4548

Merged
merged 3 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
53 changes: 53 additions & 0 deletions libraries/Microsoft.Bot.Schema/Teams/Generated/CacheInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// 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;

/// <summary>
/// A cache info object which notifies Teams how long an object should be cached for.
/// </summary>
public partial class CacheInfo
{
/// <summary>
/// Initializes a new instance of the <see cref="CacheInfo"/> class.
/// </summary>
public CacheInfo()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the <see cref="CacheInfo"/> class.
/// </summary>
/// <param name="cacheType">Type of Cache Info.</param>
/// <param name="cacheDuration">Duration of the Cached Info.</param>
public CacheInfo(string cacheType = default(string), int cacheDuration = default(int))
{
CacheType = cacheType;
CacheDuration = cacheDuration;
CustomInit();
}

/// <summary>
/// Gets or sets cache type.
/// </summary>
/// <value>The type of cache for this object.</value>
[JsonProperty(PropertyName = "cacheType")]
public string CacheType { get; set; }

/// <summary>
/// Gets or sets cache duration.
/// </summary>
/// <value>The time in seconds for which the cached object should remain in the cache.</value>
[JsonProperty(PropertyName = "cacheDuration")]
public int CacheDuration { get; set; }

/// <summary>
/// An initialization method that performs custom operations like setting defaults.
/// </summary>
partial void CustomInit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ public MessagingExtensionActionResponse()
/// <param name="task">The JSON for the Adaptive card to appear in the
/// task module.</param>
/// <param name="composeExtension">A <see cref="MessagingExtensionResult"/> that initializes the current object's ComposeExension property.</param>
public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult))
/// <param name="cacheInfo">Cache information for this Messaging Extension Action Response.</param>
public MessagingExtensionActionResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo))
{
Task = task;
ComposeExtension = composeExtension;
CacheInfo = cacheInfo;
CustomInit();
}

Expand All @@ -59,5 +61,10 @@ public MessagingExtensionActionResponse()
[JsonProperty(PropertyName = "composeExtension")]
public MessagingExtensionResult ComposeExtension { get; set; }

/// <summary>
/// Gets or sets the CacheInfo for this MessagingExtensionActionResponse.
/// </summary>
[JsonProperty(PropertyName = "cacheInfo")]
public CacheInfo CacheInfo { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ public MessagingExtensionResponse()
/// <summary>
/// Initializes a new instance of the MessagingExtensionResponse class.
/// </summary>
public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult))
/// <param name="composeExtension">A <see cref="MessagingExtensionResult"/> that initializes the current object's ComposeExension property.</param>
/// <param name="cacheInfo">Cache information for this Messaging Extension Response.</param>
public MessagingExtensionResponse(MessagingExtensionResult composeExtension = default(MessagingExtensionResult), CacheInfo cacheInfo = default(CacheInfo))
{
ComposeExtension = composeExtension;
CacheInfo = cacheInfo;
CustomInit();
}

Expand All @@ -45,5 +48,11 @@ public MessagingExtensionResponse()
[JsonProperty(PropertyName = "composeExtension")]
public MessagingExtensionResult ComposeExtension { get; set; }

/// <summary>
/// Gets or sets the CacheInfo for this MessagingExtensionResponse.
/// module.
/// </summary>
[JsonProperty(PropertyName = "cacheInfo")]
public CacheInfo CacheInfo { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// <auto-generated>
// <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
Expand Down Expand Up @@ -31,7 +31,8 @@ public TaskModuleResponse()
/// </summary>
/// <param name="task">The JSON for the Adaptive card to appear in the
/// task module.</param>
public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase))
/// <param name="cacheInfo">Cache Information for this Task Module Response.</param>
public TaskModuleResponse(TaskModuleResponseBase task = default(TaskModuleResponseBase), CacheInfo cacheInfo = default(CacheInfo))
{
Task = task;
CustomInit();
Expand All @@ -49,5 +50,11 @@ public TaskModuleResponse()
[JsonProperty(PropertyName = "task")]
public TaskModuleResponseBase Task { get; set; }

/// <summary>
/// Gets or sets the CacheInfo for this TaskModuleResponse.
/// module.
/// </summary>
[JsonProperty(PropertyName = "cacheInfo")]
public CacheInfo CacheInfo { get; set; }
}
}