microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
next/core-activitybuilder

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Cards/Core.cs

16303lines · modecode

1// This file was automatically generated by a tool on 09/16/2025, 10:37 PM UTC. DO NOT UPDATE MANUALLY.
2// It includes declarations for Adaptive Card features available in Teams, Copilot, Outlook, Word, Excel, PowerPoint.
3
4#pragma warning disable IDE0290
5
6using System.Text.Json;
7using System.Text.Json.Serialization;
8
9using Microsoft.Teams.Common;
10
11namespace Microsoft.Teams.Cards;
12
13[JsonConverter(typeof(JsonConverter<ActionStyle>))]
14public class ActionStyle(string value) : StringEnum(value, caseSensitive: false)
15{
16 public static readonly ActionStyle Default = new("default");
17 public bool IsDefault => Default.Equals(Value);
18
19 public static readonly ActionStyle Positive = new("positive");
20 public bool IsPositive => Positive.Equals(Value);
21
22 public static readonly ActionStyle Destructive = new("destructive");
23 public bool IsDestructive => Destructive.Equals(Value);
24}
25
26[JsonConverter(typeof(JsonConverter<ActionMode>))]
27public class ActionMode(string value) : StringEnum(value, caseSensitive: false)
28{
29 public static readonly ActionMode Primary = new("primary");
30 public bool IsPrimary => Primary.Equals(Value);
31
32 public static readonly ActionMode Secondary = new("secondary");
33 public bool IsSecondary => Secondary.Equals(Value);
34}
35
36[JsonConverter(typeof(JsonConverter<AssociatedInputs>))]
37public class AssociatedInputs(string value) : StringEnum(value, caseSensitive: false)
38{
39 public static readonly AssociatedInputs Auto = new("auto");
40 public bool IsAuto => Auto.Equals(Value);
41
42 public static readonly AssociatedInputs None = new("none");
43 public bool IsNone => None.Equals(Value);
44}
45
46[JsonConverter(typeof(JsonConverter<ImageInsertPosition>))]
47public class ImageInsertPosition(string value) : StringEnum(value, caseSensitive: false)
48{
49 public static readonly ImageInsertPosition Selection = new("Selection");
50 public bool IsSelection => Selection.Equals(Value);
51
52 public static readonly ImageInsertPosition Top = new("Top");
53 public bool IsTop => Top.Equals(Value);
54
55 public static readonly ImageInsertPosition Bottom = new("Bottom");
56 public bool IsBottom => Bottom.Equals(Value);
57}
58
59[JsonConverter(typeof(JsonConverter<FallbackAction>))]
60public class FallbackAction(string value) : StringEnum(value, caseSensitive: false)
61{
62 public static readonly FallbackAction Drop = new("drop");
63 public bool IsDrop => Drop.Equals(Value);
64}
65
66[JsonConverter(typeof(JsonConverter<ContainerStyle>))]
67public class ContainerStyle(string value) : StringEnum(value, caseSensitive: false)
68{
69 public static readonly ContainerStyle Default = new("default");
70 public bool IsDefault => Default.Equals(Value);
71
72 public static readonly ContainerStyle Emphasis = new("emphasis");
73 public bool IsEmphasis => Emphasis.Equals(Value);
74
75 public static readonly ContainerStyle Accent = new("accent");
76 public bool IsAccent => Accent.Equals(Value);
77
78 public static readonly ContainerStyle Good = new("good");
79 public bool IsGood => Good.Equals(Value);
80
81 public static readonly ContainerStyle Attention = new("attention");
82 public bool IsAttention => Attention.Equals(Value);
83
84 public static readonly ContainerStyle Warning = new("warning");
85 public bool IsWarning => Warning.Equals(Value);
86}
87
88[JsonConverter(typeof(JsonConverter<TargetWidth>))]
89public class TargetWidth(string value) : StringEnum(value, caseSensitive: false)
90{
91 public static readonly TargetWidth VeryNarrow = new("VeryNarrow");
92 public bool IsVeryNarrow => VeryNarrow.Equals(Value);
93
94 public static readonly TargetWidth Narrow = new("Narrow");
95 public bool IsNarrow => Narrow.Equals(Value);
96
97 public static readonly TargetWidth Standard = new("Standard");
98 public bool IsStandard => Standard.Equals(Value);
99
100 public static readonly TargetWidth Wide = new("Wide");
101 public bool IsWide => Wide.Equals(Value);
102
103 public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow");
104 public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value);
105
106 public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow");
107 public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value);
108
109 public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow");
110 public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value);
111
112 public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow");
113 public bool IsAtMostNarrow => AtMostNarrow.Equals(Value);
114
115 public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard");
116 public bool IsAtLeastStandard => AtLeastStandard.Equals(Value);
117
118 public static readonly TargetWidth AtMostStandard = new("atMost:Standard");
119 public bool IsAtMostStandard => AtMostStandard.Equals(Value);
120
121 public static readonly TargetWidth AtLeastWide = new("atLeast:Wide");
122 public bool IsAtLeastWide => AtLeastWide.Equals(Value);
123
124 public static readonly TargetWidth AtMostWide = new("atMost:Wide");
125 public bool IsAtMostWide => AtMostWide.Equals(Value);
126}
127
128[JsonConverter(typeof(JsonConverter<HorizontalAlignment>))]
129public class HorizontalAlignment(string value) : StringEnum(value, caseSensitive: false)
130{
131 public static readonly HorizontalAlignment Left = new("Left");
132 public bool IsLeft => Left.Equals(Value);
133
134 public static readonly HorizontalAlignment Center = new("Center");
135 public bool IsCenter => Center.Equals(Value);
136
137 public static readonly HorizontalAlignment Right = new("Right");
138 public bool IsRight => Right.Equals(Value);
139}
140
141[JsonConverter(typeof(JsonConverter<VerticalAlignment>))]
142public class VerticalAlignment(string value) : StringEnum(value, caseSensitive: false)
143{
144 public static readonly VerticalAlignment Top = new("Top");
145 public bool IsTop => Top.Equals(Value);
146
147 public static readonly VerticalAlignment Center = new("Center");
148 public bool IsCenter => Center.Equals(Value);
149
150 public static readonly VerticalAlignment Bottom = new("Bottom");
151 public bool IsBottom => Bottom.Equals(Value);
152}
153
154[JsonConverter(typeof(JsonConverter<FlowLayoutItemFit>))]
155public class FlowLayoutItemFit(string value) : StringEnum(value, caseSensitive: false)
156{
157 public static readonly FlowLayoutItemFit Fit = new("Fit");
158 public bool IsFit => Fit.Equals(Value);
159
160 public static readonly FlowLayoutItemFit Fill = new("Fill");
161 public bool IsFill => Fill.Equals(Value);
162}
163
164[JsonConverter(typeof(JsonConverter<Spacing>))]
165public class Spacing(string value) : StringEnum(value, caseSensitive: false)
166{
167 public static readonly Spacing None = new("None");
168 public bool IsNone => None.Equals(Value);
169
170 public static readonly Spacing ExtraSmall = new("ExtraSmall");
171 public bool IsExtraSmall => ExtraSmall.Equals(Value);
172
173 public static readonly Spacing Small = new("Small");
174 public bool IsSmall => Small.Equals(Value);
175
176 public static readonly Spacing Default = new("Default");
177 public bool IsDefault => Default.Equals(Value);
178
179 public static readonly Spacing Medium = new("Medium");
180 public bool IsMedium => Medium.Equals(Value);
181
182 public static readonly Spacing Large = new("Large");
183 public bool IsLarge => Large.Equals(Value);
184
185 public static readonly Spacing ExtraLarge = new("ExtraLarge");
186 public bool IsExtraLarge => ExtraLarge.Equals(Value);
187
188 public static readonly Spacing Padding = new("Padding");
189 public bool IsPadding => Padding.Equals(Value);
190}
191
192[JsonConverter(typeof(JsonConverter<FillMode>))]
193public class FillMode(string value) : StringEnum(value, caseSensitive: false)
194{
195 public static readonly FillMode Cover = new("Cover");
196 public bool IsCover => Cover.Equals(Value);
197
198 public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally");
199 public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value);
200
201 public static readonly FillMode RepeatVertically = new("RepeatVertically");
202 public bool IsRepeatVertically => RepeatVertically.Equals(Value);
203
204 public static readonly FillMode Repeat = new("Repeat");
205 public bool IsRepeat => Repeat.Equals(Value);
206}
207
208[JsonConverter(typeof(JsonConverter<Version>))]
209public class Version(string value) : StringEnum(value, caseSensitive: false)
210{
211 public static readonly Version Version1_0 = new("1.0");
212 public bool IsVersion1_0 => Version1_0.Equals(Value);
213
214 public static readonly Version Version1_1 = new("1.1");
215 public bool IsVersion1_1 => Version1_1.Equals(Value);
216
217 public static readonly Version Version1_2 = new("1.2");
218 public bool IsVersion1_2 => Version1_2.Equals(Value);
219
220 public static readonly Version Version1_3 = new("1.3");
221 public bool IsVersion1_3 => Version1_3.Equals(Value);
222
223 public static readonly Version Version1_4 = new("1.4");
224 public bool IsVersion1_4 => Version1_4.Equals(Value);
225
226 public static readonly Version Version1_5 = new("1.5");
227 public bool IsVersion1_5 => Version1_5.Equals(Value);
228
229 public static readonly Version Version1_6 = new("1.6");
230 public bool IsVersion1_6 => Version1_6.Equals(Value);
231}
232
233[JsonConverter(typeof(JsonConverter<TeamsCardWidth>))]
234public class TeamsCardWidth(string value) : StringEnum(value, caseSensitive: false)
235{
236 public static readonly TeamsCardWidth Full = new("full");
237 public bool IsFull => Full.Equals(Value);
238}
239
240[JsonConverter(typeof(JsonConverter<MentionType>))]
241public class MentionType(string value) : StringEnum(value, caseSensitive: false)
242{
243 public static readonly MentionType Person = new("Person");
244 public bool IsPerson => Person.Equals(Value);
245
246 public static readonly MentionType Tag = new("Tag");
247 public bool IsTag => Tag.Equals(Value);
248}
249
250[JsonConverter(typeof(JsonConverter<ElementHeight>))]
251public class ElementHeight(string value) : StringEnum(value, caseSensitive: false)
252{
253 public static readonly ElementHeight Auto = new("auto");
254 public bool IsAuto => Auto.Equals(Value);
255
256 public static readonly ElementHeight Stretch = new("stretch");
257 public bool IsStretch => Stretch.Equals(Value);
258}
259
260[JsonConverter(typeof(JsonConverter<TextSize>))]
261public class TextSize(string value) : StringEnum(value, caseSensitive: false)
262{
263 public static readonly TextSize Small = new("Small");
264 public bool IsSmall => Small.Equals(Value);
265
266 public static readonly TextSize Default = new("Default");
267 public bool IsDefault => Default.Equals(Value);
268
269 public static readonly TextSize Medium = new("Medium");
270 public bool IsMedium => Medium.Equals(Value);
271
272 public static readonly TextSize Large = new("Large");
273 public bool IsLarge => Large.Equals(Value);
274
275 public static readonly TextSize ExtraLarge = new("ExtraLarge");
276 public bool IsExtraLarge => ExtraLarge.Equals(Value);
277}
278
279[JsonConverter(typeof(JsonConverter<TextWeight>))]
280public class TextWeight(string value) : StringEnum(value, caseSensitive: false)
281{
282 public static readonly TextWeight Lighter = new("Lighter");
283 public bool IsLighter => Lighter.Equals(Value);
284
285 public static readonly TextWeight Default = new("Default");
286 public bool IsDefault => Default.Equals(Value);
287
288 public static readonly TextWeight Bolder = new("Bolder");
289 public bool IsBolder => Bolder.Equals(Value);
290}
291
292[JsonConverter(typeof(JsonConverter<TextColor>))]
293public class TextColor(string value) : StringEnum(value, caseSensitive: false)
294{
295 public static readonly TextColor Default = new("Default");
296 public bool IsDefault => Default.Equals(Value);
297
298 public static readonly TextColor Dark = new("Dark");
299 public bool IsDark => Dark.Equals(Value);
300
301 public static readonly TextColor Light = new("Light");
302 public bool IsLight => Light.Equals(Value);
303
304 public static readonly TextColor Accent = new("Accent");
305 public bool IsAccent => Accent.Equals(Value);
306
307 public static readonly TextColor Good = new("Good");
308 public bool IsGood => Good.Equals(Value);
309
310 public static readonly TextColor Warning = new("Warning");
311 public bool IsWarning => Warning.Equals(Value);
312
313 public static readonly TextColor Attention = new("Attention");
314 public bool IsAttention => Attention.Equals(Value);
315}
316
317[JsonConverter(typeof(JsonConverter<FontType>))]
318public class FontType(string value) : StringEnum(value, caseSensitive: false)
319{
320 public static readonly FontType Default = new("Default");
321 public bool IsDefault => Default.Equals(Value);
322
323 public static readonly FontType Monospace = new("Monospace");
324 public bool IsMonospace => Monospace.Equals(Value);
325}
326
327[JsonConverter(typeof(JsonConverter<StyleEnum>))]
328public class StyleEnum(string value) : StringEnum(value, caseSensitive: false)
329{
330 public static readonly StyleEnum Compact = new("compact");
331 public bool IsCompact => Compact.Equals(Value);
332
333 public static readonly StyleEnum Expanded = new("expanded");
334 public bool IsExpanded => Expanded.Equals(Value);
335
336 public static readonly StyleEnum Filtered = new("filtered");
337 public bool IsFiltered => Filtered.Equals(Value);
338}
339
340[JsonConverter(typeof(JsonConverter<ImageStyle>))]
341public class ImageStyle(string value) : StringEnum(value, caseSensitive: false)
342{
343 public static readonly ImageStyle Default = new("Default");
344 public bool IsDefault => Default.Equals(Value);
345
346 public static readonly ImageStyle Person = new("Person");
347 public bool IsPerson => Person.Equals(Value);
348
349 public static readonly ImageStyle RoundedCorners = new("RoundedCorners");
350 public bool IsRoundedCorners => RoundedCorners.Equals(Value);
351}
352
353[JsonConverter(typeof(JsonConverter<Size>))]
354public class Size(string value) : StringEnum(value, caseSensitive: false)
355{
356 public static readonly Size Auto = new("Auto");
357 public bool IsAuto => Auto.Equals(Value);
358
359 public static readonly Size Stretch = new("Stretch");
360 public bool IsStretch => Stretch.Equals(Value);
361
362 public static readonly Size Small = new("Small");
363 public bool IsSmall => Small.Equals(Value);
364
365 public static readonly Size Medium = new("Medium");
366 public bool IsMedium => Medium.Equals(Value);
367
368 public static readonly Size Large = new("Large");
369 public bool IsLarge => Large.Equals(Value);
370}
371
372[JsonConverter(typeof(JsonConverter<InputTextStyle>))]
373public class InputTextStyle(string value) : StringEnum(value, caseSensitive: false)
374{
375 public static readonly InputTextStyle Text = new("Text");
376 public bool IsText => Text.Equals(Value);
377
378 public static readonly InputTextStyle Tel = new("Tel");
379 public bool IsTel => Tel.Equals(Value);
380
381 public static readonly InputTextStyle Url = new("Url");
382 public bool IsUrl => Url.Equals(Value);
383
384 public static readonly InputTextStyle Email = new("Email");
385 public bool IsEmail => Email.Equals(Value);
386
387 public static readonly InputTextStyle Password = new("Password");
388 public bool IsPassword => Password.Equals(Value);
389}
390
391[JsonConverter(typeof(JsonConverter<RatingSize>))]
392public class RatingSize(string value) : StringEnum(value, caseSensitive: false)
393{
394 public static readonly RatingSize Medium = new("Medium");
395 public bool IsMedium => Medium.Equals(Value);
396
397 public static readonly RatingSize Large = new("Large");
398 public bool IsLarge => Large.Equals(Value);
399}
400
401[JsonConverter(typeof(JsonConverter<RatingColor>))]
402public class RatingColor(string value) : StringEnum(value, caseSensitive: false)
403{
404 public static readonly RatingColor Neutral = new("Neutral");
405 public bool IsNeutral => Neutral.Equals(Value);
406
407 public static readonly RatingColor Marigold = new("Marigold");
408 public bool IsMarigold => Marigold.Equals(Value);
409}
410
411[JsonConverter(typeof(JsonConverter<RatingStyle>))]
412public class RatingStyle(string value) : StringEnum(value, caseSensitive: false)
413{
414 public static readonly RatingStyle Default = new("Default");
415 public bool IsDefault => Default.Equals(Value);
416
417 public static readonly RatingStyle Compact = new("Compact");
418 public bool IsCompact => Compact.Equals(Value);
419}
420
421[JsonConverter(typeof(JsonConverter<IconSize>))]
422public class IconSize(string value) : StringEnum(value, caseSensitive: false)
423{
424 public static readonly IconSize XxSmall = new("xxSmall");
425 public bool IsXxSmall => XxSmall.Equals(Value);
426
427 public static readonly IconSize XSmall = new("xSmall");
428 public bool IsXSmall => XSmall.Equals(Value);
429
430 public static readonly IconSize Small = new("Small");
431 public bool IsSmall => Small.Equals(Value);
432
433 public static readonly IconSize Standard = new("Standard");
434 public bool IsStandard => Standard.Equals(Value);
435
436 public static readonly IconSize Medium = new("Medium");
437 public bool IsMedium => Medium.Equals(Value);
438
439 public static readonly IconSize Large = new("Large");
440 public bool IsLarge => Large.Equals(Value);
441
442 public static readonly IconSize XLarge = new("xLarge");
443 public bool IsXLarge => XLarge.Equals(Value);
444
445 public static readonly IconSize XxLarge = new("xxLarge");
446 public bool IsXxLarge => XxLarge.Equals(Value);
447}
448
449[JsonConverter(typeof(JsonConverter<IconStyle>))]
450public class IconStyle(string value) : StringEnum(value, caseSensitive: false)
451{
452 public static readonly IconStyle Regular = new("Regular");
453 public bool IsRegular => Regular.Equals(Value);
454
455 public static readonly IconStyle Filled = new("Filled");
456 public bool IsFilled => Filled.Equals(Value);
457}
458
459[JsonConverter(typeof(JsonConverter<CarouselPageAnimation>))]
460public class CarouselPageAnimation(string value) : StringEnum(value, caseSensitive: false)
461{
462 public static readonly CarouselPageAnimation Slide = new("Slide");
463 public bool IsSlide => Slide.Equals(Value);
464
465 public static readonly CarouselPageAnimation CrossFade = new("CrossFade");
466 public bool IsCrossFade => CrossFade.Equals(Value);
467
468 public static readonly CarouselPageAnimation None = new("None");
469 public bool IsNone => None.Equals(Value);
470}
471
472[JsonConverter(typeof(JsonConverter<BadgeIconPosition>))]
473public class BadgeIconPosition(string value) : StringEnum(value, caseSensitive: false)
474{
475 public static readonly BadgeIconPosition Before = new("Before");
476 public bool IsBefore => Before.Equals(Value);
477
478 public static readonly BadgeIconPosition After = new("After");
479 public bool IsAfter => After.Equals(Value);
480}
481
482[JsonConverter(typeof(JsonConverter<BadgeAppearance>))]
483public class BadgeAppearance(string value) : StringEnum(value, caseSensitive: false)
484{
485 public static readonly BadgeAppearance Filled = new("Filled");
486 public bool IsFilled => Filled.Equals(Value);
487
488 public static readonly BadgeAppearance Tint = new("Tint");
489 public bool IsTint => Tint.Equals(Value);
490}
491
492[JsonConverter(typeof(JsonConverter<BadgeSize>))]
493public class BadgeSize(string value) : StringEnum(value, caseSensitive: false)
494{
495 public static readonly BadgeSize Medium = new("Medium");
496 public bool IsMedium => Medium.Equals(Value);
497
498 public static readonly BadgeSize Large = new("Large");
499 public bool IsLarge => Large.Equals(Value);
500
501 public static readonly BadgeSize ExtraLarge = new("ExtraLarge");
502 public bool IsExtraLarge => ExtraLarge.Equals(Value);
503}
504
505[JsonConverter(typeof(JsonConverter<BadgeShape>))]
506public class BadgeShape(string value) : StringEnum(value, caseSensitive: false)
507{
508 public static readonly BadgeShape Square = new("Square");
509 public bool IsSquare => Square.Equals(Value);
510
511 public static readonly BadgeShape Rounded = new("Rounded");
512 public bool IsRounded => Rounded.Equals(Value);
513
514 public static readonly BadgeShape Circular = new("Circular");
515 public bool IsCircular => Circular.Equals(Value);
516}
517
518[JsonConverter(typeof(JsonConverter<BadgeStyle>))]
519public class BadgeStyle(string value) : StringEnum(value, caseSensitive: false)
520{
521 public static readonly BadgeStyle Default = new("Default");
522 public bool IsDefault => Default.Equals(Value);
523
524 public static readonly BadgeStyle Subtle = new("Subtle");
525 public bool IsSubtle => Subtle.Equals(Value);
526
527 public static readonly BadgeStyle Informative = new("Informative");
528 public bool IsInformative => Informative.Equals(Value);
529
530 public static readonly BadgeStyle Accent = new("Accent");
531 public bool IsAccent => Accent.Equals(Value);
532
533 public static readonly BadgeStyle Good = new("Good");
534 public bool IsGood => Good.Equals(Value);
535
536 public static readonly BadgeStyle Attention = new("Attention");
537 public bool IsAttention => Attention.Equals(Value);
538
539 public static readonly BadgeStyle Warning = new("Warning");
540 public bool IsWarning => Warning.Equals(Value);
541}
542
543[JsonConverter(typeof(JsonConverter<ChartColorSet>))]
544public class ChartColorSet(string value) : StringEnum(value, caseSensitive: false)
545{
546 public static readonly ChartColorSet Categorical = new("categorical");
547 public bool IsCategorical => Categorical.Equals(Value);
548
549 public static readonly ChartColorSet Sequential = new("sequential");
550 public bool IsSequential => Sequential.Equals(Value);
551
552 public static readonly ChartColorSet Diverging = new("diverging");
553 public bool IsDiverging => Diverging.Equals(Value);
554}
555
556[JsonConverter(typeof(JsonConverter<ChartColor>))]
557public class ChartColor(string value) : StringEnum(value, caseSensitive: false)
558{
559 public static readonly ChartColor Good = new("good");
560 public bool IsGood => Good.Equals(Value);
561
562 public static readonly ChartColor Warning = new("warning");
563 public bool IsWarning => Warning.Equals(Value);
564
565 public static readonly ChartColor Attention = new("attention");
566 public bool IsAttention => Attention.Equals(Value);
567
568 public static readonly ChartColor Neutral = new("neutral");
569 public bool IsNeutral => Neutral.Equals(Value);
570
571 public static readonly ChartColor CategoricalRed = new("categoricalRed");
572 public bool IsCategoricalRed => CategoricalRed.Equals(Value);
573
574 public static readonly ChartColor CategoricalPurple = new("categoricalPurple");
575 public bool IsCategoricalPurple => CategoricalPurple.Equals(Value);
576
577 public static readonly ChartColor CategoricalLavender = new("categoricalLavender");
578 public bool IsCategoricalLavender => CategoricalLavender.Equals(Value);
579
580 public static readonly ChartColor CategoricalBlue = new("categoricalBlue");
581 public bool IsCategoricalBlue => CategoricalBlue.Equals(Value);
582
583 public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue");
584 public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value);
585
586 public static readonly ChartColor CategoricalTeal = new("categoricalTeal");
587 public bool IsCategoricalTeal => CategoricalTeal.Equals(Value);
588
589 public static readonly ChartColor CategoricalGreen = new("categoricalGreen");
590 public bool IsCategoricalGreen => CategoricalGreen.Equals(Value);
591
592 public static readonly ChartColor CategoricalLime = new("categoricalLime");
593 public bool IsCategoricalLime => CategoricalLime.Equals(Value);
594
595 public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold");
596 public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value);
597
598 public static readonly ChartColor Sequential1 = new("sequential1");
599 public bool IsSequential1 => Sequential1.Equals(Value);
600
601 public static readonly ChartColor Sequential2 = new("sequential2");
602 public bool IsSequential2 => Sequential2.Equals(Value);
603
604 public static readonly ChartColor Sequential3 = new("sequential3");
605 public bool IsSequential3 => Sequential3.Equals(Value);
606
607 public static readonly ChartColor Sequential4 = new("sequential4");
608 public bool IsSequential4 => Sequential4.Equals(Value);
609
610 public static readonly ChartColor Sequential5 = new("sequential5");
611 public bool IsSequential5 => Sequential5.Equals(Value);
612
613 public static readonly ChartColor Sequential6 = new("sequential6");
614 public bool IsSequential6 => Sequential6.Equals(Value);
615
616 public static readonly ChartColor Sequential7 = new("sequential7");
617 public bool IsSequential7 => Sequential7.Equals(Value);
618
619 public static readonly ChartColor Sequential8 = new("sequential8");
620 public bool IsSequential8 => Sequential8.Equals(Value);
621
622 public static readonly ChartColor DivergingBlue = new("divergingBlue");
623 public bool IsDivergingBlue => DivergingBlue.Equals(Value);
624
625 public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue");
626 public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value);
627
628 public static readonly ChartColor DivergingCyan = new("divergingCyan");
629 public bool IsDivergingCyan => DivergingCyan.Equals(Value);
630
631 public static readonly ChartColor DivergingTeal = new("divergingTeal");
632 public bool IsDivergingTeal => DivergingTeal.Equals(Value);
633
634 public static readonly ChartColor DivergingYellow = new("divergingYellow");
635 public bool IsDivergingYellow => DivergingYellow.Equals(Value);
636
637 public static readonly ChartColor DivergingPeach = new("divergingPeach");
638 public bool IsDivergingPeach => DivergingPeach.Equals(Value);
639
640 public static readonly ChartColor DivergingLightRed = new("divergingLightRed");
641 public bool IsDivergingLightRed => DivergingLightRed.Equals(Value);
642
643 public static readonly ChartColor DivergingRed = new("divergingRed");
644 public bool IsDivergingRed => DivergingRed.Equals(Value);
645
646 public static readonly ChartColor DivergingMaroon = new("divergingMaroon");
647 public bool IsDivergingMaroon => DivergingMaroon.Equals(Value);
648
649 public static readonly ChartColor DivergingGray = new("divergingGray");
650 public bool IsDivergingGray => DivergingGray.Equals(Value);
651}
652
653[JsonConverter(typeof(JsonConverter<HorizontalBarChartDisplayMode>))]
654public class HorizontalBarChartDisplayMode(string value) : StringEnum(value, caseSensitive: false)
655{
656 public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis");
657 public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value);
658
659 public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis");
660 public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value);
661
662 public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole");
663 public bool IsPartToWhole => PartToWhole.Equals(Value);
664}
665
666[JsonConverter(typeof(JsonConverter<GaugeChartValueFormat>))]
667public class GaugeChartValueFormat(string value) : StringEnum(value, caseSensitive: false)
668{
669 public static readonly GaugeChartValueFormat Percentage = new("Percentage");
670 public bool IsPercentage => Percentage.Equals(Value);
671
672 public static readonly GaugeChartValueFormat Fraction = new("Fraction");
673 public bool IsFraction => Fraction.Equals(Value);
674}
675
676[JsonConverter(typeof(JsonConverter<CodeLanguage>))]
677public class CodeLanguage(string value) : StringEnum(value, caseSensitive: false)
678{
679 public static readonly CodeLanguage Bash = new("Bash");
680 public bool IsBash => Bash.Equals(Value);
681
682 public static readonly CodeLanguage C = new("C");
683 public bool IsC => C.Equals(Value);
684
685 public static readonly CodeLanguage Cpp = new("Cpp");
686 public bool IsCpp => Cpp.Equals(Value);
687
688 public static readonly CodeLanguage CSharp = new("CSharp");
689 public bool IsCSharp => CSharp.Equals(Value);
690
691 public static readonly CodeLanguage Css = new("Css");
692 public bool IsCss => Css.Equals(Value);
693
694 public static readonly CodeLanguage Dos = new("Dos");
695 public bool IsDos => Dos.Equals(Value);
696
697 public static readonly CodeLanguage Go = new("Go");
698 public bool IsGo => Go.Equals(Value);
699
700 public static readonly CodeLanguage Graphql = new("Graphql");
701 public bool IsGraphql => Graphql.Equals(Value);
702
703 public static readonly CodeLanguage Html = new("Html");
704 public bool IsHtml => Html.Equals(Value);
705
706 public static readonly CodeLanguage Java = new("Java");
707 public bool IsJava => Java.Equals(Value);
708
709 public static readonly CodeLanguage JavaScript = new("JavaScript");
710 public bool IsJavaScript => JavaScript.Equals(Value);
711
712 public static readonly CodeLanguage Json = new("Json");
713 public bool IsJson => Json.Equals(Value);
714
715 public static readonly CodeLanguage ObjectiveC = new("ObjectiveC");
716 public bool IsObjectiveC => ObjectiveC.Equals(Value);
717
718 public static readonly CodeLanguage Perl = new("Perl");
719 public bool IsPerl => Perl.Equals(Value);
720
721 public static readonly CodeLanguage Php = new("Php");
722 public bool IsPhp => Php.Equals(Value);
723
724 public static readonly CodeLanguage PlainText = new("PlainText");
725 public bool IsPlainText => PlainText.Equals(Value);
726
727 public static readonly CodeLanguage PowerShell = new("PowerShell");
728 public bool IsPowerShell => PowerShell.Equals(Value);
729
730 public static readonly CodeLanguage Python = new("Python");
731 public bool IsPython => Python.Equals(Value);
732
733 public static readonly CodeLanguage Sql = new("Sql");
734 public bool IsSql => Sql.Equals(Value);
735
736 public static readonly CodeLanguage TypeScript = new("TypeScript");
737 public bool IsTypeScript => TypeScript.Equals(Value);
738
739 public static readonly CodeLanguage VbNet = new("VbNet");
740 public bool IsVbNet => VbNet.Equals(Value);
741
742 public static readonly CodeLanguage Verilog = new("Verilog");
743 public bool IsVerilog => Verilog.Equals(Value);
744
745 public static readonly CodeLanguage Vhdl = new("Vhdl");
746 public bool IsVhdl => Vhdl.Equals(Value);
747
748 public static readonly CodeLanguage Xml = new("Xml");
749 public bool IsXml => Xml.Equals(Value);
750}
751
752[JsonConverter(typeof(JsonConverter<FallbackElement>))]
753public class FallbackElement(string value) : StringEnum(value, caseSensitive: false)
754{
755 public static readonly FallbackElement Drop = new("drop");
756 public bool IsDrop => Drop.Equals(Value);
757}
758
759[JsonConverter(typeof(JsonConverter<ImageSize>))]
760public class ImageSize(string value) : StringEnum(value, caseSensitive: false)
761{
762 public static readonly ImageSize Small = new("Small");
763 public bool IsSmall => Small.Equals(Value);
764
765 public static readonly ImageSize Medium = new("Medium");
766 public bool IsMedium => Medium.Equals(Value);
767
768 public static readonly ImageSize Large = new("Large");
769 public bool IsLarge => Large.Equals(Value);
770}
771
772[JsonConverter(typeof(JsonConverter<SizeEnum>))]
773public class SizeEnum(string value) : StringEnum(value, caseSensitive: false)
774{
775 public static readonly SizeEnum Small = new("Small");
776 public bool IsSmall => Small.Equals(Value);
777
778 public static readonly SizeEnum Default = new("Default");
779 public bool IsDefault => Default.Equals(Value);
780
781 public static readonly SizeEnum Medium = new("Medium");
782 public bool IsMedium => Medium.Equals(Value);
783
784 public static readonly SizeEnum Large = new("Large");
785 public bool IsLarge => Large.Equals(Value);
786
787 public static readonly SizeEnum ExtraLarge = new("ExtraLarge");
788 public bool IsExtraLarge => ExtraLarge.Equals(Value);
789}
790
791[JsonConverter(typeof(JsonConverter<ThemeName>))]
792public class ThemeName(string value) : StringEnum(value, caseSensitive: false)
793{
794 public static readonly ThemeName Light = new("Light");
795 public bool IsLight => Light.Equals(Value);
796
797 public static readonly ThemeName Dark = new("Dark");
798 public bool IsDark => Dark.Equals(Value);
799}
800
801internal record ObjectType(string[] DiscriminatorPropertyNames, string DiscriminatorValue, Type Type) { }
802
803public abstract class SerializableObject { }
804
805internal sealed class CardElementJsonConverter : JsonConverter<CardElement>
806{
807 private static readonly List<ObjectType> _typeMap = new()
808 {
809 new ObjectType(["type"], "AdaptiveCard", typeof(AdaptiveCard)),
810 new ObjectType(["type"], "Container", typeof(Container)),
811 new ObjectType(["type"], "ActionSet", typeof(ActionSet)),
812 new ObjectType(["type"], "ColumnSet", typeof(ColumnSet)),
813 new ObjectType(["type"], "Media", typeof(Media)),
814 new ObjectType(["type"], "RichTextBlock", typeof(RichTextBlock)),
815 new ObjectType(["type"], "Table", typeof(Table)),
816 new ObjectType(["type"], "TextBlock", typeof(TextBlock)),
817 new ObjectType(["type"], "FactSet", typeof(FactSet)),
818 new ObjectType(["type"], "ImageSet", typeof(ImageSet)),
819 new ObjectType(["type"], "Image", typeof(Image)),
820 new ObjectType(["type"], "Input.Text", typeof(TextInput)),
821 new ObjectType(["type"], "Input.Date", typeof(DateInput)),
822 new ObjectType(["type"], "Input.Time", typeof(TimeInput)),
823 new ObjectType(["type"], "Input.Number", typeof(NumberInput)),
824 new ObjectType(["type"], "Input.Toggle", typeof(ToggleInput)),
825 new ObjectType(["type"], "Input.ChoiceSet", typeof(ChoiceSetInput)),
826 new ObjectType(["type"], "Input.Rating", typeof(RatingInput)),
827 new ObjectType(["type"], "Rating", typeof(Rating)),
828 new ObjectType(["type"], "CompoundButton", typeof(CompoundButton)),
829 new ObjectType(["type"], "Icon", typeof(Icon)),
830 new ObjectType(["type"], "Carousel", typeof(Carousel)),
831 new ObjectType(["type"], "Badge", typeof(Badge)),
832 new ObjectType(["type"], "Chart.Donut", typeof(DonutChart)),
833 new ObjectType(["type"], "Chart.Pie", typeof(PieChart)),
834 new ObjectType(["type"], "Chart.VerticalBar.Grouped", typeof(GroupedVerticalBarChart)),
835 new ObjectType(["type"], "Chart.VerticalBar", typeof(VerticalBarChart)),
836 new ObjectType(["type"], "Chart.HorizontalBar", typeof(HorizontalBarChart)),
837 new ObjectType(["type"], "Chart.HorizontalBar.Stacked", typeof(StackedHorizontalBarChart)),
838 new ObjectType(["type"], "Chart.Line", typeof(LineChart)),
839 new ObjectType(["type"], "Chart.Gauge", typeof(GaugeChart)),
840 new ObjectType(["type"], "CodeBlock", typeof(CodeBlock)),
841 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/user", typeof(ComUserMicrosoftGraphComponent)),
842 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/users", typeof(ComUsersMicrosoftGraphComponent)),
843 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/resource", typeof(ComResourceMicrosoftGraphComponent)),
844 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/file", typeof(ComFileMicrosoftGraphComponent)),
845 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/event", typeof(ComEventMicrosoftGraphComponent)),
846 new ObjectType(["type"], "CarouselPage", typeof(CarouselPage)),
847 new ObjectType(["type"], "TableRow", typeof(TableRow)),
848 new ObjectType(["type"], "TableCell", typeof(TableCell)),
849 new ObjectType(["type"], "TextRun", typeof(TextRun)),
850 new ObjectType(["type"], "IconRun", typeof(IconRun)),
851 new ObjectType(["type"], "ImageRun", typeof(ImageRun)),
852 new ObjectType(["type"], "Column", typeof(Column)),
853 };
854
855 public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
856 {
857 if (reader.TokenType == JsonTokenType.Null) return null;
858
859 using var doc = JsonDocument.ParseValue(ref reader);
860 var root = doc.RootElement;
861
862 foreach (var type in _typeMap)
863 {
864 var discriminatorPropertyValues = new List<string?>();
865
866 foreach (var propName in type.DiscriminatorPropertyNames)
867 {
868 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
869 {
870 discriminatorPropertyValues.Insert(0, prop.GetString());
871 }
872 }
873
874 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
875 {
876 return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
877 }
878 }
879
880 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
881 }
882
883 public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options)
884 {
885 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
886 }
887}
888
889[JsonConverter(typeof(CardElementJsonConverter))]
890public abstract class CardElement : SerializableObject { }
891
892internal sealed class ActionJsonConverter : JsonConverter<Action>
893{
894 private static readonly List<ObjectType> _typeMap = new()
895 {
896 new ObjectType(["type"], "Action.Execute", typeof(ExecuteAction)),
897 new ObjectType(["type"], "Action.Submit", typeof(SubmitAction)),
898 new ObjectType(["type"], "Action.OpenUrl", typeof(OpenUrlAction)),
899 new ObjectType(["type"], "Action.ToggleVisibility", typeof(ToggleVisibilityAction)),
900 new ObjectType(["type"], "Action.ShowCard", typeof(ShowCardAction)),
901 new ObjectType(["type"], "Action.ResetInputs", typeof(ResetInputsAction)),
902 new ObjectType(["type"], "Action.InsertImage", typeof(InsertImageAction)),
903 };
904
905 public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
906 {
907 if (reader.TokenType == JsonTokenType.Null) return null;
908
909 using var doc = JsonDocument.ParseValue(ref reader);
910 var root = doc.RootElement;
911
912 foreach (var type in _typeMap)
913 {
914 var discriminatorPropertyValues = new List<string?>();
915
916 foreach (var propName in type.DiscriminatorPropertyNames)
917 {
918 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
919 {
920 discriminatorPropertyValues.Insert(0, prop.GetString());
921 }
922 }
923
924 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
925 {
926 return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
927 }
928 }
929
930 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
931 }
932
933 public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options)
934 {
935 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
936 }
937}
938
939[JsonConverter(typeof(ActionJsonConverter))]
940public abstract class Action : SerializableObject { }
941
942internal sealed class ContainerLayoutJsonConverter : JsonConverter<ContainerLayout>
943{
944 private static readonly List<ObjectType> _typeMap = new()
945 {
946 new ObjectType(["type"], "Layout.Stack", typeof(StackLayout)),
947 new ObjectType(["type"], "Layout.Flow", typeof(FlowLayout)),
948 new ObjectType(["type"], "Layout.AreaGrid", typeof(AreaGridLayout)),
949 };
950
951 public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
952 {
953 if (reader.TokenType == JsonTokenType.Null) return null;
954
955 using var doc = JsonDocument.ParseValue(ref reader);
956 var root = doc.RootElement;
957
958 foreach (var type in _typeMap)
959 {
960 var discriminatorPropertyValues = new List<string?>();
961
962 foreach (var propName in type.DiscriminatorPropertyNames)
963 {
964 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
965 {
966 discriminatorPropertyValues.Insert(0, prop.GetString());
967 }
968 }
969
970 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
971 {
972 return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
973 }
974 }
975
976 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
977 }
978
979 public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options)
980 {
981 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
982 }
983}
984
985[JsonConverter(typeof(ContainerLayoutJsonConverter))]
986public abstract class ContainerLayout : SerializableObject { }
987
988/// <summary>
989/// An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.
990/// </summary>
991public class AdaptiveCard : CardElement
992{
993 /// <summary>
994 /// Deserializes a JSON string into an object of type AdaptiveCard.
995 /// </summary>
996 public static AdaptiveCard? Deserialize(string json)
997 {
998 return JsonSerializer.Deserialize<AdaptiveCard>(json);
999 }
1000
1001 /// <summary>
1002 /// Must be **AdaptiveCard**.
1003 /// </summary>
1004 [JsonPropertyName("type")]
1005 public string Type { get; } = "AdaptiveCard";
1006
1007 /// <summary>
1008 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
1009 /// </summary>
1010 [JsonPropertyName("id")]
1011 public string? Id { get; set; }
1012
1013 /// <summary>
1014 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
1015 /// </summary>
1016 [JsonPropertyName("requires")]
1017 public HostCapabilities? Requires { get; set; }
1018
1019 /// <summary>
1020 /// The locale associated with the element.
1021 /// </summary>
1022 [JsonPropertyName("lang")]
1023 public string? Lang { get; set; }
1024
1025 /// <summary>
1026 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
1027 /// </summary>
1028 [JsonPropertyName("isSortKey")]
1029 public bool? IsSortKey { get; set; }
1030
1031 /// <summary>
1032 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
1033 /// </summary>
1034 [JsonPropertyName("selectAction")]
1035 public Action? SelectAction { get; set; }
1036
1037 /// <summary>
1038 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
1039 /// </summary>
1040 [JsonPropertyName("style")]
1041 public ContainerStyle? Style { get; set; }
1042
1043 /// <summary>
1044 /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
1045 /// </summary>
1046 [JsonPropertyName("layouts")]
1047 public IList<ContainerLayout>? Layouts { get; set; }
1048
1049 /// <summary>
1050 /// The minimum height, in pixels, of the container, in the `<number>px` format.
1051 /// </summary>
1052 [JsonPropertyName("minHeight")]
1053 public string? MinHeight { get; set; }
1054
1055 /// <summary>
1056 /// Defines the container's background image.
1057 /// </summary>
1058 [JsonPropertyName("backgroundImage")]
1059 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
1060
1061 /// <summary>
1062 /// Controls how the container's content should be vertically aligned.
1063 /// </summary>
1064 [JsonPropertyName("verticalContentAlignment")]
1065 public VerticalAlignment? VerticalContentAlignment { get; set; }
1066
1067 /// <summary>
1068 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
1069 /// </summary>
1070 [JsonPropertyName("rtl")]
1071 public bool? Rtl { get; set; }
1072
1073 /// <summary>
1074 /// A URL to the Adaptive Card schema the card is authored against.
1075 /// </summary>
1076 [JsonPropertyName("$schema")]
1077 public string? Schema { get; set; }
1078
1079 /// <summary>
1080 /// The Adaptive Card schema version the card is authored against.
1081 /// </summary>
1082 [JsonPropertyName("version")]
1083 public Version? Version { get; set; }
1084
1085 /// <summary>
1086 /// The text that should be displayed if the client is not able to render the card.
1087 /// </summary>
1088 [JsonPropertyName("fallbackText")]
1089 public string? FallbackText { get; set; }
1090
1091 /// <summary>
1092 /// The text that should be spoken for the entire card.
1093 /// </summary>
1094 [JsonPropertyName("speak")]
1095 public string? Speak { get; set; }
1096
1097 /// <summary>
1098 /// Defines how the card can be refreshed by making a request to the target Bot.
1099 /// </summary>
1100 [JsonPropertyName("refresh")]
1101 public RefreshDefinition? Refresh { get; set; }
1102
1103 /// <summary>
1104 /// Defines authentication information to enable on-behalf-of single-sign-on or just-in-time OAuth. This information is used in conjunction with the refresh property and Action.Execute in general.
1105 /// </summary>
1106 [JsonPropertyName("authentication")]
1107 public Authentication? Authentication { get; set; }
1108
1109 [JsonPropertyName("msteams")]
1110 public TeamsCardProperties? Msteams { get; set; }
1111
1112 /// <summary>
1113 /// Metadata associated with the card.
1114 /// </summary>
1115 [JsonPropertyName("metadata")]
1116 public CardMetadata? Metadata { get; set; }
1117
1118 /// <summary>
1119 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
1120 /// </summary>
1121 [JsonPropertyName("grid.area")]
1122 public string? GridArea { get; set; }
1123
1124 /// <summary>
1125 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
1126 /// </summary>
1127 [JsonPropertyName("fallback")]
1128 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
1129
1130 /// <summary>
1131 /// The body of the card, comprised of a list of elements displayed according to the layouts property. If the layouts property is not specified, a Layout.Stack is used.
1132 /// </summary>
1133 [JsonPropertyName("body")]
1134 public IList<CardElement>? Body { get; set; }
1135
1136 /// <summary>
1137 /// The card level actions, which always appear at the bottom of the card.
1138 /// </summary>
1139 [JsonPropertyName("actions")]
1140 public IList<Action>? Actions { get; set; }
1141
1142 public AdaptiveCard(params IList<CardElement> body)
1143 {
1144 this.Body = body;
1145 }
1146
1147 /// <summary>
1148 /// Serializes this AdaptiveCard into a JSON string.
1149 /// </summary>
1150 public string Serialize()
1151 {
1152 return JsonSerializer.Serialize(
1153 this,
1154 new JsonSerializerOptions
1155 {
1156 WriteIndented = true,
1157 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1158 }
1159 );
1160 }
1161
1162 public AdaptiveCard WithId(string value)
1163 {
1164 this.Id = value;
1165 return this;
1166 }
1167
1168 public AdaptiveCard WithRequires(HostCapabilities value)
1169 {
1170 this.Requires = value;
1171 return this;
1172 }
1173
1174 public AdaptiveCard WithLang(string value)
1175 {
1176 this.Lang = value;
1177 return this;
1178 }
1179
1180 public AdaptiveCard WithIsSortKey(bool value)
1181 {
1182 this.IsSortKey = value;
1183 return this;
1184 }
1185
1186 public AdaptiveCard WithSelectAction(Action value)
1187 {
1188 this.SelectAction = value;
1189 return this;
1190 }
1191
1192 public AdaptiveCard WithStyle(ContainerStyle value)
1193 {
1194 this.Style = value;
1195 return this;
1196 }
1197
1198 public AdaptiveCard WithLayouts(params IList<ContainerLayout> value)
1199 {
1200 this.Layouts = value;
1201 return this;
1202 }
1203
1204 public AdaptiveCard WithMinHeight(string value)
1205 {
1206 this.MinHeight = value;
1207 return this;
1208 }
1209
1210 public AdaptiveCard WithBackgroundImage(IUnion<string, BackgroundImage> value)
1211 {
1212 this.BackgroundImage = value;
1213 return this;
1214 }
1215
1216 public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value)
1217 {
1218 this.VerticalContentAlignment = value;
1219 return this;
1220 }
1221
1222 public AdaptiveCard WithRtl(bool value)
1223 {
1224 this.Rtl = value;
1225 return this;
1226 }
1227
1228 public AdaptiveCard WithSchema(string value)
1229 {
1230 this.Schema = value;
1231 return this;
1232 }
1233
1234 public AdaptiveCard WithVersion(Version value)
1235 {
1236 this.Version = value;
1237 return this;
1238 }
1239
1240 public AdaptiveCard WithFallbackText(string value)
1241 {
1242 this.FallbackText = value;
1243 return this;
1244 }
1245
1246 public AdaptiveCard WithSpeak(string value)
1247 {
1248 this.Speak = value;
1249 return this;
1250 }
1251
1252 public AdaptiveCard WithRefresh(RefreshDefinition value)
1253 {
1254 this.Refresh = value;
1255 return this;
1256 }
1257
1258 public AdaptiveCard WithAuthentication(Authentication value)
1259 {
1260 this.Authentication = value;
1261 return this;
1262 }
1263
1264 public AdaptiveCard WithMsteams(TeamsCardProperties value)
1265 {
1266 this.Msteams = value;
1267 return this;
1268 }
1269
1270 public AdaptiveCard WithMetadata(CardMetadata value)
1271 {
1272 this.Metadata = value;
1273 return this;
1274 }
1275
1276 public AdaptiveCard WithGridArea(string value)
1277 {
1278 this.GridArea = value;
1279 return this;
1280 }
1281
1282 public AdaptiveCard WithFallback(IUnion<CardElement, FallbackElement> value)
1283 {
1284 this.Fallback = value;
1285 return this;
1286 }
1287
1288 public AdaptiveCard WithBody(params IList<CardElement> value)
1289 {
1290 this.Body = value;
1291 return this;
1292 }
1293
1294 public AdaptiveCard WithActions(params IList<Action> value)
1295 {
1296 this.Actions = value;
1297 return this;
1298 }
1299}
1300
1301/// <summary>
1302/// Represents a list of versioned capabilities a host application must support.
1303/// </summary>
1304public class HostCapabilities : SerializableObject
1305{
1306 /// <summary>
1307 /// Deserializes a JSON string into an object of type HostCapabilities.
1308 /// </summary>
1309 public static HostCapabilities? Deserialize(string json)
1310 {
1311 return JsonSerializer.Deserialize<HostCapabilities>(json);
1312 }
1313
1314
1315 /// <summary>
1316 /// Serializes this HostCapabilities into a JSON string.
1317 /// </summary>
1318 public string Serialize()
1319 {
1320 return JsonSerializer.Serialize(
1321 this,
1322 new JsonSerializerOptions
1323 {
1324 WriteIndented = true,
1325 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1326 }
1327 );
1328 }
1329 [JsonExtensionData]
1330 public IDictionary<string, object?> NonSchemaProperties { get; set; } = new Dictionary<string, object?>();
1331}
1332
1333/// <summary>
1334/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can respond synchronously and return an updated Adaptive Card to be displayed by the client. Action.Execute works in all Adaptive Card hosts.
1335/// </summary>
1336public class ExecuteAction : Action
1337{
1338 /// <summary>
1339 /// Deserializes a JSON string into an object of type ExecuteAction.
1340 /// </summary>
1341 public static ExecuteAction? Deserialize(string json)
1342 {
1343 return JsonSerializer.Deserialize<ExecuteAction>(json);
1344 }
1345
1346 /// <summary>
1347 /// Must be **Action.Execute**.
1348 /// </summary>
1349 [JsonPropertyName("type")]
1350 public string Type { get; } = "Action.Execute";
1351
1352 /// <summary>
1353 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
1354 /// </summary>
1355 [JsonPropertyName("id")]
1356 public string? Id { get; set; }
1357
1358 /// <summary>
1359 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
1360 /// </summary>
1361 [JsonPropertyName("requires")]
1362 public HostCapabilities? Requires { get; set; }
1363
1364 /// <summary>
1365 /// The title of the action, as it appears on buttons.
1366 /// </summary>
1367 [JsonPropertyName("title")]
1368 public string? Title { get; set; }
1369
1370 /// <summary>
1371 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
1372 ///
1373 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
1374 /// </summary>
1375 [JsonPropertyName("iconUrl")]
1376 public string? IconUrl { get; set; }
1377
1378 /// <summary>
1379 /// Control the style of the action, affecting its visual and spoken representations.
1380 /// </summary>
1381 [JsonPropertyName("style")]
1382 public ActionStyle? Style { get; set; }
1383
1384 /// <summary>
1385 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
1386 /// </summary>
1387 [JsonPropertyName("mode")]
1388 public ActionMode? Mode { get; set; }
1389
1390 /// <summary>
1391 /// The tooltip text to display when the action is hovered over.
1392 /// </summary>
1393 [JsonPropertyName("tooltip")]
1394 public string? Tooltip { get; set; }
1395
1396 /// <summary>
1397 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
1398 /// </summary>
1399 [JsonPropertyName("isEnabled")]
1400 public bool? IsEnabled { get; set; }
1401
1402 /// <summary>
1403 /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot.
1404 /// </summary>
1405 [JsonPropertyName("data")]
1406 public IUnion<string, SubmitActionData>? Data { get; set; }
1407
1408 /// <summary>
1409 /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
1410 /// </summary>
1411 [JsonPropertyName("associatedInputs")]
1412 public AssociatedInputs? AssociatedInputs { get; set; }
1413
1414 /// <summary>
1415 /// Controls if the action is enabled only if at least one required input has been filled by the user.
1416 /// </summary>
1417 [JsonPropertyName("conditionallyEnabled")]
1418 public bool? ConditionallyEnabled { get; set; }
1419
1420 /// <summary>
1421 /// The verb of the action.
1422 /// </summary>
1423 [JsonPropertyName("verb")]
1424 public string? Verb { get; set; }
1425
1426 /// <summary>
1427 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
1428 /// </summary>
1429 [JsonPropertyName("fallback")]
1430 public IUnion<Action, FallbackAction>? Fallback { get; set; }
1431
1432 /// <summary>
1433 /// Serializes this ExecuteAction into a JSON string.
1434 /// </summary>
1435 public string Serialize()
1436 {
1437 return JsonSerializer.Serialize(
1438 this,
1439 new JsonSerializerOptions
1440 {
1441 WriteIndented = true,
1442 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1443 }
1444 );
1445 }
1446
1447 public ExecuteAction WithId(string value)
1448 {
1449 this.Id = value;
1450 return this;
1451 }
1452
1453 public ExecuteAction WithRequires(HostCapabilities value)
1454 {
1455 this.Requires = value;
1456 return this;
1457 }
1458
1459 public ExecuteAction WithTitle(string value)
1460 {
1461 this.Title = value;
1462 return this;
1463 }
1464
1465 public ExecuteAction WithIconUrl(string value)
1466 {
1467 this.IconUrl = value;
1468 return this;
1469 }
1470
1471 public ExecuteAction WithStyle(ActionStyle value)
1472 {
1473 this.Style = value;
1474 return this;
1475 }
1476
1477 public ExecuteAction WithMode(ActionMode value)
1478 {
1479 this.Mode = value;
1480 return this;
1481 }
1482
1483 public ExecuteAction WithTooltip(string value)
1484 {
1485 this.Tooltip = value;
1486 return this;
1487 }
1488
1489 public ExecuteAction WithIsEnabled(bool value)
1490 {
1491 this.IsEnabled = value;
1492 return this;
1493 }
1494
1495 public ExecuteAction WithData(IUnion<string, SubmitActionData> value)
1496 {
1497 this.Data = value;
1498 return this;
1499 }
1500
1501 public ExecuteAction WithAssociatedInputs(AssociatedInputs value)
1502 {
1503 this.AssociatedInputs = value;
1504 return this;
1505 }
1506
1507 public ExecuteAction WithConditionallyEnabled(bool value)
1508 {
1509 this.ConditionallyEnabled = value;
1510 return this;
1511 }
1512
1513 public ExecuteAction WithVerb(string value)
1514 {
1515 this.Verb = value;
1516 return this;
1517 }
1518
1519 public ExecuteAction WithFallback(IUnion<Action, FallbackAction> value)
1520 {
1521 this.Fallback = value;
1522 return this;
1523 }
1524}
1525
1526/// <summary>
1527/// Represents the data of an Action.Submit.
1528/// </summary>
1529public class SubmitActionData : SerializableObject
1530{
1531 /// <summary>
1532 /// Deserializes a JSON string into an object of type SubmitActionData.
1533 /// </summary>
1534 public static SubmitActionData? Deserialize(string json)
1535 {
1536 return JsonSerializer.Deserialize<SubmitActionData>(json);
1537 }
1538
1539 [JsonPropertyName("msteams")]
1540 public object? Msteams { get; set; }
1541
1542 /// <summary>
1543 /// Serializes this SubmitActionData into a JSON string.
1544 /// </summary>
1545 public string Serialize()
1546 {
1547 return JsonSerializer.Serialize(
1548 this,
1549 new JsonSerializerOptions
1550 {
1551 WriteIndented = true,
1552 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1553 }
1554 );
1555 }
1556
1557 public SubmitActionData WithMsteams(object value)
1558 {
1559 this.Msteams = value;
1560 return this;
1561 }
1562 [JsonExtensionData]
1563 public IDictionary<string, object?> NonSchemaProperties { get; set; } = new Dictionary<string, object?>();
1564}
1565
1566/// <summary>
1567/// Represents Teams-specific data in an Action.Submit to send an Instant Message back to the Bot.
1568/// </summary>
1569public class ImBackSubmitActionData : SerializableObject
1570{
1571 /// <summary>
1572 /// Deserializes a JSON string into an object of type ImBackSubmitActionData.
1573 /// </summary>
1574 public static ImBackSubmitActionData? Deserialize(string json)
1575 {
1576 return JsonSerializer.Deserialize<ImBackSubmitActionData>(json);
1577 }
1578
1579 /// <summary>
1580 /// Must be **imBack**.
1581 /// </summary>
1582 [JsonPropertyName("type")]
1583 public string Type { get; } = "imBack";
1584
1585 /// <summary>
1586 /// The value that will be sent to the Bot.
1587 /// </summary>
1588 [JsonPropertyName("value")]
1589 public string? Value { get; set; }
1590
1591 public ImBackSubmitActionData(string value)
1592 {
1593 this.Value = value;
1594 }
1595
1596 /// <summary>
1597 /// Serializes this ImBackSubmitActionData into a JSON string.
1598 /// </summary>
1599 public string Serialize()
1600 {
1601 return JsonSerializer.Serialize(
1602 this,
1603 new JsonSerializerOptions
1604 {
1605 WriteIndented = true,
1606 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1607 }
1608 );
1609 }
1610
1611 public ImBackSubmitActionData WithValue(string value)
1612 {
1613 this.Value = value;
1614 return this;
1615 }
1616}
1617
1618/// <summary>
1619/// Represents Teams-specific data in an Action.Submit to make an Invoke request to the Bot.
1620/// </summary>
1621public class InvokeSubmitActionData : SerializableObject
1622{
1623 /// <summary>
1624 /// Deserializes a JSON string into an object of type InvokeSubmitActionData.
1625 /// </summary>
1626 public static InvokeSubmitActionData? Deserialize(string json)
1627 {
1628 return JsonSerializer.Deserialize<InvokeSubmitActionData>(json);
1629 }
1630
1631 /// <summary>
1632 /// Must be **invoke**.
1633 /// </summary>
1634 [JsonPropertyName("type")]
1635 public string Type { get; } = "invoke";
1636
1637 /// <summary>
1638 /// The object to send to the Bot with the Invoke request.
1639 /// </summary>
1640 [JsonPropertyName("value")]
1641 public object? Value { get; set; }
1642
1643 public InvokeSubmitActionData(object value)
1644 {
1645 this.Value = value;
1646 }
1647
1648 /// <summary>
1649 /// Serializes this InvokeSubmitActionData into a JSON string.
1650 /// </summary>
1651 public string Serialize()
1652 {
1653 return JsonSerializer.Serialize(
1654 this,
1655 new JsonSerializerOptions
1656 {
1657 WriteIndented = true,
1658 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1659 }
1660 );
1661 }
1662
1663 public InvokeSubmitActionData WithValue(object value)
1664 {
1665 this.Value = value;
1666 return this;
1667 }
1668}
1669
1670/// <summary>
1671/// Represents Teams-specific data in an Action.Submit to send a message back to the Bot.
1672/// </summary>
1673public class MessageBackSubmitActionData : SerializableObject
1674{
1675 /// <summary>
1676 /// Deserializes a JSON string into an object of type MessageBackSubmitActionData.
1677 /// </summary>
1678 public static MessageBackSubmitActionData? Deserialize(string json)
1679 {
1680 return JsonSerializer.Deserialize<MessageBackSubmitActionData>(json);
1681 }
1682
1683 /// <summary>
1684 /// Must be **messageBack**.
1685 /// </summary>
1686 [JsonPropertyName("type")]
1687 public string Type { get; } = "messageBack";
1688
1689 /// <summary>
1690 /// The text that will be sent to the Bot.
1691 /// </summary>
1692 [JsonPropertyName("text")]
1693 public string? Text { get; set; }
1694
1695 /// <summary>
1696 /// The optional text that will be displayed as a new message in the conversation, as if the end-user sent it. `displayText` is not sent to the Bot.
1697 /// </summary>
1698 [JsonPropertyName("displayText")]
1699 public string? DisplayText { get; set; }
1700
1701 /// <summary>
1702 /// Optional additional value that will be sent to the Bot. For instance, `value` can encode specific context for the action, such as unique identifiers or a JSON object.
1703 /// </summary>
1704 [JsonPropertyName("value")]
1705 public string? Value { get; set; }
1706
1707 /// <summary>
1708 /// Serializes this MessageBackSubmitActionData into a JSON string.
1709 /// </summary>
1710 public string Serialize()
1711 {
1712 return JsonSerializer.Serialize(
1713 this,
1714 new JsonSerializerOptions
1715 {
1716 WriteIndented = true,
1717 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1718 }
1719 );
1720 }
1721
1722 public MessageBackSubmitActionData WithText(string value)
1723 {
1724 this.Text = value;
1725 return this;
1726 }
1727
1728 public MessageBackSubmitActionData WithDisplayText(string value)
1729 {
1730 this.DisplayText = value;
1731 return this;
1732 }
1733
1734 public MessageBackSubmitActionData WithValue(string value)
1735 {
1736 this.Value = value;
1737 return this;
1738 }
1739}
1740
1741/// <summary>
1742/// Represents Teams-specific data in an Action.Submit to sign in a user.
1743/// </summary>
1744public class SigninSubmitActionData : SerializableObject
1745{
1746 /// <summary>
1747 /// Deserializes a JSON string into an object of type SigninSubmitActionData.
1748 /// </summary>
1749 public static SigninSubmitActionData? Deserialize(string json)
1750 {
1751 return JsonSerializer.Deserialize<SigninSubmitActionData>(json);
1752 }
1753
1754 /// <summary>
1755 /// Must be **signin**.
1756 /// </summary>
1757 [JsonPropertyName("type")]
1758 public string Type { get; } = "signin";
1759
1760 /// <summary>
1761 /// The URL to redirect the end-user for signing in.
1762 /// </summary>
1763 [JsonPropertyName("value")]
1764 public string? Value { get; set; }
1765
1766 public SigninSubmitActionData(string value)
1767 {
1768 this.Value = value;
1769 }
1770
1771 /// <summary>
1772 /// Serializes this SigninSubmitActionData into a JSON string.
1773 /// </summary>
1774 public string Serialize()
1775 {
1776 return JsonSerializer.Serialize(
1777 this,
1778 new JsonSerializerOptions
1779 {
1780 WriteIndented = true,
1781 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1782 }
1783 );
1784 }
1785
1786 public SigninSubmitActionData WithValue(string value)
1787 {
1788 this.Value = value;
1789 return this;
1790 }
1791}
1792
1793/// <summary>
1794/// Represents Teams-specific data in an Action.Submit to open a task module.
1795/// </summary>
1796public class TaskFetchSubmitActionData : SerializableObject
1797{
1798 /// <summary>
1799 /// Deserializes a JSON string into an object of type TaskFetchSubmitActionData.
1800 /// </summary>
1801 public static TaskFetchSubmitActionData? Deserialize(string json)
1802 {
1803 return JsonSerializer.Deserialize<TaskFetchSubmitActionData>(json);
1804 }
1805
1806 /// <summary>
1807 /// Must be **task/fetch**.
1808 /// </summary>
1809 [JsonPropertyName("type")]
1810 public string Type { get; } = "task/fetch";
1811
1812 /// <summary>
1813 /// Serializes this TaskFetchSubmitActionData into a JSON string.
1814 /// </summary>
1815 public string Serialize()
1816 {
1817 return JsonSerializer.Serialize(
1818 this,
1819 new JsonSerializerOptions
1820 {
1821 WriteIndented = true,
1822 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1823 }
1824 );
1825 }
1826}
1827
1828/// <summary>
1829/// Gathers input values, merges them with the data property if specified, and sends them to the Bot via an Invoke activity. The Bot can only acknowledge is has received the request.
1830/// </summary>
1831public class SubmitAction : Action
1832{
1833 /// <summary>
1834 /// Deserializes a JSON string into an object of type SubmitAction.
1835 /// </summary>
1836 public static SubmitAction? Deserialize(string json)
1837 {
1838 return JsonSerializer.Deserialize<SubmitAction>(json);
1839 }
1840
1841 /// <summary>
1842 /// Must be **Action.Submit**.
1843 /// </summary>
1844 [JsonPropertyName("type")]
1845 public string Type { get; } = "Action.Submit";
1846
1847 /// <summary>
1848 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
1849 /// </summary>
1850 [JsonPropertyName("id")]
1851 public string? Id { get; set; }
1852
1853 /// <summary>
1854 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
1855 /// </summary>
1856 [JsonPropertyName("requires")]
1857 public HostCapabilities? Requires { get; set; }
1858
1859 /// <summary>
1860 /// The title of the action, as it appears on buttons.
1861 /// </summary>
1862 [JsonPropertyName("title")]
1863 public string? Title { get; set; }
1864
1865 /// <summary>
1866 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
1867 ///
1868 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
1869 /// </summary>
1870 [JsonPropertyName("iconUrl")]
1871 public string? IconUrl { get; set; }
1872
1873 /// <summary>
1874 /// Control the style of the action, affecting its visual and spoken representations.
1875 /// </summary>
1876 [JsonPropertyName("style")]
1877 public ActionStyle? Style { get; set; }
1878
1879 /// <summary>
1880 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
1881 /// </summary>
1882 [JsonPropertyName("mode")]
1883 public ActionMode? Mode { get; set; }
1884
1885 /// <summary>
1886 /// The tooltip text to display when the action is hovered over.
1887 /// </summary>
1888 [JsonPropertyName("tooltip")]
1889 public string? Tooltip { get; set; }
1890
1891 /// <summary>
1892 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
1893 /// </summary>
1894 [JsonPropertyName("isEnabled")]
1895 public bool? IsEnabled { get; set; }
1896
1897 /// <summary>
1898 /// The data to send to the Bot when the action is executed. When expressed as an object, `data` is sent back to the Bot when the action is executed, adorned with the values of the inputs expressed as key/value pairs, where the key is the Id of the input. If `data` is expressed as a string, input values are not sent to the Bot.
1899 /// </summary>
1900 [JsonPropertyName("data")]
1901 public IUnion<string, SubmitActionData>? Data { get; set; }
1902
1903 /// <summary>
1904 /// The Ids of the inputs associated with the Action.Submit. When the action is executed, the values of the associated inputs are sent to the Bot. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
1905 /// </summary>
1906 [JsonPropertyName("associatedInputs")]
1907 public AssociatedInputs? AssociatedInputs { get; set; }
1908
1909 /// <summary>
1910 /// Controls if the action is enabled only if at least one required input has been filled by the user.
1911 /// </summary>
1912 [JsonPropertyName("conditionallyEnabled")]
1913 public bool? ConditionallyEnabled { get; set; }
1914
1915 [JsonPropertyName("msteams")]
1916 public TeamsSubmitActionProperties? Msteams { get; set; }
1917
1918 /// <summary>
1919 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
1920 /// </summary>
1921 [JsonPropertyName("fallback")]
1922 public IUnion<Action, FallbackAction>? Fallback { get; set; }
1923
1924 /// <summary>
1925 /// Serializes this SubmitAction into a JSON string.
1926 /// </summary>
1927 public string Serialize()
1928 {
1929 return JsonSerializer.Serialize(
1930 this,
1931 new JsonSerializerOptions
1932 {
1933 WriteIndented = true,
1934 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1935 }
1936 );
1937 }
1938
1939 public SubmitAction WithId(string value)
1940 {
1941 this.Id = value;
1942 return this;
1943 }
1944
1945 public SubmitAction WithRequires(HostCapabilities value)
1946 {
1947 this.Requires = value;
1948 return this;
1949 }
1950
1951 public SubmitAction WithTitle(string value)
1952 {
1953 this.Title = value;
1954 return this;
1955 }
1956
1957 public SubmitAction WithIconUrl(string value)
1958 {
1959 this.IconUrl = value;
1960 return this;
1961 }
1962
1963 public SubmitAction WithStyle(ActionStyle value)
1964 {
1965 this.Style = value;
1966 return this;
1967 }
1968
1969 public SubmitAction WithMode(ActionMode value)
1970 {
1971 this.Mode = value;
1972 return this;
1973 }
1974
1975 public SubmitAction WithTooltip(string value)
1976 {
1977 this.Tooltip = value;
1978 return this;
1979 }
1980
1981 public SubmitAction WithIsEnabled(bool value)
1982 {
1983 this.IsEnabled = value;
1984 return this;
1985 }
1986
1987 public SubmitAction WithData(IUnion<string, SubmitActionData> value)
1988 {
1989 this.Data = value;
1990 return this;
1991 }
1992
1993 public SubmitAction WithAssociatedInputs(AssociatedInputs value)
1994 {
1995 this.AssociatedInputs = value;
1996 return this;
1997 }
1998
1999 public SubmitAction WithConditionallyEnabled(bool value)
2000 {
2001 this.ConditionallyEnabled = value;
2002 return this;
2003 }
2004
2005 public SubmitAction WithMsteams(TeamsSubmitActionProperties value)
2006 {
2007 this.Msteams = value;
2008 return this;
2009 }
2010
2011 public SubmitAction WithFallback(IUnion<Action, FallbackAction> value)
2012 {
2013 this.Fallback = value;
2014 return this;
2015 }
2016}
2017
2018/// <summary>
2019/// Teams-specific properties associated with the action.
2020/// </summary>
2021public class TeamsSubmitActionProperties : SerializableObject
2022{
2023 /// <summary>
2024 /// Deserializes a JSON string into an object of type TeamsSubmitActionProperties.
2025 /// </summary>
2026 public static TeamsSubmitActionProperties? Deserialize(string json)
2027 {
2028 return JsonSerializer.Deserialize<TeamsSubmitActionProperties>(json);
2029 }
2030
2031 /// <summary>
2032 /// Defines how feedback is provided to the end-user when the action is executed.
2033 /// </summary>
2034 [JsonPropertyName("feedback")]
2035 public TeamsSubmitActionFeedback? Feedback { get; set; }
2036
2037 /// <summary>
2038 /// Serializes this TeamsSubmitActionProperties into a JSON string.
2039 /// </summary>
2040 public string Serialize()
2041 {
2042 return JsonSerializer.Serialize(
2043 this,
2044 new JsonSerializerOptions
2045 {
2046 WriteIndented = true,
2047 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2048 }
2049 );
2050 }
2051
2052 public TeamsSubmitActionProperties WithFeedback(TeamsSubmitActionFeedback value)
2053 {
2054 this.Feedback = value;
2055 return this;
2056 }
2057}
2058
2059/// <summary>
2060/// Represents feedback options for an [Action.Submit](https://adaptivecards.microsoft.com/?topic=Action.Submit).
2061/// </summary>
2062public class TeamsSubmitActionFeedback : SerializableObject
2063{
2064 /// <summary>
2065 /// Deserializes a JSON string into an object of type TeamsSubmitActionFeedback.
2066 /// </summary>
2067 public static TeamsSubmitActionFeedback? Deserialize(string json)
2068 {
2069 return JsonSerializer.Deserialize<TeamsSubmitActionFeedback>(json);
2070 }
2071
2072 /// <summary>
2073 /// Defines if a feedback message should be displayed after the action is executed.
2074 /// </summary>
2075 [JsonPropertyName("hide")]
2076 public bool? Hide { get; set; }
2077
2078 /// <summary>
2079 /// Serializes this TeamsSubmitActionFeedback into a JSON string.
2080 /// </summary>
2081 public string Serialize()
2082 {
2083 return JsonSerializer.Serialize(
2084 this,
2085 new JsonSerializerOptions
2086 {
2087 WriteIndented = true,
2088 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2089 }
2090 );
2091 }
2092
2093 public TeamsSubmitActionFeedback WithHide(bool value)
2094 {
2095 this.Hide = value;
2096 return this;
2097 }
2098}
2099
2100/// <summary>
2101/// Opens the provided URL in either a separate browser tab or within the host application.
2102/// </summary>
2103public class OpenUrlAction : Action
2104{
2105 /// <summary>
2106 /// Deserializes a JSON string into an object of type OpenUrlAction.
2107 /// </summary>
2108 public static OpenUrlAction? Deserialize(string json)
2109 {
2110 return JsonSerializer.Deserialize<OpenUrlAction>(json);
2111 }
2112
2113 /// <summary>
2114 /// Must be **Action.OpenUrl**.
2115 /// </summary>
2116 [JsonPropertyName("type")]
2117 public string Type { get; } = "Action.OpenUrl";
2118
2119 /// <summary>
2120 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
2121 /// </summary>
2122 [JsonPropertyName("id")]
2123 public string? Id { get; set; }
2124
2125 /// <summary>
2126 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
2127 /// </summary>
2128 [JsonPropertyName("requires")]
2129 public HostCapabilities? Requires { get; set; }
2130
2131 /// <summary>
2132 /// The title of the action, as it appears on buttons.
2133 /// </summary>
2134 [JsonPropertyName("title")]
2135 public string? Title { get; set; }
2136
2137 /// <summary>
2138 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
2139 ///
2140 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
2141 /// </summary>
2142 [JsonPropertyName("iconUrl")]
2143 public string? IconUrl { get; set; }
2144
2145 /// <summary>
2146 /// Control the style of the action, affecting its visual and spoken representations.
2147 /// </summary>
2148 [JsonPropertyName("style")]
2149 public ActionStyle? Style { get; set; }
2150
2151 /// <summary>
2152 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2153 /// </summary>
2154 [JsonPropertyName("mode")]
2155 public ActionMode? Mode { get; set; }
2156
2157 /// <summary>
2158 /// The tooltip text to display when the action is hovered over.
2159 /// </summary>
2160 [JsonPropertyName("tooltip")]
2161 public string? Tooltip { get; set; }
2162
2163 /// <summary>
2164 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
2165 /// </summary>
2166 [JsonPropertyName("isEnabled")]
2167 public bool? IsEnabled { get; set; }
2168
2169 /// <summary>
2170 /// The URL to open.
2171 /// </summary>
2172 [JsonPropertyName("url")]
2173 public string? Url { get; set; }
2174
2175 /// <summary>
2176 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
2177 /// </summary>
2178 [JsonPropertyName("fallback")]
2179 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2180
2181 public OpenUrlAction(string url)
2182 {
2183 this.Url = url;
2184 }
2185
2186 /// <summary>
2187 /// Serializes this OpenUrlAction into a JSON string.
2188 /// </summary>
2189 public string Serialize()
2190 {
2191 return JsonSerializer.Serialize(
2192 this,
2193 new JsonSerializerOptions
2194 {
2195 WriteIndented = true,
2196 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2197 }
2198 );
2199 }
2200
2201 public OpenUrlAction WithId(string value)
2202 {
2203 this.Id = value;
2204 return this;
2205 }
2206
2207 public OpenUrlAction WithRequires(HostCapabilities value)
2208 {
2209 this.Requires = value;
2210 return this;
2211 }
2212
2213 public OpenUrlAction WithTitle(string value)
2214 {
2215 this.Title = value;
2216 return this;
2217 }
2218
2219 public OpenUrlAction WithIconUrl(string value)
2220 {
2221 this.IconUrl = value;
2222 return this;
2223 }
2224
2225 public OpenUrlAction WithStyle(ActionStyle value)
2226 {
2227 this.Style = value;
2228 return this;
2229 }
2230
2231 public OpenUrlAction WithMode(ActionMode value)
2232 {
2233 this.Mode = value;
2234 return this;
2235 }
2236
2237 public OpenUrlAction WithTooltip(string value)
2238 {
2239 this.Tooltip = value;
2240 return this;
2241 }
2242
2243 public OpenUrlAction WithIsEnabled(bool value)
2244 {
2245 this.IsEnabled = value;
2246 return this;
2247 }
2248
2249 public OpenUrlAction WithUrl(string value)
2250 {
2251 this.Url = value;
2252 return this;
2253 }
2254
2255 public OpenUrlAction WithFallback(IUnion<Action, FallbackAction> value)
2256 {
2257 this.Fallback = value;
2258 return this;
2259 }
2260}
2261
2262/// <summary>
2263/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.
2264/// </summary>
2265public class ToggleVisibilityAction : Action
2266{
2267 /// <summary>
2268 /// Deserializes a JSON string into an object of type ToggleVisibilityAction.
2269 /// </summary>
2270 public static ToggleVisibilityAction? Deserialize(string json)
2271 {
2272 return JsonSerializer.Deserialize<ToggleVisibilityAction>(json);
2273 }
2274
2275 /// <summary>
2276 /// Must be **Action.ToggleVisibility**.
2277 /// </summary>
2278 [JsonPropertyName("type")]
2279 public string Type { get; } = "Action.ToggleVisibility";
2280
2281 /// <summary>
2282 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
2283 /// </summary>
2284 [JsonPropertyName("id")]
2285 public string? Id { get; set; }
2286
2287 /// <summary>
2288 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
2289 /// </summary>
2290 [JsonPropertyName("requires")]
2291 public HostCapabilities? Requires { get; set; }
2292
2293 /// <summary>
2294 /// The title of the action, as it appears on buttons.
2295 /// </summary>
2296 [JsonPropertyName("title")]
2297 public string? Title { get; set; }
2298
2299 /// <summary>
2300 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
2301 ///
2302 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
2303 /// </summary>
2304 [JsonPropertyName("iconUrl")]
2305 public string? IconUrl { get; set; }
2306
2307 /// <summary>
2308 /// Control the style of the action, affecting its visual and spoken representations.
2309 /// </summary>
2310 [JsonPropertyName("style")]
2311 public ActionStyle? Style { get; set; }
2312
2313 /// <summary>
2314 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2315 /// </summary>
2316 [JsonPropertyName("mode")]
2317 public ActionMode? Mode { get; set; }
2318
2319 /// <summary>
2320 /// The tooltip text to display when the action is hovered over.
2321 /// </summary>
2322 [JsonPropertyName("tooltip")]
2323 public string? Tooltip { get; set; }
2324
2325 /// <summary>
2326 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
2327 /// </summary>
2328 [JsonPropertyName("isEnabled")]
2329 public bool? IsEnabled { get; set; }
2330
2331 /// <summary>
2332 /// The Ids of the elements to toggle the visibility of.
2333 /// </summary>
2334 [JsonPropertyName("targetElements")]
2335 public IUnion<IList<string>, IList<TargetElement>>? TargetElements { get; set; }
2336
2337 /// <summary>
2338 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
2339 /// </summary>
2340 [JsonPropertyName("fallback")]
2341 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2342
2343 /// <summary>
2344 /// Serializes this ToggleVisibilityAction into a JSON string.
2345 /// </summary>
2346 public string Serialize()
2347 {
2348 return JsonSerializer.Serialize(
2349 this,
2350 new JsonSerializerOptions
2351 {
2352 WriteIndented = true,
2353 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2354 }
2355 );
2356 }
2357
2358 public ToggleVisibilityAction WithId(string value)
2359 {
2360 this.Id = value;
2361 return this;
2362 }
2363
2364 public ToggleVisibilityAction WithRequires(HostCapabilities value)
2365 {
2366 this.Requires = value;
2367 return this;
2368 }
2369
2370 public ToggleVisibilityAction WithTitle(string value)
2371 {
2372 this.Title = value;
2373 return this;
2374 }
2375
2376 public ToggleVisibilityAction WithIconUrl(string value)
2377 {
2378 this.IconUrl = value;
2379 return this;
2380 }
2381
2382 public ToggleVisibilityAction WithStyle(ActionStyle value)
2383 {
2384 this.Style = value;
2385 return this;
2386 }
2387
2388 public ToggleVisibilityAction WithMode(ActionMode value)
2389 {
2390 this.Mode = value;
2391 return this;
2392 }
2393
2394 public ToggleVisibilityAction WithTooltip(string value)
2395 {
2396 this.Tooltip = value;
2397 return this;
2398 }
2399
2400 public ToggleVisibilityAction WithIsEnabled(bool value)
2401 {
2402 this.IsEnabled = value;
2403 return this;
2404 }
2405
2406 public ToggleVisibilityAction WithTargetElements(IUnion<IList<string>, IList<TargetElement>> value)
2407 {
2408 this.TargetElements = value;
2409 return this;
2410 }
2411
2412 public ToggleVisibilityAction WithFallback(IUnion<Action, FallbackAction> value)
2413 {
2414 this.Fallback = value;
2415 return this;
2416 }
2417}
2418
2419/// <summary>
2420/// Defines a target element in an Action.ToggleVisibility.
2421/// </summary>
2422public class TargetElement : SerializableObject
2423{
2424 /// <summary>
2425 /// Deserializes a JSON string into an object of type TargetElement.
2426 /// </summary>
2427 public static TargetElement? Deserialize(string json)
2428 {
2429 return JsonSerializer.Deserialize<TargetElement>(json);
2430 }
2431
2432 /// <summary>
2433 /// The Id of the element to change the visibility of.
2434 /// </summary>
2435 [JsonPropertyName("elementId")]
2436 public string? ElementId { get; set; }
2437
2438 /// <summary>
2439 /// The new visibility state of the element.
2440 /// </summary>
2441 [JsonPropertyName("isVisible")]
2442 public bool? IsVisible { get; set; }
2443
2444 /// <summary>
2445 /// Serializes this TargetElement into a JSON string.
2446 /// </summary>
2447 public string Serialize()
2448 {
2449 return JsonSerializer.Serialize(
2450 this,
2451 new JsonSerializerOptions
2452 {
2453 WriteIndented = true,
2454 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2455 }
2456 );
2457 }
2458
2459 public TargetElement WithElementId(string value)
2460 {
2461 this.ElementId = value;
2462 return this;
2463 }
2464
2465 public TargetElement WithIsVisible(bool value)
2466 {
2467 this.IsVisible = value;
2468 return this;
2469 }
2470}
2471
2472/// <summary>
2473/// Expands or collapses an embedded card within the main card.
2474/// </summary>
2475public class ShowCardAction : Action
2476{
2477 /// <summary>
2478 /// Deserializes a JSON string into an object of type ShowCardAction.
2479 /// </summary>
2480 public static ShowCardAction? Deserialize(string json)
2481 {
2482 return JsonSerializer.Deserialize<ShowCardAction>(json);
2483 }
2484
2485 /// <summary>
2486 /// Must be **Action.ShowCard**.
2487 /// </summary>
2488 [JsonPropertyName("type")]
2489 public string Type { get; } = "Action.ShowCard";
2490
2491 /// <summary>
2492 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
2493 /// </summary>
2494 [JsonPropertyName("id")]
2495 public string? Id { get; set; }
2496
2497 /// <summary>
2498 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
2499 /// </summary>
2500 [JsonPropertyName("requires")]
2501 public HostCapabilities? Requires { get; set; }
2502
2503 /// <summary>
2504 /// The title of the action, as it appears on buttons.
2505 /// </summary>
2506 [JsonPropertyName("title")]
2507 public string? Title { get; set; }
2508
2509 /// <summary>
2510 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
2511 ///
2512 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
2513 /// </summary>
2514 [JsonPropertyName("iconUrl")]
2515 public string? IconUrl { get; set; }
2516
2517 /// <summary>
2518 /// Control the style of the action, affecting its visual and spoken representations.
2519 /// </summary>
2520 [JsonPropertyName("style")]
2521 public ActionStyle? Style { get; set; }
2522
2523 /// <summary>
2524 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2525 /// </summary>
2526 [JsonPropertyName("mode")]
2527 public ActionMode? Mode { get; set; }
2528
2529 /// <summary>
2530 /// The tooltip text to display when the action is hovered over.
2531 /// </summary>
2532 [JsonPropertyName("tooltip")]
2533 public string? Tooltip { get; set; }
2534
2535 /// <summary>
2536 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
2537 /// </summary>
2538 [JsonPropertyName("isEnabled")]
2539 public bool? IsEnabled { get; set; }
2540
2541 /// <summary>
2542 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
2543 /// </summary>
2544 [JsonPropertyName("fallback")]
2545 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2546
2547 /// <summary>
2548 /// The card that should be displayed when the action is executed.
2549 /// </summary>
2550 [JsonPropertyName("card")]
2551 public AdaptiveCard? Card { get; set; }
2552
2553 /// <summary>
2554 /// Serializes this ShowCardAction into a JSON string.
2555 /// </summary>
2556 public string Serialize()
2557 {
2558 return JsonSerializer.Serialize(
2559 this,
2560 new JsonSerializerOptions
2561 {
2562 WriteIndented = true,
2563 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2564 }
2565 );
2566 }
2567
2568 public ShowCardAction WithId(string value)
2569 {
2570 this.Id = value;
2571 return this;
2572 }
2573
2574 public ShowCardAction WithRequires(HostCapabilities value)
2575 {
2576 this.Requires = value;
2577 return this;
2578 }
2579
2580 public ShowCardAction WithTitle(string value)
2581 {
2582 this.Title = value;
2583 return this;
2584 }
2585
2586 public ShowCardAction WithIconUrl(string value)
2587 {
2588 this.IconUrl = value;
2589 return this;
2590 }
2591
2592 public ShowCardAction WithStyle(ActionStyle value)
2593 {
2594 this.Style = value;
2595 return this;
2596 }
2597
2598 public ShowCardAction WithMode(ActionMode value)
2599 {
2600 this.Mode = value;
2601 return this;
2602 }
2603
2604 public ShowCardAction WithTooltip(string value)
2605 {
2606 this.Tooltip = value;
2607 return this;
2608 }
2609
2610 public ShowCardAction WithIsEnabled(bool value)
2611 {
2612 this.IsEnabled = value;
2613 return this;
2614 }
2615
2616 public ShowCardAction WithFallback(IUnion<Action, FallbackAction> value)
2617 {
2618 this.Fallback = value;
2619 return this;
2620 }
2621
2622 public ShowCardAction WithCard(AdaptiveCard value)
2623 {
2624 this.Card = value;
2625 return this;
2626 }
2627}
2628
2629/// <summary>
2630/// Resets the values of the inputs in the card.
2631/// </summary>
2632public class ResetInputsAction : Action
2633{
2634 /// <summary>
2635 /// Deserializes a JSON string into an object of type ResetInputsAction.
2636 /// </summary>
2637 public static ResetInputsAction? Deserialize(string json)
2638 {
2639 return JsonSerializer.Deserialize<ResetInputsAction>(json);
2640 }
2641
2642 /// <summary>
2643 /// Must be **Action.ResetInputs**.
2644 /// </summary>
2645 [JsonPropertyName("type")]
2646 public string Type { get; } = "Action.ResetInputs";
2647
2648 /// <summary>
2649 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
2650 /// </summary>
2651 [JsonPropertyName("id")]
2652 public string? Id { get; set; }
2653
2654 /// <summary>
2655 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
2656 /// </summary>
2657 [JsonPropertyName("requires")]
2658 public HostCapabilities? Requires { get; set; }
2659
2660 /// <summary>
2661 /// The title of the action, as it appears on buttons.
2662 /// </summary>
2663 [JsonPropertyName("title")]
2664 public string? Title { get; set; }
2665
2666 /// <summary>
2667 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
2668 ///
2669 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
2670 /// </summary>
2671 [JsonPropertyName("iconUrl")]
2672 public string? IconUrl { get; set; }
2673
2674 /// <summary>
2675 /// Control the style of the action, affecting its visual and spoken representations.
2676 /// </summary>
2677 [JsonPropertyName("style")]
2678 public ActionStyle? Style { get; set; }
2679
2680 /// <summary>
2681 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2682 /// </summary>
2683 [JsonPropertyName("mode")]
2684 public ActionMode? Mode { get; set; }
2685
2686 /// <summary>
2687 /// The tooltip text to display when the action is hovered over.
2688 /// </summary>
2689 [JsonPropertyName("tooltip")]
2690 public string? Tooltip { get; set; }
2691
2692 /// <summary>
2693 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
2694 /// </summary>
2695 [JsonPropertyName("isEnabled")]
2696 public bool? IsEnabled { get; set; }
2697
2698 /// <summary>
2699 /// The Ids of the inputs that should be reset.
2700 /// </summary>
2701 [JsonPropertyName("targetInputIds")]
2702 public IList<string>? TargetInputIds { get; set; }
2703
2704 /// <summary>
2705 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
2706 /// </summary>
2707 [JsonPropertyName("fallback")]
2708 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2709
2710 /// <summary>
2711 /// Serializes this ResetInputsAction into a JSON string.
2712 /// </summary>
2713 public string Serialize()
2714 {
2715 return JsonSerializer.Serialize(
2716 this,
2717 new JsonSerializerOptions
2718 {
2719 WriteIndented = true,
2720 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2721 }
2722 );
2723 }
2724
2725 public ResetInputsAction WithId(string value)
2726 {
2727 this.Id = value;
2728 return this;
2729 }
2730
2731 public ResetInputsAction WithRequires(HostCapabilities value)
2732 {
2733 this.Requires = value;
2734 return this;
2735 }
2736
2737 public ResetInputsAction WithTitle(string value)
2738 {
2739 this.Title = value;
2740 return this;
2741 }
2742
2743 public ResetInputsAction WithIconUrl(string value)
2744 {
2745 this.IconUrl = value;
2746 return this;
2747 }
2748
2749 public ResetInputsAction WithStyle(ActionStyle value)
2750 {
2751 this.Style = value;
2752 return this;
2753 }
2754
2755 public ResetInputsAction WithMode(ActionMode value)
2756 {
2757 this.Mode = value;
2758 return this;
2759 }
2760
2761 public ResetInputsAction WithTooltip(string value)
2762 {
2763 this.Tooltip = value;
2764 return this;
2765 }
2766
2767 public ResetInputsAction WithIsEnabled(bool value)
2768 {
2769 this.IsEnabled = value;
2770 return this;
2771 }
2772
2773 public ResetInputsAction WithTargetInputIds(params IList<string> value)
2774 {
2775 this.TargetInputIds = value;
2776 return this;
2777 }
2778
2779 public ResetInputsAction WithFallback(IUnion<Action, FallbackAction> value)
2780 {
2781 this.Fallback = value;
2782 return this;
2783 }
2784}
2785
2786/// <summary>
2787/// Inserts an image into the host application's canvas.
2788/// </summary>
2789public class InsertImageAction : Action
2790{
2791 /// <summary>
2792 /// Deserializes a JSON string into an object of type InsertImageAction.
2793 /// </summary>
2794 public static InsertImageAction? Deserialize(string json)
2795 {
2796 return JsonSerializer.Deserialize<InsertImageAction>(json);
2797 }
2798
2799 /// <summary>
2800 /// Must be **Action.InsertImage**.
2801 /// </summary>
2802 [JsonPropertyName("type")]
2803 public string Type { get; } = "Action.InsertImage";
2804
2805 /// <summary>
2806 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
2807 /// </summary>
2808 [JsonPropertyName("id")]
2809 public string? Id { get; set; }
2810
2811 /// <summary>
2812 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
2813 /// </summary>
2814 [JsonPropertyName("requires")]
2815 public HostCapabilities? Requires { get; set; }
2816
2817 /// <summary>
2818 /// The title of the action, as it appears on buttons.
2819 /// </summary>
2820 [JsonPropertyName("title")]
2821 public string? Title { get; set; }
2822
2823 /// <summary>
2824 /// A URL (or Base64-encoded Data URI) to a PNG, GIF, JPEG or SVG image to be displayed on the left of the action's title.
2825 ///
2826 /// `iconUrl` also accepts the `<icon-name>[,regular|filled]` format to display an icon from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) instead of an image.
2827 /// </summary>
2828 [JsonPropertyName("iconUrl")]
2829 public string? IconUrl { get; set; }
2830
2831 /// <summary>
2832 /// Control the style of the action, affecting its visual and spoken representations.
2833 /// </summary>
2834 [JsonPropertyName("style")]
2835 public ActionStyle? Style { get; set; }
2836
2837 /// <summary>
2838 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2839 /// </summary>
2840 [JsonPropertyName("mode")]
2841 public ActionMode? Mode { get; set; }
2842
2843 /// <summary>
2844 /// The tooltip text to display when the action is hovered over.
2845 /// </summary>
2846 [JsonPropertyName("tooltip")]
2847 public string? Tooltip { get; set; }
2848
2849 /// <summary>
2850 /// Controls the enabled state of the action. A disabled action cannot be clicked. If the action is represented as a button, the button's style will reflect this state.
2851 /// </summary>
2852 [JsonPropertyName("isEnabled")]
2853 public bool? IsEnabled { get; set; }
2854
2855 /// <summary>
2856 /// The URL of the image to insert.
2857 /// </summary>
2858 [JsonPropertyName("url")]
2859 public string? Url { get; set; }
2860
2861 /// <summary>
2862 /// The alternate text for the image.
2863 /// </summary>
2864 [JsonPropertyName("altText")]
2865 public string? AltText { get; set; }
2866
2867 /// <summary>
2868 /// The position at which to insert the image.
2869 /// </summary>
2870 [JsonPropertyName("insertPosition")]
2871 public ImageInsertPosition? InsertPosition { get; set; }
2872
2873 /// <summary>
2874 /// An alternate action to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
2875 /// </summary>
2876 [JsonPropertyName("fallback")]
2877 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2878
2879 /// <summary>
2880 /// Serializes this InsertImageAction into a JSON string.
2881 /// </summary>
2882 public string Serialize()
2883 {
2884 return JsonSerializer.Serialize(
2885 this,
2886 new JsonSerializerOptions
2887 {
2888 WriteIndented = true,
2889 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2890 }
2891 );
2892 }
2893
2894 public InsertImageAction WithId(string value)
2895 {
2896 this.Id = value;
2897 return this;
2898 }
2899
2900 public InsertImageAction WithRequires(HostCapabilities value)
2901 {
2902 this.Requires = value;
2903 return this;
2904 }
2905
2906 public InsertImageAction WithTitle(string value)
2907 {
2908 this.Title = value;
2909 return this;
2910 }
2911
2912 public InsertImageAction WithIconUrl(string value)
2913 {
2914 this.IconUrl = value;
2915 return this;
2916 }
2917
2918 public InsertImageAction WithStyle(ActionStyle value)
2919 {
2920 this.Style = value;
2921 return this;
2922 }
2923
2924 public InsertImageAction WithMode(ActionMode value)
2925 {
2926 this.Mode = value;
2927 return this;
2928 }
2929
2930 public InsertImageAction WithTooltip(string value)
2931 {
2932 this.Tooltip = value;
2933 return this;
2934 }
2935
2936 public InsertImageAction WithIsEnabled(bool value)
2937 {
2938 this.IsEnabled = value;
2939 return this;
2940 }
2941
2942 public InsertImageAction WithUrl(string value)
2943 {
2944 this.Url = value;
2945 return this;
2946 }
2947
2948 public InsertImageAction WithAltText(string value)
2949 {
2950 this.AltText = value;
2951 return this;
2952 }
2953
2954 public InsertImageAction WithInsertPosition(ImageInsertPosition value)
2955 {
2956 this.InsertPosition = value;
2957 return this;
2958 }
2959
2960 public InsertImageAction WithFallback(IUnion<Action, FallbackAction> value)
2961 {
2962 this.Fallback = value;
2963 return this;
2964 }
2965}
2966
2967/// <summary>
2968/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.
2969/// </summary>
2970public class StackLayout : ContainerLayout
2971{
2972 /// <summary>
2973 /// Deserializes a JSON string into an object of type StackLayout.
2974 /// </summary>
2975 public static StackLayout? Deserialize(string json)
2976 {
2977 return JsonSerializer.Deserialize<StackLayout>(json);
2978 }
2979
2980 /// <summary>
2981 /// Must be **Layout.Stack**.
2982 /// </summary>
2983 [JsonPropertyName("type")]
2984 public string Type { get; } = "Layout.Stack";
2985
2986 /// <summary>
2987 /// Controls for which card width the layout should be used.
2988 /// </summary>
2989 [JsonPropertyName("targetWidth")]
2990 public TargetWidth? TargetWidth { get; set; }
2991
2992 /// <summary>
2993 /// Serializes this StackLayout into a JSON string.
2994 /// </summary>
2995 public string Serialize()
2996 {
2997 return JsonSerializer.Serialize(
2998 this,
2999 new JsonSerializerOptions
3000 {
3001 WriteIndented = true,
3002 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3003 }
3004 );
3005 }
3006
3007 public StackLayout WithTargetWidth(TargetWidth value)
3008 {
3009 this.TargetWidth = value;
3010 return this;
3011 }
3012}
3013
3014/// <summary>
3015/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed.
3016/// </summary>
3017public class FlowLayout : ContainerLayout
3018{
3019 /// <summary>
3020 /// Deserializes a JSON string into an object of type FlowLayout.
3021 /// </summary>
3022 public static FlowLayout? Deserialize(string json)
3023 {
3024 return JsonSerializer.Deserialize<FlowLayout>(json);
3025 }
3026
3027 /// <summary>
3028 /// Must be **Layout.Flow**.
3029 /// </summary>
3030 [JsonPropertyName("type")]
3031 public string Type { get; } = "Layout.Flow";
3032
3033 /// <summary>
3034 /// Controls for which card width the layout should be used.
3035 /// </summary>
3036 [JsonPropertyName("targetWidth")]
3037 public TargetWidth? TargetWidth { get; set; }
3038
3039 /// <summary>
3040 /// Controls how the content of the container should be horizontally aligned.
3041 /// </summary>
3042 [JsonPropertyName("horizontalItemsAlignment")]
3043 public HorizontalAlignment? HorizontalItemsAlignment { get; set; }
3044
3045 /// <summary>
3046 /// Controls how the content of the container should be vertically aligned.
3047 /// </summary>
3048 [JsonPropertyName("verticalItemsAlignment")]
3049 public VerticalAlignment? VerticalItemsAlignment { get; set; }
3050
3051 /// <summary>
3052 /// Controls how item should fit inside the container.
3053 /// </summary>
3054 [JsonPropertyName("itemFit")]
3055 public FlowLayoutItemFit? ItemFit { get; set; }
3056
3057 /// <summary>
3058 /// The minimum width, in pixels, of each item, in the `<number>px` format. Should not be used if itemWidth is set.
3059 /// </summary>
3060 [JsonPropertyName("minItemWidth")]
3061 public string? MinItemWidth { get; set; }
3062
3063 /// <summary>
3064 /// The maximum width, in pixels, of each item, in the `<number>px` format. Should not be used if itemWidth is set.
3065 /// </summary>
3066 [JsonPropertyName("maxItemWidth")]
3067 public string? MaxItemWidth { get; set; }
3068
3069 /// <summary>
3070 /// The width, in pixels, of each item, in the `<number>px` format. Should not be used if maxItemWidth and/or minItemWidth are set.
3071 /// </summary>
3072 [JsonPropertyName("itemWidth")]
3073 public string? ItemWidth { get; set; }
3074
3075 /// <summary>
3076 /// The space between items.
3077 /// </summary>
3078 [JsonPropertyName("columnSpacing")]
3079 public Spacing? ColumnSpacing { get; set; }
3080
3081 /// <summary>
3082 /// The space between rows of items.
3083 /// </summary>
3084 [JsonPropertyName("rowSpacing")]
3085 public Spacing? RowSpacing { get; set; }
3086
3087 /// <summary>
3088 /// Serializes this FlowLayout into a JSON string.
3089 /// </summary>
3090 public string Serialize()
3091 {
3092 return JsonSerializer.Serialize(
3093 this,
3094 new JsonSerializerOptions
3095 {
3096 WriteIndented = true,
3097 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3098 }
3099 );
3100 }
3101
3102 public FlowLayout WithTargetWidth(TargetWidth value)
3103 {
3104 this.TargetWidth = value;
3105 return this;
3106 }
3107
3108 public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value)
3109 {
3110 this.HorizontalItemsAlignment = value;
3111 return this;
3112 }
3113
3114 public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value)
3115 {
3116 this.VerticalItemsAlignment = value;
3117 return this;
3118 }
3119
3120 public FlowLayout WithItemFit(FlowLayoutItemFit value)
3121 {
3122 this.ItemFit = value;
3123 return this;
3124 }
3125
3126 public FlowLayout WithMinItemWidth(string value)
3127 {
3128 this.MinItemWidth = value;
3129 return this;
3130 }
3131
3132 public FlowLayout WithMaxItemWidth(string value)
3133 {
3134 this.MaxItemWidth = value;
3135 return this;
3136 }
3137
3138 public FlowLayout WithItemWidth(string value)
3139 {
3140 this.ItemWidth = value;
3141 return this;
3142 }
3143
3144 public FlowLayout WithColumnSpacing(Spacing value)
3145 {
3146 this.ColumnSpacing = value;
3147 return this;
3148 }
3149
3150 public FlowLayout WithRowSpacing(Spacing value)
3151 {
3152 this.RowSpacing = value;
3153 return this;
3154 }
3155}
3156
3157/// <summary>
3158/// A layout that divides a container into named areas into which elements can be placed.
3159/// </summary>
3160public class AreaGridLayout : ContainerLayout
3161{
3162 /// <summary>
3163 /// Deserializes a JSON string into an object of type AreaGridLayout.
3164 /// </summary>
3165 public static AreaGridLayout? Deserialize(string json)
3166 {
3167 return JsonSerializer.Deserialize<AreaGridLayout>(json);
3168 }
3169
3170 /// <summary>
3171 /// Must be **Layout.AreaGrid**.
3172 /// </summary>
3173 [JsonPropertyName("type")]
3174 public string Type { get; } = "Layout.AreaGrid";
3175
3176 /// <summary>
3177 /// Controls for which card width the layout should be used.
3178 /// </summary>
3179 [JsonPropertyName("targetWidth")]
3180 public TargetWidth? TargetWidth { get; set; }
3181
3182 /// <summary>
3183 /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `<number>px` format.
3184 /// </summary>
3185 [JsonPropertyName("columns")]
3186 public IUnion<IList<float>, IList<string>>? Columns { get; set; }
3187
3188 /// <summary>
3189 /// The areas in the grid layout.
3190 /// </summary>
3191 [JsonPropertyName("areas")]
3192 public IList<GridArea>? Areas { get; set; }
3193
3194 /// <summary>
3195 /// The space between columns.
3196 /// </summary>
3197 [JsonPropertyName("columnSpacing")]
3198 public Spacing? ColumnSpacing { get; set; }
3199
3200 /// <summary>
3201 /// The space between rows.
3202 /// </summary>
3203 [JsonPropertyName("rowSpacing")]
3204 public Spacing? RowSpacing { get; set; }
3205
3206 /// <summary>
3207 /// Serializes this AreaGridLayout into a JSON string.
3208 /// </summary>
3209 public string Serialize()
3210 {
3211 return JsonSerializer.Serialize(
3212 this,
3213 new JsonSerializerOptions
3214 {
3215 WriteIndented = true,
3216 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3217 }
3218 );
3219 }
3220
3221 public AreaGridLayout WithTargetWidth(TargetWidth value)
3222 {
3223 this.TargetWidth = value;
3224 return this;
3225 }
3226
3227 public AreaGridLayout WithColumns(IUnion<IList<float>, IList<string>> value)
3228 {
3229 this.Columns = value;
3230 return this;
3231 }
3232
3233 public AreaGridLayout WithAreas(params IList<GridArea> value)
3234 {
3235 this.Areas = value;
3236 return this;
3237 }
3238
3239 public AreaGridLayout WithColumnSpacing(Spacing value)
3240 {
3241 this.ColumnSpacing = value;
3242 return this;
3243 }
3244
3245 public AreaGridLayout WithRowSpacing(Spacing value)
3246 {
3247 this.RowSpacing = value;
3248 return this;
3249 }
3250}
3251
3252/// <summary>
3253/// Defines an area in a Layout.AreaGrid layout.
3254/// </summary>
3255public class GridArea : SerializableObject
3256{
3257 /// <summary>
3258 /// Deserializes a JSON string into an object of type GridArea.
3259 /// </summary>
3260 public static GridArea? Deserialize(string json)
3261 {
3262 return JsonSerializer.Deserialize<GridArea>(json);
3263 }
3264
3265 /// <summary>
3266 /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area.
3267 /// </summary>
3268 [JsonPropertyName("name")]
3269 public string? Name { get; set; }
3270
3271 /// <summary>
3272 /// The start column index of the area. Column indices start at 1.
3273 /// </summary>
3274 [JsonPropertyName("column")]
3275 public float? Column { get; set; }
3276
3277 /// <summary>
3278 /// Defines how many columns the area should span.
3279 /// </summary>
3280 [JsonPropertyName("columnSpan")]
3281 public float? ColumnSpan { get; set; }
3282
3283 /// <summary>
3284 /// The start row index of the area. Row indices start at 1.
3285 /// </summary>
3286 [JsonPropertyName("row")]
3287 public float? Row { get; set; }
3288
3289 /// <summary>
3290 /// Defines how many rows the area should span.
3291 /// </summary>
3292 [JsonPropertyName("rowSpan")]
3293 public float? RowSpan { get; set; }
3294
3295 /// <summary>
3296 /// Serializes this GridArea into a JSON string.
3297 /// </summary>
3298 public string Serialize()
3299 {
3300 return JsonSerializer.Serialize(
3301 this,
3302 new JsonSerializerOptions
3303 {
3304 WriteIndented = true,
3305 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3306 }
3307 );
3308 }
3309
3310 public GridArea WithName(string value)
3311 {
3312 this.Name = value;
3313 return this;
3314 }
3315
3316 public GridArea WithColumn(float value)
3317 {
3318 this.Column = value;
3319 return this;
3320 }
3321
3322 public GridArea WithColumnSpan(float value)
3323 {
3324 this.ColumnSpan = value;
3325 return this;
3326 }
3327
3328 public GridArea WithRow(float value)
3329 {
3330 this.Row = value;
3331 return this;
3332 }
3333
3334 public GridArea WithRowSpan(float value)
3335 {
3336 this.RowSpan = value;
3337 return this;
3338 }
3339}
3340
3341/// <summary>
3342/// Defines a container's background image and the way it should be rendered.
3343/// </summary>
3344public class BackgroundImage : SerializableObject
3345{
3346 /// <summary>
3347 /// Deserializes a JSON string into an object of type BackgroundImage.
3348 /// </summary>
3349 public static BackgroundImage? Deserialize(string json)
3350 {
3351 return JsonSerializer.Deserialize<BackgroundImage>(json);
3352 }
3353
3354 /// <summary>
3355 /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
3356 /// </summary>
3357 [JsonPropertyName("url")]
3358 public string? Url { get; set; }
3359
3360 /// <summary>
3361 /// Controls how the image should fill the area.
3362 /// </summary>
3363 [JsonPropertyName("fillMode")]
3364 public FillMode? FillMode { get; set; }
3365
3366 /// <summary>
3367 /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
3368 /// </summary>
3369 [JsonPropertyName("horizontalAlignment")]
3370 public HorizontalAlignment? HorizontalAlignment { get; set; }
3371
3372 /// <summary>
3373 /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
3374 /// </summary>
3375 [JsonPropertyName("verticalAlignment")]
3376 public VerticalAlignment? VerticalAlignment { get; set; }
3377
3378 /// <summary>
3379 /// Serializes this BackgroundImage into a JSON string.
3380 /// </summary>
3381 public string Serialize()
3382 {
3383 return JsonSerializer.Serialize(
3384 this,
3385 new JsonSerializerOptions
3386 {
3387 WriteIndented = true,
3388 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3389 }
3390 );
3391 }
3392
3393 public BackgroundImage WithUrl(string value)
3394 {
3395 this.Url = value;
3396 return this;
3397 }
3398
3399 public BackgroundImage WithFillMode(FillMode value)
3400 {
3401 this.FillMode = value;
3402 return this;
3403 }
3404
3405 public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value)
3406 {
3407 this.HorizontalAlignment = value;
3408 return this;
3409 }
3410
3411 public BackgroundImage WithVerticalAlignment(VerticalAlignment value)
3412 {
3413 this.VerticalAlignment = value;
3414 return this;
3415 }
3416}
3417
3418/// <summary>
3419/// Defines how a card can be refreshed by making a request to the target Bot.
3420/// </summary>
3421public class RefreshDefinition : SerializableObject
3422{
3423 /// <summary>
3424 /// Deserializes a JSON string into an object of type RefreshDefinition.
3425 /// </summary>
3426 public static RefreshDefinition? Deserialize(string json)
3427 {
3428 return JsonSerializer.Deserialize<RefreshDefinition>(json);
3429 }
3430
3431 /// <summary>
3432 /// The Action.Execute action to invoke to refresh the card.
3433 /// </summary>
3434 [JsonPropertyName("action")]
3435 public ExecuteAction? Action { get; set; }
3436
3437 /// <summary>
3438 /// The list of user Ids for which the card will be automatically refreshed. In Teams, in chats or channels with more than 60 users, the card will automatically refresh only for users specified in the userIds list. Other users will have to manually click on a "refresh" button. In contexts with fewer than 60 users, the card will automatically refresh for all users.
3439 /// </summary>
3440 [JsonPropertyName("userIds")]
3441 public IList<string>? UserIds { get; set; }
3442
3443 /// <summary>
3444 /// Serializes this RefreshDefinition into a JSON string.
3445 /// </summary>
3446 public string Serialize()
3447 {
3448 return JsonSerializer.Serialize(
3449 this,
3450 new JsonSerializerOptions
3451 {
3452 WriteIndented = true,
3453 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3454 }
3455 );
3456 }
3457
3458 public RefreshDefinition WithAction(ExecuteAction value)
3459 {
3460 this.Action = value;
3461 return this;
3462 }
3463
3464 public RefreshDefinition WithUserIds(params IList<string> value)
3465 {
3466 this.UserIds = value;
3467 return this;
3468 }
3469}
3470
3471/// <summary>
3472/// Defines authentication information associated with a card. For more information, refer to the [Bot Framework OAuthCard type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.oauthcard)
3473/// </summary>
3474public class Authentication : SerializableObject
3475{
3476 /// <summary>
3477 /// Deserializes a JSON string into an object of type Authentication.
3478 /// </summary>
3479 public static Authentication? Deserialize(string json)
3480 {
3481 return JsonSerializer.Deserialize<Authentication>(json);
3482 }
3483
3484 /// <summary>
3485 /// The text that can be displayed to the end user when prompting them to authenticate.
3486 /// </summary>
3487 [JsonPropertyName("text")]
3488 public string? Text { get; set; }
3489
3490 /// <summary>
3491 /// The identifier for registered OAuth connection setting information.
3492 /// </summary>
3493 [JsonPropertyName("connectionName")]
3494 public string? ConnectionName { get; set; }
3495
3496 /// <summary>
3497 /// The buttons that should be displayed to the user when prompting for authentication. The array MUST contain one button of type “signin”. Other button types are not currently supported.
3498 /// </summary>
3499 [JsonPropertyName("buttons")]
3500 public IList<AuthCardButton>? Buttons { get; set; }
3501
3502 /// <summary>
3503 /// Provides information required to enable on-behalf-of single sign-on user authentication.
3504 /// </summary>
3505 [JsonPropertyName("tokenExchangeResource")]
3506 public TokenExchangeResource? TokenExchangeResource { get; set; }
3507
3508 /// <summary>
3509 /// Serializes this Authentication into a JSON string.
3510 /// </summary>
3511 public string Serialize()
3512 {
3513 return JsonSerializer.Serialize(
3514 this,
3515 new JsonSerializerOptions
3516 {
3517 WriteIndented = true,
3518 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3519 }
3520 );
3521 }
3522
3523 public Authentication WithText(string value)
3524 {
3525 this.Text = value;
3526 return this;
3527 }
3528
3529 public Authentication WithConnectionName(string value)
3530 {
3531 this.ConnectionName = value;
3532 return this;
3533 }
3534
3535 public Authentication WithButtons(params IList<AuthCardButton> value)
3536 {
3537 this.Buttons = value;
3538 return this;
3539 }
3540
3541 public Authentication WithTokenExchangeResource(TokenExchangeResource value)
3542 {
3543 this.TokenExchangeResource = value;
3544 return this;
3545 }
3546}
3547
3548/// <summary>
3549/// Defines a button as displayed when prompting a user to authenticate. For more information, refer to the [Bot Framework CardAction type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.cardaction).
3550/// </summary>
3551public class AuthCardButton : SerializableObject
3552{
3553 /// <summary>
3554 /// Deserializes a JSON string into an object of type AuthCardButton.
3555 /// </summary>
3556 public static AuthCardButton? Deserialize(string json)
3557 {
3558 return JsonSerializer.Deserialize<AuthCardButton>(json);
3559 }
3560
3561 /// <summary>
3562 /// Must be **signin**.
3563 /// </summary>
3564 [JsonPropertyName("type")]
3565 public string? Type { get; set; }
3566
3567 /// <summary>
3568 /// The caption of the button.
3569 /// </summary>
3570 [JsonPropertyName("title")]
3571 public string? Title { get; set; }
3572
3573 /// <summary>
3574 /// A URL to an image to display alongside the button’s caption.
3575 /// </summary>
3576 [JsonPropertyName("image")]
3577 public string? Image { get; set; }
3578
3579 /// <summary>
3580 /// The value associated with the button. The meaning of value depends on the button’s type.
3581 /// </summary>
3582 [JsonPropertyName("value")]
3583 public string? Value { get; set; }
3584
3585 /// <summary>
3586 /// Serializes this AuthCardButton into a JSON string.
3587 /// </summary>
3588 public string Serialize()
3589 {
3590 return JsonSerializer.Serialize(
3591 this,
3592 new JsonSerializerOptions
3593 {
3594 WriteIndented = true,
3595 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3596 }
3597 );
3598 }
3599
3600 public AuthCardButton WithType(string value)
3601 {
3602 this.Type = value;
3603 return this;
3604 }
3605
3606 public AuthCardButton WithTitle(string value)
3607 {
3608 this.Title = value;
3609 return this;
3610 }
3611
3612 public AuthCardButton WithImage(string value)
3613 {
3614 this.Image = value;
3615 return this;
3616 }
3617
3618 public AuthCardButton WithValue(string value)
3619 {
3620 this.Value = value;
3621 return this;
3622 }
3623}
3624
3625/// <summary>
3626/// Defines information required to enable on-behalf-of single sign-on user authentication. For more information, refer to the [Bot Framework TokenExchangeResource type](https://docs.microsoft.com/dotnet/api/microsoft.bot.schema.tokenexchangeresource)
3627/// </summary>
3628public class TokenExchangeResource : SerializableObject
3629{
3630 /// <summary>
3631 /// Deserializes a JSON string into an object of type TokenExchangeResource.
3632 /// </summary>
3633 public static TokenExchangeResource? Deserialize(string json)
3634 {
3635 return JsonSerializer.Deserialize<TokenExchangeResource>(json);
3636 }
3637
3638 /// <summary>
3639 /// The unique identified of this token exchange instance.
3640 /// </summary>
3641 [JsonPropertyName("id")]
3642 public string? Id { get; set; }
3643
3644 /// <summary>
3645 /// An application ID or resource identifier with which to exchange a token on behalf of. This property is identity provider- and application-specific.
3646 /// </summary>
3647 [JsonPropertyName("uri")]
3648 public string? Uri { get; set; }
3649
3650 /// <summary>
3651 /// An identifier for the identity provider with which to attempt a token exchange.
3652 /// </summary>
3653 [JsonPropertyName("providerId")]
3654 public string? ProviderId { get; set; }
3655
3656 /// <summary>
3657 /// Serializes this TokenExchangeResource into a JSON string.
3658 /// </summary>
3659 public string Serialize()
3660 {
3661 return JsonSerializer.Serialize(
3662 this,
3663 new JsonSerializerOptions
3664 {
3665 WriteIndented = true,
3666 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3667 }
3668 );
3669 }
3670
3671 public TokenExchangeResource WithId(string value)
3672 {
3673 this.Id = value;
3674 return this;
3675 }
3676
3677 public TokenExchangeResource WithUri(string value)
3678 {
3679 this.Uri = value;
3680 return this;
3681 }
3682
3683 public TokenExchangeResource WithProviderId(string value)
3684 {
3685 this.ProviderId = value;
3686 return this;
3687 }
3688}
3689
3690/// <summary>
3691/// Represents a set of Teams-specific properties on a card.
3692/// </summary>
3693public class TeamsCardProperties : SerializableObject
3694{
3695 /// <summary>
3696 /// Deserializes a JSON string into an object of type TeamsCardProperties.
3697 /// </summary>
3698 public static TeamsCardProperties? Deserialize(string json)
3699 {
3700 return JsonSerializer.Deserialize<TeamsCardProperties>(json);
3701 }
3702
3703 /// <summary>
3704 /// Controls the width of the card in a Teams chat.
3705 ///
3706 /// Note that setting `width` to "full" will not actually stretch the card to the "full width" of the chat pane. It will only make the card wider than when the `width` property isn't set.
3707 /// </summary>
3708 [JsonPropertyName("width")]
3709 public TeamsCardWidth? Width { get; set; }
3710
3711 /// <summary>
3712 /// The Teams-specific entities associated with the card.
3713 /// </summary>
3714 [JsonPropertyName("entities")]
3715 public IList<Mention>? Entities { get; set; }
3716
3717 /// <summary>
3718 /// Serializes this TeamsCardProperties into a JSON string.
3719 /// </summary>
3720 public string Serialize()
3721 {
3722 return JsonSerializer.Serialize(
3723 this,
3724 new JsonSerializerOptions
3725 {
3726 WriteIndented = true,
3727 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3728 }
3729 );
3730 }
3731
3732 public TeamsCardProperties WithWidth(TeamsCardWidth value)
3733 {
3734 this.Width = value;
3735 return this;
3736 }
3737
3738 public TeamsCardProperties WithEntities(params IList<Mention> value)
3739 {
3740 this.Entities = value;
3741 return this;
3742 }
3743}
3744
3745/// <summary>
3746/// Represents a mention to a person.
3747/// </summary>
3748public class Mention : SerializableObject
3749{
3750 /// <summary>
3751 /// Deserializes a JSON string into an object of type Mention.
3752 /// </summary>
3753 public static Mention? Deserialize(string json)
3754 {
3755 return JsonSerializer.Deserialize<Mention>(json);
3756 }
3757
3758 /// <summary>
3759 /// Must be **mention**.
3760 /// </summary>
3761 [JsonPropertyName("type")]
3762 public string Type { get; } = "mention";
3763
3764 /// <summary>
3765 /// The text that will be substituted with the mention.
3766 /// </summary>
3767 [JsonPropertyName("text")]
3768 public string? Text { get; set; }
3769
3770 /// <summary>
3771 /// Defines the entity being mentioned.
3772 /// </summary>
3773 [JsonPropertyName("mentioned")]
3774 public MentionedEntity? Mentioned { get; set; }
3775
3776 /// <summary>
3777 /// Serializes this Mention into a JSON string.
3778 /// </summary>
3779 public string Serialize()
3780 {
3781 return JsonSerializer.Serialize(
3782 this,
3783 new JsonSerializerOptions
3784 {
3785 WriteIndented = true,
3786 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3787 }
3788 );
3789 }
3790
3791 public Mention WithText(string value)
3792 {
3793 this.Text = value;
3794 return this;
3795 }
3796
3797 public Mention WithMentioned(MentionedEntity value)
3798 {
3799 this.Mentioned = value;
3800 return this;
3801 }
3802}
3803
3804/// <summary>
3805/// Represents a mentioned person or tag.
3806/// </summary>
3807public class MentionedEntity : SerializableObject
3808{
3809 /// <summary>
3810 /// Deserializes a JSON string into an object of type MentionedEntity.
3811 /// </summary>
3812 public static MentionedEntity? Deserialize(string json)
3813 {
3814 return JsonSerializer.Deserialize<MentionedEntity>(json);
3815 }
3816
3817 /// <summary>
3818 /// The Id of a person (typically a Microsoft Entra user Id) or tag.
3819 /// </summary>
3820 [JsonPropertyName("id")]
3821 public string? Id { get; set; }
3822
3823 /// <summary>
3824 /// The name of the mentioned entity.
3825 /// </summary>
3826 [JsonPropertyName("name")]
3827 public string? Name { get; set; }
3828
3829 /// <summary>
3830 /// The type of the mentioned entity.
3831 /// </summary>
3832 [JsonPropertyName("mentionType")]
3833 public MentionType? MentionType { get; set; }
3834
3835 /// <summary>
3836 /// Serializes this MentionedEntity into a JSON string.
3837 /// </summary>
3838 public string Serialize()
3839 {
3840 return JsonSerializer.Serialize(
3841 this,
3842 new JsonSerializerOptions
3843 {
3844 WriteIndented = true,
3845 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3846 }
3847 );
3848 }
3849
3850 public MentionedEntity WithId(string value)
3851 {
3852 this.Id = value;
3853 return this;
3854 }
3855
3856 public MentionedEntity WithName(string value)
3857 {
3858 this.Name = value;
3859 return this;
3860 }
3861
3862 public MentionedEntity WithMentionType(MentionType value)
3863 {
3864 this.MentionType = value;
3865 return this;
3866 }
3867}
3868
3869/// <summary>
3870/// Card-level metadata.
3871/// </summary>
3872public class CardMetadata : SerializableObject
3873{
3874 /// <summary>
3875 /// Deserializes a JSON string into an object of type CardMetadata.
3876 /// </summary>
3877 public static CardMetadata? Deserialize(string json)
3878 {
3879 return JsonSerializer.Deserialize<CardMetadata>(json);
3880 }
3881
3882 /// <summary>
3883 /// The URL the card originates from. When `webUrl` is set, the card is dubbed an **Adaptive Card-based Loop Component** and, when pasted in Teams or other Loop Component-capable host applications, the URL will unfurl to the same exact card.
3884 /// </summary>
3885 [JsonPropertyName("webUrl")]
3886 public string? WebUrl { get; set; }
3887
3888 /// <summary>
3889 /// Serializes this CardMetadata into a JSON string.
3890 /// </summary>
3891 public string Serialize()
3892 {
3893 return JsonSerializer.Serialize(
3894 this,
3895 new JsonSerializerOptions
3896 {
3897 WriteIndented = true,
3898 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3899 }
3900 );
3901 }
3902
3903 public CardMetadata WithWebUrl(string value)
3904 {
3905 this.WebUrl = value;
3906 return this;
3907 }
3908}
3909
3910/// <summary>
3911/// A container for other elements. Use containers for styling purposes and/or to logically group a set of elements together, which can be especially useful when used with Action.ToggleVisibility.
3912/// </summary>
3913public class Container : CardElement
3914{
3915 /// <summary>
3916 /// Deserializes a JSON string into an object of type Container.
3917 /// </summary>
3918 public static Container? Deserialize(string json)
3919 {
3920 return JsonSerializer.Deserialize<Container>(json);
3921 }
3922
3923 /// <summary>
3924 /// Must be **Container**.
3925 /// </summary>
3926 [JsonPropertyName("type")]
3927 public string Type { get; } = "Container";
3928
3929 /// <summary>
3930 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
3931 /// </summary>
3932 [JsonPropertyName("id")]
3933 public string? Id { get; set; }
3934
3935 /// <summary>
3936 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
3937 /// </summary>
3938 [JsonPropertyName("requires")]
3939 public HostCapabilities? Requires { get; set; }
3940
3941 /// <summary>
3942 /// The locale associated with the element.
3943 /// </summary>
3944 [JsonPropertyName("lang")]
3945 public string? Lang { get; set; }
3946
3947 /// <summary>
3948 /// Controls the visibility of the element.
3949 /// </summary>
3950 [JsonPropertyName("isVisible")]
3951 public bool? IsVisible { get; set; }
3952
3953 /// <summary>
3954 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
3955 /// </summary>
3956 [JsonPropertyName("separator")]
3957 public bool? Separator { get; set; }
3958
3959 /// <summary>
3960 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
3961 /// </summary>
3962 [JsonPropertyName("height")]
3963 public ElementHeight? Height { get; set; }
3964
3965 /// <summary>
3966 /// Controls how the element should be horizontally aligned.
3967 /// </summary>
3968 [JsonPropertyName("horizontalAlignment")]
3969 public HorizontalAlignment? HorizontalAlignment { get; set; }
3970
3971 /// <summary>
3972 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
3973 /// </summary>
3974 [JsonPropertyName("spacing")]
3975 public Spacing? Spacing { get; set; }
3976
3977 /// <summary>
3978 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
3979 /// </summary>
3980 [JsonPropertyName("targetWidth")]
3981 public TargetWidth? TargetWidth { get; set; }
3982
3983 /// <summary>
3984 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
3985 /// </summary>
3986 [JsonPropertyName("isSortKey")]
3987 public bool? IsSortKey { get; set; }
3988
3989 /// <summary>
3990 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
3991 /// </summary>
3992 [JsonPropertyName("selectAction")]
3993 public Action? SelectAction { get; set; }
3994
3995 /// <summary>
3996 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
3997 /// </summary>
3998 [JsonPropertyName("style")]
3999 public ContainerStyle? Style { get; set; }
4000
4001 /// <summary>
4002 /// Controls if a border should be displayed around the container.
4003 /// </summary>
4004 [JsonPropertyName("showBorder")]
4005 public bool? ShowBorder { get; set; }
4006
4007 /// <summary>
4008 /// Controls if the container should have rounded corners.
4009 /// </summary>
4010 [JsonPropertyName("roundedCorners")]
4011 public bool? RoundedCorners { get; set; }
4012
4013 /// <summary>
4014 /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
4015 /// </summary>
4016 [JsonPropertyName("layouts")]
4017 public IList<ContainerLayout>? Layouts { get; set; }
4018
4019 /// <summary>
4020 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
4021 /// </summary>
4022 [JsonPropertyName("bleed")]
4023 public bool? Bleed { get; set; }
4024
4025 /// <summary>
4026 /// The minimum height, in pixels, of the container, in the `<number>px` format.
4027 /// </summary>
4028 [JsonPropertyName("minHeight")]
4029 public string? MinHeight { get; set; }
4030
4031 /// <summary>
4032 /// Defines the container's background image.
4033 /// </summary>
4034 [JsonPropertyName("backgroundImage")]
4035 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
4036
4037 /// <summary>
4038 /// Controls how the container's content should be vertically aligned.
4039 /// </summary>
4040 [JsonPropertyName("verticalContentAlignment")]
4041 public VerticalAlignment? VerticalContentAlignment { get; set; }
4042
4043 /// <summary>
4044 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
4045 /// </summary>
4046 [JsonPropertyName("rtl")]
4047 public bool? Rtl { get; set; }
4048
4049 /// <summary>
4050 /// The maximum height, in pixels, of the container, in the `<number>px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.
4051 /// </summary>
4052 [JsonPropertyName("maxHeight")]
4053 public string? MaxHeight { get; set; }
4054
4055 /// <summary>
4056 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4057 /// </summary>
4058 [JsonPropertyName("grid.area")]
4059 public string? GridArea { get; set; }
4060
4061 /// <summary>
4062 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
4063 /// </summary>
4064 [JsonPropertyName("fallback")]
4065 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4066
4067 /// <summary>
4068 /// The elements in the container.
4069 /// </summary>
4070 [JsonPropertyName("items")]
4071 public IList<CardElement>? Items { get; set; }
4072
4073 public Container(params IList<CardElement> items)
4074 {
4075 this.Items = items;
4076 }
4077
4078 /// <summary>
4079 /// Serializes this Container into a JSON string.
4080 /// </summary>
4081 public string Serialize()
4082 {
4083 return JsonSerializer.Serialize(
4084 this,
4085 new JsonSerializerOptions
4086 {
4087 WriteIndented = true,
4088 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4089 }
4090 );
4091 }
4092
4093 public Container WithId(string value)
4094 {
4095 this.Id = value;
4096 return this;
4097 }
4098
4099 public Container WithRequires(HostCapabilities value)
4100 {
4101 this.Requires = value;
4102 return this;
4103 }
4104
4105 public Container WithLang(string value)
4106 {
4107 this.Lang = value;
4108 return this;
4109 }
4110
4111 public Container WithIsVisible(bool value)
4112 {
4113 this.IsVisible = value;
4114 return this;
4115 }
4116
4117 public Container WithSeparator(bool value)
4118 {
4119 this.Separator = value;
4120 return this;
4121 }
4122
4123 public Container WithHeight(ElementHeight value)
4124 {
4125 this.Height = value;
4126 return this;
4127 }
4128
4129 public Container WithHorizontalAlignment(HorizontalAlignment value)
4130 {
4131 this.HorizontalAlignment = value;
4132 return this;
4133 }
4134
4135 public Container WithSpacing(Spacing value)
4136 {
4137 this.Spacing = value;
4138 return this;
4139 }
4140
4141 public Container WithTargetWidth(TargetWidth value)
4142 {
4143 this.TargetWidth = value;
4144 return this;
4145 }
4146
4147 public Container WithIsSortKey(bool value)
4148 {
4149 this.IsSortKey = value;
4150 return this;
4151 }
4152
4153 public Container WithSelectAction(Action value)
4154 {
4155 this.SelectAction = value;
4156 return this;
4157 }
4158
4159 public Container WithStyle(ContainerStyle value)
4160 {
4161 this.Style = value;
4162 return this;
4163 }
4164
4165 public Container WithShowBorder(bool value)
4166 {
4167 this.ShowBorder = value;
4168 return this;
4169 }
4170
4171 public Container WithRoundedCorners(bool value)
4172 {
4173 this.RoundedCorners = value;
4174 return this;
4175 }
4176
4177 public Container WithLayouts(params IList<ContainerLayout> value)
4178 {
4179 this.Layouts = value;
4180 return this;
4181 }
4182
4183 public Container WithBleed(bool value)
4184 {
4185 this.Bleed = value;
4186 return this;
4187 }
4188
4189 public Container WithMinHeight(string value)
4190 {
4191 this.MinHeight = value;
4192 return this;
4193 }
4194
4195 public Container WithBackgroundImage(IUnion<string, BackgroundImage> value)
4196 {
4197 this.BackgroundImage = value;
4198 return this;
4199 }
4200
4201 public Container WithVerticalContentAlignment(VerticalAlignment value)
4202 {
4203 this.VerticalContentAlignment = value;
4204 return this;
4205 }
4206
4207 public Container WithRtl(bool value)
4208 {
4209 this.Rtl = value;
4210 return this;
4211 }
4212
4213 public Container WithMaxHeight(string value)
4214 {
4215 this.MaxHeight = value;
4216 return this;
4217 }
4218
4219 public Container WithGridArea(string value)
4220 {
4221 this.GridArea = value;
4222 return this;
4223 }
4224
4225 public Container WithFallback(IUnion<CardElement, FallbackElement> value)
4226 {
4227 this.Fallback = value;
4228 return this;
4229 }
4230
4231 public Container WithItems(params IList<CardElement> value)
4232 {
4233 this.Items = value;
4234 return this;
4235 }
4236}
4237
4238/// <summary>
4239/// Displays a set of action, which can be placed anywhere in the card.
4240/// </summary>
4241public class ActionSet : CardElement
4242{
4243 /// <summary>
4244 /// Deserializes a JSON string into an object of type ActionSet.
4245 /// </summary>
4246 public static ActionSet? Deserialize(string json)
4247 {
4248 return JsonSerializer.Deserialize<ActionSet>(json);
4249 }
4250
4251 /// <summary>
4252 /// Must be **ActionSet**.
4253 /// </summary>
4254 [JsonPropertyName("type")]
4255 public string Type { get; } = "ActionSet";
4256
4257 /// <summary>
4258 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
4259 /// </summary>
4260 [JsonPropertyName("id")]
4261 public string? Id { get; set; }
4262
4263 /// <summary>
4264 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
4265 /// </summary>
4266 [JsonPropertyName("requires")]
4267 public HostCapabilities? Requires { get; set; }
4268
4269 /// <summary>
4270 /// The locale associated with the element.
4271 /// </summary>
4272 [JsonPropertyName("lang")]
4273 public string? Lang { get; set; }
4274
4275 /// <summary>
4276 /// Controls the visibility of the element.
4277 /// </summary>
4278 [JsonPropertyName("isVisible")]
4279 public bool? IsVisible { get; set; }
4280
4281 /// <summary>
4282 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
4283 /// </summary>
4284 [JsonPropertyName("separator")]
4285 public bool? Separator { get; set; }
4286
4287 /// <summary>
4288 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
4289 /// </summary>
4290 [JsonPropertyName("height")]
4291 public ElementHeight? Height { get; set; }
4292
4293 /// <summary>
4294 /// Controls how the element should be horizontally aligned.
4295 /// </summary>
4296 [JsonPropertyName("horizontalAlignment")]
4297 public HorizontalAlignment? HorizontalAlignment { get; set; }
4298
4299 /// <summary>
4300 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
4301 /// </summary>
4302 [JsonPropertyName("spacing")]
4303 public Spacing? Spacing { get; set; }
4304
4305 /// <summary>
4306 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
4307 /// </summary>
4308 [JsonPropertyName("targetWidth")]
4309 public TargetWidth? TargetWidth { get; set; }
4310
4311 /// <summary>
4312 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
4313 /// </summary>
4314 [JsonPropertyName("isSortKey")]
4315 public bool? IsSortKey { get; set; }
4316
4317 /// <summary>
4318 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4319 /// </summary>
4320 [JsonPropertyName("grid.area")]
4321 public string? GridArea { get; set; }
4322
4323 /// <summary>
4324 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
4325 /// </summary>
4326 [JsonPropertyName("fallback")]
4327 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4328
4329 /// <summary>
4330 /// The actions in the set.
4331 /// </summary>
4332 [JsonPropertyName("actions")]
4333 public IList<Action>? Actions { get; set; }
4334
4335 public ActionSet(params IList<Action> actions)
4336 {
4337 this.Actions = actions;
4338 }
4339
4340 /// <summary>
4341 /// Serializes this ActionSet into a JSON string.
4342 /// </summary>
4343 public string Serialize()
4344 {
4345 return JsonSerializer.Serialize(
4346 this,
4347 new JsonSerializerOptions
4348 {
4349 WriteIndented = true,
4350 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4351 }
4352 );
4353 }
4354
4355 public ActionSet WithId(string value)
4356 {
4357 this.Id = value;
4358 return this;
4359 }
4360
4361 public ActionSet WithRequires(HostCapabilities value)
4362 {
4363 this.Requires = value;
4364 return this;
4365 }
4366
4367 public ActionSet WithLang(string value)
4368 {
4369 this.Lang = value;
4370 return this;
4371 }
4372
4373 public ActionSet WithIsVisible(bool value)
4374 {
4375 this.IsVisible = value;
4376 return this;
4377 }
4378
4379 public ActionSet WithSeparator(bool value)
4380 {
4381 this.Separator = value;
4382 return this;
4383 }
4384
4385 public ActionSet WithHeight(ElementHeight value)
4386 {
4387 this.Height = value;
4388 return this;
4389 }
4390
4391 public ActionSet WithHorizontalAlignment(HorizontalAlignment value)
4392 {
4393 this.HorizontalAlignment = value;
4394 return this;
4395 }
4396
4397 public ActionSet WithSpacing(Spacing value)
4398 {
4399 this.Spacing = value;
4400 return this;
4401 }
4402
4403 public ActionSet WithTargetWidth(TargetWidth value)
4404 {
4405 this.TargetWidth = value;
4406 return this;
4407 }
4408
4409 public ActionSet WithIsSortKey(bool value)
4410 {
4411 this.IsSortKey = value;
4412 return this;
4413 }
4414
4415 public ActionSet WithGridArea(string value)
4416 {
4417 this.GridArea = value;
4418 return this;
4419 }
4420
4421 public ActionSet WithFallback(IUnion<CardElement, FallbackElement> value)
4422 {
4423 this.Fallback = value;
4424 return this;
4425 }
4426
4427 public ActionSet WithActions(params IList<Action> value)
4428 {
4429 this.Actions = value;
4430 return this;
4431 }
4432}
4433
4434/// <summary>
4435/// Splits the available horizontal space into separate columns, so elements can be organized in a row.
4436/// </summary>
4437public class ColumnSet : CardElement
4438{
4439 /// <summary>
4440 /// Deserializes a JSON string into an object of type ColumnSet.
4441 /// </summary>
4442 public static ColumnSet? Deserialize(string json)
4443 {
4444 return JsonSerializer.Deserialize<ColumnSet>(json);
4445 }
4446
4447 /// <summary>
4448 /// Must be **ColumnSet**.
4449 /// </summary>
4450 [JsonPropertyName("type")]
4451 public string Type { get; } = "ColumnSet";
4452
4453 /// <summary>
4454 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
4455 /// </summary>
4456 [JsonPropertyName("id")]
4457 public string? Id { get; set; }
4458
4459 /// <summary>
4460 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
4461 /// </summary>
4462 [JsonPropertyName("requires")]
4463 public HostCapabilities? Requires { get; set; }
4464
4465 /// <summary>
4466 /// The locale associated with the element.
4467 /// </summary>
4468 [JsonPropertyName("lang")]
4469 public string? Lang { get; set; }
4470
4471 /// <summary>
4472 /// Controls the visibility of the element.
4473 /// </summary>
4474 [JsonPropertyName("isVisible")]
4475 public bool? IsVisible { get; set; }
4476
4477 /// <summary>
4478 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
4479 /// </summary>
4480 [JsonPropertyName("separator")]
4481 public bool? Separator { get; set; }
4482
4483 /// <summary>
4484 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
4485 /// </summary>
4486 [JsonPropertyName("height")]
4487 public ElementHeight? Height { get; set; }
4488
4489 /// <summary>
4490 /// Controls how the element should be horizontally aligned.
4491 /// </summary>
4492 [JsonPropertyName("horizontalAlignment")]
4493 public HorizontalAlignment? HorizontalAlignment { get; set; }
4494
4495 /// <summary>
4496 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
4497 /// </summary>
4498 [JsonPropertyName("spacing")]
4499 public Spacing? Spacing { get; set; }
4500
4501 /// <summary>
4502 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
4503 /// </summary>
4504 [JsonPropertyName("targetWidth")]
4505 public TargetWidth? TargetWidth { get; set; }
4506
4507 /// <summary>
4508 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
4509 /// </summary>
4510 [JsonPropertyName("isSortKey")]
4511 public bool? IsSortKey { get; set; }
4512
4513 /// <summary>
4514 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
4515 /// </summary>
4516 [JsonPropertyName("selectAction")]
4517 public Action? SelectAction { get; set; }
4518
4519 /// <summary>
4520 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
4521 /// </summary>
4522 [JsonPropertyName("style")]
4523 public ContainerStyle? Style { get; set; }
4524
4525 /// <summary>
4526 /// Controls if a border should be displayed around the container.
4527 /// </summary>
4528 [JsonPropertyName("showBorder")]
4529 public bool? ShowBorder { get; set; }
4530
4531 /// <summary>
4532 /// Controls if the container should have rounded corners.
4533 /// </summary>
4534 [JsonPropertyName("roundedCorners")]
4535 public bool? RoundedCorners { get; set; }
4536
4537 /// <summary>
4538 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
4539 /// </summary>
4540 [JsonPropertyName("bleed")]
4541 public bool? Bleed { get; set; }
4542
4543 /// <summary>
4544 /// The minimum height, in pixels, of the container, in the `<number>px` format.
4545 /// </summary>
4546 [JsonPropertyName("minHeight")]
4547 public string? MinHeight { get; set; }
4548
4549 /// <summary>
4550 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4551 /// </summary>
4552 [JsonPropertyName("grid.area")]
4553 public string? GridArea { get; set; }
4554
4555 /// <summary>
4556 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
4557 /// </summary>
4558 [JsonPropertyName("fallback")]
4559 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4560
4561 /// <summary>
4562 /// The columns in the set.
4563 /// </summary>
4564 [JsonPropertyName("columns")]
4565 public IList<Column>? Columns { get; set; }
4566
4567 /// <summary>
4568 /// Serializes this ColumnSet into a JSON string.
4569 /// </summary>
4570 public string Serialize()
4571 {
4572 return JsonSerializer.Serialize(
4573 this,
4574 new JsonSerializerOptions
4575 {
4576 WriteIndented = true,
4577 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4578 }
4579 );
4580 }
4581
4582 public ColumnSet WithId(string value)
4583 {
4584 this.Id = value;
4585 return this;
4586 }
4587
4588 public ColumnSet WithRequires(HostCapabilities value)
4589 {
4590 this.Requires = value;
4591 return this;
4592 }
4593
4594 public ColumnSet WithLang(string value)
4595 {
4596 this.Lang = value;
4597 return this;
4598 }
4599
4600 public ColumnSet WithIsVisible(bool value)
4601 {
4602 this.IsVisible = value;
4603 return this;
4604 }
4605
4606 public ColumnSet WithSeparator(bool value)
4607 {
4608 this.Separator = value;
4609 return this;
4610 }
4611
4612 public ColumnSet WithHeight(ElementHeight value)
4613 {
4614 this.Height = value;
4615 return this;
4616 }
4617
4618 public ColumnSet WithHorizontalAlignment(HorizontalAlignment value)
4619 {
4620 this.HorizontalAlignment = value;
4621 return this;
4622 }
4623
4624 public ColumnSet WithSpacing(Spacing value)
4625 {
4626 this.Spacing = value;
4627 return this;
4628 }
4629
4630 public ColumnSet WithTargetWidth(TargetWidth value)
4631 {
4632 this.TargetWidth = value;
4633 return this;
4634 }
4635
4636 public ColumnSet WithIsSortKey(bool value)
4637 {
4638 this.IsSortKey = value;
4639 return this;
4640 }
4641
4642 public ColumnSet WithSelectAction(Action value)
4643 {
4644 this.SelectAction = value;
4645 return this;
4646 }
4647
4648 public ColumnSet WithStyle(ContainerStyle value)
4649 {
4650 this.Style = value;
4651 return this;
4652 }
4653
4654 public ColumnSet WithShowBorder(bool value)
4655 {
4656 this.ShowBorder = value;
4657 return this;
4658 }
4659
4660 public ColumnSet WithRoundedCorners(bool value)
4661 {
4662 this.RoundedCorners = value;
4663 return this;
4664 }
4665
4666 public ColumnSet WithBleed(bool value)
4667 {
4668 this.Bleed = value;
4669 return this;
4670 }
4671
4672 public ColumnSet WithMinHeight(string value)
4673 {
4674 this.MinHeight = value;
4675 return this;
4676 }
4677
4678 public ColumnSet WithGridArea(string value)
4679 {
4680 this.GridArea = value;
4681 return this;
4682 }
4683
4684 public ColumnSet WithFallback(IUnion<CardElement, FallbackElement> value)
4685 {
4686 this.Fallback = value;
4687 return this;
4688 }
4689
4690 public ColumnSet WithColumns(params IList<Column> value)
4691 {
4692 this.Columns = value;
4693 return this;
4694 }
4695}
4696
4697/// <summary>
4698/// A media element, that makes it possible to embed videos inside a card.
4699/// </summary>
4700public class Media : CardElement
4701{
4702 /// <summary>
4703 /// Deserializes a JSON string into an object of type Media.
4704 /// </summary>
4705 public static Media? Deserialize(string json)
4706 {
4707 return JsonSerializer.Deserialize<Media>(json);
4708 }
4709
4710 /// <summary>
4711 /// Must be **Media**.
4712 /// </summary>
4713 [JsonPropertyName("type")]
4714 public string Type { get; } = "Media";
4715
4716 /// <summary>
4717 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
4718 /// </summary>
4719 [JsonPropertyName("id")]
4720 public string? Id { get; set; }
4721
4722 /// <summary>
4723 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
4724 /// </summary>
4725 [JsonPropertyName("requires")]
4726 public HostCapabilities? Requires { get; set; }
4727
4728 /// <summary>
4729 /// The locale associated with the element.
4730 /// </summary>
4731 [JsonPropertyName("lang")]
4732 public string? Lang { get; set; }
4733
4734 /// <summary>
4735 /// Controls the visibility of the element.
4736 /// </summary>
4737 [JsonPropertyName("isVisible")]
4738 public bool? IsVisible { get; set; }
4739
4740 /// <summary>
4741 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
4742 /// </summary>
4743 [JsonPropertyName("separator")]
4744 public bool? Separator { get; set; }
4745
4746 /// <summary>
4747 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
4748 /// </summary>
4749 [JsonPropertyName("height")]
4750 public ElementHeight? Height { get; set; }
4751
4752 /// <summary>
4753 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
4754 /// </summary>
4755 [JsonPropertyName("spacing")]
4756 public Spacing? Spacing { get; set; }
4757
4758 /// <summary>
4759 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
4760 /// </summary>
4761 [JsonPropertyName("targetWidth")]
4762 public TargetWidth? TargetWidth { get; set; }
4763
4764 /// <summary>
4765 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
4766 /// </summary>
4767 [JsonPropertyName("isSortKey")]
4768 public bool? IsSortKey { get; set; }
4769
4770 /// <summary>
4771 /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified.
4772 /// </summary>
4773 [JsonPropertyName("sources")]
4774 public IList<MediaSource>? Sources { get; set; }
4775
4776 /// <summary>
4777 /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources.
4778 /// </summary>
4779 [JsonPropertyName("captionSources")]
4780 public IList<CaptionSource>? CaptionSources { get; set; }
4781
4782 /// <summary>
4783 /// The URL of the poster image to display.
4784 /// </summary>
4785 [JsonPropertyName("poster")]
4786 public string? Poster { get; set; }
4787
4788 /// <summary>
4789 /// The alternate text for the media, used for accessibility purposes.
4790 /// </summary>
4791 [JsonPropertyName("altText")]
4792 public string? AltText { get; set; }
4793
4794 /// <summary>
4795 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4796 /// </summary>
4797 [JsonPropertyName("grid.area")]
4798 public string? GridArea { get; set; }
4799
4800 /// <summary>
4801 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
4802 /// </summary>
4803 [JsonPropertyName("fallback")]
4804 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4805
4806 /// <summary>
4807 /// Serializes this Media into a JSON string.
4808 /// </summary>
4809 public string Serialize()
4810 {
4811 return JsonSerializer.Serialize(
4812 this,
4813 new JsonSerializerOptions
4814 {
4815 WriteIndented = true,
4816 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4817 }
4818 );
4819 }
4820
4821 public Media WithId(string value)
4822 {
4823 this.Id = value;
4824 return this;
4825 }
4826
4827 public Media WithRequires(HostCapabilities value)
4828 {
4829 this.Requires = value;
4830 return this;
4831 }
4832
4833 public Media WithLang(string value)
4834 {
4835 this.Lang = value;
4836 return this;
4837 }
4838
4839 public Media WithIsVisible(bool value)
4840 {
4841 this.IsVisible = value;
4842 return this;
4843 }
4844
4845 public Media WithSeparator(bool value)
4846 {
4847 this.Separator = value;
4848 return this;
4849 }
4850
4851 public Media WithHeight(ElementHeight value)
4852 {
4853 this.Height = value;
4854 return this;
4855 }
4856
4857 public Media WithSpacing(Spacing value)
4858 {
4859 this.Spacing = value;
4860 return this;
4861 }
4862
4863 public Media WithTargetWidth(TargetWidth value)
4864 {
4865 this.TargetWidth = value;
4866 return this;
4867 }
4868
4869 public Media WithIsSortKey(bool value)
4870 {
4871 this.IsSortKey = value;
4872 return this;
4873 }
4874
4875 public Media WithSources(params IList<MediaSource> value)
4876 {
4877 this.Sources = value;
4878 return this;
4879 }
4880
4881 public Media WithCaptionSources(params IList<CaptionSource> value)
4882 {
4883 this.CaptionSources = value;
4884 return this;
4885 }
4886
4887 public Media WithPoster(string value)
4888 {
4889 this.Poster = value;
4890 return this;
4891 }
4892
4893 public Media WithAltText(string value)
4894 {
4895 this.AltText = value;
4896 return this;
4897 }
4898
4899 public Media WithGridArea(string value)
4900 {
4901 this.GridArea = value;
4902 return this;
4903 }
4904
4905 public Media WithFallback(IUnion<CardElement, FallbackElement> value)
4906 {
4907 this.Fallback = value;
4908 return this;
4909 }
4910}
4911
4912/// <summary>
4913/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.
4914/// </summary>
4915public class MediaSource : SerializableObject
4916{
4917 /// <summary>
4918 /// Deserializes a JSON string into an object of type MediaSource.
4919 /// </summary>
4920 public static MediaSource? Deserialize(string json)
4921 {
4922 return JsonSerializer.Deserialize<MediaSource>(json);
4923 }
4924
4925 /// <summary>
4926 /// The MIME type of the source.
4927 /// </summary>
4928 [JsonPropertyName("mimeType")]
4929 public string? MimeType { get; set; }
4930
4931 /// <summary>
4932 /// The URL of the source.
4933 /// </summary>
4934 [JsonPropertyName("url")]
4935 public string? Url { get; set; }
4936
4937 /// <summary>
4938 /// Serializes this MediaSource into a JSON string.
4939 /// </summary>
4940 public string Serialize()
4941 {
4942 return JsonSerializer.Serialize(
4943 this,
4944 new JsonSerializerOptions
4945 {
4946 WriteIndented = true,
4947 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4948 }
4949 );
4950 }
4951
4952 public MediaSource WithMimeType(string value)
4953 {
4954 this.MimeType = value;
4955 return this;
4956 }
4957
4958 public MediaSource WithUrl(string value)
4959 {
4960 this.Url = value;
4961 return this;
4962 }
4963}
4964
4965/// <summary>
4966/// Defines a source URL for a video captions.
4967/// </summary>
4968public class CaptionSource : SerializableObject
4969{
4970 /// <summary>
4971 /// Deserializes a JSON string into an object of type CaptionSource.
4972 /// </summary>
4973 public static CaptionSource? Deserialize(string json)
4974 {
4975 return JsonSerializer.Deserialize<CaptionSource>(json);
4976 }
4977
4978 /// <summary>
4979 /// The MIME type of the source.
4980 /// </summary>
4981 [JsonPropertyName("mimeType")]
4982 public string? MimeType { get; set; }
4983
4984 /// <summary>
4985 /// The URL of the source.
4986 /// </summary>
4987 [JsonPropertyName("url")]
4988 public string? Url { get; set; }
4989
4990 /// <summary>
4991 /// The label of this caption source.
4992 /// </summary>
4993 [JsonPropertyName("label")]
4994 public string? Label { get; set; }
4995
4996 /// <summary>
4997 /// Serializes this CaptionSource into a JSON string.
4998 /// </summary>
4999 public string Serialize()
5000 {
5001 return JsonSerializer.Serialize(
5002 this,
5003 new JsonSerializerOptions
5004 {
5005 WriteIndented = true,
5006 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5007 }
5008 );
5009 }
5010
5011 public CaptionSource WithMimeType(string value)
5012 {
5013 this.MimeType = value;
5014 return this;
5015 }
5016
5017 public CaptionSource WithUrl(string value)
5018 {
5019 this.Url = value;
5020 return this;
5021 }
5022
5023 public CaptionSource WithLabel(string value)
5024 {
5025 this.Label = value;
5026 return this;
5027 }
5028}
5029
5030/// <summary>
5031/// A rich text block that displays formatted text.
5032/// </summary>
5033public class RichTextBlock : CardElement
5034{
5035 /// <summary>
5036 /// Deserializes a JSON string into an object of type RichTextBlock.
5037 /// </summary>
5038 public static RichTextBlock? Deserialize(string json)
5039 {
5040 return JsonSerializer.Deserialize<RichTextBlock>(json);
5041 }
5042
5043 /// <summary>
5044 /// Must be **RichTextBlock**.
5045 /// </summary>
5046 [JsonPropertyName("type")]
5047 public string Type { get; } = "RichTextBlock";
5048
5049 /// <summary>
5050 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
5051 /// </summary>
5052 [JsonPropertyName("id")]
5053 public string? Id { get; set; }
5054
5055 /// <summary>
5056 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
5057 /// </summary>
5058 [JsonPropertyName("requires")]
5059 public HostCapabilities? Requires { get; set; }
5060
5061 /// <summary>
5062 /// The locale associated with the element.
5063 /// </summary>
5064 [JsonPropertyName("lang")]
5065 public string? Lang { get; set; }
5066
5067 /// <summary>
5068 /// Controls the visibility of the element.
5069 /// </summary>
5070 [JsonPropertyName("isVisible")]
5071 public bool? IsVisible { get; set; }
5072
5073 /// <summary>
5074 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
5075 /// </summary>
5076 [JsonPropertyName("separator")]
5077 public bool? Separator { get; set; }
5078
5079 /// <summary>
5080 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5081 /// </summary>
5082 [JsonPropertyName("height")]
5083 public ElementHeight? Height { get; set; }
5084
5085 /// <summary>
5086 /// Controls how the element should be horizontally aligned.
5087 /// </summary>
5088 [JsonPropertyName("horizontalAlignment")]
5089 public HorizontalAlignment? HorizontalAlignment { get; set; }
5090
5091 /// <summary>
5092 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5093 /// </summary>
5094 [JsonPropertyName("spacing")]
5095 public Spacing? Spacing { get; set; }
5096
5097 /// <summary>
5098 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
5099 /// </summary>
5100 [JsonPropertyName("targetWidth")]
5101 public TargetWidth? TargetWidth { get; set; }
5102
5103 /// <summary>
5104 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5105 /// </summary>
5106 [JsonPropertyName("isSortKey")]
5107 public bool? IsSortKey { get; set; }
5108
5109 /// <summary>
5110 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5111 /// </summary>
5112 [JsonPropertyName("grid.area")]
5113 public string? GridArea { get; set; }
5114
5115 /// <summary>
5116 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
5117 /// </summary>
5118 [JsonPropertyName("fallback")]
5119 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5120
5121 /// <summary>
5122 /// The inlines making up the rich text block.
5123 /// </summary>
5124 [JsonPropertyName("inlines")]
5125 public IUnion<IList<CardElement>, IList<string>>? Inlines { get; set; }
5126
5127 /// <summary>
5128 /// Serializes this RichTextBlock into a JSON string.
5129 /// </summary>
5130 public string Serialize()
5131 {
5132 return JsonSerializer.Serialize(
5133 this,
5134 new JsonSerializerOptions
5135 {
5136 WriteIndented = true,
5137 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5138 }
5139 );
5140 }
5141
5142 public RichTextBlock WithId(string value)
5143 {
5144 this.Id = value;
5145 return this;
5146 }
5147
5148 public RichTextBlock WithRequires(HostCapabilities value)
5149 {
5150 this.Requires = value;
5151 return this;
5152 }
5153
5154 public RichTextBlock WithLang(string value)
5155 {
5156 this.Lang = value;
5157 return this;
5158 }
5159
5160 public RichTextBlock WithIsVisible(bool value)
5161 {
5162 this.IsVisible = value;
5163 return this;
5164 }
5165
5166 public RichTextBlock WithSeparator(bool value)
5167 {
5168 this.Separator = value;
5169 return this;
5170 }
5171
5172 public RichTextBlock WithHeight(ElementHeight value)
5173 {
5174 this.Height = value;
5175 return this;
5176 }
5177
5178 public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value)
5179 {
5180 this.HorizontalAlignment = value;
5181 return this;
5182 }
5183
5184 public RichTextBlock WithSpacing(Spacing value)
5185 {
5186 this.Spacing = value;
5187 return this;
5188 }
5189
5190 public RichTextBlock WithTargetWidth(TargetWidth value)
5191 {
5192 this.TargetWidth = value;
5193 return this;
5194 }
5195
5196 public RichTextBlock WithIsSortKey(bool value)
5197 {
5198 this.IsSortKey = value;
5199 return this;
5200 }
5201
5202 public RichTextBlock WithGridArea(string value)
5203 {
5204 this.GridArea = value;
5205 return this;
5206 }
5207
5208 public RichTextBlock WithFallback(IUnion<CardElement, FallbackElement> value)
5209 {
5210 this.Fallback = value;
5211 return this;
5212 }
5213
5214 public RichTextBlock WithInlines(IUnion<IList<CardElement>, IList<string>> value)
5215 {
5216 this.Inlines = value;
5217 return this;
5218 }
5219}
5220
5221/// <summary>
5222/// Use tables to display data in a tabular way, with rows, columns and cells.
5223/// </summary>
5224public class Table : CardElement
5225{
5226 /// <summary>
5227 /// Deserializes a JSON string into an object of type Table.
5228 /// </summary>
5229 public static Table? Deserialize(string json)
5230 {
5231 return JsonSerializer.Deserialize<Table>(json);
5232 }
5233
5234 /// <summary>
5235 /// Must be **Table**.
5236 /// </summary>
5237 [JsonPropertyName("type")]
5238 public string Type { get; } = "Table";
5239
5240 /// <summary>
5241 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
5242 /// </summary>
5243 [JsonPropertyName("id")]
5244 public string? Id { get; set; }
5245
5246 /// <summary>
5247 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
5248 /// </summary>
5249 [JsonPropertyName("requires")]
5250 public HostCapabilities? Requires { get; set; }
5251
5252 /// <summary>
5253 /// The locale associated with the element.
5254 /// </summary>
5255 [JsonPropertyName("lang")]
5256 public string? Lang { get; set; }
5257
5258 /// <summary>
5259 /// Controls the visibility of the element.
5260 /// </summary>
5261 [JsonPropertyName("isVisible")]
5262 public bool? IsVisible { get; set; }
5263
5264 /// <summary>
5265 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
5266 /// </summary>
5267 [JsonPropertyName("separator")]
5268 public bool? Separator { get; set; }
5269
5270 /// <summary>
5271 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5272 /// </summary>
5273 [JsonPropertyName("height")]
5274 public ElementHeight? Height { get; set; }
5275
5276 /// <summary>
5277 /// Controls how the element should be horizontally aligned.
5278 /// </summary>
5279 [JsonPropertyName("horizontalAlignment")]
5280 public HorizontalAlignment? HorizontalAlignment { get; set; }
5281
5282 /// <summary>
5283 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5284 /// </summary>
5285 [JsonPropertyName("spacing")]
5286 public Spacing? Spacing { get; set; }
5287
5288 /// <summary>
5289 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
5290 /// </summary>
5291 [JsonPropertyName("targetWidth")]
5292 public TargetWidth? TargetWidth { get; set; }
5293
5294 /// <summary>
5295 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5296 /// </summary>
5297 [JsonPropertyName("isSortKey")]
5298 public bool? IsSortKey { get; set; }
5299
5300 /// <summary>
5301 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
5302 /// </summary>
5303 [JsonPropertyName("style")]
5304 public ContainerStyle? Style { get; set; }
5305
5306 /// <summary>
5307 /// Controls if a border should be displayed around the container.
5308 /// </summary>
5309 [JsonPropertyName("showBorder")]
5310 public bool? ShowBorder { get; set; }
5311
5312 /// <summary>
5313 /// Controls if the container should have rounded corners.
5314 /// </summary>
5315 [JsonPropertyName("roundedCorners")]
5316 public bool? RoundedCorners { get; set; }
5317
5318 /// <summary>
5319 /// The columns in the table.
5320 /// </summary>
5321 [JsonPropertyName("columns")]
5322 public IList<ColumnDefinition>? Columns { get; set; }
5323
5324 /// <summary>
5325 /// Controls whether the first row of the table should be treated as a header.
5326 /// </summary>
5327 [JsonPropertyName("firstRowAsHeaders")]
5328 public bool? FirstRowAsHeaders { get; set; }
5329
5330 /// <summary>
5331 /// Controls if grid lines should be displayed.
5332 /// </summary>
5333 [JsonPropertyName("showGridLines")]
5334 public bool? ShowGridLines { get; set; }
5335
5336 /// <summary>
5337 /// The style of the grid lines between cells.
5338 /// </summary>
5339 [JsonPropertyName("gridStyle")]
5340 public ContainerStyle? GridStyle { get; set; }
5341
5342 /// <summary>
5343 /// Controls how the content of every cell in the table should be horizontally aligned by default.
5344 /// </summary>
5345 [JsonPropertyName("horizontalCellContentAlignment")]
5346 public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
5347
5348 /// <summary>
5349 /// Controls how the content of every cell in the table should be vertically aligned by default.
5350 /// </summary>
5351 [JsonPropertyName("verticalCellContentAlignment")]
5352 public VerticalAlignment? VerticalCellContentAlignment { get; set; }
5353
5354 /// <summary>
5355 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5356 /// </summary>
5357 [JsonPropertyName("grid.area")]
5358 public string? GridArea { get; set; }
5359
5360 /// <summary>
5361 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
5362 /// </summary>
5363 [JsonPropertyName("fallback")]
5364 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5365
5366 /// <summary>
5367 /// The rows of the table.
5368 /// </summary>
5369 [JsonPropertyName("rows")]
5370 public IList<TableRow>? Rows { get; set; }
5371
5372 /// <summary>
5373 /// Serializes this Table into a JSON string.
5374 /// </summary>
5375 public string Serialize()
5376 {
5377 return JsonSerializer.Serialize(
5378 this,
5379 new JsonSerializerOptions
5380 {
5381 WriteIndented = true,
5382 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5383 }
5384 );
5385 }
5386
5387 public Table WithId(string value)
5388 {
5389 this.Id = value;
5390 return this;
5391 }
5392
5393 public Table WithRequires(HostCapabilities value)
5394 {
5395 this.Requires = value;
5396 return this;
5397 }
5398
5399 public Table WithLang(string value)
5400 {
5401 this.Lang = value;
5402 return this;
5403 }
5404
5405 public Table WithIsVisible(bool value)
5406 {
5407 this.IsVisible = value;
5408 return this;
5409 }
5410
5411 public Table WithSeparator(bool value)
5412 {
5413 this.Separator = value;
5414 return this;
5415 }
5416
5417 public Table WithHeight(ElementHeight value)
5418 {
5419 this.Height = value;
5420 return this;
5421 }
5422
5423 public Table WithHorizontalAlignment(HorizontalAlignment value)
5424 {
5425 this.HorizontalAlignment = value;
5426 return this;
5427 }
5428
5429 public Table WithSpacing(Spacing value)
5430 {
5431 this.Spacing = value;
5432 return this;
5433 }
5434
5435 public Table WithTargetWidth(TargetWidth value)
5436 {
5437 this.TargetWidth = value;
5438 return this;
5439 }
5440
5441 public Table WithIsSortKey(bool value)
5442 {
5443 this.IsSortKey = value;
5444 return this;
5445 }
5446
5447 public Table WithStyle(ContainerStyle value)
5448 {
5449 this.Style = value;
5450 return this;
5451 }
5452
5453 public Table WithShowBorder(bool value)
5454 {
5455 this.ShowBorder = value;
5456 return this;
5457 }
5458
5459 public Table WithRoundedCorners(bool value)
5460 {
5461 this.RoundedCorners = value;
5462 return this;
5463 }
5464
5465 public Table WithColumns(params IList<ColumnDefinition> value)
5466 {
5467 this.Columns = value;
5468 return this;
5469 }
5470
5471 public Table WithFirstRowAsHeaders(bool value)
5472 {
5473 this.FirstRowAsHeaders = value;
5474 return this;
5475 }
5476
5477 public Table WithShowGridLines(bool value)
5478 {
5479 this.ShowGridLines = value;
5480 return this;
5481 }
5482
5483 public Table WithGridStyle(ContainerStyle value)
5484 {
5485 this.GridStyle = value;
5486 return this;
5487 }
5488
5489 public Table WithHorizontalCellContentAlignment(HorizontalAlignment value)
5490 {
5491 this.HorizontalCellContentAlignment = value;
5492 return this;
5493 }
5494
5495 public Table WithVerticalCellContentAlignment(VerticalAlignment value)
5496 {
5497 this.VerticalCellContentAlignment = value;
5498 return this;
5499 }
5500
5501 public Table WithGridArea(string value)
5502 {
5503 this.GridArea = value;
5504 return this;
5505 }
5506
5507 public Table WithFallback(IUnion<CardElement, FallbackElement> value)
5508 {
5509 this.Fallback = value;
5510 return this;
5511 }
5512
5513 public Table WithRows(params IList<TableRow> value)
5514 {
5515 this.Rows = value;
5516 return this;
5517 }
5518}
5519
5520/// <summary>
5521/// Defines a column in a Table element.
5522/// </summary>
5523public class ColumnDefinition : SerializableObject
5524{
5525 /// <summary>
5526 /// Deserializes a JSON string into an object of type ColumnDefinition.
5527 /// </summary>
5528 public static ColumnDefinition? Deserialize(string json)
5529 {
5530 return JsonSerializer.Deserialize<ColumnDefinition>(json);
5531 }
5532
5533 /// <summary>
5534 /// Controls how the content of every cell in the table should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table.
5535 /// </summary>
5536 [JsonPropertyName("horizontalCellContentAlignment")]
5537 public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
5538
5539 /// <summary>
5540 /// Controls how the content of every cell in the column should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table.
5541 /// </summary>
5542 [JsonPropertyName("verticalCellContentAlignment")]
5543 public VerticalAlignment? VerticalCellContentAlignment { get; set; }
5544
5545 /// <summary>
5546 /// The width of the column in the table, expressed as either a percentage of the available width or in pixels, using the `<number>px` format.
5547 /// </summary>
5548 [JsonPropertyName("width")]
5549 public IUnion<string, float>? Width { get; set; }
5550
5551 /// <summary>
5552 /// Serializes this ColumnDefinition into a JSON string.
5553 /// </summary>
5554 public string Serialize()
5555 {
5556 return JsonSerializer.Serialize(
5557 this,
5558 new JsonSerializerOptions
5559 {
5560 WriteIndented = true,
5561 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5562 }
5563 );
5564 }
5565
5566 public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value)
5567 {
5568 this.HorizontalCellContentAlignment = value;
5569 return this;
5570 }
5571
5572 public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value)
5573 {
5574 this.VerticalCellContentAlignment = value;
5575 return this;
5576 }
5577
5578 public ColumnDefinition WithWidth(IUnion<string, float> value)
5579 {
5580 this.Width = value;
5581 return this;
5582 }
5583}
5584
5585/// <summary>
5586/// A block of text, optionally formatted using Markdown.
5587/// </summary>
5588public class TextBlock : CardElement
5589{
5590 /// <summary>
5591 /// Deserializes a JSON string into an object of type TextBlock.
5592 /// </summary>
5593 public static TextBlock? Deserialize(string json)
5594 {
5595 return JsonSerializer.Deserialize<TextBlock>(json);
5596 }
5597
5598 /// <summary>
5599 /// Must be **TextBlock**.
5600 /// </summary>
5601 [JsonPropertyName("type")]
5602 public string Type { get; } = "TextBlock";
5603
5604 /// <summary>
5605 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
5606 /// </summary>
5607 [JsonPropertyName("id")]
5608 public string? Id { get; set; }
5609
5610 /// <summary>
5611 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
5612 /// </summary>
5613 [JsonPropertyName("requires")]
5614 public HostCapabilities? Requires { get; set; }
5615
5616 /// <summary>
5617 /// The locale associated with the element.
5618 /// </summary>
5619 [JsonPropertyName("lang")]
5620 public string? Lang { get; set; }
5621
5622 /// <summary>
5623 /// Controls the visibility of the element.
5624 /// </summary>
5625 [JsonPropertyName("isVisible")]
5626 public bool? IsVisible { get; set; }
5627
5628 /// <summary>
5629 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
5630 /// </summary>
5631 [JsonPropertyName("separator")]
5632 public bool? Separator { get; set; }
5633
5634 /// <summary>
5635 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5636 /// </summary>
5637 [JsonPropertyName("height")]
5638 public ElementHeight? Height { get; set; }
5639
5640 /// <summary>
5641 /// Controls how the element should be horizontally aligned.
5642 /// </summary>
5643 [JsonPropertyName("horizontalAlignment")]
5644 public HorizontalAlignment? HorizontalAlignment { get; set; }
5645
5646 /// <summary>
5647 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5648 /// </summary>
5649 [JsonPropertyName("spacing")]
5650 public Spacing? Spacing { get; set; }
5651
5652 /// <summary>
5653 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
5654 /// </summary>
5655 [JsonPropertyName("targetWidth")]
5656 public TargetWidth? TargetWidth { get; set; }
5657
5658 /// <summary>
5659 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5660 /// </summary>
5661 [JsonPropertyName("isSortKey")]
5662 public bool? IsSortKey { get; set; }
5663
5664 /// <summary>
5665 /// The text to display. A subset of markdown is supported.
5666 /// </summary>
5667 [JsonPropertyName("text")]
5668 public string? Text { get; set; }
5669
5670 /// <summary>
5671 /// The size of the text.
5672 /// </summary>
5673 [JsonPropertyName("size")]
5674 public TextSize? Size { get; set; }
5675
5676 /// <summary>
5677 /// The weight of the text.
5678 /// </summary>
5679 [JsonPropertyName("weight")]
5680 public TextWeight? Weight { get; set; }
5681
5682 /// <summary>
5683 /// The color of the text.
5684 /// </summary>
5685 [JsonPropertyName("color")]
5686 public TextColor? Color { get; set; }
5687
5688 /// <summary>
5689 /// Controls whether the text should be renderer using a subtler variant of the select color.
5690 /// </summary>
5691 [JsonPropertyName("isSubtle")]
5692 public bool? IsSubtle { get; set; }
5693
5694 /// <summary>
5695 /// The type of font to use for rendering.
5696 /// </summary>
5697 [JsonPropertyName("fontType")]
5698 public FontType? FontType { get; set; }
5699
5700 /// <summary>
5701 /// Controls if the text should wrap.
5702 /// </summary>
5703 [JsonPropertyName("wrap")]
5704 public bool? Wrap { get; set; }
5705
5706 /// <summary>
5707 /// The maximum number of lines to display.
5708 /// </summary>
5709 [JsonPropertyName("maxLines")]
5710 public float? MaxLines { get; set; }
5711
5712 /// <summary>
5713 /// The style of the text.
5714 /// </summary>
5715 [JsonPropertyName("style")]
5716 public StyleEnum? Style { get; set; }
5717
5718 /// <summary>
5719 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5720 /// </summary>
5721 [JsonPropertyName("grid.area")]
5722 public string? GridArea { get; set; }
5723
5724 /// <summary>
5725 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
5726 /// </summary>
5727 [JsonPropertyName("fallback")]
5728 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5729
5730 public TextBlock(string text)
5731 {
5732 this.Text = text;
5733 }
5734
5735 /// <summary>
5736 /// Serializes this TextBlock into a JSON string.
5737 /// </summary>
5738 public string Serialize()
5739 {
5740 return JsonSerializer.Serialize(
5741 this,
5742 new JsonSerializerOptions
5743 {
5744 WriteIndented = true,
5745 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5746 }
5747 );
5748 }
5749
5750 public TextBlock WithId(string value)
5751 {
5752 this.Id = value;
5753 return this;
5754 }
5755
5756 public TextBlock WithRequires(HostCapabilities value)
5757 {
5758 this.Requires = value;
5759 return this;
5760 }
5761
5762 public TextBlock WithLang(string value)
5763 {
5764 this.Lang = value;
5765 return this;
5766 }
5767
5768 public TextBlock WithIsVisible(bool value)
5769 {
5770 this.IsVisible = value;
5771 return this;
5772 }
5773
5774 public TextBlock WithSeparator(bool value)
5775 {
5776 this.Separator = value;
5777 return this;
5778 }
5779
5780 public TextBlock WithHeight(ElementHeight value)
5781 {
5782 this.Height = value;
5783 return this;
5784 }
5785
5786 public TextBlock WithHorizontalAlignment(HorizontalAlignment value)
5787 {
5788 this.HorizontalAlignment = value;
5789 return this;
5790 }
5791
5792 public TextBlock WithSpacing(Spacing value)
5793 {
5794 this.Spacing = value;
5795 return this;
5796 }
5797
5798 public TextBlock WithTargetWidth(TargetWidth value)
5799 {
5800 this.TargetWidth = value;
5801 return this;
5802 }
5803
5804 public TextBlock WithIsSortKey(bool value)
5805 {
5806 this.IsSortKey = value;
5807 return this;
5808 }
5809
5810 public TextBlock WithText(string value)
5811 {
5812 this.Text = value;
5813 return this;
5814 }
5815
5816 public TextBlock WithSize(TextSize value)
5817 {
5818 this.Size = value;
5819 return this;
5820 }
5821
5822 public TextBlock WithWeight(TextWeight value)
5823 {
5824 this.Weight = value;
5825 return this;
5826 }
5827
5828 public TextBlock WithColor(TextColor value)
5829 {
5830 this.Color = value;
5831 return this;
5832 }
5833
5834 public TextBlock WithIsSubtle(bool value)
5835 {
5836 this.IsSubtle = value;
5837 return this;
5838 }
5839
5840 public TextBlock WithFontType(FontType value)
5841 {
5842 this.FontType = value;
5843 return this;
5844 }
5845
5846 public TextBlock WithWrap(bool value)
5847 {
5848 this.Wrap = value;
5849 return this;
5850 }
5851
5852 public TextBlock WithMaxLines(float value)
5853 {
5854 this.MaxLines = value;
5855 return this;
5856 }
5857
5858 public TextBlock WithStyle(StyleEnum value)
5859 {
5860 this.Style = value;
5861 return this;
5862 }
5863
5864 public TextBlock WithGridArea(string value)
5865 {
5866 this.GridArea = value;
5867 return this;
5868 }
5869
5870 public TextBlock WithFallback(IUnion<CardElement, FallbackElement> value)
5871 {
5872 this.Fallback = value;
5873 return this;
5874 }
5875}
5876
5877/// <summary>
5878/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained.
5879/// </summary>
5880public class FactSet : CardElement
5881{
5882 /// <summary>
5883 /// Deserializes a JSON string into an object of type FactSet.
5884 /// </summary>
5885 public static FactSet? Deserialize(string json)
5886 {
5887 return JsonSerializer.Deserialize<FactSet>(json);
5888 }
5889
5890 /// <summary>
5891 /// Must be **FactSet**.
5892 /// </summary>
5893 [JsonPropertyName("type")]
5894 public string Type { get; } = "FactSet";
5895
5896 /// <summary>
5897 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
5898 /// </summary>
5899 [JsonPropertyName("id")]
5900 public string? Id { get; set; }
5901
5902 /// <summary>
5903 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
5904 /// </summary>
5905 [JsonPropertyName("requires")]
5906 public HostCapabilities? Requires { get; set; }
5907
5908 /// <summary>
5909 /// The locale associated with the element.
5910 /// </summary>
5911 [JsonPropertyName("lang")]
5912 public string? Lang { get; set; }
5913
5914 /// <summary>
5915 /// Controls the visibility of the element.
5916 /// </summary>
5917 [JsonPropertyName("isVisible")]
5918 public bool? IsVisible { get; set; }
5919
5920 /// <summary>
5921 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
5922 /// </summary>
5923 [JsonPropertyName("separator")]
5924 public bool? Separator { get; set; }
5925
5926 /// <summary>
5927 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5928 /// </summary>
5929 [JsonPropertyName("height")]
5930 public ElementHeight? Height { get; set; }
5931
5932 /// <summary>
5933 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5934 /// </summary>
5935 [JsonPropertyName("spacing")]
5936 public Spacing? Spacing { get; set; }
5937
5938 /// <summary>
5939 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
5940 /// </summary>
5941 [JsonPropertyName("targetWidth")]
5942 public TargetWidth? TargetWidth { get; set; }
5943
5944 /// <summary>
5945 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5946 /// </summary>
5947 [JsonPropertyName("isSortKey")]
5948 public bool? IsSortKey { get; set; }
5949
5950 /// <summary>
5951 /// The facts in the set.
5952 /// </summary>
5953 [JsonPropertyName("facts")]
5954 public IList<Fact>? Facts { get; set; }
5955
5956 /// <summary>
5957 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5958 /// </summary>
5959 [JsonPropertyName("grid.area")]
5960 public string? GridArea { get; set; }
5961
5962 /// <summary>
5963 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
5964 /// </summary>
5965 [JsonPropertyName("fallback")]
5966 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5967
5968 public FactSet(params IList<Fact> facts)
5969 {
5970 this.Facts = facts;
5971 }
5972
5973 /// <summary>
5974 /// Serializes this FactSet into a JSON string.
5975 /// </summary>
5976 public string Serialize()
5977 {
5978 return JsonSerializer.Serialize(
5979 this,
5980 new JsonSerializerOptions
5981 {
5982 WriteIndented = true,
5983 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5984 }
5985 );
5986 }
5987
5988 public FactSet WithId(string value)
5989 {
5990 this.Id = value;
5991 return this;
5992 }
5993
5994 public FactSet WithRequires(HostCapabilities value)
5995 {
5996 this.Requires = value;
5997 return this;
5998 }
5999
6000 public FactSet WithLang(string value)
6001 {
6002 this.Lang = value;
6003 return this;
6004 }
6005
6006 public FactSet WithIsVisible(bool value)
6007 {
6008 this.IsVisible = value;
6009 return this;
6010 }
6011
6012 public FactSet WithSeparator(bool value)
6013 {
6014 this.Separator = value;
6015 return this;
6016 }
6017
6018 public FactSet WithHeight(ElementHeight value)
6019 {
6020 this.Height = value;
6021 return this;
6022 }
6023
6024 public FactSet WithSpacing(Spacing value)
6025 {
6026 this.Spacing = value;
6027 return this;
6028 }
6029
6030 public FactSet WithTargetWidth(TargetWidth value)
6031 {
6032 this.TargetWidth = value;
6033 return this;
6034 }
6035
6036 public FactSet WithIsSortKey(bool value)
6037 {
6038 this.IsSortKey = value;
6039 return this;
6040 }
6041
6042 public FactSet WithFacts(params IList<Fact> value)
6043 {
6044 this.Facts = value;
6045 return this;
6046 }
6047
6048 public FactSet WithGridArea(string value)
6049 {
6050 this.GridArea = value;
6051 return this;
6052 }
6053
6054 public FactSet WithFallback(IUnion<CardElement, FallbackElement> value)
6055 {
6056 this.Fallback = value;
6057 return this;
6058 }
6059}
6060
6061/// <summary>
6062/// A fact in a FactSet element.
6063/// </summary>
6064public class Fact : SerializableObject
6065{
6066 /// <summary>
6067 /// Deserializes a JSON string into an object of type Fact.
6068 /// </summary>
6069 public static Fact? Deserialize(string json)
6070 {
6071 return JsonSerializer.Deserialize<Fact>(json);
6072 }
6073
6074 /// <summary>
6075 /// The fact's title.
6076 /// </summary>
6077 [JsonPropertyName("title")]
6078 public string? Title { get; set; }
6079
6080 /// <summary>
6081 /// The fact's value.
6082 /// </summary>
6083 [JsonPropertyName("value")]
6084 public string? Value { get; set; }
6085
6086 public Fact(string title, string value)
6087 {
6088 this.Title = title;
6089 this.Value = value;
6090 }
6091
6092 /// <summary>
6093 /// Serializes this Fact into a JSON string.
6094 /// </summary>
6095 public string Serialize()
6096 {
6097 return JsonSerializer.Serialize(
6098 this,
6099 new JsonSerializerOptions
6100 {
6101 WriteIndented = true,
6102 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6103 }
6104 );
6105 }
6106
6107 public Fact WithTitle(string value)
6108 {
6109 this.Title = value;
6110 return this;
6111 }
6112
6113 public Fact WithValue(string value)
6114 {
6115 this.Value = value;
6116 return this;
6117 }
6118}
6119
6120/// <summary>
6121/// A set of images, displayed side-by-side and wrapped across multiple rows as needed.
6122/// </summary>
6123public class ImageSet : CardElement
6124{
6125 /// <summary>
6126 /// Deserializes a JSON string into an object of type ImageSet.
6127 /// </summary>
6128 public static ImageSet? Deserialize(string json)
6129 {
6130 return JsonSerializer.Deserialize<ImageSet>(json);
6131 }
6132
6133 /// <summary>
6134 /// Must be **ImageSet**.
6135 /// </summary>
6136 [JsonPropertyName("type")]
6137 public string Type { get; } = "ImageSet";
6138
6139 /// <summary>
6140 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
6141 /// </summary>
6142 [JsonPropertyName("id")]
6143 public string? Id { get; set; }
6144
6145 /// <summary>
6146 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
6147 /// </summary>
6148 [JsonPropertyName("requires")]
6149 public HostCapabilities? Requires { get; set; }
6150
6151 /// <summary>
6152 /// The locale associated with the element.
6153 /// </summary>
6154 [JsonPropertyName("lang")]
6155 public string? Lang { get; set; }
6156
6157 /// <summary>
6158 /// Controls the visibility of the element.
6159 /// </summary>
6160 [JsonPropertyName("isVisible")]
6161 public bool? IsVisible { get; set; }
6162
6163 /// <summary>
6164 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
6165 /// </summary>
6166 [JsonPropertyName("separator")]
6167 public bool? Separator { get; set; }
6168
6169 /// <summary>
6170 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
6171 /// </summary>
6172 [JsonPropertyName("height")]
6173 public ElementHeight? Height { get; set; }
6174
6175 /// <summary>
6176 /// Controls how the element should be horizontally aligned.
6177 /// </summary>
6178 [JsonPropertyName("horizontalAlignment")]
6179 public HorizontalAlignment? HorizontalAlignment { get; set; }
6180
6181 /// <summary>
6182 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6183 /// </summary>
6184 [JsonPropertyName("spacing")]
6185 public Spacing? Spacing { get; set; }
6186
6187 /// <summary>
6188 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
6189 /// </summary>
6190 [JsonPropertyName("targetWidth")]
6191 public TargetWidth? TargetWidth { get; set; }
6192
6193 /// <summary>
6194 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6195 /// </summary>
6196 [JsonPropertyName("isSortKey")]
6197 public bool? IsSortKey { get; set; }
6198
6199 /// <summary>
6200 /// The images in the set.
6201 /// </summary>
6202 [JsonPropertyName("images")]
6203 public IList<Image>? Images { get; set; }
6204
6205 /// <summary>
6206 /// The size to use to render all images in the set.
6207 /// </summary>
6208 [JsonPropertyName("imageSize")]
6209 public ImageSize? ImageSize { get; set; }
6210
6211 /// <summary>
6212 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6213 /// </summary>
6214 [JsonPropertyName("grid.area")]
6215 public string? GridArea { get; set; }
6216
6217 /// <summary>
6218 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
6219 /// </summary>
6220 [JsonPropertyName("fallback")]
6221 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6222
6223 public ImageSet(params IList<Image> images)
6224 {
6225 this.Images = images;
6226 }
6227
6228 /// <summary>
6229 /// Serializes this ImageSet into a JSON string.
6230 /// </summary>
6231 public string Serialize()
6232 {
6233 return JsonSerializer.Serialize(
6234 this,
6235 new JsonSerializerOptions
6236 {
6237 WriteIndented = true,
6238 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6239 }
6240 );
6241 }
6242
6243 public ImageSet WithId(string value)
6244 {
6245 this.Id = value;
6246 return this;
6247 }
6248
6249 public ImageSet WithRequires(HostCapabilities value)
6250 {
6251 this.Requires = value;
6252 return this;
6253 }
6254
6255 public ImageSet WithLang(string value)
6256 {
6257 this.Lang = value;
6258 return this;
6259 }
6260
6261 public ImageSet WithIsVisible(bool value)
6262 {
6263 this.IsVisible = value;
6264 return this;
6265 }
6266
6267 public ImageSet WithSeparator(bool value)
6268 {
6269 this.Separator = value;
6270 return this;
6271 }
6272
6273 public ImageSet WithHeight(ElementHeight value)
6274 {
6275 this.Height = value;
6276 return this;
6277 }
6278
6279 public ImageSet WithHorizontalAlignment(HorizontalAlignment value)
6280 {
6281 this.HorizontalAlignment = value;
6282 return this;
6283 }
6284
6285 public ImageSet WithSpacing(Spacing value)
6286 {
6287 this.Spacing = value;
6288 return this;
6289 }
6290
6291 public ImageSet WithTargetWidth(TargetWidth value)
6292 {
6293 this.TargetWidth = value;
6294 return this;
6295 }
6296
6297 public ImageSet WithIsSortKey(bool value)
6298 {
6299 this.IsSortKey = value;
6300 return this;
6301 }
6302
6303 public ImageSet WithImages(params IList<Image> value)
6304 {
6305 this.Images = value;
6306 return this;
6307 }
6308
6309 public ImageSet WithImageSize(ImageSize value)
6310 {
6311 this.ImageSize = value;
6312 return this;
6313 }
6314
6315 public ImageSet WithGridArea(string value)
6316 {
6317 this.GridArea = value;
6318 return this;
6319 }
6320
6321 public ImageSet WithFallback(IUnion<CardElement, FallbackElement> value)
6322 {
6323 this.Fallback = value;
6324 return this;
6325 }
6326}
6327
6328/// <summary>
6329/// A standalone image element.
6330/// </summary>
6331public class Image : CardElement
6332{
6333 /// <summary>
6334 /// Deserializes a JSON string into an object of type Image.
6335 /// </summary>
6336 public static Image? Deserialize(string json)
6337 {
6338 return JsonSerializer.Deserialize<Image>(json);
6339 }
6340
6341 /// <summary>
6342 /// Must be **Image**.
6343 /// </summary>
6344 [JsonPropertyName("type")]
6345 public string Type { get; } = "Image";
6346
6347 /// <summary>
6348 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
6349 /// </summary>
6350 [JsonPropertyName("id")]
6351 public string? Id { get; set; }
6352
6353 /// <summary>
6354 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
6355 /// </summary>
6356 [JsonPropertyName("requires")]
6357 public HostCapabilities? Requires { get; set; }
6358
6359 /// <summary>
6360 /// The locale associated with the element.
6361 /// </summary>
6362 [JsonPropertyName("lang")]
6363 public string? Lang { get; set; }
6364
6365 /// <summary>
6366 /// Controls the visibility of the element.
6367 /// </summary>
6368 [JsonPropertyName("isVisible")]
6369 public bool? IsVisible { get; set; }
6370
6371 /// <summary>
6372 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
6373 /// </summary>
6374 [JsonPropertyName("separator")]
6375 public bool? Separator { get; set; }
6376
6377 /// <summary>
6378 /// Controls how the element should be horizontally aligned.
6379 /// </summary>
6380 [JsonPropertyName("horizontalAlignment")]
6381 public HorizontalAlignment? HorizontalAlignment { get; set; }
6382
6383 /// <summary>
6384 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6385 /// </summary>
6386 [JsonPropertyName("spacing")]
6387 public Spacing? Spacing { get; set; }
6388
6389 /// <summary>
6390 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
6391 /// </summary>
6392 [JsonPropertyName("targetWidth")]
6393 public TargetWidth? TargetWidth { get; set; }
6394
6395 /// <summary>
6396 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6397 /// </summary>
6398 [JsonPropertyName("isSortKey")]
6399 public bool? IsSortKey { get; set; }
6400
6401 /// <summary>
6402 /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
6403 /// </summary>
6404 [JsonPropertyName("url")]
6405 public string? Url { get; set; }
6406
6407 /// <summary>
6408 /// The alternate text for the image, used for accessibility purposes.
6409 /// </summary>
6410 [JsonPropertyName("altText")]
6411 public string? AltText { get; set; }
6412
6413 /// <summary>
6414 /// The background color of the image.
6415 /// </summary>
6416 [JsonPropertyName("backgroundColor")]
6417 public string? BackgroundColor { get; set; }
6418
6419 /// <summary>
6420 /// The style of the image.
6421 /// </summary>
6422 [JsonPropertyName("style")]
6423 public ImageStyle? Style { get; set; }
6424
6425 /// <summary>
6426 /// The size of the image.
6427 /// </summary>
6428 [JsonPropertyName("size")]
6429 public Size? Size { get; set; }
6430
6431 /// <summary>
6432 /// The width of the image.
6433 /// </summary>
6434 [JsonPropertyName("width")]
6435 public string? Width { get; set; }
6436
6437 /// <summary>
6438 /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported.
6439 /// </summary>
6440 [JsonPropertyName("selectAction")]
6441 public Action? SelectAction { get; set; }
6442
6443 /// <summary>
6444 /// Controls if the image can be expanded to full screen.
6445 /// </summary>
6446 [JsonPropertyName("allowExpand")]
6447 public bool? AllowExpand { get; set; }
6448
6449 [JsonPropertyName("msteams")]
6450 public TeamsImageProperties? Msteams { get; set; }
6451
6452 /// <summary>
6453 /// The height of the image.
6454 /// </summary>
6455 [JsonPropertyName("height")]
6456 public string? Height { get; set; }
6457
6458 /// <summary>
6459 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6460 /// </summary>
6461 [JsonPropertyName("grid.area")]
6462 public string? GridArea { get; set; }
6463
6464 /// <summary>
6465 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
6466 /// </summary>
6467 [JsonPropertyName("fallback")]
6468 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6469
6470 public Image(string url)
6471 {
6472 this.Url = url;
6473 }
6474
6475 /// <summary>
6476 /// Serializes this Image into a JSON string.
6477 /// </summary>
6478 public string Serialize()
6479 {
6480 return JsonSerializer.Serialize(
6481 this,
6482 new JsonSerializerOptions
6483 {
6484 WriteIndented = true,
6485 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6486 }
6487 );
6488 }
6489
6490 public Image WithId(string value)
6491 {
6492 this.Id = value;
6493 return this;
6494 }
6495
6496 public Image WithRequires(HostCapabilities value)
6497 {
6498 this.Requires = value;
6499 return this;
6500 }
6501
6502 public Image WithLang(string value)
6503 {
6504 this.Lang = value;
6505 return this;
6506 }
6507
6508 public Image WithIsVisible(bool value)
6509 {
6510 this.IsVisible = value;
6511 return this;
6512 }
6513
6514 public Image WithSeparator(bool value)
6515 {
6516 this.Separator = value;
6517 return this;
6518 }
6519
6520 public Image WithHorizontalAlignment(HorizontalAlignment value)
6521 {
6522 this.HorizontalAlignment = value;
6523 return this;
6524 }
6525
6526 public Image WithSpacing(Spacing value)
6527 {
6528 this.Spacing = value;
6529 return this;
6530 }
6531
6532 public Image WithTargetWidth(TargetWidth value)
6533 {
6534 this.TargetWidth = value;
6535 return this;
6536 }
6537
6538 public Image WithIsSortKey(bool value)
6539 {
6540 this.IsSortKey = value;
6541 return this;
6542 }
6543
6544 public Image WithUrl(string value)
6545 {
6546 this.Url = value;
6547 return this;
6548 }
6549
6550 public Image WithAltText(string value)
6551 {
6552 this.AltText = value;
6553 return this;
6554 }
6555
6556 public Image WithBackgroundColor(string value)
6557 {
6558 this.BackgroundColor = value;
6559 return this;
6560 }
6561
6562 public Image WithStyle(ImageStyle value)
6563 {
6564 this.Style = value;
6565 return this;
6566 }
6567
6568 public Image WithSize(Size value)
6569 {
6570 this.Size = value;
6571 return this;
6572 }
6573
6574 public Image WithWidth(string value)
6575 {
6576 this.Width = value;
6577 return this;
6578 }
6579
6580 public Image WithSelectAction(Action value)
6581 {
6582 this.SelectAction = value;
6583 return this;
6584 }
6585
6586 public Image WithAllowExpand(bool value)
6587 {
6588 this.AllowExpand = value;
6589 return this;
6590 }
6591
6592 public Image WithMsteams(TeamsImageProperties value)
6593 {
6594 this.Msteams = value;
6595 return this;
6596 }
6597
6598 public Image WithHeight(string value)
6599 {
6600 this.Height = value;
6601 return this;
6602 }
6603
6604 public Image WithGridArea(string value)
6605 {
6606 this.GridArea = value;
6607 return this;
6608 }
6609
6610 public Image WithFallback(IUnion<CardElement, FallbackElement> value)
6611 {
6612 this.Fallback = value;
6613 return this;
6614 }
6615}
6616
6617/// <summary>
6618/// Represents a set of Teams-specific properties on an image.
6619/// </summary>
6620public class TeamsImageProperties : SerializableObject
6621{
6622 /// <summary>
6623 /// Deserializes a JSON string into an object of type TeamsImageProperties.
6624 /// </summary>
6625 public static TeamsImageProperties? Deserialize(string json)
6626 {
6627 return JsonSerializer.Deserialize<TeamsImageProperties>(json);
6628 }
6629
6630 /// <summary>
6631 /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property.
6632 /// </summary>
6633 [JsonPropertyName("allowExpand")]
6634 public bool? AllowExpand { get; set; }
6635
6636 /// <summary>
6637 /// Serializes this TeamsImageProperties into a JSON string.
6638 /// </summary>
6639 public string Serialize()
6640 {
6641 return JsonSerializer.Serialize(
6642 this,
6643 new JsonSerializerOptions
6644 {
6645 WriteIndented = true,
6646 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6647 }
6648 );
6649 }
6650
6651 public TeamsImageProperties WithAllowExpand(bool value)
6652 {
6653 this.AllowExpand = value;
6654 return this;
6655 }
6656}
6657
6658/// <summary>
6659/// An input to allow the user to enter text.
6660/// </summary>
6661public class TextInput : CardElement
6662{
6663 /// <summary>
6664 /// Deserializes a JSON string into an object of type TextInput.
6665 /// </summary>
6666 public static TextInput? Deserialize(string json)
6667 {
6668 return JsonSerializer.Deserialize<TextInput>(json);
6669 }
6670
6671 /// <summary>
6672 /// Must be **Input.Text**.
6673 /// </summary>
6674 [JsonPropertyName("type")]
6675 public string Type { get; } = "Input.Text";
6676
6677 /// <summary>
6678 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
6679 /// </summary>
6680 [JsonPropertyName("id")]
6681 public string? Id { get; set; }
6682
6683 /// <summary>
6684 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
6685 /// </summary>
6686 [JsonPropertyName("requires")]
6687 public HostCapabilities? Requires { get; set; }
6688
6689 /// <summary>
6690 /// The locale associated with the element.
6691 /// </summary>
6692 [JsonPropertyName("lang")]
6693 public string? Lang { get; set; }
6694
6695 /// <summary>
6696 /// Controls the visibility of the element.
6697 /// </summary>
6698 [JsonPropertyName("isVisible")]
6699 public bool? IsVisible { get; set; }
6700
6701 /// <summary>
6702 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
6703 /// </summary>
6704 [JsonPropertyName("separator")]
6705 public bool? Separator { get; set; }
6706
6707 /// <summary>
6708 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
6709 /// </summary>
6710 [JsonPropertyName("height")]
6711 public ElementHeight? Height { get; set; }
6712
6713 /// <summary>
6714 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6715 /// </summary>
6716 [JsonPropertyName("spacing")]
6717 public Spacing? Spacing { get; set; }
6718
6719 /// <summary>
6720 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
6721 /// </summary>
6722 [JsonPropertyName("targetWidth")]
6723 public TargetWidth? TargetWidth { get; set; }
6724
6725 /// <summary>
6726 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6727 /// </summary>
6728 [JsonPropertyName("isSortKey")]
6729 public bool? IsSortKey { get; set; }
6730
6731 /// <summary>
6732 /// The label of the input.
6733 ///
6734 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
6735 /// </summary>
6736 [JsonPropertyName("label")]
6737 public string? Label { get; set; }
6738
6739 /// <summary>
6740 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
6741 /// </summary>
6742 [JsonPropertyName("isRequired")]
6743 public bool? IsRequired { get; set; }
6744
6745 /// <summary>
6746 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
6747 /// </summary>
6748 [JsonPropertyName("errorMessage")]
6749 public string? ErrorMessage { get; set; }
6750
6751 /// <summary>
6752 /// An Action.ResetInputs action that will be executed when the value of the input changes.
6753 /// </summary>
6754 [JsonPropertyName("valueChangedAction")]
6755 public ResetInputsAction? ValueChangedAction { get; set; }
6756
6757 /// <summary>
6758 /// The default value of the input.
6759 /// </summary>
6760 [JsonPropertyName("value")]
6761 public string? Value { get; set; }
6762
6763 /// <summary>
6764 /// The maximum length of the text in the input.
6765 /// </summary>
6766 [JsonPropertyName("maxLength")]
6767 public float? MaxLength { get; set; }
6768
6769 /// <summary>
6770 /// Controls if the input should allow multiple lines of text.
6771 /// </summary>
6772 [JsonPropertyName("isMultiline")]
6773 public bool? IsMultiline { get; set; }
6774
6775 /// <summary>
6776 /// The text to display as a placeholder when the user hasn't entered a value.
6777 /// </summary>
6778 [JsonPropertyName("placeholder")]
6779 public string? Placeholder { get; set; }
6780
6781 /// <summary>
6782 /// The style of the input.
6783 /// </summary>
6784 [JsonPropertyName("style")]
6785 public InputTextStyle? Style { get; set; }
6786
6787 /// <summary>
6788 /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported.
6789 /// </summary>
6790 [JsonPropertyName("inlineAction")]
6791 public Action? InlineAction { get; set; }
6792
6793 /// <summary>
6794 /// The regular expression to validate the input.
6795 /// </summary>
6796 [JsonPropertyName("regex")]
6797 public string? Regex { get; set; }
6798
6799 /// <summary>
6800 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6801 /// </summary>
6802 [JsonPropertyName("grid.area")]
6803 public string? GridArea { get; set; }
6804
6805 /// <summary>
6806 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
6807 /// </summary>
6808 [JsonPropertyName("fallback")]
6809 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6810
6811 /// <summary>
6812 /// Serializes this TextInput into a JSON string.
6813 /// </summary>
6814 public string Serialize()
6815 {
6816 return JsonSerializer.Serialize(
6817 this,
6818 new JsonSerializerOptions
6819 {
6820 WriteIndented = true,
6821 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6822 }
6823 );
6824 }
6825
6826 public TextInput WithId(string value)
6827 {
6828 this.Id = value;
6829 return this;
6830 }
6831
6832 public TextInput WithRequires(HostCapabilities value)
6833 {
6834 this.Requires = value;
6835 return this;
6836 }
6837
6838 public TextInput WithLang(string value)
6839 {
6840 this.Lang = value;
6841 return this;
6842 }
6843
6844 public TextInput WithIsVisible(bool value)
6845 {
6846 this.IsVisible = value;
6847 return this;
6848 }
6849
6850 public TextInput WithSeparator(bool value)
6851 {
6852 this.Separator = value;
6853 return this;
6854 }
6855
6856 public TextInput WithHeight(ElementHeight value)
6857 {
6858 this.Height = value;
6859 return this;
6860 }
6861
6862 public TextInput WithSpacing(Spacing value)
6863 {
6864 this.Spacing = value;
6865 return this;
6866 }
6867
6868 public TextInput WithTargetWidth(TargetWidth value)
6869 {
6870 this.TargetWidth = value;
6871 return this;
6872 }
6873
6874 public TextInput WithIsSortKey(bool value)
6875 {
6876 this.IsSortKey = value;
6877 return this;
6878 }
6879
6880 public TextInput WithLabel(string value)
6881 {
6882 this.Label = value;
6883 return this;
6884 }
6885
6886 public TextInput WithIsRequired(bool value)
6887 {
6888 this.IsRequired = value;
6889 return this;
6890 }
6891
6892 public TextInput WithErrorMessage(string value)
6893 {
6894 this.ErrorMessage = value;
6895 return this;
6896 }
6897
6898 public TextInput WithValueChangedAction(ResetInputsAction value)
6899 {
6900 this.ValueChangedAction = value;
6901 return this;
6902 }
6903
6904 public TextInput WithValue(string value)
6905 {
6906 this.Value = value;
6907 return this;
6908 }
6909
6910 public TextInput WithMaxLength(float value)
6911 {
6912 this.MaxLength = value;
6913 return this;
6914 }
6915
6916 public TextInput WithIsMultiline(bool value)
6917 {
6918 this.IsMultiline = value;
6919 return this;
6920 }
6921
6922 public TextInput WithPlaceholder(string value)
6923 {
6924 this.Placeholder = value;
6925 return this;
6926 }
6927
6928 public TextInput WithStyle(InputTextStyle value)
6929 {
6930 this.Style = value;
6931 return this;
6932 }
6933
6934 public TextInput WithInlineAction(Action value)
6935 {
6936 this.InlineAction = value;
6937 return this;
6938 }
6939
6940 public TextInput WithRegex(string value)
6941 {
6942 this.Regex = value;
6943 return this;
6944 }
6945
6946 public TextInput WithGridArea(string value)
6947 {
6948 this.GridArea = value;
6949 return this;
6950 }
6951
6952 public TextInput WithFallback(IUnion<CardElement, FallbackElement> value)
6953 {
6954 this.Fallback = value;
6955 return this;
6956 }
6957}
6958
6959/// <summary>
6960/// An input to allow the user to select a date.
6961/// </summary>
6962public class DateInput : CardElement
6963{
6964 /// <summary>
6965 /// Deserializes a JSON string into an object of type DateInput.
6966 /// </summary>
6967 public static DateInput? Deserialize(string json)
6968 {
6969 return JsonSerializer.Deserialize<DateInput>(json);
6970 }
6971
6972 /// <summary>
6973 /// Must be **Input.Date**.
6974 /// </summary>
6975 [JsonPropertyName("type")]
6976 public string Type { get; } = "Input.Date";
6977
6978 /// <summary>
6979 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
6980 /// </summary>
6981 [JsonPropertyName("id")]
6982 public string? Id { get; set; }
6983
6984 /// <summary>
6985 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
6986 /// </summary>
6987 [JsonPropertyName("requires")]
6988 public HostCapabilities? Requires { get; set; }
6989
6990 /// <summary>
6991 /// The locale associated with the element.
6992 /// </summary>
6993 [JsonPropertyName("lang")]
6994 public string? Lang { get; set; }
6995
6996 /// <summary>
6997 /// Controls the visibility of the element.
6998 /// </summary>
6999 [JsonPropertyName("isVisible")]
7000 public bool? IsVisible { get; set; }
7001
7002 /// <summary>
7003 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
7004 /// </summary>
7005 [JsonPropertyName("separator")]
7006 public bool? Separator { get; set; }
7007
7008 /// <summary>
7009 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7010 /// </summary>
7011 [JsonPropertyName("height")]
7012 public ElementHeight? Height { get; set; }
7013
7014 /// <summary>
7015 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7016 /// </summary>
7017 [JsonPropertyName("spacing")]
7018 public Spacing? Spacing { get; set; }
7019
7020 /// <summary>
7021 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
7022 /// </summary>
7023 [JsonPropertyName("targetWidth")]
7024 public TargetWidth? TargetWidth { get; set; }
7025
7026 /// <summary>
7027 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7028 /// </summary>
7029 [JsonPropertyName("isSortKey")]
7030 public bool? IsSortKey { get; set; }
7031
7032 /// <summary>
7033 /// The label of the input.
7034 ///
7035 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7036 /// </summary>
7037 [JsonPropertyName("label")]
7038 public string? Label { get; set; }
7039
7040 /// <summary>
7041 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7042 /// </summary>
7043 [JsonPropertyName("isRequired")]
7044 public bool? IsRequired { get; set; }
7045
7046 /// <summary>
7047 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7048 /// </summary>
7049 [JsonPropertyName("errorMessage")]
7050 public string? ErrorMessage { get; set; }
7051
7052 /// <summary>
7053 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7054 /// </summary>
7055 [JsonPropertyName("valueChangedAction")]
7056 public ResetInputsAction? ValueChangedAction { get; set; }
7057
7058 /// <summary>
7059 /// The default value of the input, in the `YYYY-MM-DD` format.
7060 /// </summary>
7061 [JsonPropertyName("value")]
7062 public string? Value { get; set; }
7063
7064 /// <summary>
7065 /// The text to display as a placeholder when the user has not selected a date.
7066 /// </summary>
7067 [JsonPropertyName("placeholder")]
7068 public string? Placeholder { get; set; }
7069
7070 /// <summary>
7071 /// The minimum date that can be selected.
7072 /// </summary>
7073 [JsonPropertyName("min")]
7074 public string? Min { get; set; }
7075
7076 /// <summary>
7077 /// The maximum date that can be selected.
7078 /// </summary>
7079 [JsonPropertyName("max")]
7080 public string? Max { get; set; }
7081
7082 /// <summary>
7083 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7084 /// </summary>
7085 [JsonPropertyName("grid.area")]
7086 public string? GridArea { get; set; }
7087
7088 /// <summary>
7089 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
7090 /// </summary>
7091 [JsonPropertyName("fallback")]
7092 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7093
7094 /// <summary>
7095 /// Serializes this DateInput into a JSON string.
7096 /// </summary>
7097 public string Serialize()
7098 {
7099 return JsonSerializer.Serialize(
7100 this,
7101 new JsonSerializerOptions
7102 {
7103 WriteIndented = true,
7104 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7105 }
7106 );
7107 }
7108
7109 public DateInput WithId(string value)
7110 {
7111 this.Id = value;
7112 return this;
7113 }
7114
7115 public DateInput WithRequires(HostCapabilities value)
7116 {
7117 this.Requires = value;
7118 return this;
7119 }
7120
7121 public DateInput WithLang(string value)
7122 {
7123 this.Lang = value;
7124 return this;
7125 }
7126
7127 public DateInput WithIsVisible(bool value)
7128 {
7129 this.IsVisible = value;
7130 return this;
7131 }
7132
7133 public DateInput WithSeparator(bool value)
7134 {
7135 this.Separator = value;
7136 return this;
7137 }
7138
7139 public DateInput WithHeight(ElementHeight value)
7140 {
7141 this.Height = value;
7142 return this;
7143 }
7144
7145 public DateInput WithSpacing(Spacing value)
7146 {
7147 this.Spacing = value;
7148 return this;
7149 }
7150
7151 public DateInput WithTargetWidth(TargetWidth value)
7152 {
7153 this.TargetWidth = value;
7154 return this;
7155 }
7156
7157 public DateInput WithIsSortKey(bool value)
7158 {
7159 this.IsSortKey = value;
7160 return this;
7161 }
7162
7163 public DateInput WithLabel(string value)
7164 {
7165 this.Label = value;
7166 return this;
7167 }
7168
7169 public DateInput WithIsRequired(bool value)
7170 {
7171 this.IsRequired = value;
7172 return this;
7173 }
7174
7175 public DateInput WithErrorMessage(string value)
7176 {
7177 this.ErrorMessage = value;
7178 return this;
7179 }
7180
7181 public DateInput WithValueChangedAction(ResetInputsAction value)
7182 {
7183 this.ValueChangedAction = value;
7184 return this;
7185 }
7186
7187 public DateInput WithValue(string value)
7188 {
7189 this.Value = value;
7190 return this;
7191 }
7192
7193 public DateInput WithPlaceholder(string value)
7194 {
7195 this.Placeholder = value;
7196 return this;
7197 }
7198
7199 public DateInput WithMin(string value)
7200 {
7201 this.Min = value;
7202 return this;
7203 }
7204
7205 public DateInput WithMax(string value)
7206 {
7207 this.Max = value;
7208 return this;
7209 }
7210
7211 public DateInput WithGridArea(string value)
7212 {
7213 this.GridArea = value;
7214 return this;
7215 }
7216
7217 public DateInput WithFallback(IUnion<CardElement, FallbackElement> value)
7218 {
7219 this.Fallback = value;
7220 return this;
7221 }
7222}
7223
7224/// <summary>
7225/// An input to allow the user to select a time.
7226/// </summary>
7227public class TimeInput : CardElement
7228{
7229 /// <summary>
7230 /// Deserializes a JSON string into an object of type TimeInput.
7231 /// </summary>
7232 public static TimeInput? Deserialize(string json)
7233 {
7234 return JsonSerializer.Deserialize<TimeInput>(json);
7235 }
7236
7237 /// <summary>
7238 /// Must be **Input.Time**.
7239 /// </summary>
7240 [JsonPropertyName("type")]
7241 public string Type { get; } = "Input.Time";
7242
7243 /// <summary>
7244 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
7245 /// </summary>
7246 [JsonPropertyName("id")]
7247 public string? Id { get; set; }
7248
7249 /// <summary>
7250 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
7251 /// </summary>
7252 [JsonPropertyName("requires")]
7253 public HostCapabilities? Requires { get; set; }
7254
7255 /// <summary>
7256 /// The locale associated with the element.
7257 /// </summary>
7258 [JsonPropertyName("lang")]
7259 public string? Lang { get; set; }
7260
7261 /// <summary>
7262 /// Controls the visibility of the element.
7263 /// </summary>
7264 [JsonPropertyName("isVisible")]
7265 public bool? IsVisible { get; set; }
7266
7267 /// <summary>
7268 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
7269 /// </summary>
7270 [JsonPropertyName("separator")]
7271 public bool? Separator { get; set; }
7272
7273 /// <summary>
7274 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7275 /// </summary>
7276 [JsonPropertyName("height")]
7277 public ElementHeight? Height { get; set; }
7278
7279 /// <summary>
7280 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7281 /// </summary>
7282 [JsonPropertyName("spacing")]
7283 public Spacing? Spacing { get; set; }
7284
7285 /// <summary>
7286 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
7287 /// </summary>
7288 [JsonPropertyName("targetWidth")]
7289 public TargetWidth? TargetWidth { get; set; }
7290
7291 /// <summary>
7292 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7293 /// </summary>
7294 [JsonPropertyName("isSortKey")]
7295 public bool? IsSortKey { get; set; }
7296
7297 /// <summary>
7298 /// The label of the input.
7299 ///
7300 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7301 /// </summary>
7302 [JsonPropertyName("label")]
7303 public string? Label { get; set; }
7304
7305 /// <summary>
7306 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7307 /// </summary>
7308 [JsonPropertyName("isRequired")]
7309 public bool? IsRequired { get; set; }
7310
7311 /// <summary>
7312 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7313 /// </summary>
7314 [JsonPropertyName("errorMessage")]
7315 public string? ErrorMessage { get; set; }
7316
7317 /// <summary>
7318 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7319 /// </summary>
7320 [JsonPropertyName("valueChangedAction")]
7321 public ResetInputsAction? ValueChangedAction { get; set; }
7322
7323 /// <summary>
7324 /// The default value of the input, in the `HH:MM` format.
7325 /// </summary>
7326 [JsonPropertyName("value")]
7327 public string? Value { get; set; }
7328
7329 /// <summary>
7330 /// The text to display as a placeholder when the user hasn't entered a value.
7331 /// </summary>
7332 [JsonPropertyName("placeholder")]
7333 public string? Placeholder { get; set; }
7334
7335 /// <summary>
7336 /// The minimum time that can be selected, in the `HH:MM` format.
7337 /// </summary>
7338 [JsonPropertyName("min")]
7339 public string? Min { get; set; }
7340
7341 /// <summary>
7342 /// The maximum time that can be selected, in the `HH:MM` format.
7343 /// </summary>
7344 [JsonPropertyName("max")]
7345 public string? Max { get; set; }
7346
7347 /// <summary>
7348 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7349 /// </summary>
7350 [JsonPropertyName("grid.area")]
7351 public string? GridArea { get; set; }
7352
7353 /// <summary>
7354 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
7355 /// </summary>
7356 [JsonPropertyName("fallback")]
7357 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7358
7359 /// <summary>
7360 /// Serializes this TimeInput into a JSON string.
7361 /// </summary>
7362 public string Serialize()
7363 {
7364 return JsonSerializer.Serialize(
7365 this,
7366 new JsonSerializerOptions
7367 {
7368 WriteIndented = true,
7369 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7370 }
7371 );
7372 }
7373
7374 public TimeInput WithId(string value)
7375 {
7376 this.Id = value;
7377 return this;
7378 }
7379
7380 public TimeInput WithRequires(HostCapabilities value)
7381 {
7382 this.Requires = value;
7383 return this;
7384 }
7385
7386 public TimeInput WithLang(string value)
7387 {
7388 this.Lang = value;
7389 return this;
7390 }
7391
7392 public TimeInput WithIsVisible(bool value)
7393 {
7394 this.IsVisible = value;
7395 return this;
7396 }
7397
7398 public TimeInput WithSeparator(bool value)
7399 {
7400 this.Separator = value;
7401 return this;
7402 }
7403
7404 public TimeInput WithHeight(ElementHeight value)
7405 {
7406 this.Height = value;
7407 return this;
7408 }
7409
7410 public TimeInput WithSpacing(Spacing value)
7411 {
7412 this.Spacing = value;
7413 return this;
7414 }
7415
7416 public TimeInput WithTargetWidth(TargetWidth value)
7417 {
7418 this.TargetWidth = value;
7419 return this;
7420 }
7421
7422 public TimeInput WithIsSortKey(bool value)
7423 {
7424 this.IsSortKey = value;
7425 return this;
7426 }
7427
7428 public TimeInput WithLabel(string value)
7429 {
7430 this.Label = value;
7431 return this;
7432 }
7433
7434 public TimeInput WithIsRequired(bool value)
7435 {
7436 this.IsRequired = value;
7437 return this;
7438 }
7439
7440 public TimeInput WithErrorMessage(string value)
7441 {
7442 this.ErrorMessage = value;
7443 return this;
7444 }
7445
7446 public TimeInput WithValueChangedAction(ResetInputsAction value)
7447 {
7448 this.ValueChangedAction = value;
7449 return this;
7450 }
7451
7452 public TimeInput WithValue(string value)
7453 {
7454 this.Value = value;
7455 return this;
7456 }
7457
7458 public TimeInput WithPlaceholder(string value)
7459 {
7460 this.Placeholder = value;
7461 return this;
7462 }
7463
7464 public TimeInput WithMin(string value)
7465 {
7466 this.Min = value;
7467 return this;
7468 }
7469
7470 public TimeInput WithMax(string value)
7471 {
7472 this.Max = value;
7473 return this;
7474 }
7475
7476 public TimeInput WithGridArea(string value)
7477 {
7478 this.GridArea = value;
7479 return this;
7480 }
7481
7482 public TimeInput WithFallback(IUnion<CardElement, FallbackElement> value)
7483 {
7484 this.Fallback = value;
7485 return this;
7486 }
7487}
7488
7489/// <summary>
7490/// An input to allow the user to enter a number.
7491/// </summary>
7492public class NumberInput : CardElement
7493{
7494 /// <summary>
7495 /// Deserializes a JSON string into an object of type NumberInput.
7496 /// </summary>
7497 public static NumberInput? Deserialize(string json)
7498 {
7499 return JsonSerializer.Deserialize<NumberInput>(json);
7500 }
7501
7502 /// <summary>
7503 /// Must be **Input.Number**.
7504 /// </summary>
7505 [JsonPropertyName("type")]
7506 public string Type { get; } = "Input.Number";
7507
7508 /// <summary>
7509 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
7510 /// </summary>
7511 [JsonPropertyName("id")]
7512 public string? Id { get; set; }
7513
7514 /// <summary>
7515 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
7516 /// </summary>
7517 [JsonPropertyName("requires")]
7518 public HostCapabilities? Requires { get; set; }
7519
7520 /// <summary>
7521 /// The locale associated with the element.
7522 /// </summary>
7523 [JsonPropertyName("lang")]
7524 public string? Lang { get; set; }
7525
7526 /// <summary>
7527 /// Controls the visibility of the element.
7528 /// </summary>
7529 [JsonPropertyName("isVisible")]
7530 public bool? IsVisible { get; set; }
7531
7532 /// <summary>
7533 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
7534 /// </summary>
7535 [JsonPropertyName("separator")]
7536 public bool? Separator { get; set; }
7537
7538 /// <summary>
7539 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7540 /// </summary>
7541 [JsonPropertyName("height")]
7542 public ElementHeight? Height { get; set; }
7543
7544 /// <summary>
7545 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7546 /// </summary>
7547 [JsonPropertyName("spacing")]
7548 public Spacing? Spacing { get; set; }
7549
7550 /// <summary>
7551 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
7552 /// </summary>
7553 [JsonPropertyName("targetWidth")]
7554 public TargetWidth? TargetWidth { get; set; }
7555
7556 /// <summary>
7557 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7558 /// </summary>
7559 [JsonPropertyName("isSortKey")]
7560 public bool? IsSortKey { get; set; }
7561
7562 /// <summary>
7563 /// The label of the input.
7564 ///
7565 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7566 /// </summary>
7567 [JsonPropertyName("label")]
7568 public string? Label { get; set; }
7569
7570 /// <summary>
7571 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7572 /// </summary>
7573 [JsonPropertyName("isRequired")]
7574 public bool? IsRequired { get; set; }
7575
7576 /// <summary>
7577 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7578 /// </summary>
7579 [JsonPropertyName("errorMessage")]
7580 public string? ErrorMessage { get; set; }
7581
7582 /// <summary>
7583 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7584 /// </summary>
7585 [JsonPropertyName("valueChangedAction")]
7586 public ResetInputsAction? ValueChangedAction { get; set; }
7587
7588 /// <summary>
7589 /// The default value of the input.
7590 /// </summary>
7591 [JsonPropertyName("value")]
7592 public float? Value { get; set; }
7593
7594 /// <summary>
7595 /// The text to display as a placeholder when the user hasn't entered a value.
7596 /// </summary>
7597 [JsonPropertyName("placeholder")]
7598 public string? Placeholder { get; set; }
7599
7600 /// <summary>
7601 /// The minimum value that can be entered.
7602 /// </summary>
7603 [JsonPropertyName("min")]
7604 public float? Min { get; set; }
7605
7606 /// <summary>
7607 /// The maximum value that can be entered.
7608 /// </summary>
7609 [JsonPropertyName("max")]
7610 public float? Max { get; set; }
7611
7612 /// <summary>
7613 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7614 /// </summary>
7615 [JsonPropertyName("grid.area")]
7616 public string? GridArea { get; set; }
7617
7618 /// <summary>
7619 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
7620 /// </summary>
7621 [JsonPropertyName("fallback")]
7622 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7623
7624 /// <summary>
7625 /// Serializes this NumberInput into a JSON string.
7626 /// </summary>
7627 public string Serialize()
7628 {
7629 return JsonSerializer.Serialize(
7630 this,
7631 new JsonSerializerOptions
7632 {
7633 WriteIndented = true,
7634 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7635 }
7636 );
7637 }
7638
7639 public NumberInput WithId(string value)
7640 {
7641 this.Id = value;
7642 return this;
7643 }
7644
7645 public NumberInput WithRequires(HostCapabilities value)
7646 {
7647 this.Requires = value;
7648 return this;
7649 }
7650
7651 public NumberInput WithLang(string value)
7652 {
7653 this.Lang = value;
7654 return this;
7655 }
7656
7657 public NumberInput WithIsVisible(bool value)
7658 {
7659 this.IsVisible = value;
7660 return this;
7661 }
7662
7663 public NumberInput WithSeparator(bool value)
7664 {
7665 this.Separator = value;
7666 return this;
7667 }
7668
7669 public NumberInput WithHeight(ElementHeight value)
7670 {
7671 this.Height = value;
7672 return this;
7673 }
7674
7675 public NumberInput WithSpacing(Spacing value)
7676 {
7677 this.Spacing = value;
7678 return this;
7679 }
7680
7681 public NumberInput WithTargetWidth(TargetWidth value)
7682 {
7683 this.TargetWidth = value;
7684 return this;
7685 }
7686
7687 public NumberInput WithIsSortKey(bool value)
7688 {
7689 this.IsSortKey = value;
7690 return this;
7691 }
7692
7693 public NumberInput WithLabel(string value)
7694 {
7695 this.Label = value;
7696 return this;
7697 }
7698
7699 public NumberInput WithIsRequired(bool value)
7700 {
7701 this.IsRequired = value;
7702 return this;
7703 }
7704
7705 public NumberInput WithErrorMessage(string value)
7706 {
7707 this.ErrorMessage = value;
7708 return this;
7709 }
7710
7711 public NumberInput WithValueChangedAction(ResetInputsAction value)
7712 {
7713 this.ValueChangedAction = value;
7714 return this;
7715 }
7716
7717 public NumberInput WithValue(float value)
7718 {
7719 this.Value = value;
7720 return this;
7721 }
7722
7723 public NumberInput WithPlaceholder(string value)
7724 {
7725 this.Placeholder = value;
7726 return this;
7727 }
7728
7729 public NumberInput WithMin(float value)
7730 {
7731 this.Min = value;
7732 return this;
7733 }
7734
7735 public NumberInput WithMax(float value)
7736 {
7737 this.Max = value;
7738 return this;
7739 }
7740
7741 public NumberInput WithGridArea(string value)
7742 {
7743 this.GridArea = value;
7744 return this;
7745 }
7746
7747 public NumberInput WithFallback(IUnion<CardElement, FallbackElement> value)
7748 {
7749 this.Fallback = value;
7750 return this;
7751 }
7752}
7753
7754/// <summary>
7755/// An input to allow the user to select between on/off states.
7756/// </summary>
7757public class ToggleInput : CardElement
7758{
7759 /// <summary>
7760 /// Deserializes a JSON string into an object of type ToggleInput.
7761 /// </summary>
7762 public static ToggleInput? Deserialize(string json)
7763 {
7764 return JsonSerializer.Deserialize<ToggleInput>(json);
7765 }
7766
7767 /// <summary>
7768 /// Must be **Input.Toggle**.
7769 /// </summary>
7770 [JsonPropertyName("type")]
7771 public string Type { get; } = "Input.Toggle";
7772
7773 /// <summary>
7774 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
7775 /// </summary>
7776 [JsonPropertyName("id")]
7777 public string? Id { get; set; }
7778
7779 /// <summary>
7780 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
7781 /// </summary>
7782 [JsonPropertyName("requires")]
7783 public HostCapabilities? Requires { get; set; }
7784
7785 /// <summary>
7786 /// The locale associated with the element.
7787 /// </summary>
7788 [JsonPropertyName("lang")]
7789 public string? Lang { get; set; }
7790
7791 /// <summary>
7792 /// Controls the visibility of the element.
7793 /// </summary>
7794 [JsonPropertyName("isVisible")]
7795 public bool? IsVisible { get; set; }
7796
7797 /// <summary>
7798 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
7799 /// </summary>
7800 [JsonPropertyName("separator")]
7801 public bool? Separator { get; set; }
7802
7803 /// <summary>
7804 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7805 /// </summary>
7806 [JsonPropertyName("height")]
7807 public ElementHeight? Height { get; set; }
7808
7809 /// <summary>
7810 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7811 /// </summary>
7812 [JsonPropertyName("spacing")]
7813 public Spacing? Spacing { get; set; }
7814
7815 /// <summary>
7816 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
7817 /// </summary>
7818 [JsonPropertyName("targetWidth")]
7819 public TargetWidth? TargetWidth { get; set; }
7820
7821 /// <summary>
7822 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7823 /// </summary>
7824 [JsonPropertyName("isSortKey")]
7825 public bool? IsSortKey { get; set; }
7826
7827 /// <summary>
7828 /// The label of the input.
7829 ///
7830 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7831 /// </summary>
7832 [JsonPropertyName("label")]
7833 public string? Label { get; set; }
7834
7835 /// <summary>
7836 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7837 /// </summary>
7838 [JsonPropertyName("isRequired")]
7839 public bool? IsRequired { get; set; }
7840
7841 /// <summary>
7842 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7843 /// </summary>
7844 [JsonPropertyName("errorMessage")]
7845 public string? ErrorMessage { get; set; }
7846
7847 /// <summary>
7848 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7849 /// </summary>
7850 [JsonPropertyName("valueChangedAction")]
7851 public ResetInputsAction? ValueChangedAction { get; set; }
7852
7853 /// <summary>
7854 /// The default value of the input.
7855 /// </summary>
7856 [JsonPropertyName("value")]
7857 public string? Value { get; set; }
7858
7859 /// <summary>
7860 /// The title (caption) to display next to the toggle.
7861 /// </summary>
7862 [JsonPropertyName("title")]
7863 public string? Title { get; set; }
7864
7865 /// <summary>
7866 /// The value to send to the Bot when the toggle is on.
7867 /// </summary>
7868 [JsonPropertyName("valueOn")]
7869 public string? ValueOn { get; set; }
7870
7871 /// <summary>
7872 /// The value to send to the Bot when the toggle is off.
7873 /// </summary>
7874 [JsonPropertyName("valueOff")]
7875 public string? ValueOff { get; set; }
7876
7877 /// <summary>
7878 /// Controls if the title should wrap.
7879 /// </summary>
7880 [JsonPropertyName("wrap")]
7881 public bool? Wrap { get; set; }
7882
7883 /// <summary>
7884 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7885 /// </summary>
7886 [JsonPropertyName("grid.area")]
7887 public string? GridArea { get; set; }
7888
7889 /// <summary>
7890 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
7891 /// </summary>
7892 [JsonPropertyName("fallback")]
7893 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7894
7895 public ToggleInput(string title)
7896 {
7897 this.Title = title;
7898 }
7899
7900 /// <summary>
7901 /// Serializes this ToggleInput into a JSON string.
7902 /// </summary>
7903 public string Serialize()
7904 {
7905 return JsonSerializer.Serialize(
7906 this,
7907 new JsonSerializerOptions
7908 {
7909 WriteIndented = true,
7910 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7911 }
7912 );
7913 }
7914
7915 public ToggleInput WithId(string value)
7916 {
7917 this.Id = value;
7918 return this;
7919 }
7920
7921 public ToggleInput WithRequires(HostCapabilities value)
7922 {
7923 this.Requires = value;
7924 return this;
7925 }
7926
7927 public ToggleInput WithLang(string value)
7928 {
7929 this.Lang = value;
7930 return this;
7931 }
7932
7933 public ToggleInput WithIsVisible(bool value)
7934 {
7935 this.IsVisible = value;
7936 return this;
7937 }
7938
7939 public ToggleInput WithSeparator(bool value)
7940 {
7941 this.Separator = value;
7942 return this;
7943 }
7944
7945 public ToggleInput WithHeight(ElementHeight value)
7946 {
7947 this.Height = value;
7948 return this;
7949 }
7950
7951 public ToggleInput WithSpacing(Spacing value)
7952 {
7953 this.Spacing = value;
7954 return this;
7955 }
7956
7957 public ToggleInput WithTargetWidth(TargetWidth value)
7958 {
7959 this.TargetWidth = value;
7960 return this;
7961 }
7962
7963 public ToggleInput WithIsSortKey(bool value)
7964 {
7965 this.IsSortKey = value;
7966 return this;
7967 }
7968
7969 public ToggleInput WithLabel(string value)
7970 {
7971 this.Label = value;
7972 return this;
7973 }
7974
7975 public ToggleInput WithIsRequired(bool value)
7976 {
7977 this.IsRequired = value;
7978 return this;
7979 }
7980
7981 public ToggleInput WithErrorMessage(string value)
7982 {
7983 this.ErrorMessage = value;
7984 return this;
7985 }
7986
7987 public ToggleInput WithValueChangedAction(ResetInputsAction value)
7988 {
7989 this.ValueChangedAction = value;
7990 return this;
7991 }
7992
7993 public ToggleInput WithValue(string value)
7994 {
7995 this.Value = value;
7996 return this;
7997 }
7998
7999 public ToggleInput WithTitle(string value)
8000 {
8001 this.Title = value;
8002 return this;
8003 }
8004
8005 public ToggleInput WithValueOn(string value)
8006 {
8007 this.ValueOn = value;
8008 return this;
8009 }
8010
8011 public ToggleInput WithValueOff(string value)
8012 {
8013 this.ValueOff = value;
8014 return this;
8015 }
8016
8017 public ToggleInput WithWrap(bool value)
8018 {
8019 this.Wrap = value;
8020 return this;
8021 }
8022
8023 public ToggleInput WithGridArea(string value)
8024 {
8025 this.GridArea = value;
8026 return this;
8027 }
8028
8029 public ToggleInput WithFallback(IUnion<CardElement, FallbackElement> value)
8030 {
8031 this.Fallback = value;
8032 return this;
8033 }
8034}
8035
8036/// <summary>
8037/// An input to allow the user to select one or more values.
8038/// </summary>
8039public class ChoiceSetInput : CardElement
8040{
8041 /// <summary>
8042 /// Deserializes a JSON string into an object of type ChoiceSetInput.
8043 /// </summary>
8044 public static ChoiceSetInput? Deserialize(string json)
8045 {
8046 return JsonSerializer.Deserialize<ChoiceSetInput>(json);
8047 }
8048
8049 /// <summary>
8050 /// Must be **Input.ChoiceSet**.
8051 /// </summary>
8052 [JsonPropertyName("type")]
8053 public string Type { get; } = "Input.ChoiceSet";
8054
8055 /// <summary>
8056 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
8057 /// </summary>
8058 [JsonPropertyName("id")]
8059 public string? Id { get; set; }
8060
8061 /// <summary>
8062 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
8063 /// </summary>
8064 [JsonPropertyName("requires")]
8065 public HostCapabilities? Requires { get; set; }
8066
8067 /// <summary>
8068 /// The locale associated with the element.
8069 /// </summary>
8070 [JsonPropertyName("lang")]
8071 public string? Lang { get; set; }
8072
8073 /// <summary>
8074 /// Controls the visibility of the element.
8075 /// </summary>
8076 [JsonPropertyName("isVisible")]
8077 public bool? IsVisible { get; set; }
8078
8079 /// <summary>
8080 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
8081 /// </summary>
8082 [JsonPropertyName("separator")]
8083 public bool? Separator { get; set; }
8084
8085 /// <summary>
8086 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8087 /// </summary>
8088 [JsonPropertyName("height")]
8089 public ElementHeight? Height { get; set; }
8090
8091 /// <summary>
8092 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8093 /// </summary>
8094 [JsonPropertyName("spacing")]
8095 public Spacing? Spacing { get; set; }
8096
8097 /// <summary>
8098 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
8099 /// </summary>
8100 [JsonPropertyName("targetWidth")]
8101 public TargetWidth? TargetWidth { get; set; }
8102
8103 /// <summary>
8104 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8105 /// </summary>
8106 [JsonPropertyName("isSortKey")]
8107 public bool? IsSortKey { get; set; }
8108
8109 /// <summary>
8110 /// The label of the input.
8111 ///
8112 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8113 /// </summary>
8114 [JsonPropertyName("label")]
8115 public string? Label { get; set; }
8116
8117 /// <summary>
8118 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8119 /// </summary>
8120 [JsonPropertyName("isRequired")]
8121 public bool? IsRequired { get; set; }
8122
8123 /// <summary>
8124 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8125 /// </summary>
8126 [JsonPropertyName("errorMessage")]
8127 public string? ErrorMessage { get; set; }
8128
8129 /// <summary>
8130 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8131 /// </summary>
8132 [JsonPropertyName("valueChangedAction")]
8133 public ResetInputsAction? ValueChangedAction { get; set; }
8134
8135 /// <summary>
8136 /// The default value of the input.
8137 /// </summary>
8138 [JsonPropertyName("value")]
8139 public string? Value { get; set; }
8140
8141 /// <summary>
8142 /// The choices associated with the input.
8143 /// </summary>
8144 [JsonPropertyName("choices")]
8145 public IList<Choice>? Choices { get; set; }
8146
8147 /// <summary>
8148 /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input.
8149 /// </summary>
8150 [JsonPropertyName("choices.data")]
8151 public QueryData? ChoicesData { get; set; }
8152
8153 /// <summary>
8154 /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded).
8155 /// </summary>
8156 [JsonPropertyName("style")]
8157 public StyleEnum? Style { get; set; }
8158
8159 /// <summary>
8160 /// Controls whether multiple choices can be selected.
8161 /// </summary>
8162 [JsonPropertyName("isMultiSelect")]
8163 public bool? IsMultiSelect { get; set; }
8164
8165 /// <summary>
8166 /// The text to display as a placeholder when the user has not entered any value.
8167 /// </summary>
8168 [JsonPropertyName("placeholder")]
8169 public string? Placeholder { get; set; }
8170
8171 /// <summary>
8172 /// Controls if choice titles should wrap.
8173 /// </summary>
8174 [JsonPropertyName("wrap")]
8175 public bool? Wrap { get; set; }
8176
8177 /// <summary>
8178 /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false.
8179 /// </summary>
8180 [JsonPropertyName("useMultipleColumns")]
8181 public bool? UseMultipleColumns { get; set; }
8182
8183 /// <summary>
8184 /// The minimum width, in pixels, for each column when using a multi-column layout. This ensures that choice items remain readable even when horizontal space is limited. Default is 100 pixels.
8185 /// </summary>
8186 [JsonPropertyName("minColumnWidth")]
8187 public string? MinColumnWidth { get; set; }
8188
8189 /// <summary>
8190 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8191 /// </summary>
8192 [JsonPropertyName("grid.area")]
8193 public string? GridArea { get; set; }
8194
8195 /// <summary>
8196 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
8197 /// </summary>
8198 [JsonPropertyName("fallback")]
8199 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8200
8201 public ChoiceSetInput(params IList<Choice> choices)
8202 {
8203 this.Choices = choices;
8204 }
8205
8206 /// <summary>
8207 /// Serializes this ChoiceSetInput into a JSON string.
8208 /// </summary>
8209 public string Serialize()
8210 {
8211 return JsonSerializer.Serialize(
8212 this,
8213 new JsonSerializerOptions
8214 {
8215 WriteIndented = true,
8216 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8217 }
8218 );
8219 }
8220
8221 public ChoiceSetInput WithId(string value)
8222 {
8223 this.Id = value;
8224 return this;
8225 }
8226
8227 public ChoiceSetInput WithRequires(HostCapabilities value)
8228 {
8229 this.Requires = value;
8230 return this;
8231 }
8232
8233 public ChoiceSetInput WithLang(string value)
8234 {
8235 this.Lang = value;
8236 return this;
8237 }
8238
8239 public ChoiceSetInput WithIsVisible(bool value)
8240 {
8241 this.IsVisible = value;
8242 return this;
8243 }
8244
8245 public ChoiceSetInput WithSeparator(bool value)
8246 {
8247 this.Separator = value;
8248 return this;
8249 }
8250
8251 public ChoiceSetInput WithHeight(ElementHeight value)
8252 {
8253 this.Height = value;
8254 return this;
8255 }
8256
8257 public ChoiceSetInput WithSpacing(Spacing value)
8258 {
8259 this.Spacing = value;
8260 return this;
8261 }
8262
8263 public ChoiceSetInput WithTargetWidth(TargetWidth value)
8264 {
8265 this.TargetWidth = value;
8266 return this;
8267 }
8268
8269 public ChoiceSetInput WithIsSortKey(bool value)
8270 {
8271 this.IsSortKey = value;
8272 return this;
8273 }
8274
8275 public ChoiceSetInput WithLabel(string value)
8276 {
8277 this.Label = value;
8278 return this;
8279 }
8280
8281 public ChoiceSetInput WithIsRequired(bool value)
8282 {
8283 this.IsRequired = value;
8284 return this;
8285 }
8286
8287 public ChoiceSetInput WithErrorMessage(string value)
8288 {
8289 this.ErrorMessage = value;
8290 return this;
8291 }
8292
8293 public ChoiceSetInput WithValueChangedAction(ResetInputsAction value)
8294 {
8295 this.ValueChangedAction = value;
8296 return this;
8297 }
8298
8299 public ChoiceSetInput WithValue(string value)
8300 {
8301 this.Value = value;
8302 return this;
8303 }
8304
8305 public ChoiceSetInput WithChoices(params IList<Choice> value)
8306 {
8307 this.Choices = value;
8308 return this;
8309 }
8310
8311 public ChoiceSetInput WithChoicesData(QueryData value)
8312 {
8313 this.ChoicesData = value;
8314 return this;
8315 }
8316
8317 public ChoiceSetInput WithStyle(StyleEnum value)
8318 {
8319 this.Style = value;
8320 return this;
8321 }
8322
8323 public ChoiceSetInput WithIsMultiSelect(bool value)
8324 {
8325 this.IsMultiSelect = value;
8326 return this;
8327 }
8328
8329 public ChoiceSetInput WithPlaceholder(string value)
8330 {
8331 this.Placeholder = value;
8332 return this;
8333 }
8334
8335 public ChoiceSetInput WithWrap(bool value)
8336 {
8337 this.Wrap = value;
8338 return this;
8339 }
8340
8341 public ChoiceSetInput WithUseMultipleColumns(bool value)
8342 {
8343 this.UseMultipleColumns = value;
8344 return this;
8345 }
8346
8347 public ChoiceSetInput WithMinColumnWidth(string value)
8348 {
8349 this.MinColumnWidth = value;
8350 return this;
8351 }
8352
8353 public ChoiceSetInput WithGridArea(string value)
8354 {
8355 this.GridArea = value;
8356 return this;
8357 }
8358
8359 public ChoiceSetInput WithFallback(IUnion<CardElement, FallbackElement> value)
8360 {
8361 this.Fallback = value;
8362 return this;
8363 }
8364}
8365
8366/// <summary>
8367/// A choice as used by the Input.ChoiceSet input.
8368/// </summary>
8369public class Choice : SerializableObject
8370{
8371 /// <summary>
8372 /// Deserializes a JSON string into an object of type Choice.
8373 /// </summary>
8374 public static Choice? Deserialize(string json)
8375 {
8376 return JsonSerializer.Deserialize<Choice>(json);
8377 }
8378
8379 /// <summary>
8380 /// The text to display for the choice.
8381 /// </summary>
8382 [JsonPropertyName("title")]
8383 public string? Title { get; set; }
8384
8385 /// <summary>
8386 /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked
8387 /// </summary>
8388 [JsonPropertyName("value")]
8389 public string? Value { get; set; }
8390
8391 /// <summary>
8392 /// Serializes this Choice into a JSON string.
8393 /// </summary>
8394 public string Serialize()
8395 {
8396 return JsonSerializer.Serialize(
8397 this,
8398 new JsonSerializerOptions
8399 {
8400 WriteIndented = true,
8401 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8402 }
8403 );
8404 }
8405
8406 public Choice WithTitle(string value)
8407 {
8408 this.Title = value;
8409 return this;
8410 }
8411
8412 public Choice WithValue(string value)
8413 {
8414 this.Value = value;
8415 return this;
8416 }
8417}
8418
8419/// <summary>
8420/// Defines a query to dynamically fetch data from a Bot.
8421/// </summary>
8422public class QueryData : SerializableObject
8423{
8424 /// <summary>
8425 /// Deserializes a JSON string into an object of type QueryData.
8426 /// </summary>
8427 public static QueryData? Deserialize(string json)
8428 {
8429 return JsonSerializer.Deserialize<QueryData>(json);
8430 }
8431
8432 /// <summary>
8433 /// Must be **Data.Query**.
8434 /// </summary>
8435 [JsonPropertyName("type")]
8436 public string Type { get; } = "Data.Query";
8437
8438 /// <summary>
8439 /// The dataset from which to fetch the data.
8440 /// </summary>
8441 [JsonPropertyName("dataset")]
8442 public string? Dataset { get; set; }
8443
8444 /// <summary>
8445 /// Controls which inputs are associated with the Data.Query. When a Data.Query is executed, the values of the associated inputs are sent to the Bot, allowing it to perform filtering operations based on the user's input.
8446 /// </summary>
8447 [JsonPropertyName("associatedInputs")]
8448 public AssociatedInputs? AssociatedInputs { get; set; }
8449
8450 /// <summary>
8451 /// The maximum number of data items that should be returned by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination.
8452 /// </summary>
8453 [JsonPropertyName("count")]
8454 public float? Count { get; set; }
8455
8456 /// <summary>
8457 /// The number of data items to be skipped by the query. Card authors should not specify this property in their card payload. It is determined by the client and sent to the Bot to enable pagination.
8458 /// </summary>
8459 [JsonPropertyName("skip")]
8460 public float? Skip { get; set; }
8461
8462 /// <summary>
8463 /// Serializes this QueryData into a JSON string.
8464 /// </summary>
8465 public string Serialize()
8466 {
8467 return JsonSerializer.Serialize(
8468 this,
8469 new JsonSerializerOptions
8470 {
8471 WriteIndented = true,
8472 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8473 }
8474 );
8475 }
8476
8477 public QueryData WithDataset(string value)
8478 {
8479 this.Dataset = value;
8480 return this;
8481 }
8482
8483 public QueryData WithAssociatedInputs(AssociatedInputs value)
8484 {
8485 this.AssociatedInputs = value;
8486 return this;
8487 }
8488
8489 public QueryData WithCount(float value)
8490 {
8491 this.Count = value;
8492 return this;
8493 }
8494
8495 public QueryData WithSkip(float value)
8496 {
8497 this.Skip = value;
8498 return this;
8499 }
8500}
8501
8502/// <summary>
8503/// An input to allow the user to rate something using stars.
8504/// </summary>
8505public class RatingInput : CardElement
8506{
8507 /// <summary>
8508 /// Deserializes a JSON string into an object of type RatingInput.
8509 /// </summary>
8510 public static RatingInput? Deserialize(string json)
8511 {
8512 return JsonSerializer.Deserialize<RatingInput>(json);
8513 }
8514
8515 /// <summary>
8516 /// Must be **Input.Rating**.
8517 /// </summary>
8518 [JsonPropertyName("type")]
8519 public string Type { get; } = "Input.Rating";
8520
8521 /// <summary>
8522 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
8523 /// </summary>
8524 [JsonPropertyName("id")]
8525 public string? Id { get; set; }
8526
8527 /// <summary>
8528 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
8529 /// </summary>
8530 [JsonPropertyName("requires")]
8531 public HostCapabilities? Requires { get; set; }
8532
8533 /// <summary>
8534 /// The locale associated with the element.
8535 /// </summary>
8536 [JsonPropertyName("lang")]
8537 public string? Lang { get; set; }
8538
8539 /// <summary>
8540 /// Controls the visibility of the element.
8541 /// </summary>
8542 [JsonPropertyName("isVisible")]
8543 public bool? IsVisible { get; set; }
8544
8545 /// <summary>
8546 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
8547 /// </summary>
8548 [JsonPropertyName("separator")]
8549 public bool? Separator { get; set; }
8550
8551 /// <summary>
8552 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8553 /// </summary>
8554 [JsonPropertyName("height")]
8555 public ElementHeight? Height { get; set; }
8556
8557 /// <summary>
8558 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8559 /// </summary>
8560 [JsonPropertyName("spacing")]
8561 public Spacing? Spacing { get; set; }
8562
8563 /// <summary>
8564 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
8565 /// </summary>
8566 [JsonPropertyName("targetWidth")]
8567 public TargetWidth? TargetWidth { get; set; }
8568
8569 /// <summary>
8570 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8571 /// </summary>
8572 [JsonPropertyName("isSortKey")]
8573 public bool? IsSortKey { get; set; }
8574
8575 /// <summary>
8576 /// The label of the input.
8577 ///
8578 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8579 /// </summary>
8580 [JsonPropertyName("label")]
8581 public string? Label { get; set; }
8582
8583 /// <summary>
8584 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8585 /// </summary>
8586 [JsonPropertyName("isRequired")]
8587 public bool? IsRequired { get; set; }
8588
8589 /// <summary>
8590 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8591 /// </summary>
8592 [JsonPropertyName("errorMessage")]
8593 public string? ErrorMessage { get; set; }
8594
8595 /// <summary>
8596 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8597 /// </summary>
8598 [JsonPropertyName("valueChangedAction")]
8599 public ResetInputsAction? ValueChangedAction { get; set; }
8600
8601 /// <summary>
8602 /// The default value of the input.
8603 /// </summary>
8604 [JsonPropertyName("value")]
8605 public float? Value { get; set; }
8606
8607 /// <summary>
8608 /// The number of stars to display.
8609 /// </summary>
8610 [JsonPropertyName("max")]
8611 public float? Max { get; set; }
8612
8613 /// <summary>
8614 /// Controls if the user can select half stars.
8615 /// </summary>
8616 [JsonPropertyName("allowHalfSteps")]
8617 public bool? AllowHalfSteps { get; set; }
8618
8619 /// <summary>
8620 /// The size of the stars.
8621 /// </summary>
8622 [JsonPropertyName("size")]
8623 public RatingSize? Size { get; set; }
8624
8625 /// <summary>
8626 /// The color of the stars.
8627 /// </summary>
8628 [JsonPropertyName("color")]
8629 public RatingColor? Color { get; set; }
8630
8631 /// <summary>
8632 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8633 /// </summary>
8634 [JsonPropertyName("grid.area")]
8635 public string? GridArea { get; set; }
8636
8637 /// <summary>
8638 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
8639 /// </summary>
8640 [JsonPropertyName("fallback")]
8641 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8642
8643 /// <summary>
8644 /// Serializes this RatingInput into a JSON string.
8645 /// </summary>
8646 public string Serialize()
8647 {
8648 return JsonSerializer.Serialize(
8649 this,
8650 new JsonSerializerOptions
8651 {
8652 WriteIndented = true,
8653 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8654 }
8655 );
8656 }
8657
8658 public RatingInput WithId(string value)
8659 {
8660 this.Id = value;
8661 return this;
8662 }
8663
8664 public RatingInput WithRequires(HostCapabilities value)
8665 {
8666 this.Requires = value;
8667 return this;
8668 }
8669
8670 public RatingInput WithLang(string value)
8671 {
8672 this.Lang = value;
8673 return this;
8674 }
8675
8676 public RatingInput WithIsVisible(bool value)
8677 {
8678 this.IsVisible = value;
8679 return this;
8680 }
8681
8682 public RatingInput WithSeparator(bool value)
8683 {
8684 this.Separator = value;
8685 return this;
8686 }
8687
8688 public RatingInput WithHeight(ElementHeight value)
8689 {
8690 this.Height = value;
8691 return this;
8692 }
8693
8694 public RatingInput WithSpacing(Spacing value)
8695 {
8696 this.Spacing = value;
8697 return this;
8698 }
8699
8700 public RatingInput WithTargetWidth(TargetWidth value)
8701 {
8702 this.TargetWidth = value;
8703 return this;
8704 }
8705
8706 public RatingInput WithIsSortKey(bool value)
8707 {
8708 this.IsSortKey = value;
8709 return this;
8710 }
8711
8712 public RatingInput WithLabel(string value)
8713 {
8714 this.Label = value;
8715 return this;
8716 }
8717
8718 public RatingInput WithIsRequired(bool value)
8719 {
8720 this.IsRequired = value;
8721 return this;
8722 }
8723
8724 public RatingInput WithErrorMessage(string value)
8725 {
8726 this.ErrorMessage = value;
8727 return this;
8728 }
8729
8730 public RatingInput WithValueChangedAction(ResetInputsAction value)
8731 {
8732 this.ValueChangedAction = value;
8733 return this;
8734 }
8735
8736 public RatingInput WithValue(float value)
8737 {
8738 this.Value = value;
8739 return this;
8740 }
8741
8742 public RatingInput WithMax(float value)
8743 {
8744 this.Max = value;
8745 return this;
8746 }
8747
8748 public RatingInput WithAllowHalfSteps(bool value)
8749 {
8750 this.AllowHalfSteps = value;
8751 return this;
8752 }
8753
8754 public RatingInput WithSize(RatingSize value)
8755 {
8756 this.Size = value;
8757 return this;
8758 }
8759
8760 public RatingInput WithColor(RatingColor value)
8761 {
8762 this.Color = value;
8763 return this;
8764 }
8765
8766 public RatingInput WithGridArea(string value)
8767 {
8768 this.GridArea = value;
8769 return this;
8770 }
8771
8772 public RatingInput WithFallback(IUnion<CardElement, FallbackElement> value)
8773 {
8774 this.Fallback = value;
8775 return this;
8776 }
8777}
8778
8779/// <summary>
8780/// A read-only star rating element, to display the rating of something.
8781/// </summary>
8782public class Rating : CardElement
8783{
8784 /// <summary>
8785 /// Deserializes a JSON string into an object of type Rating.
8786 /// </summary>
8787 public static Rating? Deserialize(string json)
8788 {
8789 return JsonSerializer.Deserialize<Rating>(json);
8790 }
8791
8792 /// <summary>
8793 /// Must be **Rating**.
8794 /// </summary>
8795 [JsonPropertyName("type")]
8796 public string Type { get; } = "Rating";
8797
8798 /// <summary>
8799 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
8800 /// </summary>
8801 [JsonPropertyName("id")]
8802 public string? Id { get; set; }
8803
8804 /// <summary>
8805 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
8806 /// </summary>
8807 [JsonPropertyName("requires")]
8808 public HostCapabilities? Requires { get; set; }
8809
8810 /// <summary>
8811 /// The locale associated with the element.
8812 /// </summary>
8813 [JsonPropertyName("lang")]
8814 public string? Lang { get; set; }
8815
8816 /// <summary>
8817 /// Controls the visibility of the element.
8818 /// </summary>
8819 [JsonPropertyName("isVisible")]
8820 public bool? IsVisible { get; set; }
8821
8822 /// <summary>
8823 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
8824 /// </summary>
8825 [JsonPropertyName("separator")]
8826 public bool? Separator { get; set; }
8827
8828 /// <summary>
8829 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8830 /// </summary>
8831 [JsonPropertyName("height")]
8832 public ElementHeight? Height { get; set; }
8833
8834 /// <summary>
8835 /// Controls how the element should be horizontally aligned.
8836 /// </summary>
8837 [JsonPropertyName("horizontalAlignment")]
8838 public HorizontalAlignment? HorizontalAlignment { get; set; }
8839
8840 /// <summary>
8841 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8842 /// </summary>
8843 [JsonPropertyName("spacing")]
8844 public Spacing? Spacing { get; set; }
8845
8846 /// <summary>
8847 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
8848 /// </summary>
8849 [JsonPropertyName("targetWidth")]
8850 public TargetWidth? TargetWidth { get; set; }
8851
8852 /// <summary>
8853 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8854 /// </summary>
8855 [JsonPropertyName("isSortKey")]
8856 public bool? IsSortKey { get; set; }
8857
8858 /// <summary>
8859 /// The value of the rating. Must be between 0 and max.
8860 /// </summary>
8861 [JsonPropertyName("value")]
8862 public float? Value { get; set; }
8863
8864 /// <summary>
8865 /// The number of "votes" associated with the rating.
8866 /// </summary>
8867 [JsonPropertyName("count")]
8868 public float? Count { get; set; }
8869
8870 /// <summary>
8871 /// The number of stars to display.
8872 /// </summary>
8873 [JsonPropertyName("max")]
8874 public float? Max { get; set; }
8875
8876 /// <summary>
8877 /// The size of the stars.
8878 /// </summary>
8879 [JsonPropertyName("size")]
8880 public RatingSize? Size { get; set; }
8881
8882 /// <summary>
8883 /// The color of the stars.
8884 /// </summary>
8885 [JsonPropertyName("color")]
8886 public RatingColor? Color { get; set; }
8887
8888 /// <summary>
8889 /// The style of the stars.
8890 /// </summary>
8891 [JsonPropertyName("style")]
8892 public RatingStyle? Style { get; set; }
8893
8894 /// <summary>
8895 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8896 /// </summary>
8897 [JsonPropertyName("grid.area")]
8898 public string? GridArea { get; set; }
8899
8900 /// <summary>
8901 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
8902 /// </summary>
8903 [JsonPropertyName("fallback")]
8904 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8905
8906 /// <summary>
8907 /// Serializes this Rating into a JSON string.
8908 /// </summary>
8909 public string Serialize()
8910 {
8911 return JsonSerializer.Serialize(
8912 this,
8913 new JsonSerializerOptions
8914 {
8915 WriteIndented = true,
8916 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8917 }
8918 );
8919 }
8920
8921 public Rating WithId(string value)
8922 {
8923 this.Id = value;
8924 return this;
8925 }
8926
8927 public Rating WithRequires(HostCapabilities value)
8928 {
8929 this.Requires = value;
8930 return this;
8931 }
8932
8933 public Rating WithLang(string value)
8934 {
8935 this.Lang = value;
8936 return this;
8937 }
8938
8939 public Rating WithIsVisible(bool value)
8940 {
8941 this.IsVisible = value;
8942 return this;
8943 }
8944
8945 public Rating WithSeparator(bool value)
8946 {
8947 this.Separator = value;
8948 return this;
8949 }
8950
8951 public Rating WithHeight(ElementHeight value)
8952 {
8953 this.Height = value;
8954 return this;
8955 }
8956
8957 public Rating WithHorizontalAlignment(HorizontalAlignment value)
8958 {
8959 this.HorizontalAlignment = value;
8960 return this;
8961 }
8962
8963 public Rating WithSpacing(Spacing value)
8964 {
8965 this.Spacing = value;
8966 return this;
8967 }
8968
8969 public Rating WithTargetWidth(TargetWidth value)
8970 {
8971 this.TargetWidth = value;
8972 return this;
8973 }
8974
8975 public Rating WithIsSortKey(bool value)
8976 {
8977 this.IsSortKey = value;
8978 return this;
8979 }
8980
8981 public Rating WithValue(float value)
8982 {
8983 this.Value = value;
8984 return this;
8985 }
8986
8987 public Rating WithCount(float value)
8988 {
8989 this.Count = value;
8990 return this;
8991 }
8992
8993 public Rating WithMax(float value)
8994 {
8995 this.Max = value;
8996 return this;
8997 }
8998
8999 public Rating WithSize(RatingSize value)
9000 {
9001 this.Size = value;
9002 return this;
9003 }
9004
9005 public Rating WithColor(RatingColor value)
9006 {
9007 this.Color = value;
9008 return this;
9009 }
9010
9011 public Rating WithStyle(RatingStyle value)
9012 {
9013 this.Style = value;
9014 return this;
9015 }
9016
9017 public Rating WithGridArea(string value)
9018 {
9019 this.GridArea = value;
9020 return this;
9021 }
9022
9023 public Rating WithFallback(IUnion<CardElement, FallbackElement> value)
9024 {
9025 this.Fallback = value;
9026 return this;
9027 }
9028}
9029
9030/// <summary>
9031/// A special type of button with an icon, title and description.
9032/// </summary>
9033public class CompoundButton : CardElement
9034{
9035 /// <summary>
9036 /// Deserializes a JSON string into an object of type CompoundButton.
9037 /// </summary>
9038 public static CompoundButton? Deserialize(string json)
9039 {
9040 return JsonSerializer.Deserialize<CompoundButton>(json);
9041 }
9042
9043 /// <summary>
9044 /// Must be **CompoundButton**.
9045 /// </summary>
9046 [JsonPropertyName("type")]
9047 public string Type { get; } = "CompoundButton";
9048
9049 /// <summary>
9050 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
9051 /// </summary>
9052 [JsonPropertyName("id")]
9053 public string? Id { get; set; }
9054
9055 /// <summary>
9056 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
9057 /// </summary>
9058 [JsonPropertyName("requires")]
9059 public HostCapabilities? Requires { get; set; }
9060
9061 /// <summary>
9062 /// The locale associated with the element.
9063 /// </summary>
9064 [JsonPropertyName("lang")]
9065 public string? Lang { get; set; }
9066
9067 /// <summary>
9068 /// Controls the visibility of the element.
9069 /// </summary>
9070 [JsonPropertyName("isVisible")]
9071 public bool? IsVisible { get; set; }
9072
9073 /// <summary>
9074 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
9075 /// </summary>
9076 [JsonPropertyName("separator")]
9077 public bool? Separator { get; set; }
9078
9079 /// <summary>
9080 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9081 /// </summary>
9082 [JsonPropertyName("height")]
9083 public ElementHeight? Height { get; set; }
9084
9085 /// <summary>
9086 /// Controls how the element should be horizontally aligned.
9087 /// </summary>
9088 [JsonPropertyName("horizontalAlignment")]
9089 public HorizontalAlignment? HorizontalAlignment { get; set; }
9090
9091 /// <summary>
9092 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9093 /// </summary>
9094 [JsonPropertyName("spacing")]
9095 public Spacing? Spacing { get; set; }
9096
9097 /// <summary>
9098 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
9099 /// </summary>
9100 [JsonPropertyName("targetWidth")]
9101 public TargetWidth? TargetWidth { get; set; }
9102
9103 /// <summary>
9104 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9105 /// </summary>
9106 [JsonPropertyName("isSortKey")]
9107 public bool? IsSortKey { get; set; }
9108
9109 /// <summary>
9110 /// The icon to show on the button.
9111 /// </summary>
9112 [JsonPropertyName("icon")]
9113 public IconInfo? Icon { get; set; }
9114
9115 /// <summary>
9116 /// The badge to show on the button.
9117 /// </summary>
9118 [JsonPropertyName("badge")]
9119 public string? Badge { get; set; }
9120
9121 /// <summary>
9122 /// The title of the button.
9123 /// </summary>
9124 [JsonPropertyName("title")]
9125 public string? Title { get; set; }
9126
9127 /// <summary>
9128 /// The description text of the button.
9129 /// </summary>
9130 [JsonPropertyName("description")]
9131 public string? Description { get; set; }
9132
9133 /// <summary>
9134 /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported.
9135 /// </summary>
9136 [JsonPropertyName("selectAction")]
9137 public Action? SelectAction { get; set; }
9138
9139 /// <summary>
9140 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9141 /// </summary>
9142 [JsonPropertyName("grid.area")]
9143 public string? GridArea { get; set; }
9144
9145 /// <summary>
9146 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
9147 /// </summary>
9148 [JsonPropertyName("fallback")]
9149 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9150
9151 /// <summary>
9152 /// Serializes this CompoundButton into a JSON string.
9153 /// </summary>
9154 public string Serialize()
9155 {
9156 return JsonSerializer.Serialize(
9157 this,
9158 new JsonSerializerOptions
9159 {
9160 WriteIndented = true,
9161 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9162 }
9163 );
9164 }
9165
9166 public CompoundButton WithId(string value)
9167 {
9168 this.Id = value;
9169 return this;
9170 }
9171
9172 public CompoundButton WithRequires(HostCapabilities value)
9173 {
9174 this.Requires = value;
9175 return this;
9176 }
9177
9178 public CompoundButton WithLang(string value)
9179 {
9180 this.Lang = value;
9181 return this;
9182 }
9183
9184 public CompoundButton WithIsVisible(bool value)
9185 {
9186 this.IsVisible = value;
9187 return this;
9188 }
9189
9190 public CompoundButton WithSeparator(bool value)
9191 {
9192 this.Separator = value;
9193 return this;
9194 }
9195
9196 public CompoundButton WithHeight(ElementHeight value)
9197 {
9198 this.Height = value;
9199 return this;
9200 }
9201
9202 public CompoundButton WithHorizontalAlignment(HorizontalAlignment value)
9203 {
9204 this.HorizontalAlignment = value;
9205 return this;
9206 }
9207
9208 public CompoundButton WithSpacing(Spacing value)
9209 {
9210 this.Spacing = value;
9211 return this;
9212 }
9213
9214 public CompoundButton WithTargetWidth(TargetWidth value)
9215 {
9216 this.TargetWidth = value;
9217 return this;
9218 }
9219
9220 public CompoundButton WithIsSortKey(bool value)
9221 {
9222 this.IsSortKey = value;
9223 return this;
9224 }
9225
9226 public CompoundButton WithIcon(IconInfo value)
9227 {
9228 this.Icon = value;
9229 return this;
9230 }
9231
9232 public CompoundButton WithBadge(string value)
9233 {
9234 this.Badge = value;
9235 return this;
9236 }
9237
9238 public CompoundButton WithTitle(string value)
9239 {
9240 this.Title = value;
9241 return this;
9242 }
9243
9244 public CompoundButton WithDescription(string value)
9245 {
9246 this.Description = value;
9247 return this;
9248 }
9249
9250 public CompoundButton WithSelectAction(Action value)
9251 {
9252 this.SelectAction = value;
9253 return this;
9254 }
9255
9256 public CompoundButton WithGridArea(string value)
9257 {
9258 this.GridArea = value;
9259 return this;
9260 }
9261
9262 public CompoundButton WithFallback(IUnion<CardElement, FallbackElement> value)
9263 {
9264 this.Fallback = value;
9265 return this;
9266 }
9267}
9268
9269/// <summary>
9270/// Defines information about a Fluent icon and how it should be rendered.
9271/// </summary>
9272public class IconInfo : SerializableObject
9273{
9274 /// <summary>
9275 /// Deserializes a JSON string into an object of type IconInfo.
9276 /// </summary>
9277 public static IconInfo? Deserialize(string json)
9278 {
9279 return JsonSerializer.Deserialize<IconInfo>(json);
9280 }
9281
9282 /// <summary>
9283 /// The name of the icon to display.
9284 /// </summary>
9285 [JsonPropertyName("name")]
9286 public string? Name { get; set; }
9287
9288 /// <summary>
9289 /// The size of the icon.
9290 /// </summary>
9291 [JsonPropertyName("size")]
9292 public IconSize? Size { get; set; }
9293
9294 /// <summary>
9295 /// The style of the icon.
9296 /// </summary>
9297 [JsonPropertyName("style")]
9298 public IconStyle? Style { get; set; }
9299
9300 /// <summary>
9301 /// The color of the icon.
9302 /// </summary>
9303 [JsonPropertyName("color")]
9304 public TextColor? Color { get; set; }
9305
9306 /// <summary>
9307 /// Serializes this IconInfo into a JSON string.
9308 /// </summary>
9309 public string Serialize()
9310 {
9311 return JsonSerializer.Serialize(
9312 this,
9313 new JsonSerializerOptions
9314 {
9315 WriteIndented = true,
9316 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9317 }
9318 );
9319 }
9320
9321 public IconInfo WithName(string value)
9322 {
9323 this.Name = value;
9324 return this;
9325 }
9326
9327 public IconInfo WithSize(IconSize value)
9328 {
9329 this.Size = value;
9330 return this;
9331 }
9332
9333 public IconInfo WithStyle(IconStyle value)
9334 {
9335 this.Style = value;
9336 return this;
9337 }
9338
9339 public IconInfo WithColor(TextColor value)
9340 {
9341 this.Color = value;
9342 return this;
9343 }
9344}
9345
9346/// <summary>
9347/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog).
9348/// </summary>
9349public class Icon : CardElement
9350{
9351 /// <summary>
9352 /// Deserializes a JSON string into an object of type Icon.
9353 /// </summary>
9354 public static Icon? Deserialize(string json)
9355 {
9356 return JsonSerializer.Deserialize<Icon>(json);
9357 }
9358
9359 /// <summary>
9360 /// Must be **Icon**.
9361 /// </summary>
9362 [JsonPropertyName("type")]
9363 public string Type { get; } = "Icon";
9364
9365 /// <summary>
9366 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
9367 /// </summary>
9368 [JsonPropertyName("id")]
9369 public string? Id { get; set; }
9370
9371 /// <summary>
9372 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
9373 /// </summary>
9374 [JsonPropertyName("requires")]
9375 public HostCapabilities? Requires { get; set; }
9376
9377 /// <summary>
9378 /// The locale associated with the element.
9379 /// </summary>
9380 [JsonPropertyName("lang")]
9381 public string? Lang { get; set; }
9382
9383 /// <summary>
9384 /// Controls the visibility of the element.
9385 /// </summary>
9386 [JsonPropertyName("isVisible")]
9387 public bool? IsVisible { get; set; }
9388
9389 /// <summary>
9390 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
9391 /// </summary>
9392 [JsonPropertyName("separator")]
9393 public bool? Separator { get; set; }
9394
9395 /// <summary>
9396 /// Controls how the element should be horizontally aligned.
9397 /// </summary>
9398 [JsonPropertyName("horizontalAlignment")]
9399 public HorizontalAlignment? HorizontalAlignment { get; set; }
9400
9401 /// <summary>
9402 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9403 /// </summary>
9404 [JsonPropertyName("spacing")]
9405 public Spacing? Spacing { get; set; }
9406
9407 /// <summary>
9408 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
9409 /// </summary>
9410 [JsonPropertyName("targetWidth")]
9411 public TargetWidth? TargetWidth { get; set; }
9412
9413 /// <summary>
9414 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9415 /// </summary>
9416 [JsonPropertyName("isSortKey")]
9417 public bool? IsSortKey { get; set; }
9418
9419 /// <summary>
9420 /// The name of the icon to display.
9421 /// </summary>
9422 [JsonPropertyName("name")]
9423 public string? Name { get; set; }
9424
9425 /// <summary>
9426 /// The size of the icon.
9427 /// </summary>
9428 [JsonPropertyName("size")]
9429 public IconSize? Size { get; set; }
9430
9431 /// <summary>
9432 /// The style of the icon.
9433 /// </summary>
9434 [JsonPropertyName("style")]
9435 public IconStyle? Style { get; set; }
9436
9437 /// <summary>
9438 /// The color of the icon.
9439 /// </summary>
9440 [JsonPropertyName("color")]
9441 public TextColor? Color { get; set; }
9442
9443 /// <summary>
9444 /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported.
9445 /// </summary>
9446 [JsonPropertyName("selectAction")]
9447 public Action? SelectAction { get; set; }
9448
9449 /// <summary>
9450 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9451 /// </summary>
9452 [JsonPropertyName("grid.area")]
9453 public string? GridArea { get; set; }
9454
9455 /// <summary>
9456 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
9457 /// </summary>
9458 [JsonPropertyName("fallback")]
9459 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9460
9461 public Icon(string name)
9462 {
9463 this.Name = name;
9464 }
9465
9466 /// <summary>
9467 /// Serializes this Icon into a JSON string.
9468 /// </summary>
9469 public string Serialize()
9470 {
9471 return JsonSerializer.Serialize(
9472 this,
9473 new JsonSerializerOptions
9474 {
9475 WriteIndented = true,
9476 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9477 }
9478 );
9479 }
9480
9481 public Icon WithId(string value)
9482 {
9483 this.Id = value;
9484 return this;
9485 }
9486
9487 public Icon WithRequires(HostCapabilities value)
9488 {
9489 this.Requires = value;
9490 return this;
9491 }
9492
9493 public Icon WithLang(string value)
9494 {
9495 this.Lang = value;
9496 return this;
9497 }
9498
9499 public Icon WithIsVisible(bool value)
9500 {
9501 this.IsVisible = value;
9502 return this;
9503 }
9504
9505 public Icon WithSeparator(bool value)
9506 {
9507 this.Separator = value;
9508 return this;
9509 }
9510
9511 public Icon WithHorizontalAlignment(HorizontalAlignment value)
9512 {
9513 this.HorizontalAlignment = value;
9514 return this;
9515 }
9516
9517 public Icon WithSpacing(Spacing value)
9518 {
9519 this.Spacing = value;
9520 return this;
9521 }
9522
9523 public Icon WithTargetWidth(TargetWidth value)
9524 {
9525 this.TargetWidth = value;
9526 return this;
9527 }
9528
9529 public Icon WithIsSortKey(bool value)
9530 {
9531 this.IsSortKey = value;
9532 return this;
9533 }
9534
9535 public Icon WithName(string value)
9536 {
9537 this.Name = value;
9538 return this;
9539 }
9540
9541 public Icon WithSize(IconSize value)
9542 {
9543 this.Size = value;
9544 return this;
9545 }
9546
9547 public Icon WithStyle(IconStyle value)
9548 {
9549 this.Style = value;
9550 return this;
9551 }
9552
9553 public Icon WithColor(TextColor value)
9554 {
9555 this.Color = value;
9556 return this;
9557 }
9558
9559 public Icon WithSelectAction(Action value)
9560 {
9561 this.SelectAction = value;
9562 return this;
9563 }
9564
9565 public Icon WithGridArea(string value)
9566 {
9567 this.GridArea = value;
9568 return this;
9569 }
9570
9571 public Icon WithFallback(IUnion<CardElement, FallbackElement> value)
9572 {
9573 this.Fallback = value;
9574 return this;
9575 }
9576}
9577
9578/// <summary>
9579/// A carousel with sliding pages.
9580/// </summary>
9581public class Carousel : CardElement
9582{
9583 /// <summary>
9584 /// Deserializes a JSON string into an object of type Carousel.
9585 /// </summary>
9586 public static Carousel? Deserialize(string json)
9587 {
9588 return JsonSerializer.Deserialize<Carousel>(json);
9589 }
9590
9591 /// <summary>
9592 /// Must be **Carousel**.
9593 /// </summary>
9594 [JsonPropertyName("type")]
9595 public string Type { get; } = "Carousel";
9596
9597 /// <summary>
9598 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
9599 /// </summary>
9600 [JsonPropertyName("id")]
9601 public string? Id { get; set; }
9602
9603 /// <summary>
9604 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
9605 /// </summary>
9606 [JsonPropertyName("requires")]
9607 public HostCapabilities? Requires { get; set; }
9608
9609 /// <summary>
9610 /// The locale associated with the element.
9611 /// </summary>
9612 [JsonPropertyName("lang")]
9613 public string? Lang { get; set; }
9614
9615 /// <summary>
9616 /// Controls the visibility of the element.
9617 /// </summary>
9618 [JsonPropertyName("isVisible")]
9619 public bool? IsVisible { get; set; }
9620
9621 /// <summary>
9622 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
9623 /// </summary>
9624 [JsonPropertyName("separator")]
9625 public bool? Separator { get; set; }
9626
9627 /// <summary>
9628 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9629 /// </summary>
9630 [JsonPropertyName("height")]
9631 public ElementHeight? Height { get; set; }
9632
9633 /// <summary>
9634 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9635 /// </summary>
9636 [JsonPropertyName("spacing")]
9637 public Spacing? Spacing { get; set; }
9638
9639 /// <summary>
9640 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
9641 /// </summary>
9642 [JsonPropertyName("targetWidth")]
9643 public TargetWidth? TargetWidth { get; set; }
9644
9645 /// <summary>
9646 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9647 /// </summary>
9648 [JsonPropertyName("isSortKey")]
9649 public bool? IsSortKey { get; set; }
9650
9651 /// <summary>
9652 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
9653 /// </summary>
9654 [JsonPropertyName("bleed")]
9655 public bool? Bleed { get; set; }
9656
9657 /// <summary>
9658 /// The minimum height, in pixels, of the container, in the `<number>px` format.
9659 /// </summary>
9660 [JsonPropertyName("minHeight")]
9661 public string? MinHeight { get; set; }
9662
9663 /// <summary>
9664 /// Controls the type of animation to use to navigate between pages.
9665 /// </summary>
9666 [JsonPropertyName("pageAnimation")]
9667 public CarouselPageAnimation? PageAnimation { get; set; }
9668
9669 /// <summary>
9670 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9671 /// </summary>
9672 [JsonPropertyName("grid.area")]
9673 public string? GridArea { get; set; }
9674
9675 /// <summary>
9676 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
9677 /// </summary>
9678 [JsonPropertyName("fallback")]
9679 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9680
9681 /// <summary>
9682 /// The pages in the carousel.
9683 /// </summary>
9684 [JsonPropertyName("pages")]
9685 public IList<CarouselPage>? Pages { get; set; }
9686
9687 /// <summary>
9688 /// Serializes this Carousel into a JSON string.
9689 /// </summary>
9690 public string Serialize()
9691 {
9692 return JsonSerializer.Serialize(
9693 this,
9694 new JsonSerializerOptions
9695 {
9696 WriteIndented = true,
9697 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9698 }
9699 );
9700 }
9701
9702 public Carousel WithId(string value)
9703 {
9704 this.Id = value;
9705 return this;
9706 }
9707
9708 public Carousel WithRequires(HostCapabilities value)
9709 {
9710 this.Requires = value;
9711 return this;
9712 }
9713
9714 public Carousel WithLang(string value)
9715 {
9716 this.Lang = value;
9717 return this;
9718 }
9719
9720 public Carousel WithIsVisible(bool value)
9721 {
9722 this.IsVisible = value;
9723 return this;
9724 }
9725
9726 public Carousel WithSeparator(bool value)
9727 {
9728 this.Separator = value;
9729 return this;
9730 }
9731
9732 public Carousel WithHeight(ElementHeight value)
9733 {
9734 this.Height = value;
9735 return this;
9736 }
9737
9738 public Carousel WithSpacing(Spacing value)
9739 {
9740 this.Spacing = value;
9741 return this;
9742 }
9743
9744 public Carousel WithTargetWidth(TargetWidth value)
9745 {
9746 this.TargetWidth = value;
9747 return this;
9748 }
9749
9750 public Carousel WithIsSortKey(bool value)
9751 {
9752 this.IsSortKey = value;
9753 return this;
9754 }
9755
9756 public Carousel WithBleed(bool value)
9757 {
9758 this.Bleed = value;
9759 return this;
9760 }
9761
9762 public Carousel WithMinHeight(string value)
9763 {
9764 this.MinHeight = value;
9765 return this;
9766 }
9767
9768 public Carousel WithPageAnimation(CarouselPageAnimation value)
9769 {
9770 this.PageAnimation = value;
9771 return this;
9772 }
9773
9774 public Carousel WithGridArea(string value)
9775 {
9776 this.GridArea = value;
9777 return this;
9778 }
9779
9780 public Carousel WithFallback(IUnion<CardElement, FallbackElement> value)
9781 {
9782 this.Fallback = value;
9783 return this;
9784 }
9785
9786 public Carousel WithPages(params IList<CarouselPage> value)
9787 {
9788 this.Pages = value;
9789 return this;
9790 }
9791}
9792
9793/// <summary>
9794/// A badge element to show an icon and/or text in a compact form over a colored background.
9795/// </summary>
9796public class Badge : CardElement
9797{
9798 /// <summary>
9799 /// Deserializes a JSON string into an object of type Badge.
9800 /// </summary>
9801 public static Badge? Deserialize(string json)
9802 {
9803 return JsonSerializer.Deserialize<Badge>(json);
9804 }
9805
9806 /// <summary>
9807 /// Must be **Badge**.
9808 /// </summary>
9809 [JsonPropertyName("type")]
9810 public string Type { get; } = "Badge";
9811
9812 /// <summary>
9813 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
9814 /// </summary>
9815 [JsonPropertyName("id")]
9816 public string? Id { get; set; }
9817
9818 /// <summary>
9819 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
9820 /// </summary>
9821 [JsonPropertyName("requires")]
9822 public HostCapabilities? Requires { get; set; }
9823
9824 /// <summary>
9825 /// The locale associated with the element.
9826 /// </summary>
9827 [JsonPropertyName("lang")]
9828 public string? Lang { get; set; }
9829
9830 /// <summary>
9831 /// Controls the visibility of the element.
9832 /// </summary>
9833 [JsonPropertyName("isVisible")]
9834 public bool? IsVisible { get; set; }
9835
9836 /// <summary>
9837 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
9838 /// </summary>
9839 [JsonPropertyName("separator")]
9840 public bool? Separator { get; set; }
9841
9842 /// <summary>
9843 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9844 /// </summary>
9845 [JsonPropertyName("height")]
9846 public ElementHeight? Height { get; set; }
9847
9848 /// <summary>
9849 /// Controls how the element should be horizontally aligned.
9850 /// </summary>
9851 [JsonPropertyName("horizontalAlignment")]
9852 public HorizontalAlignment? HorizontalAlignment { get; set; }
9853
9854 /// <summary>
9855 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9856 /// </summary>
9857 [JsonPropertyName("spacing")]
9858 public Spacing? Spacing { get; set; }
9859
9860 /// <summary>
9861 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
9862 /// </summary>
9863 [JsonPropertyName("targetWidth")]
9864 public TargetWidth? TargetWidth { get; set; }
9865
9866 /// <summary>
9867 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9868 /// </summary>
9869 [JsonPropertyName("isSortKey")]
9870 public bool? IsSortKey { get; set; }
9871
9872 /// <summary>
9873 /// The text to display.
9874 /// </summary>
9875 [JsonPropertyName("text")]
9876 public string? Text { get; set; }
9877
9878 /// <summary>
9879 /// The name of an icon from the [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog) to display, in the `<icon-name>[,regular|filled]` format. If the style is not specified, the regular style is used.
9880 /// </summary>
9881 [JsonPropertyName("icon")]
9882 public string? Icon { get; set; }
9883
9884 /// <summary>
9885 /// Controls the position of the icon.
9886 /// </summary>
9887 [JsonPropertyName("iconPosition")]
9888 public BadgeIconPosition? IconPosition { get; set; }
9889
9890 /// <summary>
9891 /// Controls the strength of the background color.
9892 /// </summary>
9893 [JsonPropertyName("appearance")]
9894 public BadgeAppearance? Appearance { get; set; }
9895
9896 /// <summary>
9897 /// The size of the badge.
9898 /// </summary>
9899 [JsonPropertyName("size")]
9900 public BadgeSize? Size { get; set; }
9901
9902 /// <summary>
9903 /// Controls the shape of the badge.
9904 /// </summary>
9905 [JsonPropertyName("shape")]
9906 public BadgeShape? Shape { get; set; }
9907
9908 /// <summary>
9909 /// The style of the badge.
9910 /// </summary>
9911 [JsonPropertyName("style")]
9912 public BadgeStyle? Style { get; set; }
9913
9914 /// <summary>
9915 /// Controls the tooltip text to display when the badge is hovered over.
9916 /// </summary>
9917 [JsonPropertyName("tooltip")]
9918 public string? Tooltip { get; set; }
9919
9920 /// <summary>
9921 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9922 /// </summary>
9923 [JsonPropertyName("grid.area")]
9924 public string? GridArea { get; set; }
9925
9926 /// <summary>
9927 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
9928 /// </summary>
9929 [JsonPropertyName("fallback")]
9930 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9931
9932 /// <summary>
9933 /// Serializes this Badge into a JSON string.
9934 /// </summary>
9935 public string Serialize()
9936 {
9937 return JsonSerializer.Serialize(
9938 this,
9939 new JsonSerializerOptions
9940 {
9941 WriteIndented = true,
9942 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9943 }
9944 );
9945 }
9946
9947 public Badge WithId(string value)
9948 {
9949 this.Id = value;
9950 return this;
9951 }
9952
9953 public Badge WithRequires(HostCapabilities value)
9954 {
9955 this.Requires = value;
9956 return this;
9957 }
9958
9959 public Badge WithLang(string value)
9960 {
9961 this.Lang = value;
9962 return this;
9963 }
9964
9965 public Badge WithIsVisible(bool value)
9966 {
9967 this.IsVisible = value;
9968 return this;
9969 }
9970
9971 public Badge WithSeparator(bool value)
9972 {
9973 this.Separator = value;
9974 return this;
9975 }
9976
9977 public Badge WithHeight(ElementHeight value)
9978 {
9979 this.Height = value;
9980 return this;
9981 }
9982
9983 public Badge WithHorizontalAlignment(HorizontalAlignment value)
9984 {
9985 this.HorizontalAlignment = value;
9986 return this;
9987 }
9988
9989 public Badge WithSpacing(Spacing value)
9990 {
9991 this.Spacing = value;
9992 return this;
9993 }
9994
9995 public Badge WithTargetWidth(TargetWidth value)
9996 {
9997 this.TargetWidth = value;
9998 return this;
9999 }
10000
10001 public Badge WithIsSortKey(bool value)
10002 {
10003 this.IsSortKey = value;
10004 return this;
10005 }
10006
10007 public Badge WithText(string value)
10008 {
10009 this.Text = value;
10010 return this;
10011 }
10012
10013 public Badge WithIcon(string value)
10014 {
10015 this.Icon = value;
10016 return this;
10017 }
10018
10019 public Badge WithIconPosition(BadgeIconPosition value)
10020 {
10021 this.IconPosition = value;
10022 return this;
10023 }
10024
10025 public Badge WithAppearance(BadgeAppearance value)
10026 {
10027 this.Appearance = value;
10028 return this;
10029 }
10030
10031 public Badge WithSize(BadgeSize value)
10032 {
10033 this.Size = value;
10034 return this;
10035 }
10036
10037 public Badge WithShape(BadgeShape value)
10038 {
10039 this.Shape = value;
10040 return this;
10041 }
10042
10043 public Badge WithStyle(BadgeStyle value)
10044 {
10045 this.Style = value;
10046 return this;
10047 }
10048
10049 public Badge WithTooltip(string value)
10050 {
10051 this.Tooltip = value;
10052 return this;
10053 }
10054
10055 public Badge WithGridArea(string value)
10056 {
10057 this.GridArea = value;
10058 return this;
10059 }
10060
10061 public Badge WithFallback(IUnion<CardElement, FallbackElement> value)
10062 {
10063 this.Fallback = value;
10064 return this;
10065 }
10066}
10067
10068/// <summary>
10069/// A donut chart.
10070/// </summary>
10071public class DonutChart : CardElement
10072{
10073 /// <summary>
10074 /// Deserializes a JSON string into an object of type DonutChart.
10075 /// </summary>
10076 public static DonutChart? Deserialize(string json)
10077 {
10078 return JsonSerializer.Deserialize<DonutChart>(json);
10079 }
10080
10081 /// <summary>
10082 /// Must be **Chart.Donut**.
10083 /// </summary>
10084 [JsonPropertyName("type")]
10085 public string Type { get; } = "Chart.Donut";
10086
10087 /// <summary>
10088 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
10089 /// </summary>
10090 [JsonPropertyName("id")]
10091 public string? Id { get; set; }
10092
10093 /// <summary>
10094 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
10095 /// </summary>
10096 [JsonPropertyName("requires")]
10097 public HostCapabilities? Requires { get; set; }
10098
10099 /// <summary>
10100 /// The locale associated with the element.
10101 /// </summary>
10102 [JsonPropertyName("lang")]
10103 public string? Lang { get; set; }
10104
10105 /// <summary>
10106 /// Controls the visibility of the element.
10107 /// </summary>
10108 [JsonPropertyName("isVisible")]
10109 public bool? IsVisible { get; set; }
10110
10111 /// <summary>
10112 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
10113 /// </summary>
10114 [JsonPropertyName("separator")]
10115 public bool? Separator { get; set; }
10116
10117 /// <summary>
10118 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
10119 /// </summary>
10120 [JsonPropertyName("height")]
10121 public ElementHeight? Height { get; set; }
10122
10123 /// <summary>
10124 /// Controls how the element should be horizontally aligned.
10125 /// </summary>
10126 [JsonPropertyName("horizontalAlignment")]
10127 public HorizontalAlignment? HorizontalAlignment { get; set; }
10128
10129 /// <summary>
10130 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10131 /// </summary>
10132 [JsonPropertyName("spacing")]
10133 public Spacing? Spacing { get; set; }
10134
10135 /// <summary>
10136 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
10137 /// </summary>
10138 [JsonPropertyName("targetWidth")]
10139 public TargetWidth? TargetWidth { get; set; }
10140
10141 /// <summary>
10142 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10143 /// </summary>
10144 [JsonPropertyName("isSortKey")]
10145 public bool? IsSortKey { get; set; }
10146
10147 /// <summary>
10148 /// The title of the chart.
10149 /// </summary>
10150 [JsonPropertyName("title")]
10151 public string? Title { get; set; }
10152
10153 /// <summary>
10154 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10155 /// </summary>
10156 [JsonPropertyName("colorSet")]
10157 public ChartColorSet? ColorSet { get; set; }
10158
10159 /// <summary>
10160 /// The data to display in the chart.
10161 /// </summary>
10162 [JsonPropertyName("data")]
10163 public IList<DonutChartData>? Data { get; set; }
10164
10165 /// <summary>
10166 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10167 /// </summary>
10168 [JsonPropertyName("grid.area")]
10169 public string? GridArea { get; set; }
10170
10171 /// <summary>
10172 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
10173 /// </summary>
10174 [JsonPropertyName("fallback")]
10175 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10176
10177 /// <summary>
10178 /// Serializes this DonutChart into a JSON string.
10179 /// </summary>
10180 public string Serialize()
10181 {
10182 return JsonSerializer.Serialize(
10183 this,
10184 new JsonSerializerOptions
10185 {
10186 WriteIndented = true,
10187 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10188 }
10189 );
10190 }
10191
10192 public DonutChart WithId(string value)
10193 {
10194 this.Id = value;
10195 return this;
10196 }
10197
10198 public DonutChart WithRequires(HostCapabilities value)
10199 {
10200 this.Requires = value;
10201 return this;
10202 }
10203
10204 public DonutChart WithLang(string value)
10205 {
10206 this.Lang = value;
10207 return this;
10208 }
10209
10210 public DonutChart WithIsVisible(bool value)
10211 {
10212 this.IsVisible = value;
10213 return this;
10214 }
10215
10216 public DonutChart WithSeparator(bool value)
10217 {
10218 this.Separator = value;
10219 return this;
10220 }
10221
10222 public DonutChart WithHeight(ElementHeight value)
10223 {
10224 this.Height = value;
10225 return this;
10226 }
10227
10228 public DonutChart WithHorizontalAlignment(HorizontalAlignment value)
10229 {
10230 this.HorizontalAlignment = value;
10231 return this;
10232 }
10233
10234 public DonutChart WithSpacing(Spacing value)
10235 {
10236 this.Spacing = value;
10237 return this;
10238 }
10239
10240 public DonutChart WithTargetWidth(TargetWidth value)
10241 {
10242 this.TargetWidth = value;
10243 return this;
10244 }
10245
10246 public DonutChart WithIsSortKey(bool value)
10247 {
10248 this.IsSortKey = value;
10249 return this;
10250 }
10251
10252 public DonutChart WithTitle(string value)
10253 {
10254 this.Title = value;
10255 return this;
10256 }
10257
10258 public DonutChart WithColorSet(ChartColorSet value)
10259 {
10260 this.ColorSet = value;
10261 return this;
10262 }
10263
10264 public DonutChart WithData(params IList<DonutChartData> value)
10265 {
10266 this.Data = value;
10267 return this;
10268 }
10269
10270 public DonutChart WithGridArea(string value)
10271 {
10272 this.GridArea = value;
10273 return this;
10274 }
10275
10276 public DonutChart WithFallback(IUnion<CardElement, FallbackElement> value)
10277 {
10278 this.Fallback = value;
10279 return this;
10280 }
10281}
10282
10283/// <summary>
10284/// A data point in a Donut chart.
10285/// </summary>
10286public class DonutChartData : SerializableObject
10287{
10288 /// <summary>
10289 /// Deserializes a JSON string into an object of type DonutChartData.
10290 /// </summary>
10291 public static DonutChartData? Deserialize(string json)
10292 {
10293 return JsonSerializer.Deserialize<DonutChartData>(json);
10294 }
10295
10296 /// <summary>
10297 /// The legend of the chart.
10298 /// </summary>
10299 [JsonPropertyName("legend")]
10300 public string? Legend { get; set; }
10301
10302 /// <summary>
10303 /// The value associated with the data point.
10304 /// </summary>
10305 [JsonPropertyName("value")]
10306 public float? Value { get; set; }
10307
10308 /// <summary>
10309 /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10310 /// </summary>
10311 [JsonPropertyName("color")]
10312 public ChartColor? Color { get; set; }
10313
10314 /// <summary>
10315 /// Serializes this DonutChartData into a JSON string.
10316 /// </summary>
10317 public string Serialize()
10318 {
10319 return JsonSerializer.Serialize(
10320 this,
10321 new JsonSerializerOptions
10322 {
10323 WriteIndented = true,
10324 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10325 }
10326 );
10327 }
10328
10329 public DonutChartData WithLegend(string value)
10330 {
10331 this.Legend = value;
10332 return this;
10333 }
10334
10335 public DonutChartData WithValue(float value)
10336 {
10337 this.Value = value;
10338 return this;
10339 }
10340
10341 public DonutChartData WithColor(ChartColor value)
10342 {
10343 this.Color = value;
10344 return this;
10345 }
10346}
10347
10348/// <summary>
10349/// A pie chart.
10350/// </summary>
10351public class PieChart : CardElement
10352{
10353 /// <summary>
10354 /// Deserializes a JSON string into an object of type PieChart.
10355 /// </summary>
10356 public static PieChart? Deserialize(string json)
10357 {
10358 return JsonSerializer.Deserialize<PieChart>(json);
10359 }
10360
10361 /// <summary>
10362 /// Must be **Chart.Pie**.
10363 /// </summary>
10364 [JsonPropertyName("type")]
10365 public string Type { get; } = "Chart.Pie";
10366
10367 /// <summary>
10368 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
10369 /// </summary>
10370 [JsonPropertyName("id")]
10371 public string? Id { get; set; }
10372
10373 /// <summary>
10374 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
10375 /// </summary>
10376 [JsonPropertyName("requires")]
10377 public HostCapabilities? Requires { get; set; }
10378
10379 /// <summary>
10380 /// The locale associated with the element.
10381 /// </summary>
10382 [JsonPropertyName("lang")]
10383 public string? Lang { get; set; }
10384
10385 /// <summary>
10386 /// Controls the visibility of the element.
10387 /// </summary>
10388 [JsonPropertyName("isVisible")]
10389 public bool? IsVisible { get; set; }
10390
10391 /// <summary>
10392 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
10393 /// </summary>
10394 [JsonPropertyName("separator")]
10395 public bool? Separator { get; set; }
10396
10397 /// <summary>
10398 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
10399 /// </summary>
10400 [JsonPropertyName("height")]
10401 public ElementHeight? Height { get; set; }
10402
10403 /// <summary>
10404 /// Controls how the element should be horizontally aligned.
10405 /// </summary>
10406 [JsonPropertyName("horizontalAlignment")]
10407 public HorizontalAlignment? HorizontalAlignment { get; set; }
10408
10409 /// <summary>
10410 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10411 /// </summary>
10412 [JsonPropertyName("spacing")]
10413 public Spacing? Spacing { get; set; }
10414
10415 /// <summary>
10416 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
10417 /// </summary>
10418 [JsonPropertyName("targetWidth")]
10419 public TargetWidth? TargetWidth { get; set; }
10420
10421 /// <summary>
10422 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10423 /// </summary>
10424 [JsonPropertyName("isSortKey")]
10425 public bool? IsSortKey { get; set; }
10426
10427 /// <summary>
10428 /// The title of the chart.
10429 /// </summary>
10430 [JsonPropertyName("title")]
10431 public string? Title { get; set; }
10432
10433 /// <summary>
10434 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10435 /// </summary>
10436 [JsonPropertyName("colorSet")]
10437 public ChartColorSet? ColorSet { get; set; }
10438
10439 /// <summary>
10440 /// The data to display in the chart.
10441 /// </summary>
10442 [JsonPropertyName("data")]
10443 public IList<DonutChartData>? Data { get; set; }
10444
10445 /// <summary>
10446 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10447 /// </summary>
10448 [JsonPropertyName("grid.area")]
10449 public string? GridArea { get; set; }
10450
10451 /// <summary>
10452 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
10453 /// </summary>
10454 [JsonPropertyName("fallback")]
10455 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10456
10457 /// <summary>
10458 /// Serializes this PieChart into a JSON string.
10459 /// </summary>
10460 public string Serialize()
10461 {
10462 return JsonSerializer.Serialize(
10463 this,
10464 new JsonSerializerOptions
10465 {
10466 WriteIndented = true,
10467 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10468 }
10469 );
10470 }
10471
10472 public PieChart WithId(string value)
10473 {
10474 this.Id = value;
10475 return this;
10476 }
10477
10478 public PieChart WithRequires(HostCapabilities value)
10479 {
10480 this.Requires = value;
10481 return this;
10482 }
10483
10484 public PieChart WithLang(string value)
10485 {
10486 this.Lang = value;
10487 return this;
10488 }
10489
10490 public PieChart WithIsVisible(bool value)
10491 {
10492 this.IsVisible = value;
10493 return this;
10494 }
10495
10496 public PieChart WithSeparator(bool value)
10497 {
10498 this.Separator = value;
10499 return this;
10500 }
10501
10502 public PieChart WithHeight(ElementHeight value)
10503 {
10504 this.Height = value;
10505 return this;
10506 }
10507
10508 public PieChart WithHorizontalAlignment(HorizontalAlignment value)
10509 {
10510 this.HorizontalAlignment = value;
10511 return this;
10512 }
10513
10514 public PieChart WithSpacing(Spacing value)
10515 {
10516 this.Spacing = value;
10517 return this;
10518 }
10519
10520 public PieChart WithTargetWidth(TargetWidth value)
10521 {
10522 this.TargetWidth = value;
10523 return this;
10524 }
10525
10526 public PieChart WithIsSortKey(bool value)
10527 {
10528 this.IsSortKey = value;
10529 return this;
10530 }
10531
10532 public PieChart WithTitle(string value)
10533 {
10534 this.Title = value;
10535 return this;
10536 }
10537
10538 public PieChart WithColorSet(ChartColorSet value)
10539 {
10540 this.ColorSet = value;
10541 return this;
10542 }
10543
10544 public PieChart WithData(params IList<DonutChartData> value)
10545 {
10546 this.Data = value;
10547 return this;
10548 }
10549
10550 public PieChart WithGridArea(string value)
10551 {
10552 this.GridArea = value;
10553 return this;
10554 }
10555
10556 public PieChart WithFallback(IUnion<CardElement, FallbackElement> value)
10557 {
10558 this.Fallback = value;
10559 return this;
10560 }
10561}
10562
10563/// <summary>
10564/// A grouped vertical bar chart.
10565/// </summary>
10566public class GroupedVerticalBarChart : CardElement
10567{
10568 /// <summary>
10569 /// Deserializes a JSON string into an object of type GroupedVerticalBarChart.
10570 /// </summary>
10571 public static GroupedVerticalBarChart? Deserialize(string json)
10572 {
10573 return JsonSerializer.Deserialize<GroupedVerticalBarChart>(json);
10574 }
10575
10576 /// <summary>
10577 /// Must be **Chart.VerticalBar.Grouped**.
10578 /// </summary>
10579 [JsonPropertyName("type")]
10580 public string Type { get; } = "Chart.VerticalBar.Grouped";
10581
10582 /// <summary>
10583 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
10584 /// </summary>
10585 [JsonPropertyName("id")]
10586 public string? Id { get; set; }
10587
10588 /// <summary>
10589 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
10590 /// </summary>
10591 [JsonPropertyName("requires")]
10592 public HostCapabilities? Requires { get; set; }
10593
10594 /// <summary>
10595 /// The locale associated with the element.
10596 /// </summary>
10597 [JsonPropertyName("lang")]
10598 public string? Lang { get; set; }
10599
10600 /// <summary>
10601 /// Controls the visibility of the element.
10602 /// </summary>
10603 [JsonPropertyName("isVisible")]
10604 public bool? IsVisible { get; set; }
10605
10606 /// <summary>
10607 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
10608 /// </summary>
10609 [JsonPropertyName("separator")]
10610 public bool? Separator { get; set; }
10611
10612 /// <summary>
10613 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
10614 /// </summary>
10615 [JsonPropertyName("height")]
10616 public ElementHeight? Height { get; set; }
10617
10618 /// <summary>
10619 /// Controls how the element should be horizontally aligned.
10620 /// </summary>
10621 [JsonPropertyName("horizontalAlignment")]
10622 public HorizontalAlignment? HorizontalAlignment { get; set; }
10623
10624 /// <summary>
10625 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10626 /// </summary>
10627 [JsonPropertyName("spacing")]
10628 public Spacing? Spacing { get; set; }
10629
10630 /// <summary>
10631 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
10632 /// </summary>
10633 [JsonPropertyName("targetWidth")]
10634 public TargetWidth? TargetWidth { get; set; }
10635
10636 /// <summary>
10637 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10638 /// </summary>
10639 [JsonPropertyName("isSortKey")]
10640 public bool? IsSortKey { get; set; }
10641
10642 /// <summary>
10643 /// The title of the chart.
10644 /// </summary>
10645 [JsonPropertyName("title")]
10646 public string? Title { get; set; }
10647
10648 /// <summary>
10649 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10650 /// </summary>
10651 [JsonPropertyName("colorSet")]
10652 public ChartColorSet? ColorSet { get; set; }
10653
10654 /// <summary>
10655 /// The title of the x axis.
10656 /// </summary>
10657 [JsonPropertyName("xAxisTitle")]
10658 public string? XAxisTitle { get; set; }
10659
10660 /// <summary>
10661 /// The title of the y axis.
10662 /// </summary>
10663 [JsonPropertyName("yAxisTitle")]
10664 public string? YAxisTitle { get; set; }
10665
10666 /// <summary>
10667 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10668 /// </summary>
10669 [JsonPropertyName("color")]
10670 public ChartColor? Color { get; set; }
10671
10672 /// <summary>
10673 /// Controls if bars in the chart should be displayed as stacks instead of groups.
10674 ///
10675 /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values.
10676 /// </summary>
10677 [JsonPropertyName("stacked")]
10678 public bool? Stacked { get; set; }
10679
10680 /// <summary>
10681 /// The data points in a series.
10682 /// </summary>
10683 [JsonPropertyName("data")]
10684 public IList<GroupedVerticalBarChartData>? Data { get; set; }
10685
10686 /// <summary>
10687 /// Controls if values should be displayed on each bar.
10688 /// </summary>
10689 [JsonPropertyName("showBarValues")]
10690 public bool? ShowBarValues { get; set; }
10691
10692 /// <summary>
10693 /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
10694 ///
10695 /// `yMin` is ignored if `stacked` is set to `true`.
10696 /// </summary>
10697 [JsonPropertyName("yMin")]
10698 public float? YMin { get; set; }
10699
10700 /// <summary>
10701 /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
10702 ///
10703 /// `yMax` is ignored if `stacked` is set to `true`.
10704 /// </summary>
10705 [JsonPropertyName("yMax")]
10706 public float? YMax { get; set; }
10707
10708 /// <summary>
10709 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10710 /// </summary>
10711 [JsonPropertyName("grid.area")]
10712 public string? GridArea { get; set; }
10713
10714 /// <summary>
10715 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
10716 /// </summary>
10717 [JsonPropertyName("fallback")]
10718 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10719
10720 /// <summary>
10721 /// Serializes this GroupedVerticalBarChart into a JSON string.
10722 /// </summary>
10723 public string Serialize()
10724 {
10725 return JsonSerializer.Serialize(
10726 this,
10727 new JsonSerializerOptions
10728 {
10729 WriteIndented = true,
10730 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10731 }
10732 );
10733 }
10734
10735 public GroupedVerticalBarChart WithId(string value)
10736 {
10737 this.Id = value;
10738 return this;
10739 }
10740
10741 public GroupedVerticalBarChart WithRequires(HostCapabilities value)
10742 {
10743 this.Requires = value;
10744 return this;
10745 }
10746
10747 public GroupedVerticalBarChart WithLang(string value)
10748 {
10749 this.Lang = value;
10750 return this;
10751 }
10752
10753 public GroupedVerticalBarChart WithIsVisible(bool value)
10754 {
10755 this.IsVisible = value;
10756 return this;
10757 }
10758
10759 public GroupedVerticalBarChart WithSeparator(bool value)
10760 {
10761 this.Separator = value;
10762 return this;
10763 }
10764
10765 public GroupedVerticalBarChart WithHeight(ElementHeight value)
10766 {
10767 this.Height = value;
10768 return this;
10769 }
10770
10771 public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value)
10772 {
10773 this.HorizontalAlignment = value;
10774 return this;
10775 }
10776
10777 public GroupedVerticalBarChart WithSpacing(Spacing value)
10778 {
10779 this.Spacing = value;
10780 return this;
10781 }
10782
10783 public GroupedVerticalBarChart WithTargetWidth(TargetWidth value)
10784 {
10785 this.TargetWidth = value;
10786 return this;
10787 }
10788
10789 public GroupedVerticalBarChart WithIsSortKey(bool value)
10790 {
10791 this.IsSortKey = value;
10792 return this;
10793 }
10794
10795 public GroupedVerticalBarChart WithTitle(string value)
10796 {
10797 this.Title = value;
10798 return this;
10799 }
10800
10801 public GroupedVerticalBarChart WithColorSet(ChartColorSet value)
10802 {
10803 this.ColorSet = value;
10804 return this;
10805 }
10806
10807 public GroupedVerticalBarChart WithXAxisTitle(string value)
10808 {
10809 this.XAxisTitle = value;
10810 return this;
10811 }
10812
10813 public GroupedVerticalBarChart WithYAxisTitle(string value)
10814 {
10815 this.YAxisTitle = value;
10816 return this;
10817 }
10818
10819 public GroupedVerticalBarChart WithColor(ChartColor value)
10820 {
10821 this.Color = value;
10822 return this;
10823 }
10824
10825 public GroupedVerticalBarChart WithStacked(bool value)
10826 {
10827 this.Stacked = value;
10828 return this;
10829 }
10830
10831 public GroupedVerticalBarChart WithData(params IList<GroupedVerticalBarChartData> value)
10832 {
10833 this.Data = value;
10834 return this;
10835 }
10836
10837 public GroupedVerticalBarChart WithShowBarValues(bool value)
10838 {
10839 this.ShowBarValues = value;
10840 return this;
10841 }
10842
10843 public GroupedVerticalBarChart WithYMin(float value)
10844 {
10845 this.YMin = value;
10846 return this;
10847 }
10848
10849 public GroupedVerticalBarChart WithYMax(float value)
10850 {
10851 this.YMax = value;
10852 return this;
10853 }
10854
10855 public GroupedVerticalBarChart WithGridArea(string value)
10856 {
10857 this.GridArea = value;
10858 return this;
10859 }
10860
10861 public GroupedVerticalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
10862 {
10863 this.Fallback = value;
10864 return this;
10865 }
10866}
10867
10868/// <summary>
10869/// Represents a series of data points.
10870/// </summary>
10871public class GroupedVerticalBarChartData : SerializableObject
10872{
10873 /// <summary>
10874 /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData.
10875 /// </summary>
10876 public static GroupedVerticalBarChartData? Deserialize(string json)
10877 {
10878 return JsonSerializer.Deserialize<GroupedVerticalBarChartData>(json);
10879 }
10880
10881 /// <summary>
10882 /// The legend of the chart.
10883 /// </summary>
10884 [JsonPropertyName("legend")]
10885 public string? Legend { get; set; }
10886
10887 /// <summary>
10888 /// The data points in the series.
10889 /// </summary>
10890 [JsonPropertyName("values")]
10891 public IList<BarChartDataValue>? Values { get; set; }
10892
10893 /// <summary>
10894 /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
10895 /// </summary>
10896 [JsonPropertyName("color")]
10897 public ChartColor? Color { get; set; }
10898
10899 /// <summary>
10900 /// Serializes this GroupedVerticalBarChartData into a JSON string.
10901 /// </summary>
10902 public string Serialize()
10903 {
10904 return JsonSerializer.Serialize(
10905 this,
10906 new JsonSerializerOptions
10907 {
10908 WriteIndented = true,
10909 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10910 }
10911 );
10912 }
10913
10914 public GroupedVerticalBarChartData WithLegend(string value)
10915 {
10916 this.Legend = value;
10917 return this;
10918 }
10919
10920 public GroupedVerticalBarChartData WithValues(params IList<BarChartDataValue> value)
10921 {
10922 this.Values = value;
10923 return this;
10924 }
10925
10926 public GroupedVerticalBarChartData WithColor(ChartColor value)
10927 {
10928 this.Color = value;
10929 return this;
10930 }
10931}
10932
10933/// <summary>
10934/// A single data point in a bar chart.
10935/// </summary>
10936public class BarChartDataValue : SerializableObject
10937{
10938 /// <summary>
10939 /// Deserializes a JSON string into an object of type BarChartDataValue.
10940 /// </summary>
10941 public static BarChartDataValue? Deserialize(string json)
10942 {
10943 return JsonSerializer.Deserialize<BarChartDataValue>(json);
10944 }
10945
10946 /// <summary>
10947 /// The x axis value of the data point.
10948 /// </summary>
10949 [JsonPropertyName("x")]
10950 public string? X { get; set; }
10951
10952 /// <summary>
10953 /// The y axis value of the data point.
10954 /// </summary>
10955 [JsonPropertyName("y")]
10956 public float? Y { get; set; }
10957
10958 /// <summary>
10959 /// Serializes this BarChartDataValue into a JSON string.
10960 /// </summary>
10961 public string Serialize()
10962 {
10963 return JsonSerializer.Serialize(
10964 this,
10965 new JsonSerializerOptions
10966 {
10967 WriteIndented = true,
10968 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10969 }
10970 );
10971 }
10972
10973 public BarChartDataValue WithX(string value)
10974 {
10975 this.X = value;
10976 return this;
10977 }
10978
10979 public BarChartDataValue WithY(float value)
10980 {
10981 this.Y = value;
10982 return this;
10983 }
10984}
10985
10986/// <summary>
10987/// A vertical bar chart.
10988/// </summary>
10989public class VerticalBarChart : CardElement
10990{
10991 /// <summary>
10992 /// Deserializes a JSON string into an object of type VerticalBarChart.
10993 /// </summary>
10994 public static VerticalBarChart? Deserialize(string json)
10995 {
10996 return JsonSerializer.Deserialize<VerticalBarChart>(json);
10997 }
10998
10999 /// <summary>
11000 /// Must be **Chart.VerticalBar**.
11001 /// </summary>
11002 [JsonPropertyName("type")]
11003 public string Type { get; } = "Chart.VerticalBar";
11004
11005 /// <summary>
11006 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
11007 /// </summary>
11008 [JsonPropertyName("id")]
11009 public string? Id { get; set; }
11010
11011 /// <summary>
11012 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
11013 /// </summary>
11014 [JsonPropertyName("requires")]
11015 public HostCapabilities? Requires { get; set; }
11016
11017 /// <summary>
11018 /// The locale associated with the element.
11019 /// </summary>
11020 [JsonPropertyName("lang")]
11021 public string? Lang { get; set; }
11022
11023 /// <summary>
11024 /// Controls the visibility of the element.
11025 /// </summary>
11026 [JsonPropertyName("isVisible")]
11027 public bool? IsVisible { get; set; }
11028
11029 /// <summary>
11030 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
11031 /// </summary>
11032 [JsonPropertyName("separator")]
11033 public bool? Separator { get; set; }
11034
11035 /// <summary>
11036 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11037 /// </summary>
11038 [JsonPropertyName("height")]
11039 public ElementHeight? Height { get; set; }
11040
11041 /// <summary>
11042 /// Controls how the element should be horizontally aligned.
11043 /// </summary>
11044 [JsonPropertyName("horizontalAlignment")]
11045 public HorizontalAlignment? HorizontalAlignment { get; set; }
11046
11047 /// <summary>
11048 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11049 /// </summary>
11050 [JsonPropertyName("spacing")]
11051 public Spacing? Spacing { get; set; }
11052
11053 /// <summary>
11054 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
11055 /// </summary>
11056 [JsonPropertyName("targetWidth")]
11057 public TargetWidth? TargetWidth { get; set; }
11058
11059 /// <summary>
11060 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11061 /// </summary>
11062 [JsonPropertyName("isSortKey")]
11063 public bool? IsSortKey { get; set; }
11064
11065 /// <summary>
11066 /// The title of the chart.
11067 /// </summary>
11068 [JsonPropertyName("title")]
11069 public string? Title { get; set; }
11070
11071 /// <summary>
11072 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11073 /// </summary>
11074 [JsonPropertyName("colorSet")]
11075 public ChartColorSet? ColorSet { get; set; }
11076
11077 /// <summary>
11078 /// The title of the x axis.
11079 /// </summary>
11080 [JsonPropertyName("xAxisTitle")]
11081 public string? XAxisTitle { get; set; }
11082
11083 /// <summary>
11084 /// The title of the y axis.
11085 /// </summary>
11086 [JsonPropertyName("yAxisTitle")]
11087 public string? YAxisTitle { get; set; }
11088
11089 /// <summary>
11090 /// The data to display in the chart.
11091 /// </summary>
11092 [JsonPropertyName("data")]
11093 public IList<VerticalBarChartDataValue>? Data { get; set; }
11094
11095 /// <summary>
11096 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11097 /// </summary>
11098 [JsonPropertyName("color")]
11099 public ChartColor? Color { get; set; }
11100
11101 /// <summary>
11102 /// Controls if the bar values should be displayed.
11103 /// </summary>
11104 [JsonPropertyName("showBarValues")]
11105 public bool? ShowBarValues { get; set; }
11106
11107 /// <summary>
11108 /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
11109 /// </summary>
11110 [JsonPropertyName("yMin")]
11111 public float? YMin { get; set; }
11112
11113 /// <summary>
11114 /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
11115 /// </summary>
11116 [JsonPropertyName("yMax")]
11117 public float? YMax { get; set; }
11118
11119 /// <summary>
11120 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11121 /// </summary>
11122 [JsonPropertyName("grid.area")]
11123 public string? GridArea { get; set; }
11124
11125 /// <summary>
11126 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
11127 /// </summary>
11128 [JsonPropertyName("fallback")]
11129 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11130
11131 /// <summary>
11132 /// Serializes this VerticalBarChart into a JSON string.
11133 /// </summary>
11134 public string Serialize()
11135 {
11136 return JsonSerializer.Serialize(
11137 this,
11138 new JsonSerializerOptions
11139 {
11140 WriteIndented = true,
11141 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11142 }
11143 );
11144 }
11145
11146 public VerticalBarChart WithId(string value)
11147 {
11148 this.Id = value;
11149 return this;
11150 }
11151
11152 public VerticalBarChart WithRequires(HostCapabilities value)
11153 {
11154 this.Requires = value;
11155 return this;
11156 }
11157
11158 public VerticalBarChart WithLang(string value)
11159 {
11160 this.Lang = value;
11161 return this;
11162 }
11163
11164 public VerticalBarChart WithIsVisible(bool value)
11165 {
11166 this.IsVisible = value;
11167 return this;
11168 }
11169
11170 public VerticalBarChart WithSeparator(bool value)
11171 {
11172 this.Separator = value;
11173 return this;
11174 }
11175
11176 public VerticalBarChart WithHeight(ElementHeight value)
11177 {
11178 this.Height = value;
11179 return this;
11180 }
11181
11182 public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value)
11183 {
11184 this.HorizontalAlignment = value;
11185 return this;
11186 }
11187
11188 public VerticalBarChart WithSpacing(Spacing value)
11189 {
11190 this.Spacing = value;
11191 return this;
11192 }
11193
11194 public VerticalBarChart WithTargetWidth(TargetWidth value)
11195 {
11196 this.TargetWidth = value;
11197 return this;
11198 }
11199
11200 public VerticalBarChart WithIsSortKey(bool value)
11201 {
11202 this.IsSortKey = value;
11203 return this;
11204 }
11205
11206 public VerticalBarChart WithTitle(string value)
11207 {
11208 this.Title = value;
11209 return this;
11210 }
11211
11212 public VerticalBarChart WithColorSet(ChartColorSet value)
11213 {
11214 this.ColorSet = value;
11215 return this;
11216 }
11217
11218 public VerticalBarChart WithXAxisTitle(string value)
11219 {
11220 this.XAxisTitle = value;
11221 return this;
11222 }
11223
11224 public VerticalBarChart WithYAxisTitle(string value)
11225 {
11226 this.YAxisTitle = value;
11227 return this;
11228 }
11229
11230 public VerticalBarChart WithData(params IList<VerticalBarChartDataValue> value)
11231 {
11232 this.Data = value;
11233 return this;
11234 }
11235
11236 public VerticalBarChart WithColor(ChartColor value)
11237 {
11238 this.Color = value;
11239 return this;
11240 }
11241
11242 public VerticalBarChart WithShowBarValues(bool value)
11243 {
11244 this.ShowBarValues = value;
11245 return this;
11246 }
11247
11248 public VerticalBarChart WithYMin(float value)
11249 {
11250 this.YMin = value;
11251 return this;
11252 }
11253
11254 public VerticalBarChart WithYMax(float value)
11255 {
11256 this.YMax = value;
11257 return this;
11258 }
11259
11260 public VerticalBarChart WithGridArea(string value)
11261 {
11262 this.GridArea = value;
11263 return this;
11264 }
11265
11266 public VerticalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
11267 {
11268 this.Fallback = value;
11269 return this;
11270 }
11271}
11272
11273/// <summary>
11274/// Represents a data point in a vertical bar chart.
11275/// </summary>
11276public class VerticalBarChartDataValue : SerializableObject
11277{
11278 /// <summary>
11279 /// Deserializes a JSON string into an object of type VerticalBarChartDataValue.
11280 /// </summary>
11281 public static VerticalBarChartDataValue? Deserialize(string json)
11282 {
11283 return JsonSerializer.Deserialize<VerticalBarChartDataValue>(json);
11284 }
11285
11286 /// <summary>
11287 /// The x axis value of the data point.
11288 /// </summary>
11289 [JsonPropertyName("x")]
11290 public IUnion<string, float>? X { get; set; }
11291
11292 /// <summary>
11293 /// The y axis value of the data point.
11294 /// </summary>
11295 [JsonPropertyName("y")]
11296 public float? Y { get; set; }
11297
11298 /// <summary>
11299 /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11300 /// </summary>
11301 [JsonPropertyName("color")]
11302 public ChartColor? Color { get; set; }
11303
11304 /// <summary>
11305 /// Serializes this VerticalBarChartDataValue into a JSON string.
11306 /// </summary>
11307 public string Serialize()
11308 {
11309 return JsonSerializer.Serialize(
11310 this,
11311 new JsonSerializerOptions
11312 {
11313 WriteIndented = true,
11314 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11315 }
11316 );
11317 }
11318
11319 public VerticalBarChartDataValue WithX(IUnion<string, float> value)
11320 {
11321 this.X = value;
11322 return this;
11323 }
11324
11325 public VerticalBarChartDataValue WithY(float value)
11326 {
11327 this.Y = value;
11328 return this;
11329 }
11330
11331 public VerticalBarChartDataValue WithColor(ChartColor value)
11332 {
11333 this.Color = value;
11334 return this;
11335 }
11336}
11337
11338/// <summary>
11339/// A horizontal bar chart.
11340/// </summary>
11341public class HorizontalBarChart : CardElement
11342{
11343 /// <summary>
11344 /// Deserializes a JSON string into an object of type HorizontalBarChart.
11345 /// </summary>
11346 public static HorizontalBarChart? Deserialize(string json)
11347 {
11348 return JsonSerializer.Deserialize<HorizontalBarChart>(json);
11349 }
11350
11351 /// <summary>
11352 /// Must be **Chart.HorizontalBar**.
11353 /// </summary>
11354 [JsonPropertyName("type")]
11355 public string Type { get; } = "Chart.HorizontalBar";
11356
11357 /// <summary>
11358 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
11359 /// </summary>
11360 [JsonPropertyName("id")]
11361 public string? Id { get; set; }
11362
11363 /// <summary>
11364 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
11365 /// </summary>
11366 [JsonPropertyName("requires")]
11367 public HostCapabilities? Requires { get; set; }
11368
11369 /// <summary>
11370 /// The locale associated with the element.
11371 /// </summary>
11372 [JsonPropertyName("lang")]
11373 public string? Lang { get; set; }
11374
11375 /// <summary>
11376 /// Controls the visibility of the element.
11377 /// </summary>
11378 [JsonPropertyName("isVisible")]
11379 public bool? IsVisible { get; set; }
11380
11381 /// <summary>
11382 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
11383 /// </summary>
11384 [JsonPropertyName("separator")]
11385 public bool? Separator { get; set; }
11386
11387 /// <summary>
11388 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11389 /// </summary>
11390 [JsonPropertyName("height")]
11391 public ElementHeight? Height { get; set; }
11392
11393 /// <summary>
11394 /// Controls how the element should be horizontally aligned.
11395 /// </summary>
11396 [JsonPropertyName("horizontalAlignment")]
11397 public HorizontalAlignment? HorizontalAlignment { get; set; }
11398
11399 /// <summary>
11400 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11401 /// </summary>
11402 [JsonPropertyName("spacing")]
11403 public Spacing? Spacing { get; set; }
11404
11405 /// <summary>
11406 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
11407 /// </summary>
11408 [JsonPropertyName("targetWidth")]
11409 public TargetWidth? TargetWidth { get; set; }
11410
11411 /// <summary>
11412 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11413 /// </summary>
11414 [JsonPropertyName("isSortKey")]
11415 public bool? IsSortKey { get; set; }
11416
11417 /// <summary>
11418 /// The title of the chart.
11419 /// </summary>
11420 [JsonPropertyName("title")]
11421 public string? Title { get; set; }
11422
11423 /// <summary>
11424 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11425 /// </summary>
11426 [JsonPropertyName("colorSet")]
11427 public ChartColorSet? ColorSet { get; set; }
11428
11429 /// <summary>
11430 /// The title of the x axis.
11431 /// </summary>
11432 [JsonPropertyName("xAxisTitle")]
11433 public string? XAxisTitle { get; set; }
11434
11435 /// <summary>
11436 /// The title of the y axis.
11437 /// </summary>
11438 [JsonPropertyName("yAxisTitle")]
11439 public string? YAxisTitle { get; set; }
11440
11441 /// <summary>
11442 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11443 /// </summary>
11444 [JsonPropertyName("color")]
11445 public ChartColor? Color { get; set; }
11446
11447 /// <summary>
11448 /// The data points in the chart.
11449 /// </summary>
11450 [JsonPropertyName("data")]
11451 public IList<HorizontalBarChartDataValue>? Data { get; set; }
11452
11453 /// <summary>
11454 /// Controls how the chart should be visually laid out.
11455 /// </summary>
11456 [JsonPropertyName("displayMode")]
11457 public HorizontalBarChartDisplayMode? DisplayMode { get; set; }
11458
11459 /// <summary>
11460 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11461 /// </summary>
11462 [JsonPropertyName("grid.area")]
11463 public string? GridArea { get; set; }
11464
11465 /// <summary>
11466 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
11467 /// </summary>
11468 [JsonPropertyName("fallback")]
11469 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11470
11471 /// <summary>
11472 /// Serializes this HorizontalBarChart into a JSON string.
11473 /// </summary>
11474 public string Serialize()
11475 {
11476 return JsonSerializer.Serialize(
11477 this,
11478 new JsonSerializerOptions
11479 {
11480 WriteIndented = true,
11481 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11482 }
11483 );
11484 }
11485
11486 public HorizontalBarChart WithId(string value)
11487 {
11488 this.Id = value;
11489 return this;
11490 }
11491
11492 public HorizontalBarChart WithRequires(HostCapabilities value)
11493 {
11494 this.Requires = value;
11495 return this;
11496 }
11497
11498 public HorizontalBarChart WithLang(string value)
11499 {
11500 this.Lang = value;
11501 return this;
11502 }
11503
11504 public HorizontalBarChart WithIsVisible(bool value)
11505 {
11506 this.IsVisible = value;
11507 return this;
11508 }
11509
11510 public HorizontalBarChart WithSeparator(bool value)
11511 {
11512 this.Separator = value;
11513 return this;
11514 }
11515
11516 public HorizontalBarChart WithHeight(ElementHeight value)
11517 {
11518 this.Height = value;
11519 return this;
11520 }
11521
11522 public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value)
11523 {
11524 this.HorizontalAlignment = value;
11525 return this;
11526 }
11527
11528 public HorizontalBarChart WithSpacing(Spacing value)
11529 {
11530 this.Spacing = value;
11531 return this;
11532 }
11533
11534 public HorizontalBarChart WithTargetWidth(TargetWidth value)
11535 {
11536 this.TargetWidth = value;
11537 return this;
11538 }
11539
11540 public HorizontalBarChart WithIsSortKey(bool value)
11541 {
11542 this.IsSortKey = value;
11543 return this;
11544 }
11545
11546 public HorizontalBarChart WithTitle(string value)
11547 {
11548 this.Title = value;
11549 return this;
11550 }
11551
11552 public HorizontalBarChart WithColorSet(ChartColorSet value)
11553 {
11554 this.ColorSet = value;
11555 return this;
11556 }
11557
11558 public HorizontalBarChart WithXAxisTitle(string value)
11559 {
11560 this.XAxisTitle = value;
11561 return this;
11562 }
11563
11564 public HorizontalBarChart WithYAxisTitle(string value)
11565 {
11566 this.YAxisTitle = value;
11567 return this;
11568 }
11569
11570 public HorizontalBarChart WithColor(ChartColor value)
11571 {
11572 this.Color = value;
11573 return this;
11574 }
11575
11576 public HorizontalBarChart WithData(params IList<HorizontalBarChartDataValue> value)
11577 {
11578 this.Data = value;
11579 return this;
11580 }
11581
11582 public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value)
11583 {
11584 this.DisplayMode = value;
11585 return this;
11586 }
11587
11588 public HorizontalBarChart WithGridArea(string value)
11589 {
11590 this.GridArea = value;
11591 return this;
11592 }
11593
11594 public HorizontalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
11595 {
11596 this.Fallback = value;
11597 return this;
11598 }
11599}
11600
11601/// <summary>
11602/// Represents a single data point in a horizontal bar chart.
11603/// </summary>
11604public class HorizontalBarChartDataValue : SerializableObject
11605{
11606 /// <summary>
11607 /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue.
11608 /// </summary>
11609 public static HorizontalBarChartDataValue? Deserialize(string json)
11610 {
11611 return JsonSerializer.Deserialize<HorizontalBarChartDataValue>(json);
11612 }
11613
11614 /// <summary>
11615 /// The x axis value of the data point.
11616 /// </summary>
11617 [JsonPropertyName("x")]
11618 public string? X { get; set; }
11619
11620 /// <summary>
11621 /// The y axis value of the data point.
11622 /// </summary>
11623 [JsonPropertyName("y")]
11624 public float? Y { get; set; }
11625
11626 /// <summary>
11627 /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11628 /// </summary>
11629 [JsonPropertyName("color")]
11630 public ChartColor? Color { get; set; }
11631
11632 /// <summary>
11633 /// Serializes this HorizontalBarChartDataValue into a JSON string.
11634 /// </summary>
11635 public string Serialize()
11636 {
11637 return JsonSerializer.Serialize(
11638 this,
11639 new JsonSerializerOptions
11640 {
11641 WriteIndented = true,
11642 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11643 }
11644 );
11645 }
11646
11647 public HorizontalBarChartDataValue WithX(string value)
11648 {
11649 this.X = value;
11650 return this;
11651 }
11652
11653 public HorizontalBarChartDataValue WithY(float value)
11654 {
11655 this.Y = value;
11656 return this;
11657 }
11658
11659 public HorizontalBarChartDataValue WithColor(ChartColor value)
11660 {
11661 this.Color = value;
11662 return this;
11663 }
11664}
11665
11666/// <summary>
11667/// A stacked horizontal bar chart.
11668/// </summary>
11669public class StackedHorizontalBarChart : CardElement
11670{
11671 /// <summary>
11672 /// Deserializes a JSON string into an object of type StackedHorizontalBarChart.
11673 /// </summary>
11674 public static StackedHorizontalBarChart? Deserialize(string json)
11675 {
11676 return JsonSerializer.Deserialize<StackedHorizontalBarChart>(json);
11677 }
11678
11679 /// <summary>
11680 /// Must be **Chart.HorizontalBar.Stacked**.
11681 /// </summary>
11682 [JsonPropertyName("type")]
11683 public string Type { get; } = "Chart.HorizontalBar.Stacked";
11684
11685 /// <summary>
11686 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
11687 /// </summary>
11688 [JsonPropertyName("id")]
11689 public string? Id { get; set; }
11690
11691 /// <summary>
11692 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
11693 /// </summary>
11694 [JsonPropertyName("requires")]
11695 public HostCapabilities? Requires { get; set; }
11696
11697 /// <summary>
11698 /// The locale associated with the element.
11699 /// </summary>
11700 [JsonPropertyName("lang")]
11701 public string? Lang { get; set; }
11702
11703 /// <summary>
11704 /// Controls the visibility of the element.
11705 /// </summary>
11706 [JsonPropertyName("isVisible")]
11707 public bool? IsVisible { get; set; }
11708
11709 /// <summary>
11710 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
11711 /// </summary>
11712 [JsonPropertyName("separator")]
11713 public bool? Separator { get; set; }
11714
11715 /// <summary>
11716 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11717 /// </summary>
11718 [JsonPropertyName("height")]
11719 public ElementHeight? Height { get; set; }
11720
11721 /// <summary>
11722 /// Controls how the element should be horizontally aligned.
11723 /// </summary>
11724 [JsonPropertyName("horizontalAlignment")]
11725 public HorizontalAlignment? HorizontalAlignment { get; set; }
11726
11727 /// <summary>
11728 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11729 /// </summary>
11730 [JsonPropertyName("spacing")]
11731 public Spacing? Spacing { get; set; }
11732
11733 /// <summary>
11734 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
11735 /// </summary>
11736 [JsonPropertyName("targetWidth")]
11737 public TargetWidth? TargetWidth { get; set; }
11738
11739 /// <summary>
11740 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11741 /// </summary>
11742 [JsonPropertyName("isSortKey")]
11743 public bool? IsSortKey { get; set; }
11744
11745 /// <summary>
11746 /// The title of the chart.
11747 /// </summary>
11748 [JsonPropertyName("title")]
11749 public string? Title { get; set; }
11750
11751 /// <summary>
11752 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11753 /// </summary>
11754 [JsonPropertyName("colorSet")]
11755 public ChartColorSet? ColorSet { get; set; }
11756
11757 /// <summary>
11758 /// The title of the x axis.
11759 /// </summary>
11760 [JsonPropertyName("xAxisTitle")]
11761 public string? XAxisTitle { get; set; }
11762
11763 /// <summary>
11764 /// The title of the y axis.
11765 /// </summary>
11766 [JsonPropertyName("yAxisTitle")]
11767 public string? YAxisTitle { get; set; }
11768
11769 /// <summary>
11770 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11771 /// </summary>
11772 [JsonPropertyName("color")]
11773 public ChartColor? Color { get; set; }
11774
11775 /// <summary>
11776 /// The data to display in the chart.
11777 /// </summary>
11778 [JsonPropertyName("data")]
11779 public IList<StackedHorizontalBarChartData>? Data { get; set; }
11780
11781 /// <summary>
11782 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11783 /// </summary>
11784 [JsonPropertyName("grid.area")]
11785 public string? GridArea { get; set; }
11786
11787 /// <summary>
11788 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
11789 /// </summary>
11790 [JsonPropertyName("fallback")]
11791 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11792
11793 /// <summary>
11794 /// Serializes this StackedHorizontalBarChart into a JSON string.
11795 /// </summary>
11796 public string Serialize()
11797 {
11798 return JsonSerializer.Serialize(
11799 this,
11800 new JsonSerializerOptions
11801 {
11802 WriteIndented = true,
11803 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11804 }
11805 );
11806 }
11807
11808 public StackedHorizontalBarChart WithId(string value)
11809 {
11810 this.Id = value;
11811 return this;
11812 }
11813
11814 public StackedHorizontalBarChart WithRequires(HostCapabilities value)
11815 {
11816 this.Requires = value;
11817 return this;
11818 }
11819
11820 public StackedHorizontalBarChart WithLang(string value)
11821 {
11822 this.Lang = value;
11823 return this;
11824 }
11825
11826 public StackedHorizontalBarChart WithIsVisible(bool value)
11827 {
11828 this.IsVisible = value;
11829 return this;
11830 }
11831
11832 public StackedHorizontalBarChart WithSeparator(bool value)
11833 {
11834 this.Separator = value;
11835 return this;
11836 }
11837
11838 public StackedHorizontalBarChart WithHeight(ElementHeight value)
11839 {
11840 this.Height = value;
11841 return this;
11842 }
11843
11844 public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value)
11845 {
11846 this.HorizontalAlignment = value;
11847 return this;
11848 }
11849
11850 public StackedHorizontalBarChart WithSpacing(Spacing value)
11851 {
11852 this.Spacing = value;
11853 return this;
11854 }
11855
11856 public StackedHorizontalBarChart WithTargetWidth(TargetWidth value)
11857 {
11858 this.TargetWidth = value;
11859 return this;
11860 }
11861
11862 public StackedHorizontalBarChart WithIsSortKey(bool value)
11863 {
11864 this.IsSortKey = value;
11865 return this;
11866 }
11867
11868 public StackedHorizontalBarChart WithTitle(string value)
11869 {
11870 this.Title = value;
11871 return this;
11872 }
11873
11874 public StackedHorizontalBarChart WithColorSet(ChartColorSet value)
11875 {
11876 this.ColorSet = value;
11877 return this;
11878 }
11879
11880 public StackedHorizontalBarChart WithXAxisTitle(string value)
11881 {
11882 this.XAxisTitle = value;
11883 return this;
11884 }
11885
11886 public StackedHorizontalBarChart WithYAxisTitle(string value)
11887 {
11888 this.YAxisTitle = value;
11889 return this;
11890 }
11891
11892 public StackedHorizontalBarChart WithColor(ChartColor value)
11893 {
11894 this.Color = value;
11895 return this;
11896 }
11897
11898 public StackedHorizontalBarChart WithData(params IList<StackedHorizontalBarChartData> value)
11899 {
11900 this.Data = value;
11901 return this;
11902 }
11903
11904 public StackedHorizontalBarChart WithGridArea(string value)
11905 {
11906 this.GridArea = value;
11907 return this;
11908 }
11909
11910 public StackedHorizontalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
11911 {
11912 this.Fallback = value;
11913 return this;
11914 }
11915}
11916
11917/// <summary>
11918/// Defines the collection of data series to display in as a stacked horizontal bar chart.
11919/// </summary>
11920public class StackedHorizontalBarChartData : SerializableObject
11921{
11922 /// <summary>
11923 /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData.
11924 /// </summary>
11925 public static StackedHorizontalBarChartData? Deserialize(string json)
11926 {
11927 return JsonSerializer.Deserialize<StackedHorizontalBarChartData>(json);
11928 }
11929
11930 /// <summary>
11931 /// The title of the series.
11932 /// </summary>
11933 [JsonPropertyName("title")]
11934 public string? Title { get; set; }
11935
11936 /// <summary>
11937 /// The data points in the series.
11938 /// </summary>
11939 [JsonPropertyName("data")]
11940 public IList<StackedHorizontalBarChartDataPoint>? Data { get; set; }
11941
11942 /// <summary>
11943 /// Serializes this StackedHorizontalBarChartData into a JSON string.
11944 /// </summary>
11945 public string Serialize()
11946 {
11947 return JsonSerializer.Serialize(
11948 this,
11949 new JsonSerializerOptions
11950 {
11951 WriteIndented = true,
11952 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11953 }
11954 );
11955 }
11956
11957 public StackedHorizontalBarChartData WithTitle(string value)
11958 {
11959 this.Title = value;
11960 return this;
11961 }
11962
11963 public StackedHorizontalBarChartData WithData(params IList<StackedHorizontalBarChartDataPoint> value)
11964 {
11965 this.Data = value;
11966 return this;
11967 }
11968}
11969
11970/// <summary>
11971/// A data point in a series.
11972/// </summary>
11973public class StackedHorizontalBarChartDataPoint : SerializableObject
11974{
11975 /// <summary>
11976 /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint.
11977 /// </summary>
11978 public static StackedHorizontalBarChartDataPoint? Deserialize(string json)
11979 {
11980 return JsonSerializer.Deserialize<StackedHorizontalBarChartDataPoint>(json);
11981 }
11982
11983 /// <summary>
11984 /// The legend associated with the data point.
11985 /// </summary>
11986 [JsonPropertyName("legend")]
11987 public string? Legend { get; set; }
11988
11989 /// <summary>
11990 /// The value of the data point.
11991 /// </summary>
11992 [JsonPropertyName("value")]
11993 public float? Value { get; set; }
11994
11995 /// <summary>
11996 /// The color to use to render the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11997 /// </summary>
11998 [JsonPropertyName("color")]
11999 public ChartColor? Color { get; set; }
12000
12001 /// <summary>
12002 /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string.
12003 /// </summary>
12004 public string Serialize()
12005 {
12006 return JsonSerializer.Serialize(
12007 this,
12008 new JsonSerializerOptions
12009 {
12010 WriteIndented = true,
12011 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12012 }
12013 );
12014 }
12015
12016 public StackedHorizontalBarChartDataPoint WithLegend(string value)
12017 {
12018 this.Legend = value;
12019 return this;
12020 }
12021
12022 public StackedHorizontalBarChartDataPoint WithValue(float value)
12023 {
12024 this.Value = value;
12025 return this;
12026 }
12027
12028 public StackedHorizontalBarChartDataPoint WithColor(ChartColor value)
12029 {
12030 this.Color = value;
12031 return this;
12032 }
12033}
12034
12035/// <summary>
12036/// A line chart.
12037/// </summary>
12038public class LineChart : CardElement
12039{
12040 /// <summary>
12041 /// Deserializes a JSON string into an object of type LineChart.
12042 /// </summary>
12043 public static LineChart? Deserialize(string json)
12044 {
12045 return JsonSerializer.Deserialize<LineChart>(json);
12046 }
12047
12048 /// <summary>
12049 /// Must be **Chart.Line**.
12050 /// </summary>
12051 [JsonPropertyName("type")]
12052 public string Type { get; } = "Chart.Line";
12053
12054 /// <summary>
12055 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
12056 /// </summary>
12057 [JsonPropertyName("id")]
12058 public string? Id { get; set; }
12059
12060 /// <summary>
12061 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
12062 /// </summary>
12063 [JsonPropertyName("requires")]
12064 public HostCapabilities? Requires { get; set; }
12065
12066 /// <summary>
12067 /// The locale associated with the element.
12068 /// </summary>
12069 [JsonPropertyName("lang")]
12070 public string? Lang { get; set; }
12071
12072 /// <summary>
12073 /// Controls the visibility of the element.
12074 /// </summary>
12075 [JsonPropertyName("isVisible")]
12076 public bool? IsVisible { get; set; }
12077
12078 /// <summary>
12079 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
12080 /// </summary>
12081 [JsonPropertyName("separator")]
12082 public bool? Separator { get; set; }
12083
12084 /// <summary>
12085 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
12086 /// </summary>
12087 [JsonPropertyName("height")]
12088 public ElementHeight? Height { get; set; }
12089
12090 /// <summary>
12091 /// Controls how the element should be horizontally aligned.
12092 /// </summary>
12093 [JsonPropertyName("horizontalAlignment")]
12094 public HorizontalAlignment? HorizontalAlignment { get; set; }
12095
12096 /// <summary>
12097 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
12098 /// </summary>
12099 [JsonPropertyName("spacing")]
12100 public Spacing? Spacing { get; set; }
12101
12102 /// <summary>
12103 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
12104 /// </summary>
12105 [JsonPropertyName("targetWidth")]
12106 public TargetWidth? TargetWidth { get; set; }
12107
12108 /// <summary>
12109 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
12110 /// </summary>
12111 [JsonPropertyName("isSortKey")]
12112 public bool? IsSortKey { get; set; }
12113
12114 /// <summary>
12115 /// The title of the chart.
12116 /// </summary>
12117 [JsonPropertyName("title")]
12118 public string? Title { get; set; }
12119
12120 /// <summary>
12121 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12122 /// </summary>
12123 [JsonPropertyName("colorSet")]
12124 public ChartColorSet? ColorSet { get; set; }
12125
12126 /// <summary>
12127 /// The title of the x axis.
12128 /// </summary>
12129 [JsonPropertyName("xAxisTitle")]
12130 public string? XAxisTitle { get; set; }
12131
12132 /// <summary>
12133 /// The title of the y axis.
12134 /// </summary>
12135 [JsonPropertyName("yAxisTitle")]
12136 public string? YAxisTitle { get; set; }
12137
12138 /// <summary>
12139 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12140 /// </summary>
12141 [JsonPropertyName("color")]
12142 public ChartColor? Color { get; set; }
12143
12144 /// <summary>
12145 /// The data point series in the line chart.
12146 /// </summary>
12147 [JsonPropertyName("data")]
12148 public IList<LineChartData>? Data { get; set; }
12149
12150 /// <summary>
12151 /// The maximum y range.
12152 /// </summary>
12153 [JsonPropertyName("yMin")]
12154 public float? YMin { get; set; }
12155
12156 /// <summary>
12157 /// The minimum y range.
12158 /// </summary>
12159 [JsonPropertyName("yMax")]
12160 public float? YMax { get; set; }
12161
12162 /// <summary>
12163 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12164 /// </summary>
12165 [JsonPropertyName("grid.area")]
12166 public string? GridArea { get; set; }
12167
12168 /// <summary>
12169 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
12170 /// </summary>
12171 [JsonPropertyName("fallback")]
12172 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12173
12174 /// <summary>
12175 /// Serializes this LineChart into a JSON string.
12176 /// </summary>
12177 public string Serialize()
12178 {
12179 return JsonSerializer.Serialize(
12180 this,
12181 new JsonSerializerOptions
12182 {
12183 WriteIndented = true,
12184 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12185 }
12186 );
12187 }
12188
12189 public LineChart WithId(string value)
12190 {
12191 this.Id = value;
12192 return this;
12193 }
12194
12195 public LineChart WithRequires(HostCapabilities value)
12196 {
12197 this.Requires = value;
12198 return this;
12199 }
12200
12201 public LineChart WithLang(string value)
12202 {
12203 this.Lang = value;
12204 return this;
12205 }
12206
12207 public LineChart WithIsVisible(bool value)
12208 {
12209 this.IsVisible = value;
12210 return this;
12211 }
12212
12213 public LineChart WithSeparator(bool value)
12214 {
12215 this.Separator = value;
12216 return this;
12217 }
12218
12219 public LineChart WithHeight(ElementHeight value)
12220 {
12221 this.Height = value;
12222 return this;
12223 }
12224
12225 public LineChart WithHorizontalAlignment(HorizontalAlignment value)
12226 {
12227 this.HorizontalAlignment = value;
12228 return this;
12229 }
12230
12231 public LineChart WithSpacing(Spacing value)
12232 {
12233 this.Spacing = value;
12234 return this;
12235 }
12236
12237 public LineChart WithTargetWidth(TargetWidth value)
12238 {
12239 this.TargetWidth = value;
12240 return this;
12241 }
12242
12243 public LineChart WithIsSortKey(bool value)
12244 {
12245 this.IsSortKey = value;
12246 return this;
12247 }
12248
12249 public LineChart WithTitle(string value)
12250 {
12251 this.Title = value;
12252 return this;
12253 }
12254
12255 public LineChart WithColorSet(ChartColorSet value)
12256 {
12257 this.ColorSet = value;
12258 return this;
12259 }
12260
12261 public LineChart WithXAxisTitle(string value)
12262 {
12263 this.XAxisTitle = value;
12264 return this;
12265 }
12266
12267 public LineChart WithYAxisTitle(string value)
12268 {
12269 this.YAxisTitle = value;
12270 return this;
12271 }
12272
12273 public LineChart WithColor(ChartColor value)
12274 {
12275 this.Color = value;
12276 return this;
12277 }
12278
12279 public LineChart WithData(params IList<LineChartData> value)
12280 {
12281 this.Data = value;
12282 return this;
12283 }
12284
12285 public LineChart WithYMin(float value)
12286 {
12287 this.YMin = value;
12288 return this;
12289 }
12290
12291 public LineChart WithYMax(float value)
12292 {
12293 this.YMax = value;
12294 return this;
12295 }
12296
12297 public LineChart WithGridArea(string value)
12298 {
12299 this.GridArea = value;
12300 return this;
12301 }
12302
12303 public LineChart WithFallback(IUnion<CardElement, FallbackElement> value)
12304 {
12305 this.Fallback = value;
12306 return this;
12307 }
12308}
12309
12310/// <summary>
12311/// Represents a collection of data points series in a line chart.
12312/// </summary>
12313public class LineChartData : SerializableObject
12314{
12315 /// <summary>
12316 /// Deserializes a JSON string into an object of type LineChartData.
12317 /// </summary>
12318 public static LineChartData? Deserialize(string json)
12319 {
12320 return JsonSerializer.Deserialize<LineChartData>(json);
12321 }
12322
12323 /// <summary>
12324 /// The legend of the chart.
12325 /// </summary>
12326 [JsonPropertyName("legend")]
12327 public string? Legend { get; set; }
12328
12329 /// <summary>
12330 /// The data points in the series.
12331 /// </summary>
12332 [JsonPropertyName("values")]
12333 public IList<LineChartValue>? Values { get; set; }
12334
12335 /// <summary>
12336 /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12337 /// </summary>
12338 [JsonPropertyName("color")]
12339 public ChartColor? Color { get; set; }
12340
12341 /// <summary>
12342 /// Serializes this LineChartData into a JSON string.
12343 /// </summary>
12344 public string Serialize()
12345 {
12346 return JsonSerializer.Serialize(
12347 this,
12348 new JsonSerializerOptions
12349 {
12350 WriteIndented = true,
12351 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12352 }
12353 );
12354 }
12355
12356 public LineChartData WithLegend(string value)
12357 {
12358 this.Legend = value;
12359 return this;
12360 }
12361
12362 public LineChartData WithValues(params IList<LineChartValue> value)
12363 {
12364 this.Values = value;
12365 return this;
12366 }
12367
12368 public LineChartData WithColor(ChartColor value)
12369 {
12370 this.Color = value;
12371 return this;
12372 }
12373}
12374
12375/// <summary>
12376/// Represents a single data point in a line chart.
12377/// </summary>
12378public class LineChartValue : SerializableObject
12379{
12380 /// <summary>
12381 /// Deserializes a JSON string into an object of type LineChartValue.
12382 /// </summary>
12383 public static LineChartValue? Deserialize(string json)
12384 {
12385 return JsonSerializer.Deserialize<LineChartValue>(json);
12386 }
12387
12388 /// <summary>
12389 /// The x axis value of the data point.
12390 ///
12391 /// If all x values of the x [Chart.Line](https://adaptivecards.microsoft.com/?topic=Chart.Line) are expressed as a number, or if all x values are expressed as a date string in the `YYYY-MM-DD` format, the chart will be rendered as a time series chart, i.e. x axis values will span across the minimum x value to maximum x value range.
12392 ///
12393 /// Otherwise, if x values are represented as a mix of numbers and strings or if at least one x value isn't in the `YYYY-MM-DD` format, the chart will be rendered as a categorical chart, i.e. x axis values will be displayed as categories.
12394 /// </summary>
12395 [JsonPropertyName("x")]
12396 public IUnion<float, string>? X { get; set; }
12397
12398 /// <summary>
12399 /// The y axis value of the data point.
12400 /// </summary>
12401 [JsonPropertyName("y")]
12402 public float? Y { get; set; }
12403
12404 /// <summary>
12405 /// Serializes this LineChartValue into a JSON string.
12406 /// </summary>
12407 public string Serialize()
12408 {
12409 return JsonSerializer.Serialize(
12410 this,
12411 new JsonSerializerOptions
12412 {
12413 WriteIndented = true,
12414 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12415 }
12416 );
12417 }
12418
12419 public LineChartValue WithX(IUnion<float, string> value)
12420 {
12421 this.X = value;
12422 return this;
12423 }
12424
12425 public LineChartValue WithY(float value)
12426 {
12427 this.Y = value;
12428 return this;
12429 }
12430}
12431
12432/// <summary>
12433/// A gauge chart.
12434/// </summary>
12435public class GaugeChart : CardElement
12436{
12437 /// <summary>
12438 /// Deserializes a JSON string into an object of type GaugeChart.
12439 /// </summary>
12440 public static GaugeChart? Deserialize(string json)
12441 {
12442 return JsonSerializer.Deserialize<GaugeChart>(json);
12443 }
12444
12445 /// <summary>
12446 /// Must be **Chart.Gauge**.
12447 /// </summary>
12448 [JsonPropertyName("type")]
12449 public string Type { get; } = "Chart.Gauge";
12450
12451 /// <summary>
12452 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
12453 /// </summary>
12454 [JsonPropertyName("id")]
12455 public string? Id { get; set; }
12456
12457 /// <summary>
12458 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
12459 /// </summary>
12460 [JsonPropertyName("requires")]
12461 public HostCapabilities? Requires { get; set; }
12462
12463 /// <summary>
12464 /// The locale associated with the element.
12465 /// </summary>
12466 [JsonPropertyName("lang")]
12467 public string? Lang { get; set; }
12468
12469 /// <summary>
12470 /// Controls the visibility of the element.
12471 /// </summary>
12472 [JsonPropertyName("isVisible")]
12473 public bool? IsVisible { get; set; }
12474
12475 /// <summary>
12476 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
12477 /// </summary>
12478 [JsonPropertyName("separator")]
12479 public bool? Separator { get; set; }
12480
12481 /// <summary>
12482 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
12483 /// </summary>
12484 [JsonPropertyName("height")]
12485 public ElementHeight? Height { get; set; }
12486
12487 /// <summary>
12488 /// Controls how the element should be horizontally aligned.
12489 /// </summary>
12490 [JsonPropertyName("horizontalAlignment")]
12491 public HorizontalAlignment? HorizontalAlignment { get; set; }
12492
12493 /// <summary>
12494 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
12495 /// </summary>
12496 [JsonPropertyName("spacing")]
12497 public Spacing? Spacing { get; set; }
12498
12499 /// <summary>
12500 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
12501 /// </summary>
12502 [JsonPropertyName("targetWidth")]
12503 public TargetWidth? TargetWidth { get; set; }
12504
12505 /// <summary>
12506 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
12507 /// </summary>
12508 [JsonPropertyName("isSortKey")]
12509 public bool? IsSortKey { get; set; }
12510
12511 /// <summary>
12512 /// The title of the chart.
12513 /// </summary>
12514 [JsonPropertyName("title")]
12515 public string? Title { get; set; }
12516
12517 /// <summary>
12518 /// The name of the set of colors to use to render the chart. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12519 /// </summary>
12520 [JsonPropertyName("colorSet")]
12521 public ChartColorSet? ColorSet { get; set; }
12522
12523 /// <summary>
12524 /// The minimum value of the gauge.
12525 /// </summary>
12526 [JsonPropertyName("min")]
12527 public float? Min { get; set; }
12528
12529 /// <summary>
12530 /// The maximum value of the gauge.
12531 /// </summary>
12532 [JsonPropertyName("max")]
12533 public float? Max { get; set; }
12534
12535 /// <summary>
12536 /// The sub-label of the gauge.
12537 /// </summary>
12538 [JsonPropertyName("subLabel")]
12539 public string? SubLabel { get; set; }
12540
12541 /// <summary>
12542 /// Controls whether the min/max values should be displayed.
12543 /// </summary>
12544 [JsonPropertyName("showMinMax")]
12545 public bool? ShowMinMax { get; set; }
12546
12547 /// <summary>
12548 /// The segments to display in the gauge.
12549 /// </summary>
12550 [JsonPropertyName("segments")]
12551 public IList<GaugeChartLegend>? Segments { get; set; }
12552
12553 /// <summary>
12554 /// The value of the gauge.
12555 /// </summary>
12556 [JsonPropertyName("value")]
12557 public float? Value { get; set; }
12558
12559 /// <summary>
12560 /// The format used to display the gauge's value.
12561 /// </summary>
12562 [JsonPropertyName("valueFormat")]
12563 public GaugeChartValueFormat? ValueFormat { get; set; }
12564
12565 /// <summary>
12566 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12567 /// </summary>
12568 [JsonPropertyName("grid.area")]
12569 public string? GridArea { get; set; }
12570
12571 /// <summary>
12572 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
12573 /// </summary>
12574 [JsonPropertyName("fallback")]
12575 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12576
12577 /// <summary>
12578 /// Serializes this GaugeChart into a JSON string.
12579 /// </summary>
12580 public string Serialize()
12581 {
12582 return JsonSerializer.Serialize(
12583 this,
12584 new JsonSerializerOptions
12585 {
12586 WriteIndented = true,
12587 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12588 }
12589 );
12590 }
12591
12592 public GaugeChart WithId(string value)
12593 {
12594 this.Id = value;
12595 return this;
12596 }
12597
12598 public GaugeChart WithRequires(HostCapabilities value)
12599 {
12600 this.Requires = value;
12601 return this;
12602 }
12603
12604 public GaugeChart WithLang(string value)
12605 {
12606 this.Lang = value;
12607 return this;
12608 }
12609
12610 public GaugeChart WithIsVisible(bool value)
12611 {
12612 this.IsVisible = value;
12613 return this;
12614 }
12615
12616 public GaugeChart WithSeparator(bool value)
12617 {
12618 this.Separator = value;
12619 return this;
12620 }
12621
12622 public GaugeChart WithHeight(ElementHeight value)
12623 {
12624 this.Height = value;
12625 return this;
12626 }
12627
12628 public GaugeChart WithHorizontalAlignment(HorizontalAlignment value)
12629 {
12630 this.HorizontalAlignment = value;
12631 return this;
12632 }
12633
12634 public GaugeChart WithSpacing(Spacing value)
12635 {
12636 this.Spacing = value;
12637 return this;
12638 }
12639
12640 public GaugeChart WithTargetWidth(TargetWidth value)
12641 {
12642 this.TargetWidth = value;
12643 return this;
12644 }
12645
12646 public GaugeChart WithIsSortKey(bool value)
12647 {
12648 this.IsSortKey = value;
12649 return this;
12650 }
12651
12652 public GaugeChart WithTitle(string value)
12653 {
12654 this.Title = value;
12655 return this;
12656 }
12657
12658 public GaugeChart WithColorSet(ChartColorSet value)
12659 {
12660 this.ColorSet = value;
12661 return this;
12662 }
12663
12664 public GaugeChart WithMin(float value)
12665 {
12666 this.Min = value;
12667 return this;
12668 }
12669
12670 public GaugeChart WithMax(float value)
12671 {
12672 this.Max = value;
12673 return this;
12674 }
12675
12676 public GaugeChart WithSubLabel(string value)
12677 {
12678 this.SubLabel = value;
12679 return this;
12680 }
12681
12682 public GaugeChart WithShowMinMax(bool value)
12683 {
12684 this.ShowMinMax = value;
12685 return this;
12686 }
12687
12688 public GaugeChart WithSegments(params IList<GaugeChartLegend> value)
12689 {
12690 this.Segments = value;
12691 return this;
12692 }
12693
12694 public GaugeChart WithValue(float value)
12695 {
12696 this.Value = value;
12697 return this;
12698 }
12699
12700 public GaugeChart WithValueFormat(GaugeChartValueFormat value)
12701 {
12702 this.ValueFormat = value;
12703 return this;
12704 }
12705
12706 public GaugeChart WithGridArea(string value)
12707 {
12708 this.GridArea = value;
12709 return this;
12710 }
12711
12712 public GaugeChart WithFallback(IUnion<CardElement, FallbackElement> value)
12713 {
12714 this.Fallback = value;
12715 return this;
12716 }
12717}
12718
12719/// <summary>
12720/// The legend of the chart.
12721/// </summary>
12722public class GaugeChartLegend : SerializableObject
12723{
12724 /// <summary>
12725 /// Deserializes a JSON string into an object of type GaugeChartLegend.
12726 /// </summary>
12727 public static GaugeChartLegend? Deserialize(string json)
12728 {
12729 return JsonSerializer.Deserialize<GaugeChartLegend>(json);
12730 }
12731
12732 /// <summary>
12733 /// The size of the segment.
12734 /// </summary>
12735 [JsonPropertyName("size")]
12736 public float? Size { get; set; }
12737
12738 /// <summary>
12739 /// The legend text associated with the segment.
12740 /// </summary>
12741 [JsonPropertyName("legend")]
12742 public string? Legend { get; set; }
12743
12744 /// <summary>
12745 /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12746 /// </summary>
12747 [JsonPropertyName("color")]
12748 public ChartColor? Color { get; set; }
12749
12750 /// <summary>
12751 /// Serializes this GaugeChartLegend into a JSON string.
12752 /// </summary>
12753 public string Serialize()
12754 {
12755 return JsonSerializer.Serialize(
12756 this,
12757 new JsonSerializerOptions
12758 {
12759 WriteIndented = true,
12760 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12761 }
12762 );
12763 }
12764
12765 public GaugeChartLegend WithSize(float value)
12766 {
12767 this.Size = value;
12768 return this;
12769 }
12770
12771 public GaugeChartLegend WithLegend(string value)
12772 {
12773 this.Legend = value;
12774 return this;
12775 }
12776
12777 public GaugeChartLegend WithColor(ChartColor value)
12778 {
12779 this.Color = value;
12780 return this;
12781 }
12782}
12783
12784/// <summary>
12785/// A formatted and syntax-colored code block.
12786/// </summary>
12787public class CodeBlock : CardElement
12788{
12789 /// <summary>
12790 /// Deserializes a JSON string into an object of type CodeBlock.
12791 /// </summary>
12792 public static CodeBlock? Deserialize(string json)
12793 {
12794 return JsonSerializer.Deserialize<CodeBlock>(json);
12795 }
12796
12797 /// <summary>
12798 /// Must be **CodeBlock**.
12799 /// </summary>
12800 [JsonPropertyName("type")]
12801 public string Type { get; } = "CodeBlock";
12802
12803 /// <summary>
12804 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
12805 /// </summary>
12806 [JsonPropertyName("id")]
12807 public string? Id { get; set; }
12808
12809 /// <summary>
12810 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
12811 /// </summary>
12812 [JsonPropertyName("requires")]
12813 public HostCapabilities? Requires { get; set; }
12814
12815 /// <summary>
12816 /// The locale associated with the element.
12817 /// </summary>
12818 [JsonPropertyName("lang")]
12819 public string? Lang { get; set; }
12820
12821 /// <summary>
12822 /// Controls the visibility of the element.
12823 /// </summary>
12824 [JsonPropertyName("isVisible")]
12825 public bool? IsVisible { get; set; }
12826
12827 /// <summary>
12828 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
12829 /// </summary>
12830 [JsonPropertyName("separator")]
12831 public bool? Separator { get; set; }
12832
12833 /// <summary>
12834 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
12835 /// </summary>
12836 [JsonPropertyName("height")]
12837 public ElementHeight? Height { get; set; }
12838
12839 /// <summary>
12840 /// Controls how the element should be horizontally aligned.
12841 /// </summary>
12842 [JsonPropertyName("horizontalAlignment")]
12843 public HorizontalAlignment? HorizontalAlignment { get; set; }
12844
12845 /// <summary>
12846 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
12847 /// </summary>
12848 [JsonPropertyName("spacing")]
12849 public Spacing? Spacing { get; set; }
12850
12851 /// <summary>
12852 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
12853 /// </summary>
12854 [JsonPropertyName("targetWidth")]
12855 public TargetWidth? TargetWidth { get; set; }
12856
12857 /// <summary>
12858 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
12859 /// </summary>
12860 [JsonPropertyName("isSortKey")]
12861 public bool? IsSortKey { get; set; }
12862
12863 /// <summary>
12864 /// The code snippet to display.
12865 /// </summary>
12866 [JsonPropertyName("codeSnippet")]
12867 public string? CodeSnippet { get; set; }
12868
12869 /// <summary>
12870 /// The language the code snippet is expressed in.
12871 /// </summary>
12872 [JsonPropertyName("language")]
12873 public CodeLanguage? Language { get; set; }
12874
12875 /// <summary>
12876 /// A number that represents the line in the file from where the code snippet was extracted.
12877 /// </summary>
12878 [JsonPropertyName("startLineNumber")]
12879 public float? StartLineNumber { get; set; }
12880
12881 /// <summary>
12882 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12883 /// </summary>
12884 [JsonPropertyName("grid.area")]
12885 public string? GridArea { get; set; }
12886
12887 /// <summary>
12888 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
12889 /// </summary>
12890 [JsonPropertyName("fallback")]
12891 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12892
12893 /// <summary>
12894 /// Serializes this CodeBlock into a JSON string.
12895 /// </summary>
12896 public string Serialize()
12897 {
12898 return JsonSerializer.Serialize(
12899 this,
12900 new JsonSerializerOptions
12901 {
12902 WriteIndented = true,
12903 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12904 }
12905 );
12906 }
12907
12908 public CodeBlock WithId(string value)
12909 {
12910 this.Id = value;
12911 return this;
12912 }
12913
12914 public CodeBlock WithRequires(HostCapabilities value)
12915 {
12916 this.Requires = value;
12917 return this;
12918 }
12919
12920 public CodeBlock WithLang(string value)
12921 {
12922 this.Lang = value;
12923 return this;
12924 }
12925
12926 public CodeBlock WithIsVisible(bool value)
12927 {
12928 this.IsVisible = value;
12929 return this;
12930 }
12931
12932 public CodeBlock WithSeparator(bool value)
12933 {
12934 this.Separator = value;
12935 return this;
12936 }
12937
12938 public CodeBlock WithHeight(ElementHeight value)
12939 {
12940 this.Height = value;
12941 return this;
12942 }
12943
12944 public CodeBlock WithHorizontalAlignment(HorizontalAlignment value)
12945 {
12946 this.HorizontalAlignment = value;
12947 return this;
12948 }
12949
12950 public CodeBlock WithSpacing(Spacing value)
12951 {
12952 this.Spacing = value;
12953 return this;
12954 }
12955
12956 public CodeBlock WithTargetWidth(TargetWidth value)
12957 {
12958 this.TargetWidth = value;
12959 return this;
12960 }
12961
12962 public CodeBlock WithIsSortKey(bool value)
12963 {
12964 this.IsSortKey = value;
12965 return this;
12966 }
12967
12968 public CodeBlock WithCodeSnippet(string value)
12969 {
12970 this.CodeSnippet = value;
12971 return this;
12972 }
12973
12974 public CodeBlock WithLanguage(CodeLanguage value)
12975 {
12976 this.Language = value;
12977 return this;
12978 }
12979
12980 public CodeBlock WithStartLineNumber(float value)
12981 {
12982 this.StartLineNumber = value;
12983 return this;
12984 }
12985
12986 public CodeBlock WithGridArea(string value)
12987 {
12988 this.GridArea = value;
12989 return this;
12990 }
12991
12992 public CodeBlock WithFallback(IUnion<CardElement, FallbackElement> value)
12993 {
12994 this.Fallback = value;
12995 return this;
12996 }
12997}
12998
12999/// <summary>
13000/// Displays a user's information, including their profile picture.
13001/// </summary>
13002public class ComUserMicrosoftGraphComponent : CardElement
13003{
13004 /// <summary>
13005 /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent.
13006 /// </summary>
13007 public static ComUserMicrosoftGraphComponent? Deserialize(string json)
13008 {
13009 return JsonSerializer.Deserialize<ComUserMicrosoftGraphComponent>(json);
13010 }
13011
13012 /// <summary>
13013 /// Must be **Component**.
13014 /// </summary>
13015 [JsonPropertyName("type")]
13016 public string Type { get; } = "Component";
13017
13018 /// <summary>
13019 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
13020 /// </summary>
13021 [JsonPropertyName("id")]
13022 public string? Id { get; set; }
13023
13024 /// <summary>
13025 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
13026 /// </summary>
13027 [JsonPropertyName("requires")]
13028 public HostCapabilities? Requires { get; set; }
13029
13030 /// <summary>
13031 /// The locale associated with the element.
13032 /// </summary>
13033 [JsonPropertyName("lang")]
13034 public string? Lang { get; set; }
13035
13036 /// <summary>
13037 /// Controls the visibility of the element.
13038 /// </summary>
13039 [JsonPropertyName("isVisible")]
13040 public bool? IsVisible { get; set; }
13041
13042 /// <summary>
13043 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
13044 /// </summary>
13045 [JsonPropertyName("separator")]
13046 public bool? Separator { get; set; }
13047
13048 /// <summary>
13049 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13050 /// </summary>
13051 [JsonPropertyName("height")]
13052 public ElementHeight? Height { get; set; }
13053
13054 /// <summary>
13055 /// Controls how the element should be horizontally aligned.
13056 /// </summary>
13057 [JsonPropertyName("horizontalAlignment")]
13058 public HorizontalAlignment? HorizontalAlignment { get; set; }
13059
13060 /// <summary>
13061 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13062 /// </summary>
13063 [JsonPropertyName("spacing")]
13064 public Spacing? Spacing { get; set; }
13065
13066 /// <summary>
13067 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
13068 /// </summary>
13069 [JsonPropertyName("targetWidth")]
13070 public TargetWidth? TargetWidth { get; set; }
13071
13072 /// <summary>
13073 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13074 /// </summary>
13075 [JsonPropertyName("isSortKey")]
13076 public bool? IsSortKey { get; set; }
13077
13078 /// <summary>
13079 /// Must be **graph.microsoft.com/user**.
13080 /// </summary>
13081 [JsonPropertyName("name")]
13082 public string Name { get; } = "graph.microsoft.com/user";
13083
13084 /// <summary>
13085 /// The properties of the user.
13086 /// </summary>
13087 [JsonPropertyName("properties")]
13088 public PersonaProperties? Properties { get; set; }
13089
13090 /// <summary>
13091 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13092 /// </summary>
13093 [JsonPropertyName("grid.area")]
13094 public string? GridArea { get; set; }
13095
13096 /// <summary>
13097 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
13098 /// </summary>
13099 [JsonPropertyName("fallback")]
13100 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13101
13102 /// <summary>
13103 /// Serializes this ComUserMicrosoftGraphComponent into a JSON string.
13104 /// </summary>
13105 public string Serialize()
13106 {
13107 return JsonSerializer.Serialize(
13108 this,
13109 new JsonSerializerOptions
13110 {
13111 WriteIndented = true,
13112 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13113 }
13114 );
13115 }
13116
13117 public ComUserMicrosoftGraphComponent WithId(string value)
13118 {
13119 this.Id = value;
13120 return this;
13121 }
13122
13123 public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value)
13124 {
13125 this.Requires = value;
13126 return this;
13127 }
13128
13129 public ComUserMicrosoftGraphComponent WithLang(string value)
13130 {
13131 this.Lang = value;
13132 return this;
13133 }
13134
13135 public ComUserMicrosoftGraphComponent WithIsVisible(bool value)
13136 {
13137 this.IsVisible = value;
13138 return this;
13139 }
13140
13141 public ComUserMicrosoftGraphComponent WithSeparator(bool value)
13142 {
13143 this.Separator = value;
13144 return this;
13145 }
13146
13147 public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value)
13148 {
13149 this.Height = value;
13150 return this;
13151 }
13152
13153 public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
13154 {
13155 this.HorizontalAlignment = value;
13156 return this;
13157 }
13158
13159 public ComUserMicrosoftGraphComponent WithSpacing(Spacing value)
13160 {
13161 this.Spacing = value;
13162 return this;
13163 }
13164
13165 public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
13166 {
13167 this.TargetWidth = value;
13168 return this;
13169 }
13170
13171 public ComUserMicrosoftGraphComponent WithIsSortKey(bool value)
13172 {
13173 this.IsSortKey = value;
13174 return this;
13175 }
13176
13177 public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value)
13178 {
13179 this.Properties = value;
13180 return this;
13181 }
13182
13183 public ComUserMicrosoftGraphComponent WithGridArea(string value)
13184 {
13185 this.GridArea = value;
13186 return this;
13187 }
13188
13189 public ComUserMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
13190 {
13191 this.Fallback = value;
13192 return this;
13193 }
13194}
13195
13196/// <summary>
13197/// Represents the properties of a Persona component.
13198/// </summary>
13199public class PersonaProperties : SerializableObject
13200{
13201 /// <summary>
13202 /// Deserializes a JSON string into an object of type PersonaProperties.
13203 /// </summary>
13204 public static PersonaProperties? Deserialize(string json)
13205 {
13206 return JsonSerializer.Deserialize<PersonaProperties>(json);
13207 }
13208
13209 /// <summary>
13210 /// The UPN of the persona.
13211 /// </summary>
13212 [JsonPropertyName("userPrincipalName")]
13213 public string? UserPrincipalName { get; set; }
13214
13215 /// <summary>
13216 /// The display name of the persona.
13217 /// </summary>
13218 [JsonPropertyName("displayName")]
13219 public string? DisplayName { get; set; }
13220
13221 /// <summary>
13222 /// Serializes this PersonaProperties into a JSON string.
13223 /// </summary>
13224 public string Serialize()
13225 {
13226 return JsonSerializer.Serialize(
13227 this,
13228 new JsonSerializerOptions
13229 {
13230 WriteIndented = true,
13231 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13232 }
13233 );
13234 }
13235
13236 public PersonaProperties WithUserPrincipalName(string value)
13237 {
13238 this.UserPrincipalName = value;
13239 return this;
13240 }
13241
13242 public PersonaProperties WithDisplayName(string value)
13243 {
13244 this.DisplayName = value;
13245 return this;
13246 }
13247}
13248
13249/// <summary>
13250/// Displays multiple users' information, including their profile pictures.
13251/// </summary>
13252public class ComUsersMicrosoftGraphComponent : CardElement
13253{
13254 /// <summary>
13255 /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent.
13256 /// </summary>
13257 public static ComUsersMicrosoftGraphComponent? Deserialize(string json)
13258 {
13259 return JsonSerializer.Deserialize<ComUsersMicrosoftGraphComponent>(json);
13260 }
13261
13262 /// <summary>
13263 /// Must be **Component**.
13264 /// </summary>
13265 [JsonPropertyName("type")]
13266 public string Type { get; } = "Component";
13267
13268 /// <summary>
13269 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
13270 /// </summary>
13271 [JsonPropertyName("id")]
13272 public string? Id { get; set; }
13273
13274 /// <summary>
13275 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
13276 /// </summary>
13277 [JsonPropertyName("requires")]
13278 public HostCapabilities? Requires { get; set; }
13279
13280 /// <summary>
13281 /// The locale associated with the element.
13282 /// </summary>
13283 [JsonPropertyName("lang")]
13284 public string? Lang { get; set; }
13285
13286 /// <summary>
13287 /// Controls the visibility of the element.
13288 /// </summary>
13289 [JsonPropertyName("isVisible")]
13290 public bool? IsVisible { get; set; }
13291
13292 /// <summary>
13293 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
13294 /// </summary>
13295 [JsonPropertyName("separator")]
13296 public bool? Separator { get; set; }
13297
13298 /// <summary>
13299 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13300 /// </summary>
13301 [JsonPropertyName("height")]
13302 public ElementHeight? Height { get; set; }
13303
13304 /// <summary>
13305 /// Controls how the element should be horizontally aligned.
13306 /// </summary>
13307 [JsonPropertyName("horizontalAlignment")]
13308 public HorizontalAlignment? HorizontalAlignment { get; set; }
13309
13310 /// <summary>
13311 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13312 /// </summary>
13313 [JsonPropertyName("spacing")]
13314 public Spacing? Spacing { get; set; }
13315
13316 /// <summary>
13317 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
13318 /// </summary>
13319 [JsonPropertyName("targetWidth")]
13320 public TargetWidth? TargetWidth { get; set; }
13321
13322 /// <summary>
13323 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13324 /// </summary>
13325 [JsonPropertyName("isSortKey")]
13326 public bool? IsSortKey { get; set; }
13327
13328 /// <summary>
13329 /// Must be **graph.microsoft.com/users**.
13330 /// </summary>
13331 [JsonPropertyName("name")]
13332 public string Name { get; } = "graph.microsoft.com/users";
13333
13334 /// <summary>
13335 /// The properties of the set.
13336 /// </summary>
13337 [JsonPropertyName("properties")]
13338 public PersonaSetProperties? Properties { get; set; }
13339
13340 /// <summary>
13341 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13342 /// </summary>
13343 [JsonPropertyName("grid.area")]
13344 public string? GridArea { get; set; }
13345
13346 /// <summary>
13347 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
13348 /// </summary>
13349 [JsonPropertyName("fallback")]
13350 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13351
13352 /// <summary>
13353 /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string.
13354 /// </summary>
13355 public string Serialize()
13356 {
13357 return JsonSerializer.Serialize(
13358 this,
13359 new JsonSerializerOptions
13360 {
13361 WriteIndented = true,
13362 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13363 }
13364 );
13365 }
13366
13367 public ComUsersMicrosoftGraphComponent WithId(string value)
13368 {
13369 this.Id = value;
13370 return this;
13371 }
13372
13373 public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value)
13374 {
13375 this.Requires = value;
13376 return this;
13377 }
13378
13379 public ComUsersMicrosoftGraphComponent WithLang(string value)
13380 {
13381 this.Lang = value;
13382 return this;
13383 }
13384
13385 public ComUsersMicrosoftGraphComponent WithIsVisible(bool value)
13386 {
13387 this.IsVisible = value;
13388 return this;
13389 }
13390
13391 public ComUsersMicrosoftGraphComponent WithSeparator(bool value)
13392 {
13393 this.Separator = value;
13394 return this;
13395 }
13396
13397 public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value)
13398 {
13399 this.Height = value;
13400 return this;
13401 }
13402
13403 public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
13404 {
13405 this.HorizontalAlignment = value;
13406 return this;
13407 }
13408
13409 public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value)
13410 {
13411 this.Spacing = value;
13412 return this;
13413 }
13414
13415 public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
13416 {
13417 this.TargetWidth = value;
13418 return this;
13419 }
13420
13421 public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value)
13422 {
13423 this.IsSortKey = value;
13424 return this;
13425 }
13426
13427 public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value)
13428 {
13429 this.Properties = value;
13430 return this;
13431 }
13432
13433 public ComUsersMicrosoftGraphComponent WithGridArea(string value)
13434 {
13435 this.GridArea = value;
13436 return this;
13437 }
13438
13439 public ComUsersMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
13440 {
13441 this.Fallback = value;
13442 return this;
13443 }
13444}
13445
13446/// <summary>
13447/// Represents the properties of a PersonaSet component.
13448/// </summary>
13449public class PersonaSetProperties : SerializableObject
13450{
13451 /// <summary>
13452 /// Deserializes a JSON string into an object of type PersonaSetProperties.
13453 /// </summary>
13454 public static PersonaSetProperties? Deserialize(string json)
13455 {
13456 return JsonSerializer.Deserialize<PersonaSetProperties>(json);
13457 }
13458
13459 /// <summary>
13460 /// The users a PersonaSet component should display.
13461 /// </summary>
13462 [JsonPropertyName("users")]
13463 public IList<PersonaProperties>? Users { get; set; }
13464
13465 /// <summary>
13466 /// Serializes this PersonaSetProperties into a JSON string.
13467 /// </summary>
13468 public string Serialize()
13469 {
13470 return JsonSerializer.Serialize(
13471 this,
13472 new JsonSerializerOptions
13473 {
13474 WriteIndented = true,
13475 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13476 }
13477 );
13478 }
13479
13480 public PersonaSetProperties WithUsers(params IList<PersonaProperties> value)
13481 {
13482 this.Users = value;
13483 return this;
13484 }
13485}
13486
13487/// <summary>
13488/// Displays information about a generic graph resource.
13489/// </summary>
13490public class ComResourceMicrosoftGraphComponent : CardElement
13491{
13492 /// <summary>
13493 /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent.
13494 /// </summary>
13495 public static ComResourceMicrosoftGraphComponent? Deserialize(string json)
13496 {
13497 return JsonSerializer.Deserialize<ComResourceMicrosoftGraphComponent>(json);
13498 }
13499
13500 /// <summary>
13501 /// Must be **Component**.
13502 /// </summary>
13503 [JsonPropertyName("type")]
13504 public string Type { get; } = "Component";
13505
13506 /// <summary>
13507 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
13508 /// </summary>
13509 [JsonPropertyName("id")]
13510 public string? Id { get; set; }
13511
13512 /// <summary>
13513 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
13514 /// </summary>
13515 [JsonPropertyName("requires")]
13516 public HostCapabilities? Requires { get; set; }
13517
13518 /// <summary>
13519 /// The locale associated with the element.
13520 /// </summary>
13521 [JsonPropertyName("lang")]
13522 public string? Lang { get; set; }
13523
13524 /// <summary>
13525 /// Controls the visibility of the element.
13526 /// </summary>
13527 [JsonPropertyName("isVisible")]
13528 public bool? IsVisible { get; set; }
13529
13530 /// <summary>
13531 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
13532 /// </summary>
13533 [JsonPropertyName("separator")]
13534 public bool? Separator { get; set; }
13535
13536 /// <summary>
13537 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13538 /// </summary>
13539 [JsonPropertyName("height")]
13540 public ElementHeight? Height { get; set; }
13541
13542 /// <summary>
13543 /// Controls how the element should be horizontally aligned.
13544 /// </summary>
13545 [JsonPropertyName("horizontalAlignment")]
13546 public HorizontalAlignment? HorizontalAlignment { get; set; }
13547
13548 /// <summary>
13549 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13550 /// </summary>
13551 [JsonPropertyName("spacing")]
13552 public Spacing? Spacing { get; set; }
13553
13554 /// <summary>
13555 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
13556 /// </summary>
13557 [JsonPropertyName("targetWidth")]
13558 public TargetWidth? TargetWidth { get; set; }
13559
13560 /// <summary>
13561 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13562 /// </summary>
13563 [JsonPropertyName("isSortKey")]
13564 public bool? IsSortKey { get; set; }
13565
13566 /// <summary>
13567 /// Must be **graph.microsoft.com/resource**.
13568 /// </summary>
13569 [JsonPropertyName("name")]
13570 public string Name { get; } = "graph.microsoft.com/resource";
13571
13572 /// <summary>
13573 /// The properties of the resource.
13574 /// </summary>
13575 [JsonPropertyName("properties")]
13576 public ResourceProperties? Properties { get; set; }
13577
13578 /// <summary>
13579 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13580 /// </summary>
13581 [JsonPropertyName("grid.area")]
13582 public string? GridArea { get; set; }
13583
13584 /// <summary>
13585 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
13586 /// </summary>
13587 [JsonPropertyName("fallback")]
13588 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13589
13590 /// <summary>
13591 /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string.
13592 /// </summary>
13593 public string Serialize()
13594 {
13595 return JsonSerializer.Serialize(
13596 this,
13597 new JsonSerializerOptions
13598 {
13599 WriteIndented = true,
13600 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13601 }
13602 );
13603 }
13604
13605 public ComResourceMicrosoftGraphComponent WithId(string value)
13606 {
13607 this.Id = value;
13608 return this;
13609 }
13610
13611 public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value)
13612 {
13613 this.Requires = value;
13614 return this;
13615 }
13616
13617 public ComResourceMicrosoftGraphComponent WithLang(string value)
13618 {
13619 this.Lang = value;
13620 return this;
13621 }
13622
13623 public ComResourceMicrosoftGraphComponent WithIsVisible(bool value)
13624 {
13625 this.IsVisible = value;
13626 return this;
13627 }
13628
13629 public ComResourceMicrosoftGraphComponent WithSeparator(bool value)
13630 {
13631 this.Separator = value;
13632 return this;
13633 }
13634
13635 public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value)
13636 {
13637 this.Height = value;
13638 return this;
13639 }
13640
13641 public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
13642 {
13643 this.HorizontalAlignment = value;
13644 return this;
13645 }
13646
13647 public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value)
13648 {
13649 this.Spacing = value;
13650 return this;
13651 }
13652
13653 public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
13654 {
13655 this.TargetWidth = value;
13656 return this;
13657 }
13658
13659 public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value)
13660 {
13661 this.IsSortKey = value;
13662 return this;
13663 }
13664
13665 public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value)
13666 {
13667 this.Properties = value;
13668 return this;
13669 }
13670
13671 public ComResourceMicrosoftGraphComponent WithGridArea(string value)
13672 {
13673 this.GridArea = value;
13674 return this;
13675 }
13676
13677 public ComResourceMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
13678 {
13679 this.Fallback = value;
13680 return this;
13681 }
13682}
13683
13684/// <summary>
13685/// Represents the properties of a resource component.
13686/// </summary>
13687public class ResourceProperties : SerializableObject
13688{
13689 /// <summary>
13690 /// Deserializes a JSON string into an object of type ResourceProperties.
13691 /// </summary>
13692 public static ResourceProperties? Deserialize(string json)
13693 {
13694 return JsonSerializer.Deserialize<ResourceProperties>(json);
13695 }
13696
13697 /// <summary>
13698 /// The Id of the resource.
13699 /// </summary>
13700 [JsonPropertyName("id")]
13701 public string? Id { get; set; }
13702
13703 /// <summary>
13704 /// The reference to the resource.
13705 /// </summary>
13706 [JsonPropertyName("resourceReference")]
13707 public IDictionary<string, string>? ResourceReference { get; set; }
13708
13709 /// <summary>
13710 /// The visualization of the resource.
13711 /// </summary>
13712 [JsonPropertyName("resourceVisualization")]
13713 public ResourceVisualization? ResourceVisualization { get; set; }
13714
13715 /// <summary>
13716 /// Serializes this ResourceProperties into a JSON string.
13717 /// </summary>
13718 public string Serialize()
13719 {
13720 return JsonSerializer.Serialize(
13721 this,
13722 new JsonSerializerOptions
13723 {
13724 WriteIndented = true,
13725 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13726 }
13727 );
13728 }
13729
13730 public ResourceProperties WithId(string value)
13731 {
13732 this.Id = value;
13733 return this;
13734 }
13735
13736 public ResourceProperties WithResourceReference(IDictionary<string, string> value)
13737 {
13738 this.ResourceReference = value;
13739 return this;
13740 }
13741
13742 public ResourceProperties WithResourceVisualization(ResourceVisualization value)
13743 {
13744 this.ResourceVisualization = value;
13745 return this;
13746 }
13747}
13748
13749/// <summary>
13750/// Represents a visualization of a resource.
13751/// </summary>
13752public class ResourceVisualization : SerializableObject
13753{
13754 /// <summary>
13755 /// Deserializes a JSON string into an object of type ResourceVisualization.
13756 /// </summary>
13757 public static ResourceVisualization? Deserialize(string json)
13758 {
13759 return JsonSerializer.Deserialize<ResourceVisualization>(json);
13760 }
13761
13762 /// <summary>
13763 /// The media associated with the resource.
13764 /// </summary>
13765 [JsonPropertyName("media")]
13766 public string? Media { get; set; }
13767
13768 /// <summary>
13769 /// Serializes this ResourceVisualization into a JSON string.
13770 /// </summary>
13771 public string Serialize()
13772 {
13773 return JsonSerializer.Serialize(
13774 this,
13775 new JsonSerializerOptions
13776 {
13777 WriteIndented = true,
13778 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13779 }
13780 );
13781 }
13782
13783 public ResourceVisualization WithMedia(string value)
13784 {
13785 this.Media = value;
13786 return this;
13787 }
13788}
13789
13790/// <summary>
13791/// Displays information about a file resource.
13792/// </summary>
13793public class ComFileMicrosoftGraphComponent : CardElement
13794{
13795 /// <summary>
13796 /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent.
13797 /// </summary>
13798 public static ComFileMicrosoftGraphComponent? Deserialize(string json)
13799 {
13800 return JsonSerializer.Deserialize<ComFileMicrosoftGraphComponent>(json);
13801 }
13802
13803 /// <summary>
13804 /// Must be **Component**.
13805 /// </summary>
13806 [JsonPropertyName("type")]
13807 public string Type { get; } = "Component";
13808
13809 /// <summary>
13810 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
13811 /// </summary>
13812 [JsonPropertyName("id")]
13813 public string? Id { get; set; }
13814
13815 /// <summary>
13816 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
13817 /// </summary>
13818 [JsonPropertyName("requires")]
13819 public HostCapabilities? Requires { get; set; }
13820
13821 /// <summary>
13822 /// The locale associated with the element.
13823 /// </summary>
13824 [JsonPropertyName("lang")]
13825 public string? Lang { get; set; }
13826
13827 /// <summary>
13828 /// Controls the visibility of the element.
13829 /// </summary>
13830 [JsonPropertyName("isVisible")]
13831 public bool? IsVisible { get; set; }
13832
13833 /// <summary>
13834 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
13835 /// </summary>
13836 [JsonPropertyName("separator")]
13837 public bool? Separator { get; set; }
13838
13839 /// <summary>
13840 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13841 /// </summary>
13842 [JsonPropertyName("height")]
13843 public ElementHeight? Height { get; set; }
13844
13845 /// <summary>
13846 /// Controls how the element should be horizontally aligned.
13847 /// </summary>
13848 [JsonPropertyName("horizontalAlignment")]
13849 public HorizontalAlignment? HorizontalAlignment { get; set; }
13850
13851 /// <summary>
13852 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13853 /// </summary>
13854 [JsonPropertyName("spacing")]
13855 public Spacing? Spacing { get; set; }
13856
13857 /// <summary>
13858 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
13859 /// </summary>
13860 [JsonPropertyName("targetWidth")]
13861 public TargetWidth? TargetWidth { get; set; }
13862
13863 /// <summary>
13864 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13865 /// </summary>
13866 [JsonPropertyName("isSortKey")]
13867 public bool? IsSortKey { get; set; }
13868
13869 /// <summary>
13870 /// Must be **graph.microsoft.com/file**.
13871 /// </summary>
13872 [JsonPropertyName("name")]
13873 public string Name { get; } = "graph.microsoft.com/file";
13874
13875 /// <summary>
13876 /// The properties of the file.
13877 /// </summary>
13878 [JsonPropertyName("properties")]
13879 public FileProperties? Properties { get; set; }
13880
13881 /// <summary>
13882 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13883 /// </summary>
13884 [JsonPropertyName("grid.area")]
13885 public string? GridArea { get; set; }
13886
13887 /// <summary>
13888 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
13889 /// </summary>
13890 [JsonPropertyName("fallback")]
13891 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13892
13893 /// <summary>
13894 /// Serializes this ComFileMicrosoftGraphComponent into a JSON string.
13895 /// </summary>
13896 public string Serialize()
13897 {
13898 return JsonSerializer.Serialize(
13899 this,
13900 new JsonSerializerOptions
13901 {
13902 WriteIndented = true,
13903 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13904 }
13905 );
13906 }
13907
13908 public ComFileMicrosoftGraphComponent WithId(string value)
13909 {
13910 this.Id = value;
13911 return this;
13912 }
13913
13914 public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value)
13915 {
13916 this.Requires = value;
13917 return this;
13918 }
13919
13920 public ComFileMicrosoftGraphComponent WithLang(string value)
13921 {
13922 this.Lang = value;
13923 return this;
13924 }
13925
13926 public ComFileMicrosoftGraphComponent WithIsVisible(bool value)
13927 {
13928 this.IsVisible = value;
13929 return this;
13930 }
13931
13932 public ComFileMicrosoftGraphComponent WithSeparator(bool value)
13933 {
13934 this.Separator = value;
13935 return this;
13936 }
13937
13938 public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value)
13939 {
13940 this.Height = value;
13941 return this;
13942 }
13943
13944 public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
13945 {
13946 this.HorizontalAlignment = value;
13947 return this;
13948 }
13949
13950 public ComFileMicrosoftGraphComponent WithSpacing(Spacing value)
13951 {
13952 this.Spacing = value;
13953 return this;
13954 }
13955
13956 public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
13957 {
13958 this.TargetWidth = value;
13959 return this;
13960 }
13961
13962 public ComFileMicrosoftGraphComponent WithIsSortKey(bool value)
13963 {
13964 this.IsSortKey = value;
13965 return this;
13966 }
13967
13968 public ComFileMicrosoftGraphComponent WithProperties(FileProperties value)
13969 {
13970 this.Properties = value;
13971 return this;
13972 }
13973
13974 public ComFileMicrosoftGraphComponent WithGridArea(string value)
13975 {
13976 this.GridArea = value;
13977 return this;
13978 }
13979
13980 public ComFileMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
13981 {
13982 this.Fallback = value;
13983 return this;
13984 }
13985}
13986
13987/// <summary>
13988/// Represents the properties of a file component.
13989/// </summary>
13990public class FileProperties : SerializableObject
13991{
13992 /// <summary>
13993 /// Deserializes a JSON string into an object of type FileProperties.
13994 /// </summary>
13995 public static FileProperties? Deserialize(string json)
13996 {
13997 return JsonSerializer.Deserialize<FileProperties>(json);
13998 }
13999
14000 /// <summary>
14001 /// The name of the file.
14002 /// </summary>
14003 [JsonPropertyName("name")]
14004 public string? Name { get; set; }
14005
14006 /// <summary>
14007 /// The file extension.
14008 /// </summary>
14009 [JsonPropertyName("extension")]
14010 public string? Extension { get; set; }
14011
14012 /// <summary>
14013 /// The URL of the file.
14014 /// </summary>
14015 [JsonPropertyName("url")]
14016 public string? Url { get; set; }
14017
14018 /// <summary>
14019 /// Serializes this FileProperties into a JSON string.
14020 /// </summary>
14021 public string Serialize()
14022 {
14023 return JsonSerializer.Serialize(
14024 this,
14025 new JsonSerializerOptions
14026 {
14027 WriteIndented = true,
14028 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14029 }
14030 );
14031 }
14032
14033 public FileProperties WithName(string value)
14034 {
14035 this.Name = value;
14036 return this;
14037 }
14038
14039 public FileProperties WithExtension(string value)
14040 {
14041 this.Extension = value;
14042 return this;
14043 }
14044
14045 public FileProperties WithUrl(string value)
14046 {
14047 this.Url = value;
14048 return this;
14049 }
14050}
14051
14052/// <summary>
14053/// Displays information about a calendar event.
14054/// </summary>
14055public class ComEventMicrosoftGraphComponent : CardElement
14056{
14057 /// <summary>
14058 /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent.
14059 /// </summary>
14060 public static ComEventMicrosoftGraphComponent? Deserialize(string json)
14061 {
14062 return JsonSerializer.Deserialize<ComEventMicrosoftGraphComponent>(json);
14063 }
14064
14065 /// <summary>
14066 /// Must be **Component**.
14067 /// </summary>
14068 [JsonPropertyName("type")]
14069 public string Type { get; } = "Component";
14070
14071 /// <summary>
14072 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
14073 /// </summary>
14074 [JsonPropertyName("id")]
14075 public string? Id { get; set; }
14076
14077 /// <summary>
14078 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
14079 /// </summary>
14080 [JsonPropertyName("requires")]
14081 public HostCapabilities? Requires { get; set; }
14082
14083 /// <summary>
14084 /// The locale associated with the element.
14085 /// </summary>
14086 [JsonPropertyName("lang")]
14087 public string? Lang { get; set; }
14088
14089 /// <summary>
14090 /// Controls the visibility of the element.
14091 /// </summary>
14092 [JsonPropertyName("isVisible")]
14093 public bool? IsVisible { get; set; }
14094
14095 /// <summary>
14096 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
14097 /// </summary>
14098 [JsonPropertyName("separator")]
14099 public bool? Separator { get; set; }
14100
14101 /// <summary>
14102 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14103 /// </summary>
14104 [JsonPropertyName("height")]
14105 public ElementHeight? Height { get; set; }
14106
14107 /// <summary>
14108 /// Controls how the element should be horizontally aligned.
14109 /// </summary>
14110 [JsonPropertyName("horizontalAlignment")]
14111 public HorizontalAlignment? HorizontalAlignment { get; set; }
14112
14113 /// <summary>
14114 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
14115 /// </summary>
14116 [JsonPropertyName("spacing")]
14117 public Spacing? Spacing { get; set; }
14118
14119 /// <summary>
14120 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
14121 /// </summary>
14122 [JsonPropertyName("targetWidth")]
14123 public TargetWidth? TargetWidth { get; set; }
14124
14125 /// <summary>
14126 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14127 /// </summary>
14128 [JsonPropertyName("isSortKey")]
14129 public bool? IsSortKey { get; set; }
14130
14131 /// <summary>
14132 /// Must be **graph.microsoft.com/event**.
14133 /// </summary>
14134 [JsonPropertyName("name")]
14135 public string Name { get; } = "graph.microsoft.com/event";
14136
14137 /// <summary>
14138 /// The properties of the event.
14139 /// </summary>
14140 [JsonPropertyName("properties")]
14141 public CalendarEventProperties? Properties { get; set; }
14142
14143 /// <summary>
14144 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14145 /// </summary>
14146 [JsonPropertyName("grid.area")]
14147 public string? GridArea { get; set; }
14148
14149 /// <summary>
14150 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
14151 /// </summary>
14152 [JsonPropertyName("fallback")]
14153 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14154
14155 /// <summary>
14156 /// Serializes this ComEventMicrosoftGraphComponent into a JSON string.
14157 /// </summary>
14158 public string Serialize()
14159 {
14160 return JsonSerializer.Serialize(
14161 this,
14162 new JsonSerializerOptions
14163 {
14164 WriteIndented = true,
14165 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14166 }
14167 );
14168 }
14169
14170 public ComEventMicrosoftGraphComponent WithId(string value)
14171 {
14172 this.Id = value;
14173 return this;
14174 }
14175
14176 public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value)
14177 {
14178 this.Requires = value;
14179 return this;
14180 }
14181
14182 public ComEventMicrosoftGraphComponent WithLang(string value)
14183 {
14184 this.Lang = value;
14185 return this;
14186 }
14187
14188 public ComEventMicrosoftGraphComponent WithIsVisible(bool value)
14189 {
14190 this.IsVisible = value;
14191 return this;
14192 }
14193
14194 public ComEventMicrosoftGraphComponent WithSeparator(bool value)
14195 {
14196 this.Separator = value;
14197 return this;
14198 }
14199
14200 public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value)
14201 {
14202 this.Height = value;
14203 return this;
14204 }
14205
14206 public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
14207 {
14208 this.HorizontalAlignment = value;
14209 return this;
14210 }
14211
14212 public ComEventMicrosoftGraphComponent WithSpacing(Spacing value)
14213 {
14214 this.Spacing = value;
14215 return this;
14216 }
14217
14218 public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
14219 {
14220 this.TargetWidth = value;
14221 return this;
14222 }
14223
14224 public ComEventMicrosoftGraphComponent WithIsSortKey(bool value)
14225 {
14226 this.IsSortKey = value;
14227 return this;
14228 }
14229
14230 public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value)
14231 {
14232 this.Properties = value;
14233 return this;
14234 }
14235
14236 public ComEventMicrosoftGraphComponent WithGridArea(string value)
14237 {
14238 this.GridArea = value;
14239 return this;
14240 }
14241
14242 public ComEventMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
14243 {
14244 this.Fallback = value;
14245 return this;
14246 }
14247}
14248
14249/// <summary>
14250/// The properties of a calendar event.
14251/// </summary>
14252public class CalendarEventProperties : SerializableObject
14253{
14254 /// <summary>
14255 /// Deserializes a JSON string into an object of type CalendarEventProperties.
14256 /// </summary>
14257 public static CalendarEventProperties? Deserialize(string json)
14258 {
14259 return JsonSerializer.Deserialize<CalendarEventProperties>(json);
14260 }
14261
14262 /// <summary>
14263 /// The ID of the event.
14264 /// </summary>
14265 [JsonPropertyName("id")]
14266 public string? Id { get; set; }
14267
14268 /// <summary>
14269 /// The title of the event.
14270 /// </summary>
14271 [JsonPropertyName("title")]
14272 public string? Title { get; set; }
14273
14274 /// <summary>
14275 /// The start date and time of the event.
14276 /// </summary>
14277 [JsonPropertyName("start")]
14278 public string? Start { get; set; }
14279
14280 /// <summary>
14281 /// The end date and time of the event.
14282 /// </summary>
14283 [JsonPropertyName("end")]
14284 public string? End { get; set; }
14285
14286 /// <summary>
14287 /// The status of the event.
14288 /// </summary>
14289 [JsonPropertyName("status")]
14290 public string? Status { get; set; }
14291
14292 /// <summary>
14293 /// The locations of the event.
14294 /// </summary>
14295 [JsonPropertyName("locations")]
14296 public IList<string>? Locations { get; set; }
14297
14298 /// <summary>
14299 /// The URL of the online meeting.
14300 /// </summary>
14301 [JsonPropertyName("onlineMeetingUrl")]
14302 public string? OnlineMeetingUrl { get; set; }
14303
14304 /// <summary>
14305 /// Indicates if the event is all day.
14306 /// </summary>
14307 [JsonPropertyName("isAllDay")]
14308 public bool? IsAllDay { get; set; }
14309
14310 /// <summary>
14311 /// The extension of the event.
14312 /// </summary>
14313 [JsonPropertyName("extension")]
14314 public string? Extension { get; set; }
14315
14316 /// <summary>
14317 /// The URL of the event.
14318 /// </summary>
14319 [JsonPropertyName("url")]
14320 public string? Url { get; set; }
14321
14322 /// <summary>
14323 /// The attendees of the event.
14324 /// </summary>
14325 [JsonPropertyName("attendees")]
14326 public IList<CalendarEventAttendee>? Attendees { get; set; }
14327
14328 /// <summary>
14329 /// The organizer of the event.
14330 /// </summary>
14331 [JsonPropertyName("organizer")]
14332 public CalendarEventAttendee? Organizer { get; set; }
14333
14334 /// <summary>
14335 /// Serializes this CalendarEventProperties into a JSON string.
14336 /// </summary>
14337 public string Serialize()
14338 {
14339 return JsonSerializer.Serialize(
14340 this,
14341 new JsonSerializerOptions
14342 {
14343 WriteIndented = true,
14344 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14345 }
14346 );
14347 }
14348
14349 public CalendarEventProperties WithId(string value)
14350 {
14351 this.Id = value;
14352 return this;
14353 }
14354
14355 public CalendarEventProperties WithTitle(string value)
14356 {
14357 this.Title = value;
14358 return this;
14359 }
14360
14361 public CalendarEventProperties WithStart(string value)
14362 {
14363 this.Start = value;
14364 return this;
14365 }
14366
14367 public CalendarEventProperties WithEnd(string value)
14368 {
14369 this.End = value;
14370 return this;
14371 }
14372
14373 public CalendarEventProperties WithStatus(string value)
14374 {
14375 this.Status = value;
14376 return this;
14377 }
14378
14379 public CalendarEventProperties WithLocations(params IList<string> value)
14380 {
14381 this.Locations = value;
14382 return this;
14383 }
14384
14385 public CalendarEventProperties WithOnlineMeetingUrl(string value)
14386 {
14387 this.OnlineMeetingUrl = value;
14388 return this;
14389 }
14390
14391 public CalendarEventProperties WithIsAllDay(bool value)
14392 {
14393 this.IsAllDay = value;
14394 return this;
14395 }
14396
14397 public CalendarEventProperties WithExtension(string value)
14398 {
14399 this.Extension = value;
14400 return this;
14401 }
14402
14403 public CalendarEventProperties WithUrl(string value)
14404 {
14405 this.Url = value;
14406 return this;
14407 }
14408
14409 public CalendarEventProperties WithAttendees(params IList<CalendarEventAttendee> value)
14410 {
14411 this.Attendees = value;
14412 return this;
14413 }
14414
14415 public CalendarEventProperties WithOrganizer(CalendarEventAttendee value)
14416 {
14417 this.Organizer = value;
14418 return this;
14419 }
14420}
14421
14422/// <summary>
14423/// Represents a calendar event attendee.
14424/// </summary>
14425public class CalendarEventAttendee : SerializableObject
14426{
14427 /// <summary>
14428 /// Deserializes a JSON string into an object of type CalendarEventAttendee.
14429 /// </summary>
14430 public static CalendarEventAttendee? Deserialize(string json)
14431 {
14432 return JsonSerializer.Deserialize<CalendarEventAttendee>(json);
14433 }
14434
14435 /// <summary>
14436 /// The name of the attendee.
14437 /// </summary>
14438 [JsonPropertyName("name")]
14439 public string? Name { get; set; }
14440
14441 /// <summary>
14442 /// The email address of the attendee.
14443 /// </summary>
14444 [JsonPropertyName("email")]
14445 public string? Email { get; set; }
14446
14447 /// <summary>
14448 /// The title of the attendee.
14449 /// </summary>
14450 [JsonPropertyName("title")]
14451 public string? Title { get; set; }
14452
14453 /// <summary>
14454 /// The type of the attendee.
14455 /// </summary>
14456 [JsonPropertyName("type")]
14457 public string? Type { get; set; }
14458
14459 /// <summary>
14460 /// The status of the attendee.
14461 /// </summary>
14462 [JsonPropertyName("status")]
14463 public string? Status { get; set; }
14464
14465 /// <summary>
14466 /// Serializes this CalendarEventAttendee into a JSON string.
14467 /// </summary>
14468 public string Serialize()
14469 {
14470 return JsonSerializer.Serialize(
14471 this,
14472 new JsonSerializerOptions
14473 {
14474 WriteIndented = true,
14475 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14476 }
14477 );
14478 }
14479
14480 public CalendarEventAttendee WithName(string value)
14481 {
14482 this.Name = value;
14483 return this;
14484 }
14485
14486 public CalendarEventAttendee WithEmail(string value)
14487 {
14488 this.Email = value;
14489 return this;
14490 }
14491
14492 public CalendarEventAttendee WithTitle(string value)
14493 {
14494 this.Title = value;
14495 return this;
14496 }
14497
14498 public CalendarEventAttendee WithType(string value)
14499 {
14500 this.Type = value;
14501 return this;
14502 }
14503
14504 public CalendarEventAttendee WithStatus(string value)
14505 {
14506 this.Status = value;
14507 return this;
14508 }
14509}
14510
14511/// <summary>
14512/// A page inside a Carousel element.
14513/// </summary>
14514public class CarouselPage : CardElement
14515{
14516 /// <summary>
14517 /// Deserializes a JSON string into an object of type CarouselPage.
14518 /// </summary>
14519 public static CarouselPage? Deserialize(string json)
14520 {
14521 return JsonSerializer.Deserialize<CarouselPage>(json);
14522 }
14523
14524 /// <summary>
14525 /// Must be **CarouselPage**.
14526 /// </summary>
14527 [JsonPropertyName("type")]
14528 public string Type { get; } = "CarouselPage";
14529
14530 /// <summary>
14531 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
14532 /// </summary>
14533 [JsonPropertyName("id")]
14534 public string? Id { get; set; }
14535
14536 /// <summary>
14537 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
14538 /// </summary>
14539 [JsonPropertyName("requires")]
14540 public HostCapabilities? Requires { get; set; }
14541
14542 /// <summary>
14543 /// The locale associated with the element.
14544 /// </summary>
14545 [JsonPropertyName("lang")]
14546 public string? Lang { get; set; }
14547
14548 /// <summary>
14549 /// Controls the visibility of the element.
14550 /// </summary>
14551 [JsonPropertyName("isVisible")]
14552 public bool? IsVisible { get; set; }
14553
14554 /// <summary>
14555 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14556 /// </summary>
14557 [JsonPropertyName("height")]
14558 public ElementHeight? Height { get; set; }
14559
14560 /// <summary>
14561 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
14562 /// </summary>
14563 [JsonPropertyName("targetWidth")]
14564 public TargetWidth? TargetWidth { get; set; }
14565
14566 /// <summary>
14567 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14568 /// </summary>
14569 [JsonPropertyName("isSortKey")]
14570 public bool? IsSortKey { get; set; }
14571
14572 /// <summary>
14573 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
14574 /// </summary>
14575 [JsonPropertyName("selectAction")]
14576 public Action? SelectAction { get; set; }
14577
14578 /// <summary>
14579 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
14580 /// </summary>
14581 [JsonPropertyName("style")]
14582 public ContainerStyle? Style { get; set; }
14583
14584 /// <summary>
14585 /// Controls if a border should be displayed around the container.
14586 /// </summary>
14587 [JsonPropertyName("showBorder")]
14588 public bool? ShowBorder { get; set; }
14589
14590 /// <summary>
14591 /// Controls if the container should have rounded corners.
14592 /// </summary>
14593 [JsonPropertyName("roundedCorners")]
14594 public bool? RoundedCorners { get; set; }
14595
14596 /// <summary>
14597 /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
14598 /// </summary>
14599 [JsonPropertyName("layouts")]
14600 public IList<ContainerLayout>? Layouts { get; set; }
14601
14602 /// <summary>
14603 /// The minimum height, in pixels, of the container, in the `<number>px` format.
14604 /// </summary>
14605 [JsonPropertyName("minHeight")]
14606 public string? MinHeight { get; set; }
14607
14608 /// <summary>
14609 /// Defines the container's background image.
14610 /// </summary>
14611 [JsonPropertyName("backgroundImage")]
14612 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
14613
14614 /// <summary>
14615 /// Controls how the container's content should be vertically aligned.
14616 /// </summary>
14617 [JsonPropertyName("verticalContentAlignment")]
14618 public VerticalAlignment? VerticalContentAlignment { get; set; }
14619
14620 /// <summary>
14621 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
14622 /// </summary>
14623 [JsonPropertyName("rtl")]
14624 public bool? Rtl { get; set; }
14625
14626 /// <summary>
14627 /// The maximum height, in pixels, of the container, in the `<number>px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.
14628 /// </summary>
14629 [JsonPropertyName("maxHeight")]
14630 public string? MaxHeight { get; set; }
14631
14632 /// <summary>
14633 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14634 /// </summary>
14635 [JsonPropertyName("grid.area")]
14636 public string? GridArea { get; set; }
14637
14638 /// <summary>
14639 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
14640 /// </summary>
14641 [JsonPropertyName("fallback")]
14642 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14643
14644 /// <summary>
14645 /// The elements in the page.
14646 /// </summary>
14647 [JsonPropertyName("items")]
14648 public IList<CardElement>? Items { get; set; }
14649
14650 public CarouselPage(params IList<CardElement> items)
14651 {
14652 this.Items = items;
14653 }
14654
14655 /// <summary>
14656 /// Serializes this CarouselPage into a JSON string.
14657 /// </summary>
14658 public string Serialize()
14659 {
14660 return JsonSerializer.Serialize(
14661 this,
14662 new JsonSerializerOptions
14663 {
14664 WriteIndented = true,
14665 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14666 }
14667 );
14668 }
14669
14670 public CarouselPage WithId(string value)
14671 {
14672 this.Id = value;
14673 return this;
14674 }
14675
14676 public CarouselPage WithRequires(HostCapabilities value)
14677 {
14678 this.Requires = value;
14679 return this;
14680 }
14681
14682 public CarouselPage WithLang(string value)
14683 {
14684 this.Lang = value;
14685 return this;
14686 }
14687
14688 public CarouselPage WithIsVisible(bool value)
14689 {
14690 this.IsVisible = value;
14691 return this;
14692 }
14693
14694 public CarouselPage WithHeight(ElementHeight value)
14695 {
14696 this.Height = value;
14697 return this;
14698 }
14699
14700 public CarouselPage WithTargetWidth(TargetWidth value)
14701 {
14702 this.TargetWidth = value;
14703 return this;
14704 }
14705
14706 public CarouselPage WithIsSortKey(bool value)
14707 {
14708 this.IsSortKey = value;
14709 return this;
14710 }
14711
14712 public CarouselPage WithSelectAction(Action value)
14713 {
14714 this.SelectAction = value;
14715 return this;
14716 }
14717
14718 public CarouselPage WithStyle(ContainerStyle value)
14719 {
14720 this.Style = value;
14721 return this;
14722 }
14723
14724 public CarouselPage WithShowBorder(bool value)
14725 {
14726 this.ShowBorder = value;
14727 return this;
14728 }
14729
14730 public CarouselPage WithRoundedCorners(bool value)
14731 {
14732 this.RoundedCorners = value;
14733 return this;
14734 }
14735
14736 public CarouselPage WithLayouts(params IList<ContainerLayout> value)
14737 {
14738 this.Layouts = value;
14739 return this;
14740 }
14741
14742 public CarouselPage WithMinHeight(string value)
14743 {
14744 this.MinHeight = value;
14745 return this;
14746 }
14747
14748 public CarouselPage WithBackgroundImage(IUnion<string, BackgroundImage> value)
14749 {
14750 this.BackgroundImage = value;
14751 return this;
14752 }
14753
14754 public CarouselPage WithVerticalContentAlignment(VerticalAlignment value)
14755 {
14756 this.VerticalContentAlignment = value;
14757 return this;
14758 }
14759
14760 public CarouselPage WithRtl(bool value)
14761 {
14762 this.Rtl = value;
14763 return this;
14764 }
14765
14766 public CarouselPage WithMaxHeight(string value)
14767 {
14768 this.MaxHeight = value;
14769 return this;
14770 }
14771
14772 public CarouselPage WithGridArea(string value)
14773 {
14774 this.GridArea = value;
14775 return this;
14776 }
14777
14778 public CarouselPage WithFallback(IUnion<CardElement, FallbackElement> value)
14779 {
14780 this.Fallback = value;
14781 return this;
14782 }
14783
14784 public CarouselPage WithItems(params IList<CardElement> value)
14785 {
14786 this.Items = value;
14787 return this;
14788 }
14789}
14790
14791/// <summary>
14792/// Represents a row of cells in a table.
14793/// </summary>
14794public class TableRow : CardElement
14795{
14796 /// <summary>
14797 /// Deserializes a JSON string into an object of type TableRow.
14798 /// </summary>
14799 public static TableRow? Deserialize(string json)
14800 {
14801 return JsonSerializer.Deserialize<TableRow>(json);
14802 }
14803
14804 /// <summary>
14805 /// Must be **TableRow**.
14806 /// </summary>
14807 [JsonPropertyName("type")]
14808 public string Type { get; } = "TableRow";
14809
14810 /// <summary>
14811 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
14812 /// </summary>
14813 [JsonPropertyName("id")]
14814 public string? Id { get; set; }
14815
14816 /// <summary>
14817 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
14818 /// </summary>
14819 [JsonPropertyName("requires")]
14820 public HostCapabilities? Requires { get; set; }
14821
14822 /// <summary>
14823 /// The locale associated with the element.
14824 /// </summary>
14825 [JsonPropertyName("lang")]
14826 public string? Lang { get; set; }
14827
14828 /// <summary>
14829 /// Controls the visibility of the element.
14830 /// </summary>
14831 [JsonPropertyName("isVisible")]
14832 public bool? IsVisible { get; set; }
14833
14834 /// <summary>
14835 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
14836 /// </summary>
14837 [JsonPropertyName("separator")]
14838 public bool? Separator { get; set; }
14839
14840 /// <summary>
14841 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14842 /// </summary>
14843 [JsonPropertyName("height")]
14844 public ElementHeight? Height { get; set; }
14845
14846 /// <summary>
14847 /// Controls how the element should be horizontally aligned.
14848 /// </summary>
14849 [JsonPropertyName("horizontalAlignment")]
14850 public HorizontalAlignment? HorizontalAlignment { get; set; }
14851
14852 /// <summary>
14853 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
14854 /// </summary>
14855 [JsonPropertyName("spacing")]
14856 public Spacing? Spacing { get; set; }
14857
14858 /// <summary>
14859 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
14860 /// </summary>
14861 [JsonPropertyName("targetWidth")]
14862 public TargetWidth? TargetWidth { get; set; }
14863
14864 /// <summary>
14865 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14866 /// </summary>
14867 [JsonPropertyName("isSortKey")]
14868 public bool? IsSortKey { get; set; }
14869
14870 /// <summary>
14871 /// Controls if a border should be displayed around the container.
14872 /// </summary>
14873 [JsonPropertyName("showBorder")]
14874 public bool? ShowBorder { get; set; }
14875
14876 /// <summary>
14877 /// Controls if the container should have rounded corners.
14878 /// </summary>
14879 [JsonPropertyName("roundedCorners")]
14880 public bool? RoundedCorners { get; set; }
14881
14882 /// <summary>
14883 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
14884 /// </summary>
14885 [JsonPropertyName("style")]
14886 public ContainerStyle? Style { get; set; }
14887
14888 /// <summary>
14889 /// Controls how the content of every cell in the row should be horizontally aligned by default. This property overrides the horizontalCellContentAlignment property of the table and columns.
14890 /// </summary>
14891 [JsonPropertyName("horizontalCellContentAlignment")]
14892 public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
14893
14894 /// <summary>
14895 /// Controls how the content of every cell in the row should be vertically aligned by default. This property overrides the verticalCellContentAlignment property of the table and columns.
14896 /// </summary>
14897 [JsonPropertyName("verticalCellContentAlignment")]
14898 public VerticalAlignment? VerticalCellContentAlignment { get; set; }
14899
14900 /// <summary>
14901 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14902 /// </summary>
14903 [JsonPropertyName("grid.area")]
14904 public string? GridArea { get; set; }
14905
14906 /// <summary>
14907 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
14908 /// </summary>
14909 [JsonPropertyName("fallback")]
14910 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14911
14912 /// <summary>
14913 /// The cells in the row.
14914 /// </summary>
14915 [JsonPropertyName("cells")]
14916 public IList<TableCell>? Cells { get; set; }
14917
14918 /// <summary>
14919 /// Serializes this TableRow into a JSON string.
14920 /// </summary>
14921 public string Serialize()
14922 {
14923 return JsonSerializer.Serialize(
14924 this,
14925 new JsonSerializerOptions
14926 {
14927 WriteIndented = true,
14928 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14929 }
14930 );
14931 }
14932
14933 public TableRow WithId(string value)
14934 {
14935 this.Id = value;
14936 return this;
14937 }
14938
14939 public TableRow WithRequires(HostCapabilities value)
14940 {
14941 this.Requires = value;
14942 return this;
14943 }
14944
14945 public TableRow WithLang(string value)
14946 {
14947 this.Lang = value;
14948 return this;
14949 }
14950
14951 public TableRow WithIsVisible(bool value)
14952 {
14953 this.IsVisible = value;
14954 return this;
14955 }
14956
14957 public TableRow WithSeparator(bool value)
14958 {
14959 this.Separator = value;
14960 return this;
14961 }
14962
14963 public TableRow WithHeight(ElementHeight value)
14964 {
14965 this.Height = value;
14966 return this;
14967 }
14968
14969 public TableRow WithHorizontalAlignment(HorizontalAlignment value)
14970 {
14971 this.HorizontalAlignment = value;
14972 return this;
14973 }
14974
14975 public TableRow WithSpacing(Spacing value)
14976 {
14977 this.Spacing = value;
14978 return this;
14979 }
14980
14981 public TableRow WithTargetWidth(TargetWidth value)
14982 {
14983 this.TargetWidth = value;
14984 return this;
14985 }
14986
14987 public TableRow WithIsSortKey(bool value)
14988 {
14989 this.IsSortKey = value;
14990 return this;
14991 }
14992
14993 public TableRow WithShowBorder(bool value)
14994 {
14995 this.ShowBorder = value;
14996 return this;
14997 }
14998
14999 public TableRow WithRoundedCorners(bool value)
15000 {
15001 this.RoundedCorners = value;
15002 return this;
15003 }
15004
15005 public TableRow WithStyle(ContainerStyle value)
15006 {
15007 this.Style = value;
15008 return this;
15009 }
15010
15011 public TableRow WithHorizontalCellContentAlignment(HorizontalAlignment value)
15012 {
15013 this.HorizontalCellContentAlignment = value;
15014 return this;
15015 }
15016
15017 public TableRow WithVerticalCellContentAlignment(VerticalAlignment value)
15018 {
15019 this.VerticalCellContentAlignment = value;
15020 return this;
15021 }
15022
15023 public TableRow WithGridArea(string value)
15024 {
15025 this.GridArea = value;
15026 return this;
15027 }
15028
15029 public TableRow WithFallback(IUnion<CardElement, FallbackElement> value)
15030 {
15031 this.Fallback = value;
15032 return this;
15033 }
15034
15035 public TableRow WithCells(params IList<TableCell> value)
15036 {
15037 this.Cells = value;
15038 return this;
15039 }
15040}
15041
15042/// <summary>
15043/// Represents a cell in a table row.
15044/// </summary>
15045public class TableCell : CardElement
15046{
15047 /// <summary>
15048 /// Deserializes a JSON string into an object of type TableCell.
15049 /// </summary>
15050 public static TableCell? Deserialize(string json)
15051 {
15052 return JsonSerializer.Deserialize<TableCell>(json);
15053 }
15054
15055 /// <summary>
15056 /// Must be **TableCell**.
15057 /// </summary>
15058 [JsonPropertyName("type")]
15059 public string Type { get; } = "TableCell";
15060
15061 /// <summary>
15062 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
15063 /// </summary>
15064 [JsonPropertyName("id")]
15065 public string? Id { get; set; }
15066
15067 /// <summary>
15068 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
15069 /// </summary>
15070 [JsonPropertyName("requires")]
15071 public HostCapabilities? Requires { get; set; }
15072
15073 /// <summary>
15074 /// The locale associated with the element.
15075 /// </summary>
15076 [JsonPropertyName("lang")]
15077 public string? Lang { get; set; }
15078
15079 /// <summary>
15080 /// Controls the visibility of the element.
15081 /// </summary>
15082 [JsonPropertyName("isVisible")]
15083 public bool? IsVisible { get; set; }
15084
15085 /// <summary>
15086 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
15087 /// </summary>
15088 [JsonPropertyName("separator")]
15089 public bool? Separator { get; set; }
15090
15091 /// <summary>
15092 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
15093 /// </summary>
15094 [JsonPropertyName("height")]
15095 public ElementHeight? Height { get; set; }
15096
15097 /// <summary>
15098 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
15099 /// </summary>
15100 [JsonPropertyName("spacing")]
15101 public Spacing? Spacing { get; set; }
15102
15103 /// <summary>
15104 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
15105 /// </summary>
15106 [JsonPropertyName("targetWidth")]
15107 public TargetWidth? TargetWidth { get; set; }
15108
15109 /// <summary>
15110 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15111 /// </summary>
15112 [JsonPropertyName("isSortKey")]
15113 public bool? IsSortKey { get; set; }
15114
15115 /// <summary>
15116 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
15117 /// </summary>
15118 [JsonPropertyName("selectAction")]
15119 public Action? SelectAction { get; set; }
15120
15121 /// <summary>
15122 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
15123 /// </summary>
15124 [JsonPropertyName("style")]
15125 public ContainerStyle? Style { get; set; }
15126
15127 /// <summary>
15128 /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
15129 /// </summary>
15130 [JsonPropertyName("layouts")]
15131 public IList<ContainerLayout>? Layouts { get; set; }
15132
15133 /// <summary>
15134 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
15135 /// </summary>
15136 [JsonPropertyName("bleed")]
15137 public bool? Bleed { get; set; }
15138
15139 /// <summary>
15140 /// The minimum height, in pixels, of the container, in the `<number>px` format.
15141 /// </summary>
15142 [JsonPropertyName("minHeight")]
15143 public string? MinHeight { get; set; }
15144
15145 /// <summary>
15146 /// Defines the container's background image.
15147 /// </summary>
15148 [JsonPropertyName("backgroundImage")]
15149 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
15150
15151 /// <summary>
15152 /// Controls how the container's content should be vertically aligned.
15153 /// </summary>
15154 [JsonPropertyName("verticalContentAlignment")]
15155 public VerticalAlignment? VerticalContentAlignment { get; set; }
15156
15157 /// <summary>
15158 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
15159 /// </summary>
15160 [JsonPropertyName("rtl")]
15161 public bool? Rtl { get; set; }
15162
15163 /// <summary>
15164 /// The maximum height, in pixels, of the container, in the `<number>px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.
15165 /// </summary>
15166 [JsonPropertyName("maxHeight")]
15167 public string? MaxHeight { get; set; }
15168
15169 /// <summary>
15170 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15171 /// </summary>
15172 [JsonPropertyName("grid.area")]
15173 public string? GridArea { get; set; }
15174
15175 /// <summary>
15176 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
15177 /// </summary>
15178 [JsonPropertyName("fallback")]
15179 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15180
15181 /// <summary>
15182 /// The items (elements) in the cell.
15183 /// </summary>
15184 [JsonPropertyName("items")]
15185 public IList<CardElement>? Items { get; set; }
15186
15187 public TableCell(params IList<CardElement> items)
15188 {
15189 this.Items = items;
15190 }
15191
15192 /// <summary>
15193 /// Serializes this TableCell into a JSON string.
15194 /// </summary>
15195 public string Serialize()
15196 {
15197 return JsonSerializer.Serialize(
15198 this,
15199 new JsonSerializerOptions
15200 {
15201 WriteIndented = true,
15202 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15203 }
15204 );
15205 }
15206
15207 public TableCell WithId(string value)
15208 {
15209 this.Id = value;
15210 return this;
15211 }
15212
15213 public TableCell WithRequires(HostCapabilities value)
15214 {
15215 this.Requires = value;
15216 return this;
15217 }
15218
15219 public TableCell WithLang(string value)
15220 {
15221 this.Lang = value;
15222 return this;
15223 }
15224
15225 public TableCell WithIsVisible(bool value)
15226 {
15227 this.IsVisible = value;
15228 return this;
15229 }
15230
15231 public TableCell WithSeparator(bool value)
15232 {
15233 this.Separator = value;
15234 return this;
15235 }
15236
15237 public TableCell WithHeight(ElementHeight value)
15238 {
15239 this.Height = value;
15240 return this;
15241 }
15242
15243 public TableCell WithSpacing(Spacing value)
15244 {
15245 this.Spacing = value;
15246 return this;
15247 }
15248
15249 public TableCell WithTargetWidth(TargetWidth value)
15250 {
15251 this.TargetWidth = value;
15252 return this;
15253 }
15254
15255 public TableCell WithIsSortKey(bool value)
15256 {
15257 this.IsSortKey = value;
15258 return this;
15259 }
15260
15261 public TableCell WithSelectAction(Action value)
15262 {
15263 this.SelectAction = value;
15264 return this;
15265 }
15266
15267 public TableCell WithStyle(ContainerStyle value)
15268 {
15269 this.Style = value;
15270 return this;
15271 }
15272
15273 public TableCell WithLayouts(params IList<ContainerLayout> value)
15274 {
15275 this.Layouts = value;
15276 return this;
15277 }
15278
15279 public TableCell WithBleed(bool value)
15280 {
15281 this.Bleed = value;
15282 return this;
15283 }
15284
15285 public TableCell WithMinHeight(string value)
15286 {
15287 this.MinHeight = value;
15288 return this;
15289 }
15290
15291 public TableCell WithBackgroundImage(IUnion<string, BackgroundImage> value)
15292 {
15293 this.BackgroundImage = value;
15294 return this;
15295 }
15296
15297 public TableCell WithVerticalContentAlignment(VerticalAlignment value)
15298 {
15299 this.VerticalContentAlignment = value;
15300 return this;
15301 }
15302
15303 public TableCell WithRtl(bool value)
15304 {
15305 this.Rtl = value;
15306 return this;
15307 }
15308
15309 public TableCell WithMaxHeight(string value)
15310 {
15311 this.MaxHeight = value;
15312 return this;
15313 }
15314
15315 public TableCell WithGridArea(string value)
15316 {
15317 this.GridArea = value;
15318 return this;
15319 }
15320
15321 public TableCell WithFallback(IUnion<CardElement, FallbackElement> value)
15322 {
15323 this.Fallback = value;
15324 return this;
15325 }
15326
15327 public TableCell WithItems(params IList<CardElement> value)
15328 {
15329 this.Items = value;
15330 return this;
15331 }
15332}
15333
15334/// <summary>
15335/// A block of text inside a RichTextBlock element.
15336/// </summary>
15337public class TextRun : CardElement
15338{
15339 /// <summary>
15340 /// Deserializes a JSON string into an object of type TextRun.
15341 /// </summary>
15342 public static TextRun? Deserialize(string json)
15343 {
15344 return JsonSerializer.Deserialize<TextRun>(json);
15345 }
15346
15347 /// <summary>
15348 /// Must be **TextRun**.
15349 /// </summary>
15350 [JsonPropertyName("type")]
15351 public string Type { get; } = "TextRun";
15352
15353 /// <summary>
15354 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
15355 /// </summary>
15356 [JsonPropertyName("id")]
15357 public string? Id { get; set; }
15358
15359 /// <summary>
15360 /// The locale associated with the element.
15361 /// </summary>
15362 [JsonPropertyName("lang")]
15363 public string? Lang { get; set; }
15364
15365 /// <summary>
15366 /// Controls the visibility of the element.
15367 /// </summary>
15368 [JsonPropertyName("isVisible")]
15369 public bool? IsVisible { get; set; }
15370
15371 /// <summary>
15372 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15373 /// </summary>
15374 [JsonPropertyName("isSortKey")]
15375 public bool? IsSortKey { get; set; }
15376
15377 /// <summary>
15378 /// The text to display. A subset of markdown is supported.
15379 /// </summary>
15380 [JsonPropertyName("text")]
15381 public string? Text { get; set; }
15382
15383 /// <summary>
15384 /// The size of the text.
15385 /// </summary>
15386 [JsonPropertyName("size")]
15387 public TextSize? Size { get; set; }
15388
15389 /// <summary>
15390 /// The weight of the text.
15391 /// </summary>
15392 [JsonPropertyName("weight")]
15393 public TextWeight? Weight { get; set; }
15394
15395 /// <summary>
15396 /// The color of the text.
15397 /// </summary>
15398 [JsonPropertyName("color")]
15399 public TextColor? Color { get; set; }
15400
15401 /// <summary>
15402 /// Controls whether the text should be renderer using a subtler variant of the select color.
15403 /// </summary>
15404 [JsonPropertyName("isSubtle")]
15405 public bool? IsSubtle { get; set; }
15406
15407 /// <summary>
15408 /// The type of font to use for rendering.
15409 /// </summary>
15410 [JsonPropertyName("fontType")]
15411 public FontType? FontType { get; set; }
15412
15413 /// <summary>
15414 /// Controls if the text should be italicized.
15415 /// </summary>
15416 [JsonPropertyName("italic")]
15417 public bool? Italic { get; set; }
15418
15419 /// <summary>
15420 /// Controls if the text should be struck through.
15421 /// </summary>
15422 [JsonPropertyName("strikethrough")]
15423 public bool? Strikethrough { get; set; }
15424
15425 /// <summary>
15426 /// Controls if the text should be highlighted.
15427 /// </summary>
15428 [JsonPropertyName("highlight")]
15429 public bool? Highlight { get; set; }
15430
15431 /// <summary>
15432 /// Controls if the text should be underlined.
15433 /// </summary>
15434 [JsonPropertyName("underline")]
15435 public bool? Underline { get; set; }
15436
15437 /// <summary>
15438 /// An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported.
15439 /// </summary>
15440 [JsonPropertyName("selectAction")]
15441 public Action? SelectAction { get; set; }
15442
15443 /// <summary>
15444 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15445 /// </summary>
15446 [JsonPropertyName("grid.area")]
15447 public string? GridArea { get; set; }
15448
15449 /// <summary>
15450 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
15451 /// </summary>
15452 [JsonPropertyName("fallback")]
15453 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15454
15455 public TextRun(string text)
15456 {
15457 this.Text = text;
15458 }
15459
15460 /// <summary>
15461 /// Serializes this TextRun into a JSON string.
15462 /// </summary>
15463 public string Serialize()
15464 {
15465 return JsonSerializer.Serialize(
15466 this,
15467 new JsonSerializerOptions
15468 {
15469 WriteIndented = true,
15470 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15471 }
15472 );
15473 }
15474
15475 public TextRun WithId(string value)
15476 {
15477 this.Id = value;
15478 return this;
15479 }
15480
15481 public TextRun WithLang(string value)
15482 {
15483 this.Lang = value;
15484 return this;
15485 }
15486
15487 public TextRun WithIsVisible(bool value)
15488 {
15489 this.IsVisible = value;
15490 return this;
15491 }
15492
15493 public TextRun WithIsSortKey(bool value)
15494 {
15495 this.IsSortKey = value;
15496 return this;
15497 }
15498
15499 public TextRun WithText(string value)
15500 {
15501 this.Text = value;
15502 return this;
15503 }
15504
15505 public TextRun WithSize(TextSize value)
15506 {
15507 this.Size = value;
15508 return this;
15509 }
15510
15511 public TextRun WithWeight(TextWeight value)
15512 {
15513 this.Weight = value;
15514 return this;
15515 }
15516
15517 public TextRun WithColor(TextColor value)
15518 {
15519 this.Color = value;
15520 return this;
15521 }
15522
15523 public TextRun WithIsSubtle(bool value)
15524 {
15525 this.IsSubtle = value;
15526 return this;
15527 }
15528
15529 public TextRun WithFontType(FontType value)
15530 {
15531 this.FontType = value;
15532 return this;
15533 }
15534
15535 public TextRun WithItalic(bool value)
15536 {
15537 this.Italic = value;
15538 return this;
15539 }
15540
15541 public TextRun WithStrikethrough(bool value)
15542 {
15543 this.Strikethrough = value;
15544 return this;
15545 }
15546
15547 public TextRun WithHighlight(bool value)
15548 {
15549 this.Highlight = value;
15550 return this;
15551 }
15552
15553 public TextRun WithUnderline(bool value)
15554 {
15555 this.Underline = value;
15556 return this;
15557 }
15558
15559 public TextRun WithSelectAction(Action value)
15560 {
15561 this.SelectAction = value;
15562 return this;
15563 }
15564
15565 public TextRun WithGridArea(string value)
15566 {
15567 this.GridArea = value;
15568 return this;
15569 }
15570
15571 public TextRun WithFallback(IUnion<CardElement, FallbackElement> value)
15572 {
15573 this.Fallback = value;
15574 return this;
15575 }
15576}
15577
15578/// <summary>
15579/// An inline icon inside a RichTextBlock element.
15580/// </summary>
15581public class IconRun : CardElement
15582{
15583 /// <summary>
15584 /// Deserializes a JSON string into an object of type IconRun.
15585 /// </summary>
15586 public static IconRun? Deserialize(string json)
15587 {
15588 return JsonSerializer.Deserialize<IconRun>(json);
15589 }
15590
15591 /// <summary>
15592 /// Must be **IconRun**.
15593 /// </summary>
15594 [JsonPropertyName("type")]
15595 public string Type { get; } = "IconRun";
15596
15597 /// <summary>
15598 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
15599 /// </summary>
15600 [JsonPropertyName("id")]
15601 public string? Id { get; set; }
15602
15603 /// <summary>
15604 /// The locale associated with the element.
15605 /// </summary>
15606 [JsonPropertyName("lang")]
15607 public string? Lang { get; set; }
15608
15609 /// <summary>
15610 /// Controls the visibility of the element.
15611 /// </summary>
15612 [JsonPropertyName("isVisible")]
15613 public bool? IsVisible { get; set; }
15614
15615 /// <summary>
15616 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15617 /// </summary>
15618 [JsonPropertyName("isSortKey")]
15619 public bool? IsSortKey { get; set; }
15620
15621 /// <summary>
15622 /// The name of the inline icon to display.
15623 /// </summary>
15624 [JsonPropertyName("name")]
15625 public string? Name { get; set; }
15626
15627 /// <summary>
15628 /// The size of the inline icon.
15629 /// </summary>
15630 [JsonPropertyName("size")]
15631 public SizeEnum? Size { get; set; }
15632
15633 /// <summary>
15634 /// The style of the inline icon.
15635 /// </summary>
15636 [JsonPropertyName("style")]
15637 public IconStyle? Style { get; set; }
15638
15639 /// <summary>
15640 /// The color of the inline icon.
15641 /// </summary>
15642 [JsonPropertyName("color")]
15643 public TextColor? Color { get; set; }
15644
15645 /// <summary>
15646 /// An Action that will be invoked when the inline icon is tapped or clicked. Action.ShowCard is not supported.
15647 /// </summary>
15648 [JsonPropertyName("selectAction")]
15649 public Action? SelectAction { get; set; }
15650
15651 /// <summary>
15652 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15653 /// </summary>
15654 [JsonPropertyName("grid.area")]
15655 public string? GridArea { get; set; }
15656
15657 /// <summary>
15658 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
15659 /// </summary>
15660 [JsonPropertyName("fallback")]
15661 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15662
15663 /// <summary>
15664 /// Serializes this IconRun into a JSON string.
15665 /// </summary>
15666 public string Serialize()
15667 {
15668 return JsonSerializer.Serialize(
15669 this,
15670 new JsonSerializerOptions
15671 {
15672 WriteIndented = true,
15673 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15674 }
15675 );
15676 }
15677
15678 public IconRun WithId(string value)
15679 {
15680 this.Id = value;
15681 return this;
15682 }
15683
15684 public IconRun WithLang(string value)
15685 {
15686 this.Lang = value;
15687 return this;
15688 }
15689
15690 public IconRun WithIsVisible(bool value)
15691 {
15692 this.IsVisible = value;
15693 return this;
15694 }
15695
15696 public IconRun WithIsSortKey(bool value)
15697 {
15698 this.IsSortKey = value;
15699 return this;
15700 }
15701
15702 public IconRun WithName(string value)
15703 {
15704 this.Name = value;
15705 return this;
15706 }
15707
15708 public IconRun WithSize(SizeEnum value)
15709 {
15710 this.Size = value;
15711 return this;
15712 }
15713
15714 public IconRun WithStyle(IconStyle value)
15715 {
15716 this.Style = value;
15717 return this;
15718 }
15719
15720 public IconRun WithColor(TextColor value)
15721 {
15722 this.Color = value;
15723 return this;
15724 }
15725
15726 public IconRun WithSelectAction(Action value)
15727 {
15728 this.SelectAction = value;
15729 return this;
15730 }
15731
15732 public IconRun WithGridArea(string value)
15733 {
15734 this.GridArea = value;
15735 return this;
15736 }
15737
15738 public IconRun WithFallback(IUnion<CardElement, FallbackElement> value)
15739 {
15740 this.Fallback = value;
15741 return this;
15742 }
15743}
15744
15745/// <summary>
15746/// An inline image inside a RichTextBlock element.
15747/// </summary>
15748public class ImageRun : CardElement
15749{
15750 /// <summary>
15751 /// Deserializes a JSON string into an object of type ImageRun.
15752 /// </summary>
15753 public static ImageRun? Deserialize(string json)
15754 {
15755 return JsonSerializer.Deserialize<ImageRun>(json);
15756 }
15757
15758 /// <summary>
15759 /// Must be **ImageRun**.
15760 /// </summary>
15761 [JsonPropertyName("type")]
15762 public string Type { get; } = "ImageRun";
15763
15764 /// <summary>
15765 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
15766 /// </summary>
15767 [JsonPropertyName("id")]
15768 public string? Id { get; set; }
15769
15770 /// <summary>
15771 /// The locale associated with the element.
15772 /// </summary>
15773 [JsonPropertyName("lang")]
15774 public string? Lang { get; set; }
15775
15776 /// <summary>
15777 /// Controls the visibility of the element.
15778 /// </summary>
15779 [JsonPropertyName("isVisible")]
15780 public bool? IsVisible { get; set; }
15781
15782 /// <summary>
15783 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15784 /// </summary>
15785 [JsonPropertyName("isSortKey")]
15786 public bool? IsSortKey { get; set; }
15787
15788 /// <summary>
15789 /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
15790 /// </summary>
15791 [JsonPropertyName("url")]
15792 public string? Url { get; set; }
15793
15794 /// <summary>
15795 /// The size of the inline image.
15796 /// </summary>
15797 [JsonPropertyName("size")]
15798 public SizeEnum? Size { get; set; }
15799
15800 /// <summary>
15801 /// The style of the inline image.
15802 /// </summary>
15803 [JsonPropertyName("style")]
15804 public ImageStyle? Style { get; set; }
15805
15806 /// <summary>
15807 /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported.
15808 /// </summary>
15809 [JsonPropertyName("selectAction")]
15810 public Action? SelectAction { get; set; }
15811
15812 /// <summary>
15813 /// A set of theme-specific image URLs.
15814 /// </summary>
15815 [JsonPropertyName("themedUrls")]
15816 public IList<ThemedUrl>? ThemedUrls { get; set; }
15817
15818 /// <summary>
15819 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15820 /// </summary>
15821 [JsonPropertyName("grid.area")]
15822 public string? GridArea { get; set; }
15823
15824 /// <summary>
15825 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
15826 /// </summary>
15827 [JsonPropertyName("fallback")]
15828 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15829
15830 /// <summary>
15831 /// Serializes this ImageRun into a JSON string.
15832 /// </summary>
15833 public string Serialize()
15834 {
15835 return JsonSerializer.Serialize(
15836 this,
15837 new JsonSerializerOptions
15838 {
15839 WriteIndented = true,
15840 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15841 }
15842 );
15843 }
15844
15845 public ImageRun WithId(string value)
15846 {
15847 this.Id = value;
15848 return this;
15849 }
15850
15851 public ImageRun WithLang(string value)
15852 {
15853 this.Lang = value;
15854 return this;
15855 }
15856
15857 public ImageRun WithIsVisible(bool value)
15858 {
15859 this.IsVisible = value;
15860 return this;
15861 }
15862
15863 public ImageRun WithIsSortKey(bool value)
15864 {
15865 this.IsSortKey = value;
15866 return this;
15867 }
15868
15869 public ImageRun WithUrl(string value)
15870 {
15871 this.Url = value;
15872 return this;
15873 }
15874
15875 public ImageRun WithSize(SizeEnum value)
15876 {
15877 this.Size = value;
15878 return this;
15879 }
15880
15881 public ImageRun WithStyle(ImageStyle value)
15882 {
15883 this.Style = value;
15884 return this;
15885 }
15886
15887 public ImageRun WithSelectAction(Action value)
15888 {
15889 this.SelectAction = value;
15890 return this;
15891 }
15892
15893 public ImageRun WithThemedUrls(params IList<ThemedUrl> value)
15894 {
15895 this.ThemedUrls = value;
15896 return this;
15897 }
15898
15899 public ImageRun WithGridArea(string value)
15900 {
15901 this.GridArea = value;
15902 return this;
15903 }
15904
15905 public ImageRun WithFallback(IUnion<CardElement, FallbackElement> value)
15906 {
15907 this.Fallback = value;
15908 return this;
15909 }
15910}
15911
15912/// <summary>
15913/// Defines a theme-specific URL.
15914/// </summary>
15915public class ThemedUrl : SerializableObject
15916{
15917 /// <summary>
15918 /// Deserializes a JSON string into an object of type ThemedUrl.
15919 /// </summary>
15920 public static ThemedUrl? Deserialize(string json)
15921 {
15922 return JsonSerializer.Deserialize<ThemedUrl>(json);
15923 }
15924
15925 /// <summary>
15926 /// The theme this URL applies to.
15927 /// </summary>
15928 [JsonPropertyName("theme")]
15929 public ThemeName? Theme { get; set; }
15930
15931 /// <summary>
15932 /// The URL to use for the associated theme.
15933 /// </summary>
15934 [JsonPropertyName("url")]
15935 public string? Url { get; set; }
15936
15937 /// <summary>
15938 /// Serializes this ThemedUrl into a JSON string.
15939 /// </summary>
15940 public string Serialize()
15941 {
15942 return JsonSerializer.Serialize(
15943 this,
15944 new JsonSerializerOptions
15945 {
15946 WriteIndented = true,
15947 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15948 }
15949 );
15950 }
15951
15952 public ThemedUrl WithTheme(ThemeName value)
15953 {
15954 this.Theme = value;
15955 return this;
15956 }
15957
15958 public ThemedUrl WithUrl(string value)
15959 {
15960 this.Url = value;
15961 return this;
15962 }
15963}
15964
15965/// <summary>
15966/// A column in a ColumnSet element.
15967/// </summary>
15968public class Column : CardElement
15969{
15970 /// <summary>
15971 /// Deserializes a JSON string into an object of type Column.
15972 /// </summary>
15973 public static Column? Deserialize(string json)
15974 {
15975 return JsonSerializer.Deserialize<Column>(json);
15976 }
15977
15978 /// <summary>
15979 /// Optional. If specified, must be **Column**.
15980 /// </summary>
15981 [JsonPropertyName("type")]
15982 public string Type { get; } = "Column";
15983
15984 /// <summary>
15985 /// A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
15986 /// </summary>
15987 [JsonPropertyName("id")]
15988 public string? Id { get; set; }
15989
15990 /// <summary>
15991 /// A list of capabilities the element requires the host application to support. If the host application doesn't support at least one of the listed capabilities, the element is not rendered (or its fallback is rendered if provided).
15992 /// </summary>
15993 [JsonPropertyName("requires")]
15994 public HostCapabilities? Requires { get; set; }
15995
15996 /// <summary>
15997 /// The locale associated with the element.
15998 /// </summary>
15999 [JsonPropertyName("lang")]
16000 public string? Lang { get; set; }
16001
16002 /// <summary>
16003 /// Controls the visibility of the element.
16004 /// </summary>
16005 [JsonPropertyName("isVisible")]
16006 public bool? IsVisible { get; set; }
16007
16008 /// <summary>
16009 /// Controls whether a separator line should be displayed above the element to visually separate it from the previous element. No separator will be displayed for the first element in a container, even if this property is set to true.
16010 /// </summary>
16011 [JsonPropertyName("separator")]
16012 public bool? Separator { get; set; }
16013
16014 /// <summary>
16015 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
16016 /// </summary>
16017 [JsonPropertyName("height")]
16018 public ElementHeight? Height { get; set; }
16019
16020 /// <summary>
16021 /// Controls how the element should be horizontally aligned.
16022 /// </summary>
16023 [JsonPropertyName("horizontalAlignment")]
16024 public HorizontalAlignment? HorizontalAlignment { get; set; }
16025
16026 /// <summary>
16027 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
16028 /// </summary>
16029 [JsonPropertyName("spacing")]
16030 public Spacing? Spacing { get; set; }
16031
16032 /// <summary>
16033 /// Controls for which card width the element should be displayed. If targetWidth isn't specified, the element is rendered at all card widths. Using targetWidth makes it possible to author responsive cards that adapt their layout to the available horizontal space. For more details, see [Responsive layout](https://adaptivecards.microsoft.com/?topic=responsive-layout).
16034 /// </summary>
16035 [JsonPropertyName("targetWidth")]
16036 public TargetWidth? TargetWidth { get; set; }
16037
16038 /// <summary>
16039 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
16040 /// </summary>
16041 [JsonPropertyName("isSortKey")]
16042 public bool? IsSortKey { get; set; }
16043
16044 /// <summary>
16045 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
16046 /// </summary>
16047 [JsonPropertyName("selectAction")]
16048 public Action? SelectAction { get; set; }
16049
16050 /// <summary>
16051 /// The style of the container. Container styles control the colors of the background, border and text inside the container, in such a way that contrast requirements are always met.
16052 /// </summary>
16053 [JsonPropertyName("style")]
16054 public ContainerStyle? Style { get; set; }
16055
16056 /// <summary>
16057 /// Controls if a border should be displayed around the container.
16058 /// </summary>
16059 [JsonPropertyName("showBorder")]
16060 public bool? ShowBorder { get; set; }
16061
16062 /// <summary>
16063 /// Controls if the container should have rounded corners.
16064 /// </summary>
16065 [JsonPropertyName("roundedCorners")]
16066 public bool? RoundedCorners { get; set; }
16067
16068 /// <summary>
16069 /// The layouts associated with the container. The container can dynamically switch from one layout to another as the card's width changes. See [Container layouts](https://adaptivecards.microsoft.com/?topic=container-layouts) for more details.
16070 /// </summary>
16071 [JsonPropertyName("layouts")]
16072 public IList<ContainerLayout>? Layouts { get; set; }
16073
16074 /// <summary>
16075 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
16076 /// </summary>
16077 [JsonPropertyName("bleed")]
16078 public bool? Bleed { get; set; }
16079
16080 /// <summary>
16081 /// The minimum height, in pixels, of the container, in the `<number>px` format.
16082 /// </summary>
16083 [JsonPropertyName("minHeight")]
16084 public string? MinHeight { get; set; }
16085
16086 /// <summary>
16087 /// Defines the container's background image.
16088 /// </summary>
16089 [JsonPropertyName("backgroundImage")]
16090 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
16091
16092 /// <summary>
16093 /// Controls how the container's content should be vertically aligned.
16094 /// </summary>
16095 [JsonPropertyName("verticalContentAlignment")]
16096 public VerticalAlignment? VerticalContentAlignment { get; set; }
16097
16098 /// <summary>
16099 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
16100 /// </summary>
16101 [JsonPropertyName("rtl")]
16102 public bool? Rtl { get; set; }
16103
16104 /// <summary>
16105 /// The maximum height, in pixels, of the container, in the `<number>px` format. When the content of a container exceeds the container's maximum height, a vertical scrollbar is displayed.
16106 /// </summary>
16107 [JsonPropertyName("maxHeight")]
16108 public string? MaxHeight { get; set; }
16109
16110 /// <summary>
16111 /// The width of the column. If expressed as a number, represents the relative weight of the column in the set. If expressed as a string, `auto` will automatically adjust the column's width according to its content, `stretch` will make the column use the remaining horizontal space (shared with other columns with width set to `stretch`) and using the `<number>px` format will give the column an explicit width in pixels.
16112 /// </summary>
16113 [JsonPropertyName("width")]
16114 public IUnion<string, float>? Width { get; set; }
16115
16116 /// <summary>
16117 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
16118 /// </summary>
16119 [JsonPropertyName("grid.area")]
16120 public string? GridArea { get; set; }
16121
16122 /// <summary>
16123 /// An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
16124 /// </summary>
16125 [JsonPropertyName("fallback")]
16126 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
16127
16128 /// <summary>
16129 /// The elements in the column.
16130 /// </summary>
16131 [JsonPropertyName("items")]
16132 public IList<CardElement>? Items { get; set; }
16133
16134 public Column(params IList<CardElement> items)
16135 {
16136 this.Items = items;
16137 }
16138
16139 /// <summary>
16140 /// Serializes this Column into a JSON string.
16141 /// </summary>
16142 public string Serialize()
16143 {
16144 return JsonSerializer.Serialize(
16145 this,
16146 new JsonSerializerOptions
16147 {
16148 WriteIndented = true,
16149 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16150 }
16151 );
16152 }
16153
16154 public Column WithId(string value)
16155 {
16156 this.Id = value;
16157 return this;
16158 }
16159
16160 public Column WithRequires(HostCapabilities value)
16161 {
16162 this.Requires = value;
16163 return this;
16164 }
16165
16166 public Column WithLang(string value)
16167 {
16168 this.Lang = value;
16169 return this;
16170 }
16171
16172 public Column WithIsVisible(bool value)
16173 {
16174 this.IsVisible = value;
16175 return this;
16176 }
16177
16178 public Column WithSeparator(bool value)
16179 {
16180 this.Separator = value;
16181 return this;
16182 }
16183
16184 public Column WithHeight(ElementHeight value)
16185 {
16186 this.Height = value;
16187 return this;
16188 }
16189
16190 public Column WithHorizontalAlignment(HorizontalAlignment value)
16191 {
16192 this.HorizontalAlignment = value;
16193 return this;
16194 }
16195
16196 public Column WithSpacing(Spacing value)
16197 {
16198 this.Spacing = value;
16199 return this;
16200 }
16201
16202 public Column WithTargetWidth(TargetWidth value)
16203 {
16204 this.TargetWidth = value;
16205 return this;
16206 }
16207
16208 public Column WithIsSortKey(bool value)
16209 {
16210 this.IsSortKey = value;
16211 return this;
16212 }
16213
16214 public Column WithSelectAction(Action value)
16215 {
16216 this.SelectAction = value;
16217 return this;
16218 }
16219
16220 public Column WithStyle(ContainerStyle value)
16221 {
16222 this.Style = value;
16223 return this;
16224 }
16225
16226 public Column WithShowBorder(bool value)
16227 {
16228 this.ShowBorder = value;
16229 return this;
16230 }
16231
16232 public Column WithRoundedCorners(bool value)
16233 {
16234 this.RoundedCorners = value;
16235 return this;
16236 }
16237
16238 public Column WithLayouts(params IList<ContainerLayout> value)
16239 {
16240 this.Layouts = value;
16241 return this;
16242 }
16243
16244 public Column WithBleed(bool value)
16245 {
16246 this.Bleed = value;
16247 return this;
16248 }
16249
16250 public Column WithMinHeight(string value)
16251 {
16252 this.MinHeight = value;
16253 return this;
16254 }
16255
16256 public Column WithBackgroundImage(IUnion<string, BackgroundImage> value)
16257 {
16258 this.BackgroundImage = value;
16259 return this;
16260 }
16261
16262 public Column WithVerticalContentAlignment(VerticalAlignment value)
16263 {
16264 this.VerticalContentAlignment = value;
16265 return this;
16266 }
16267
16268 public Column WithRtl(bool value)
16269 {
16270 this.Rtl = value;
16271 return this;
16272 }
16273
16274 public Column WithMaxHeight(string value)
16275 {
16276 this.MaxHeight = value;
16277 return this;
16278 }
16279
16280 public Column WithWidth(IUnion<string, float> value)
16281 {
16282 this.Width = value;
16283 return this;
16284 }
16285
16286 public Column WithGridArea(string value)
16287 {
16288 this.GridArea = value;
16289 return this;
16290 }
16291
16292 public Column WithFallback(IUnion<CardElement, FallbackElement> value)
16293 {
16294 this.Fallback = value;
16295 return this;
16296 }
16297
16298 public Column WithItems(params IList<CardElement> value)
16299 {
16300 this.Items = value;
16301 return this;
16302 }
16303}