From 4122c5fd9a61922a08279a9dcfaf1e6e44e29563 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 20:29:05 +0000 Subject: [PATCH 1/3] Initial plan From 5351b10a44e13f0b8e3775ff6bf8b6078629f4e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 20:31:01 +0000 Subject: [PATCH 2/3] Replace AttachmentLayout 'carousel' with 'grid' Agent-Logs-Url: https://github.com/microsoft/teams.net/sessions/23017044-2ca1-46f9-9a18-5d084e4a18fc Co-authored-by: corinagum <14900841+corinagum@users.noreply.github.com> --- Libraries/Microsoft.Teams.Api/Attachment.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Microsoft.Teams.Api/Attachment.cs b/Libraries/Microsoft.Teams.Api/Attachment.cs index 7d7ae8a8..be2add8b 100644 --- a/Libraries/Microsoft.Teams.Api/Attachment.cs +++ b/Libraries/Microsoft.Teams.Api/Attachment.cs @@ -130,8 +130,8 @@ public class Layout(string value) : StringEnum(value) [JsonIgnore] public bool IsList => List.Equals(Value); - public static readonly Layout Carousel = new("carousel"); + public static readonly Layout Grid = new("grid"); [JsonIgnore] - public bool IsCarousel => Carousel.Equals(Value); + public bool IsGrid => Grid.Equals(Value); } } \ No newline at end of file From 3bccf7d8d836e67c2c33016ab24ffa3efddef33c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 7 May 2026 21:13:52 +0000 Subject: [PATCH 3/3] Add MessageExtensions.AttachmentLayout and revert Attachment.Layout Agent-Logs-Url: https://github.com/microsoft/teams.net/sessions/815d7134-0c52-4af0-96a0-275388419bdf Co-authored-by: corinagum <14900841+corinagum@users.noreply.github.com> --- Libraries/Microsoft.Teams.Api/Attachment.cs | 4 ++-- .../MessageExtensions/AttachmentLayout.cs | 24 +++++++++++++++++++ .../MessageExtensions/Result.cs | 2 +- Samples/Samples.MessageExtensions/Program.cs | 12 +++++----- 4 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 Libraries/Microsoft.Teams.Api/MessageExtensions/AttachmentLayout.cs diff --git a/Libraries/Microsoft.Teams.Api/Attachment.cs b/Libraries/Microsoft.Teams.Api/Attachment.cs index be2add8b..7d7ae8a8 100644 --- a/Libraries/Microsoft.Teams.Api/Attachment.cs +++ b/Libraries/Microsoft.Teams.Api/Attachment.cs @@ -130,8 +130,8 @@ public class Layout(string value) : StringEnum(value) [JsonIgnore] public bool IsList => List.Equals(Value); - public static readonly Layout Grid = new("grid"); + public static readonly Layout Carousel = new("carousel"); [JsonIgnore] - public bool IsGrid => Grid.Equals(Value); + public bool IsCarousel => Carousel.Equals(Value); } } \ No newline at end of file diff --git a/Libraries/Microsoft.Teams.Api/MessageExtensions/AttachmentLayout.cs b/Libraries/Microsoft.Teams.Api/MessageExtensions/AttachmentLayout.cs new file mode 100644 index 00000000..9c84dcfc --- /dev/null +++ b/Libraries/Microsoft.Teams.Api/MessageExtensions/AttachmentLayout.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Text.Json.Serialization; + +using Microsoft.Teams.Common; + +namespace Microsoft.Teams.Api.MessageExtensions; + +/// +/// Hint for how to deal with multiple messaging extension result attachments. +/// Possible values include: 'list', 'grid'. +/// +[JsonConverter(typeof(JsonConverter))] +public class AttachmentLayout(string value) : StringEnum(value) +{ + public static readonly AttachmentLayout List = new("list"); + [JsonIgnore] + public bool IsList => List.Equals(Value); + + public static readonly AttachmentLayout Grid = new("grid"); + [JsonIgnore] + public bool IsGrid => Grid.Equals(Value); +} \ No newline at end of file diff --git a/Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs b/Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs index f7dc401a..5995c6b9 100644 --- a/Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs +++ b/Libraries/Microsoft.Teams.Api/MessageExtensions/Result.cs @@ -42,7 +42,7 @@ public class Result /// [JsonPropertyName("attachmentLayout")] [JsonPropertyOrder(0)] - public Api.Attachment.Layout? AttachmentLayout { get; set; } + public AttachmentLayout? AttachmentLayout { get; set; } /// /// The type of the result. Possible values include: diff --git a/Samples/Samples.MessageExtensions/Program.cs b/Samples/Samples.MessageExtensions/Program.cs index a82cd559..38048b70 100644 --- a/Samples/Samples.MessageExtensions/Program.cs +++ b/Samples/Samples.MessageExtensions/Program.cs @@ -60,7 +60,7 @@ ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = new List() } }); @@ -198,7 +198,7 @@ static Microsoft.Teams.Api.MessageExtensions.Response CreateSearchResults(string ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = attachments } }; @@ -233,7 +233,7 @@ static Microsoft.Teams.Api.MessageExtensions.Response HandleCreateCard(JsonEleme ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = new List { attachment } } }; @@ -268,7 +268,7 @@ static Microsoft.Teams.Api.MessageExtensions.Response HandleGetMessageDetails(Mi ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = new List { attachment } } }; @@ -303,7 +303,7 @@ static Microsoft.Teams.Api.MessageExtensions.Response CreateLinkUnfurlResponse(s ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = new List { attachment } } }; @@ -335,7 +335,7 @@ static Microsoft.Teams.Api.MessageExtensions.Response CreateItemSelectionRespons ComposeExtension = new Microsoft.Teams.Api.MessageExtensions.Result { Type = Microsoft.Teams.Api.MessageExtensions.ResultType.Result, - AttachmentLayout = Microsoft.Teams.Api.Attachment.Layout.List, + AttachmentLayout = Microsoft.Teams.Api.MessageExtensions.AttachmentLayout.List, Attachments = new List { attachment } } };