microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dependabot/npm_and_yarn/Samples/Samples.Tab/Web/multi-5ea19b96cb

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Cards/Core.cs

17073lines · modecode

1// This file was automatically generated by a tool on 04/06/2026, 11:50 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<ThemeName>))]
37public class ThemeName(string value) : StringEnum(value, caseSensitive: false)
38{
39 public static readonly ThemeName Light = new("Light");
40 public bool IsLight => Light.Equals(Value);
41
42 public static readonly ThemeName Dark = new("Dark");
43 public bool IsDark => Dark.Equals(Value);
44}
45
46[JsonConverter(typeof(JsonConverter<ElementHeight>))]
47public class ElementHeight(string value) : StringEnum(value, caseSensitive: false)
48{
49 public static readonly ElementHeight Auto = new("auto");
50 public bool IsAuto => Auto.Equals(Value);
51
52 public static readonly ElementHeight Stretch = new("stretch");
53 public bool IsStretch => Stretch.Equals(Value);
54}
55
56[JsonConverter(typeof(JsonConverter<HorizontalAlignment>))]
57public class HorizontalAlignment(string value) : StringEnum(value, caseSensitive: false)
58{
59 public static readonly HorizontalAlignment Left = new("Left");
60 public bool IsLeft => Left.Equals(Value);
61
62 public static readonly HorizontalAlignment Center = new("Center");
63 public bool IsCenter => Center.Equals(Value);
64
65 public static readonly HorizontalAlignment Right = new("Right");
66 public bool IsRight => Right.Equals(Value);
67}
68
69[JsonConverter(typeof(JsonConverter<Spacing>))]
70public class Spacing(string value) : StringEnum(value, caseSensitive: false)
71{
72 public static readonly Spacing None = new("None");
73 public bool IsNone => None.Equals(Value);
74
75 public static readonly Spacing ExtraSmall = new("ExtraSmall");
76 public bool IsExtraSmall => ExtraSmall.Equals(Value);
77
78 public static readonly Spacing Small = new("Small");
79 public bool IsSmall => Small.Equals(Value);
80
81 public static readonly Spacing Default = new("Default");
82 public bool IsDefault => Default.Equals(Value);
83
84 public static readonly Spacing Medium = new("Medium");
85 public bool IsMedium => Medium.Equals(Value);
86
87 public static readonly Spacing Large = new("Large");
88 public bool IsLarge => Large.Equals(Value);
89
90 public static readonly Spacing ExtraLarge = new("ExtraLarge");
91 public bool IsExtraLarge => ExtraLarge.Equals(Value);
92
93 public static readonly Spacing Padding = new("Padding");
94 public bool IsPadding => Padding.Equals(Value);
95}
96
97[JsonConverter(typeof(JsonConverter<TargetWidth>))]
98public class TargetWidth(string value) : StringEnum(value, caseSensitive: false)
99{
100 public static readonly TargetWidth VeryNarrow = new("VeryNarrow");
101 public bool IsVeryNarrow => VeryNarrow.Equals(Value);
102
103 public static readonly TargetWidth Narrow = new("Narrow");
104 public bool IsNarrow => Narrow.Equals(Value);
105
106 public static readonly TargetWidth Standard = new("Standard");
107 public bool IsStandard => Standard.Equals(Value);
108
109 public static readonly TargetWidth Wide = new("Wide");
110 public bool IsWide => Wide.Equals(Value);
111
112 public static readonly TargetWidth AtLeastVeryNarrow = new("atLeast:VeryNarrow");
113 public bool IsAtLeastVeryNarrow => AtLeastVeryNarrow.Equals(Value);
114
115 public static readonly TargetWidth AtMostVeryNarrow = new("atMost:VeryNarrow");
116 public bool IsAtMostVeryNarrow => AtMostVeryNarrow.Equals(Value);
117
118 public static readonly TargetWidth AtLeastNarrow = new("atLeast:Narrow");
119 public bool IsAtLeastNarrow => AtLeastNarrow.Equals(Value);
120
121 public static readonly TargetWidth AtMostNarrow = new("atMost:Narrow");
122 public bool IsAtMostNarrow => AtMostNarrow.Equals(Value);
123
124 public static readonly TargetWidth AtLeastStandard = new("atLeast:Standard");
125 public bool IsAtLeastStandard => AtLeastStandard.Equals(Value);
126
127 public static readonly TargetWidth AtMostStandard = new("atMost:Standard");
128 public bool IsAtMostStandard => AtMostStandard.Equals(Value);
129
130 public static readonly TargetWidth AtLeastWide = new("atLeast:Wide");
131 public bool IsAtLeastWide => AtLeastWide.Equals(Value);
132
133 public static readonly TargetWidth AtMostWide = new("atMost:Wide");
134 public bool IsAtMostWide => AtMostWide.Equals(Value);
135}
136
137[JsonConverter(typeof(JsonConverter<ContainerStyle>))]
138public class ContainerStyle(string value) : StringEnum(value, caseSensitive: false)
139{
140 public static readonly ContainerStyle Default = new("default");
141 public bool IsDefault => Default.Equals(Value);
142
143 public static readonly ContainerStyle Emphasis = new("emphasis");
144 public bool IsEmphasis => Emphasis.Equals(Value);
145
146 public static readonly ContainerStyle Accent = new("accent");
147 public bool IsAccent => Accent.Equals(Value);
148
149 public static readonly ContainerStyle Good = new("good");
150 public bool IsGood => Good.Equals(Value);
151
152 public static readonly ContainerStyle Attention = new("attention");
153 public bool IsAttention => Attention.Equals(Value);
154
155 public static readonly ContainerStyle Warning = new("warning");
156 public bool IsWarning => Warning.Equals(Value);
157}
158
159[JsonConverter(typeof(JsonConverter<VerticalAlignment>))]
160public class VerticalAlignment(string value) : StringEnum(value, caseSensitive: false)
161{
162 public static readonly VerticalAlignment Top = new("Top");
163 public bool IsTop => Top.Equals(Value);
164
165 public static readonly VerticalAlignment Center = new("Center");
166 public bool IsCenter => Center.Equals(Value);
167
168 public static readonly VerticalAlignment Bottom = new("Bottom");
169 public bool IsBottom => Bottom.Equals(Value);
170}
171
172[JsonConverter(typeof(JsonConverter<FlowLayoutItemFit>))]
173public class FlowLayoutItemFit(string value) : StringEnum(value, caseSensitive: false)
174{
175 public static readonly FlowLayoutItemFit Fit = new("Fit");
176 public bool IsFit => Fit.Equals(Value);
177
178 public static readonly FlowLayoutItemFit Fill = new("Fill");
179 public bool IsFill => Fill.Equals(Value);
180}
181
182[JsonConverter(typeof(JsonConverter<FillMode>))]
183public class FillMode(string value) : StringEnum(value, caseSensitive: false)
184{
185 public static readonly FillMode Cover = new("Cover");
186 public bool IsCover => Cover.Equals(Value);
187
188 public static readonly FillMode RepeatHorizontally = new("RepeatHorizontally");
189 public bool IsRepeatHorizontally => RepeatHorizontally.Equals(Value);
190
191 public static readonly FillMode RepeatVertically = new("RepeatVertically");
192 public bool IsRepeatVertically => RepeatVertically.Equals(Value);
193
194 public static readonly FillMode Repeat = new("Repeat");
195 public bool IsRepeat => Repeat.Equals(Value);
196}
197
198[JsonConverter(typeof(JsonConverter<TextSize>))]
199public class TextSize(string value) : StringEnum(value, caseSensitive: false)
200{
201 public static readonly TextSize Small = new("Small");
202 public bool IsSmall => Small.Equals(Value);
203
204 public static readonly TextSize Default = new("Default");
205 public bool IsDefault => Default.Equals(Value);
206
207 public static readonly TextSize Medium = new("Medium");
208 public bool IsMedium => Medium.Equals(Value);
209
210 public static readonly TextSize Large = new("Large");
211 public bool IsLarge => Large.Equals(Value);
212
213 public static readonly TextSize ExtraLarge = new("ExtraLarge");
214 public bool IsExtraLarge => ExtraLarge.Equals(Value);
215}
216
217[JsonConverter(typeof(JsonConverter<TextWeight>))]
218public class TextWeight(string value) : StringEnum(value, caseSensitive: false)
219{
220 public static readonly TextWeight Lighter = new("Lighter");
221 public bool IsLighter => Lighter.Equals(Value);
222
223 public static readonly TextWeight Default = new("Default");
224 public bool IsDefault => Default.Equals(Value);
225
226 public static readonly TextWeight Bolder = new("Bolder");
227 public bool IsBolder => Bolder.Equals(Value);
228}
229
230[JsonConverter(typeof(JsonConverter<TextColor>))]
231public class TextColor(string value) : StringEnum(value, caseSensitive: false)
232{
233 public static readonly TextColor Default = new("Default");
234 public bool IsDefault => Default.Equals(Value);
235
236 public static readonly TextColor Dark = new("Dark");
237 public bool IsDark => Dark.Equals(Value);
238
239 public static readonly TextColor Light = new("Light");
240 public bool IsLight => Light.Equals(Value);
241
242 public static readonly TextColor Accent = new("Accent");
243 public bool IsAccent => Accent.Equals(Value);
244
245 public static readonly TextColor Good = new("Good");
246 public bool IsGood => Good.Equals(Value);
247
248 public static readonly TextColor Warning = new("Warning");
249 public bool IsWarning => Warning.Equals(Value);
250
251 public static readonly TextColor Attention = new("Attention");
252 public bool IsAttention => Attention.Equals(Value);
253}
254
255[JsonConverter(typeof(JsonConverter<FontType>))]
256public class FontType(string value) : StringEnum(value, caseSensitive: false)
257{
258 public static readonly FontType Default = new("Default");
259 public bool IsDefault => Default.Equals(Value);
260
261 public static readonly FontType Monospace = new("Monospace");
262 public bool IsMonospace => Monospace.Equals(Value);
263}
264
265[JsonConverter(typeof(JsonConverter<TextBlockStyle>))]
266public class TextBlockStyle(string value) : StringEnum(value, caseSensitive: false)
267{
268 public static readonly TextBlockStyle Default = new("default");
269 public bool IsDefault => Default.Equals(Value);
270
271 public static readonly TextBlockStyle ColumnHeader = new("columnHeader");
272 public bool IsColumnHeader => ColumnHeader.Equals(Value);
273
274 public static readonly TextBlockStyle Heading = new("heading");
275 public bool IsHeading => Heading.Equals(Value);
276}
277
278[JsonConverter(typeof(JsonConverter<ImageStyle>))]
279public class ImageStyle(string value) : StringEnum(value, caseSensitive: false)
280{
281 public static readonly ImageStyle Default = new("Default");
282 public bool IsDefault => Default.Equals(Value);
283
284 public static readonly ImageStyle Person = new("Person");
285 public bool IsPerson => Person.Equals(Value);
286
287 public static readonly ImageStyle RoundedCorners = new("RoundedCorners");
288 public bool IsRoundedCorners => RoundedCorners.Equals(Value);
289}
290
291[JsonConverter(typeof(JsonConverter<Size>))]
292public class Size(string value) : StringEnum(value, caseSensitive: false)
293{
294 public static readonly Size Auto = new("Auto");
295 public bool IsAuto => Auto.Equals(Value);
296
297 public static readonly Size Stretch = new("Stretch");
298 public bool IsStretch => Stretch.Equals(Value);
299
300 public static readonly Size Small = new("Small");
301 public bool IsSmall => Small.Equals(Value);
302
303 public static readonly Size Medium = new("Medium");
304 public bool IsMedium => Medium.Equals(Value);
305
306 public static readonly Size Large = new("Large");
307 public bool IsLarge => Large.Equals(Value);
308}
309
310[JsonConverter(typeof(JsonConverter<ImageFitMode>))]
311public class ImageFitMode(string value) : StringEnum(value, caseSensitive: false)
312{
313 public static readonly ImageFitMode Cover = new("Cover");
314 public bool IsCover => Cover.Equals(Value);
315
316 public static readonly ImageFitMode Contain = new("Contain");
317 public bool IsContain => Contain.Equals(Value);
318
319 public static readonly ImageFitMode Fill = new("Fill");
320 public bool IsFill => Fill.Equals(Value);
321}
322
323[JsonConverter(typeof(JsonConverter<InputTextStyle>))]
324public class InputTextStyle(string value) : StringEnum(value, caseSensitive: false)
325{
326 public static readonly InputTextStyle Text = new("Text");
327 public bool IsText => Text.Equals(Value);
328
329 public static readonly InputTextStyle Tel = new("Tel");
330 public bool IsTel => Tel.Equals(Value);
331
332 public static readonly InputTextStyle Url = new("Url");
333 public bool IsUrl => Url.Equals(Value);
334
335 public static readonly InputTextStyle Email = new("Email");
336 public bool IsEmail => Email.Equals(Value);
337
338 public static readonly InputTextStyle Password = new("Password");
339 public bool IsPassword => Password.Equals(Value);
340}
341
342[JsonConverter(typeof(JsonConverter<AssociatedInputs>))]
343public class AssociatedInputs(string value) : StringEnum(value, caseSensitive: false)
344{
345 public static readonly AssociatedInputs Auto = new("auto");
346 public bool IsAuto => Auto.Equals(Value);
347
348 public static readonly AssociatedInputs None = new("none");
349 public bool IsNone => None.Equals(Value);
350}
351
352[JsonConverter(typeof(JsonConverter<ChoiceSetInputStyle>))]
353public class ChoiceSetInputStyle(string value) : StringEnum(value, caseSensitive: false)
354{
355 public static readonly ChoiceSetInputStyle Compact = new("compact");
356 public bool IsCompact => Compact.Equals(Value);
357
358 public static readonly ChoiceSetInputStyle Expanded = new("expanded");
359 public bool IsExpanded => Expanded.Equals(Value);
360
361 public static readonly ChoiceSetInputStyle Filtered = new("filtered");
362 public bool IsFiltered => Filtered.Equals(Value);
363}
364
365[JsonConverter(typeof(JsonConverter<RatingSize>))]
366public class RatingSize(string value) : StringEnum(value, caseSensitive: false)
367{
368 public static readonly RatingSize Medium = new("Medium");
369 public bool IsMedium => Medium.Equals(Value);
370
371 public static readonly RatingSize Large = new("Large");
372 public bool IsLarge => Large.Equals(Value);
373}
374
375[JsonConverter(typeof(JsonConverter<RatingColor>))]
376public class RatingColor(string value) : StringEnum(value, caseSensitive: false)
377{
378 public static readonly RatingColor Neutral = new("Neutral");
379 public bool IsNeutral => Neutral.Equals(Value);
380
381 public static readonly RatingColor Marigold = new("Marigold");
382 public bool IsMarigold => Marigold.Equals(Value);
383}
384
385[JsonConverter(typeof(JsonConverter<RatingStyle>))]
386public class RatingStyle(string value) : StringEnum(value, caseSensitive: false)
387{
388 public static readonly RatingStyle Default = new("Default");
389 public bool IsDefault => Default.Equals(Value);
390
391 public static readonly RatingStyle Compact = new("Compact");
392 public bool IsCompact => Compact.Equals(Value);
393}
394
395[JsonConverter(typeof(JsonConverter<IconSize>))]
396public class IconSize(string value) : StringEnum(value, caseSensitive: false)
397{
398 public static readonly IconSize XxSmall = new("xxSmall");
399 public bool IsXxSmall => XxSmall.Equals(Value);
400
401 public static readonly IconSize XSmall = new("xSmall");
402 public bool IsXSmall => XSmall.Equals(Value);
403
404 public static readonly IconSize Small = new("Small");
405 public bool IsSmall => Small.Equals(Value);
406
407 public static readonly IconSize Standard = new("Standard");
408 public bool IsStandard => Standard.Equals(Value);
409
410 public static readonly IconSize Medium = new("Medium");
411 public bool IsMedium => Medium.Equals(Value);
412
413 public static readonly IconSize Large = new("Large");
414 public bool IsLarge => Large.Equals(Value);
415
416 public static readonly IconSize XLarge = new("xLarge");
417 public bool IsXLarge => XLarge.Equals(Value);
418
419 public static readonly IconSize XxLarge = new("xxLarge");
420 public bool IsXxLarge => XxLarge.Equals(Value);
421}
422
423[JsonConverter(typeof(JsonConverter<IconStyle>))]
424public class IconStyle(string value) : StringEnum(value, caseSensitive: false)
425{
426 public static readonly IconStyle Regular = new("Regular");
427 public bool IsRegular => Regular.Equals(Value);
428
429 public static readonly IconStyle Filled = new("Filled");
430 public bool IsFilled => Filled.Equals(Value);
431}
432
433[JsonConverter(typeof(JsonConverter<CarouselPageAnimation>))]
434public class CarouselPageAnimation(string value) : StringEnum(value, caseSensitive: false)
435{
436 public static readonly CarouselPageAnimation Slide = new("Slide");
437 public bool IsSlide => Slide.Equals(Value);
438
439 public static readonly CarouselPageAnimation CrossFade = new("CrossFade");
440 public bool IsCrossFade => CrossFade.Equals(Value);
441
442 public static readonly CarouselPageAnimation None = new("None");
443 public bool IsNone => None.Equals(Value);
444}
445
446[JsonConverter(typeof(JsonConverter<BadgeIconPosition>))]
447public class BadgeIconPosition(string value) : StringEnum(value, caseSensitive: false)
448{
449 public static readonly BadgeIconPosition Before = new("Before");
450 public bool IsBefore => Before.Equals(Value);
451
452 public static readonly BadgeIconPosition After = new("After");
453 public bool IsAfter => After.Equals(Value);
454}
455
456[JsonConverter(typeof(JsonConverter<BadgeAppearance>))]
457public class BadgeAppearance(string value) : StringEnum(value, caseSensitive: false)
458{
459 public static readonly BadgeAppearance Filled = new("Filled");
460 public bool IsFilled => Filled.Equals(Value);
461
462 public static readonly BadgeAppearance Tint = new("Tint");
463 public bool IsTint => Tint.Equals(Value);
464}
465
466[JsonConverter(typeof(JsonConverter<BadgeSize>))]
467public class BadgeSize(string value) : StringEnum(value, caseSensitive: false)
468{
469 public static readonly BadgeSize Medium = new("Medium");
470 public bool IsMedium => Medium.Equals(Value);
471
472 public static readonly BadgeSize Large = new("Large");
473 public bool IsLarge => Large.Equals(Value);
474
475 public static readonly BadgeSize ExtraLarge = new("ExtraLarge");
476 public bool IsExtraLarge => ExtraLarge.Equals(Value);
477}
478
479[JsonConverter(typeof(JsonConverter<BadgeShape>))]
480public class BadgeShape(string value) : StringEnum(value, caseSensitive: false)
481{
482 public static readonly BadgeShape Square = new("Square");
483 public bool IsSquare => Square.Equals(Value);
484
485 public static readonly BadgeShape Rounded = new("Rounded");
486 public bool IsRounded => Rounded.Equals(Value);
487
488 public static readonly BadgeShape Circular = new("Circular");
489 public bool IsCircular => Circular.Equals(Value);
490}
491
492[JsonConverter(typeof(JsonConverter<BadgeStyle>))]
493public class BadgeStyle(string value) : StringEnum(value, caseSensitive: false)
494{
495 public static readonly BadgeStyle Default = new("Default");
496 public bool IsDefault => Default.Equals(Value);
497
498 public static readonly BadgeStyle Subtle = new("Subtle");
499 public bool IsSubtle => Subtle.Equals(Value);
500
501 public static readonly BadgeStyle Informative = new("Informative");
502 public bool IsInformative => Informative.Equals(Value);
503
504 public static readonly BadgeStyle Accent = new("Accent");
505 public bool IsAccent => Accent.Equals(Value);
506
507 public static readonly BadgeStyle Good = new("Good");
508 public bool IsGood => Good.Equals(Value);
509
510 public static readonly BadgeStyle Attention = new("Attention");
511 public bool IsAttention => Attention.Equals(Value);
512
513 public static readonly BadgeStyle Warning = new("Warning");
514 public bool IsWarning => Warning.Equals(Value);
515}
516
517[JsonConverter(typeof(JsonConverter<ProgressRingLabelPosition>))]
518public class ProgressRingLabelPosition(string value) : StringEnum(value, caseSensitive: false)
519{
520 public static readonly ProgressRingLabelPosition Before = new("Before");
521 public bool IsBefore => Before.Equals(Value);
522
523 public static readonly ProgressRingLabelPosition After = new("After");
524 public bool IsAfter => After.Equals(Value);
525
526 public static readonly ProgressRingLabelPosition Above = new("Above");
527 public bool IsAbove => Above.Equals(Value);
528
529 public static readonly ProgressRingLabelPosition Below = new("Below");
530 public bool IsBelow => Below.Equals(Value);
531}
532
533[JsonConverter(typeof(JsonConverter<ProgressRingSize>))]
534public class ProgressRingSize(string value) : StringEnum(value, caseSensitive: false)
535{
536 public static readonly ProgressRingSize Tiny = new("Tiny");
537 public bool IsTiny => Tiny.Equals(Value);
538
539 public static readonly ProgressRingSize Small = new("Small");
540 public bool IsSmall => Small.Equals(Value);
541
542 public static readonly ProgressRingSize Medium = new("Medium");
543 public bool IsMedium => Medium.Equals(Value);
544
545 public static readonly ProgressRingSize Large = new("Large");
546 public bool IsLarge => Large.Equals(Value);
547}
548
549[JsonConverter(typeof(JsonConverter<ProgressBarColor>))]
550public class ProgressBarColor(string value) : StringEnum(value, caseSensitive: false)
551{
552 public static readonly ProgressBarColor Accent = new("Accent");
553 public bool IsAccent => Accent.Equals(Value);
554
555 public static readonly ProgressBarColor Good = new("Good");
556 public bool IsGood => Good.Equals(Value);
557
558 public static readonly ProgressBarColor Warning = new("Warning");
559 public bool IsWarning => Warning.Equals(Value);
560
561 public static readonly ProgressBarColor Attention = new("Attention");
562 public bool IsAttention => Attention.Equals(Value);
563}
564
565[JsonConverter(typeof(JsonConverter<ChartColorSet>))]
566public class ChartColorSet(string value) : StringEnum(value, caseSensitive: false)
567{
568 public static readonly ChartColorSet Categorical = new("categorical");
569 public bool IsCategorical => Categorical.Equals(Value);
570
571 public static readonly ChartColorSet Sequential = new("sequential");
572 public bool IsSequential => Sequential.Equals(Value);
573
574 public static readonly ChartColorSet Sequentialred = new("sequentialred");
575 public bool IsSequentialred => Sequentialred.Equals(Value);
576
577 public static readonly ChartColorSet Sequentialgreen = new("sequentialgreen");
578 public bool IsSequentialgreen => Sequentialgreen.Equals(Value);
579
580 public static readonly ChartColorSet Sequentialyellow = new("sequentialyellow");
581 public bool IsSequentialyellow => Sequentialyellow.Equals(Value);
582
583 public static readonly ChartColorSet Diverging = new("diverging");
584 public bool IsDiverging => Diverging.Equals(Value);
585}
586
587[JsonConverter(typeof(JsonConverter<ChartColor>))]
588public class ChartColor(string value) : StringEnum(value, caseSensitive: false)
589{
590 public static readonly ChartColor Good = new("good");
591 public bool IsGood => Good.Equals(Value);
592
593 public static readonly ChartColor Warning = new("warning");
594 public bool IsWarning => Warning.Equals(Value);
595
596 public static readonly ChartColor Attention = new("attention");
597 public bool IsAttention => Attention.Equals(Value);
598
599 public static readonly ChartColor Neutral = new("neutral");
600 public bool IsNeutral => Neutral.Equals(Value);
601
602 public static readonly ChartColor CategoricalRed = new("categoricalRed");
603 public bool IsCategoricalRed => CategoricalRed.Equals(Value);
604
605 public static readonly ChartColor CategoricalPurple = new("categoricalPurple");
606 public bool IsCategoricalPurple => CategoricalPurple.Equals(Value);
607
608 public static readonly ChartColor CategoricalLavender = new("categoricalLavender");
609 public bool IsCategoricalLavender => CategoricalLavender.Equals(Value);
610
611 public static readonly ChartColor CategoricalBlue = new("categoricalBlue");
612 public bool IsCategoricalBlue => CategoricalBlue.Equals(Value);
613
614 public static readonly ChartColor CategoricalLightBlue = new("categoricalLightBlue");
615 public bool IsCategoricalLightBlue => CategoricalLightBlue.Equals(Value);
616
617 public static readonly ChartColor CategoricalTeal = new("categoricalTeal");
618 public bool IsCategoricalTeal => CategoricalTeal.Equals(Value);
619
620 public static readonly ChartColor CategoricalGreen = new("categoricalGreen");
621 public bool IsCategoricalGreen => CategoricalGreen.Equals(Value);
622
623 public static readonly ChartColor CategoricalLime = new("categoricalLime");
624 public bool IsCategoricalLime => CategoricalLime.Equals(Value);
625
626 public static readonly ChartColor CategoricalMarigold = new("categoricalMarigold");
627 public bool IsCategoricalMarigold => CategoricalMarigold.Equals(Value);
628
629 public static readonly ChartColor Sequential1 = new("sequential1");
630 public bool IsSequential1 => Sequential1.Equals(Value);
631
632 public static readonly ChartColor Sequential2 = new("sequential2");
633 public bool IsSequential2 => Sequential2.Equals(Value);
634
635 public static readonly ChartColor Sequential3 = new("sequential3");
636 public bool IsSequential3 => Sequential3.Equals(Value);
637
638 public static readonly ChartColor Sequential4 = new("sequential4");
639 public bool IsSequential4 => Sequential4.Equals(Value);
640
641 public static readonly ChartColor Sequential5 = new("sequential5");
642 public bool IsSequential5 => Sequential5.Equals(Value);
643
644 public static readonly ChartColor Sequential6 = new("sequential6");
645 public bool IsSequential6 => Sequential6.Equals(Value);
646
647 public static readonly ChartColor Sequential7 = new("sequential7");
648 public bool IsSequential7 => Sequential7.Equals(Value);
649
650 public static readonly ChartColor Sequential8 = new("sequential8");
651 public bool IsSequential8 => Sequential8.Equals(Value);
652
653 public static readonly ChartColor DivergingBlue = new("divergingBlue");
654 public bool IsDivergingBlue => DivergingBlue.Equals(Value);
655
656 public static readonly ChartColor DivergingLightBlue = new("divergingLightBlue");
657 public bool IsDivergingLightBlue => DivergingLightBlue.Equals(Value);
658
659 public static readonly ChartColor DivergingCyan = new("divergingCyan");
660 public bool IsDivergingCyan => DivergingCyan.Equals(Value);
661
662 public static readonly ChartColor DivergingTeal = new("divergingTeal");
663 public bool IsDivergingTeal => DivergingTeal.Equals(Value);
664
665 public static readonly ChartColor DivergingYellow = new("divergingYellow");
666 public bool IsDivergingYellow => DivergingYellow.Equals(Value);
667
668 public static readonly ChartColor DivergingPeach = new("divergingPeach");
669 public bool IsDivergingPeach => DivergingPeach.Equals(Value);
670
671 public static readonly ChartColor DivergingLightRed = new("divergingLightRed");
672 public bool IsDivergingLightRed => DivergingLightRed.Equals(Value);
673
674 public static readonly ChartColor DivergingRed = new("divergingRed");
675 public bool IsDivergingRed => DivergingRed.Equals(Value);
676
677 public static readonly ChartColor DivergingMaroon = new("divergingMaroon");
678 public bool IsDivergingMaroon => DivergingMaroon.Equals(Value);
679
680 public static readonly ChartColor DivergingGray = new("divergingGray");
681 public bool IsDivergingGray => DivergingGray.Equals(Value);
682
683 public static readonly ChartColor SequentialRed1 = new("sequentialRed1");
684 public bool IsSequentialRed1 => SequentialRed1.Equals(Value);
685
686 public static readonly ChartColor SequentialRed2 = new("sequentialRed2");
687 public bool IsSequentialRed2 => SequentialRed2.Equals(Value);
688
689 public static readonly ChartColor SequentialRed3 = new("sequentialRed3");
690 public bool IsSequentialRed3 => SequentialRed3.Equals(Value);
691
692 public static readonly ChartColor SequentialRed4 = new("sequentialRed4");
693 public bool IsSequentialRed4 => SequentialRed4.Equals(Value);
694
695 public static readonly ChartColor SequentialRed5 = new("sequentialRed5");
696 public bool IsSequentialRed5 => SequentialRed5.Equals(Value);
697
698 public static readonly ChartColor SequentialRed6 = new("sequentialRed6");
699 public bool IsSequentialRed6 => SequentialRed6.Equals(Value);
700
701 public static readonly ChartColor SequentialRed7 = new("sequentialRed7");
702 public bool IsSequentialRed7 => SequentialRed7.Equals(Value);
703
704 public static readonly ChartColor SequentialRed8 = new("sequentialRed8");
705 public bool IsSequentialRed8 => SequentialRed8.Equals(Value);
706
707 public static readonly ChartColor SequentialGreen1 = new("sequentialGreen1");
708 public bool IsSequentialGreen1 => SequentialGreen1.Equals(Value);
709
710 public static readonly ChartColor SequentialGreen2 = new("sequentialGreen2");
711 public bool IsSequentialGreen2 => SequentialGreen2.Equals(Value);
712
713 public static readonly ChartColor SequentialGreen3 = new("sequentialGreen3");
714 public bool IsSequentialGreen3 => SequentialGreen3.Equals(Value);
715
716 public static readonly ChartColor SequentialGreen4 = new("sequentialGreen4");
717 public bool IsSequentialGreen4 => SequentialGreen4.Equals(Value);
718
719 public static readonly ChartColor SequentialGreen5 = new("sequentialGreen5");
720 public bool IsSequentialGreen5 => SequentialGreen5.Equals(Value);
721
722 public static readonly ChartColor SequentialGreen6 = new("sequentialGreen6");
723 public bool IsSequentialGreen6 => SequentialGreen6.Equals(Value);
724
725 public static readonly ChartColor SequentialGreen7 = new("sequentialGreen7");
726 public bool IsSequentialGreen7 => SequentialGreen7.Equals(Value);
727
728 public static readonly ChartColor SequentialGreen8 = new("sequentialGreen8");
729 public bool IsSequentialGreen8 => SequentialGreen8.Equals(Value);
730
731 public static readonly ChartColor SequentialYellow1 = new("sequentialYellow1");
732 public bool IsSequentialYellow1 => SequentialYellow1.Equals(Value);
733
734 public static readonly ChartColor SequentialYellow2 = new("sequentialYellow2");
735 public bool IsSequentialYellow2 => SequentialYellow2.Equals(Value);
736
737 public static readonly ChartColor SequentialYellow3 = new("sequentialYellow3");
738 public bool IsSequentialYellow3 => SequentialYellow3.Equals(Value);
739
740 public static readonly ChartColor SequentialYellow4 = new("sequentialYellow4");
741 public bool IsSequentialYellow4 => SequentialYellow4.Equals(Value);
742
743 public static readonly ChartColor SequentialYellow5 = new("sequentialYellow5");
744 public bool IsSequentialYellow5 => SequentialYellow5.Equals(Value);
745
746 public static readonly ChartColor SequentialYellow6 = new("sequentialYellow6");
747 public bool IsSequentialYellow6 => SequentialYellow6.Equals(Value);
748
749 public static readonly ChartColor SequentialYellow7 = new("sequentialYellow7");
750 public bool IsSequentialYellow7 => SequentialYellow7.Equals(Value);
751
752 public static readonly ChartColor SequentialYellow8 = new("sequentialYellow8");
753 public bool IsSequentialYellow8 => SequentialYellow8.Equals(Value);
754}
755
756[JsonConverter(typeof(JsonConverter<DonutThickness>))]
757public class DonutThickness(string value) : StringEnum(value, caseSensitive: false)
758{
759 public static readonly DonutThickness Thin = new("Thin");
760 public bool IsThin => Thin.Equals(Value);
761
762 public static readonly DonutThickness Thick = new("Thick");
763 public bool IsThick => Thick.Equals(Value);
764}
765
766[JsonConverter(typeof(JsonConverter<HorizontalBarChartDisplayMode>))]
767public class HorizontalBarChartDisplayMode(string value) : StringEnum(value, caseSensitive: false)
768{
769 public static readonly HorizontalBarChartDisplayMode AbsoluteWithAxis = new("AbsoluteWithAxis");
770 public bool IsAbsoluteWithAxis => AbsoluteWithAxis.Equals(Value);
771
772 public static readonly HorizontalBarChartDisplayMode AbsoluteNoAxis = new("AbsoluteNoAxis");
773 public bool IsAbsoluteNoAxis => AbsoluteNoAxis.Equals(Value);
774
775 public static readonly HorizontalBarChartDisplayMode PartToWhole = new("PartToWhole");
776 public bool IsPartToWhole => PartToWhole.Equals(Value);
777}
778
779[JsonConverter(typeof(JsonConverter<GaugeChartValueFormat>))]
780public class GaugeChartValueFormat(string value) : StringEnum(value, caseSensitive: false)
781{
782 public static readonly GaugeChartValueFormat Percentage = new("Percentage");
783 public bool IsPercentage => Percentage.Equals(Value);
784
785 public static readonly GaugeChartValueFormat Fraction = new("Fraction");
786 public bool IsFraction => Fraction.Equals(Value);
787}
788
789[JsonConverter(typeof(JsonConverter<CodeLanguage>))]
790public class CodeLanguage(string value) : StringEnum(value, caseSensitive: false)
791{
792 public static readonly CodeLanguage Bash = new("Bash");
793 public bool IsBash => Bash.Equals(Value);
794
795 public static readonly CodeLanguage C = new("C");
796 public bool IsC => C.Equals(Value);
797
798 public static readonly CodeLanguage Cpp = new("Cpp");
799 public bool IsCpp => Cpp.Equals(Value);
800
801 public static readonly CodeLanguage CSharp = new("CSharp");
802 public bool IsCSharp => CSharp.Equals(Value);
803
804 public static readonly CodeLanguage Css = new("Css");
805 public bool IsCss => Css.Equals(Value);
806
807 public static readonly CodeLanguage Dos = new("Dos");
808 public bool IsDos => Dos.Equals(Value);
809
810 public static readonly CodeLanguage Go = new("Go");
811 public bool IsGo => Go.Equals(Value);
812
813 public static readonly CodeLanguage Graphql = new("Graphql");
814 public bool IsGraphql => Graphql.Equals(Value);
815
816 public static readonly CodeLanguage Html = new("Html");
817 public bool IsHtml => Html.Equals(Value);
818
819 public static readonly CodeLanguage Java = new("Java");
820 public bool IsJava => Java.Equals(Value);
821
822 public static readonly CodeLanguage JavaScript = new("JavaScript");
823 public bool IsJavaScript => JavaScript.Equals(Value);
824
825 public static readonly CodeLanguage Json = new("Json");
826 public bool IsJson => Json.Equals(Value);
827
828 public static readonly CodeLanguage ObjectiveC = new("ObjectiveC");
829 public bool IsObjectiveC => ObjectiveC.Equals(Value);
830
831 public static readonly CodeLanguage Perl = new("Perl");
832 public bool IsPerl => Perl.Equals(Value);
833
834 public static readonly CodeLanguage Php = new("Php");
835 public bool IsPhp => Php.Equals(Value);
836
837 public static readonly CodeLanguage PlainText = new("PlainText");
838 public bool IsPlainText => PlainText.Equals(Value);
839
840 public static readonly CodeLanguage PowerShell = new("PowerShell");
841 public bool IsPowerShell => PowerShell.Equals(Value);
842
843 public static readonly CodeLanguage Python = new("Python");
844 public bool IsPython => Python.Equals(Value);
845
846 public static readonly CodeLanguage Sql = new("Sql");
847 public bool IsSql => Sql.Equals(Value);
848
849 public static readonly CodeLanguage TypeScript = new("TypeScript");
850 public bool IsTypeScript => TypeScript.Equals(Value);
851
852 public static readonly CodeLanguage VbNet = new("VbNet");
853 public bool IsVbNet => VbNet.Equals(Value);
854
855 public static readonly CodeLanguage Verilog = new("Verilog");
856 public bool IsVerilog => Verilog.Equals(Value);
857
858 public static readonly CodeLanguage Vhdl = new("Vhdl");
859 public bool IsVhdl => Vhdl.Equals(Value);
860
861 public static readonly CodeLanguage Xml = new("Xml");
862 public bool IsXml => Xml.Equals(Value);
863}
864
865[JsonConverter(typeof(JsonConverter<PersonaIconStyle>))]
866public class PersonaIconStyle(string value) : StringEnum(value, caseSensitive: false)
867{
868 public static readonly PersonaIconStyle ProfilePicture = new("profilePicture");
869 public bool IsProfilePicture => ProfilePicture.Equals(Value);
870
871 public static readonly PersonaIconStyle ContactCard = new("contactCard");
872 public bool IsContactCard => ContactCard.Equals(Value);
873
874 public static readonly PersonaIconStyle None = new("none");
875 public bool IsNone => None.Equals(Value);
876}
877
878[JsonConverter(typeof(JsonConverter<PersonaDisplayStyle>))]
879public class PersonaDisplayStyle(string value) : StringEnum(value, caseSensitive: false)
880{
881 public static readonly PersonaDisplayStyle IconAndName = new("iconAndName");
882 public bool IsIconAndName => IconAndName.Equals(Value);
883
884 public static readonly PersonaDisplayStyle IconOnly = new("iconOnly");
885 public bool IsIconOnly => IconOnly.Equals(Value);
886
887 public static readonly PersonaDisplayStyle NameOnly = new("nameOnly");
888 public bool IsNameOnly => NameOnly.Equals(Value);
889}
890
891[JsonConverter(typeof(JsonConverter<FallbackElement>))]
892public class FallbackElement(string value) : StringEnum(value, caseSensitive: false)
893{
894 public static readonly FallbackElement Drop = new("drop");
895 public bool IsDrop => Drop.Equals(Value);
896}
897
898[JsonConverter(typeof(JsonConverter<ImageSize>))]
899public class ImageSize(string value) : StringEnum(value, caseSensitive: false)
900{
901 public static readonly ImageSize Small = new("Small");
902 public bool IsSmall => Small.Equals(Value);
903
904 public static readonly ImageSize Medium = new("Medium");
905 public bool IsMedium => Medium.Equals(Value);
906
907 public static readonly ImageSize Large = new("Large");
908 public bool IsLarge => Large.Equals(Value);
909}
910
911[JsonConverter(typeof(JsonConverter<SizeEnum>))]
912public class SizeEnum(string value) : StringEnum(value, caseSensitive: false)
913{
914 public static readonly SizeEnum Small = new("Small");
915 public bool IsSmall => Small.Equals(Value);
916
917 public static readonly SizeEnum Default = new("Default");
918 public bool IsDefault => Default.Equals(Value);
919
920 public static readonly SizeEnum Medium = new("Medium");
921 public bool IsMedium => Medium.Equals(Value);
922
923 public static readonly SizeEnum Large = new("Large");
924 public bool IsLarge => Large.Equals(Value);
925
926 public static readonly SizeEnum ExtraLarge = new("ExtraLarge");
927 public bool IsExtraLarge => ExtraLarge.Equals(Value);
928}
929
930[JsonConverter(typeof(JsonConverter<PopoverPosition>))]
931public class PopoverPosition(string value) : StringEnum(value, caseSensitive: false)
932{
933 public static readonly PopoverPosition Above = new("Above");
934 public bool IsAbove => Above.Equals(Value);
935
936 public static readonly PopoverPosition Below = new("Below");
937 public bool IsBelow => Below.Equals(Value);
938
939 public static readonly PopoverPosition Before = new("Before");
940 public bool IsBefore => Before.Equals(Value);
941
942 public static readonly PopoverPosition After = new("After");
943 public bool IsAfter => After.Equals(Value);
944}
945
946[JsonConverter(typeof(JsonConverter<FallbackAction>))]
947public class FallbackAction(string value) : StringEnum(value, caseSensitive: false)
948{
949 public static readonly FallbackAction Drop = new("drop");
950 public bool IsDrop => Drop.Equals(Value);
951}
952
953[JsonConverter(typeof(JsonConverter<ImageInsertPosition>))]
954public class ImageInsertPosition(string value) : StringEnum(value, caseSensitive: false)
955{
956 public static readonly ImageInsertPosition Selection = new("Selection");
957 public bool IsSelection => Selection.Equals(Value);
958
959 public static readonly ImageInsertPosition Top = new("Top");
960 public bool IsTop => Top.Equals(Value);
961
962 public static readonly ImageInsertPosition Bottom = new("Bottom");
963 public bool IsBottom => Bottom.Equals(Value);
964}
965
966[JsonConverter(typeof(JsonConverter<Version>))]
967public class Version(string value) : StringEnum(value, caseSensitive: false)
968{
969 public static readonly Version Version1_0 = new("1.0");
970 public bool IsVersion1_0 => Version1_0.Equals(Value);
971
972 public static readonly Version Version1_1 = new("1.1");
973 public bool IsVersion1_1 => Version1_1.Equals(Value);
974
975 public static readonly Version Version1_2 = new("1.2");
976 public bool IsVersion1_2 => Version1_2.Equals(Value);
977
978 public static readonly Version Version1_3 = new("1.3");
979 public bool IsVersion1_3 => Version1_3.Equals(Value);
980
981 public static readonly Version Version1_4 = new("1.4");
982 public bool IsVersion1_4 => Version1_4.Equals(Value);
983
984 public static readonly Version Version1_5 = new("1.5");
985 public bool IsVersion1_5 => Version1_5.Equals(Value);
986
987 public static readonly Version Version1_6 = new("1.6");
988 public bool IsVersion1_6 => Version1_6.Equals(Value);
989}
990
991[JsonConverter(typeof(JsonConverter<TeamsCardWidth>))]
992public class TeamsCardWidth(string value) : StringEnum(value, caseSensitive: false)
993{
994 public static readonly TeamsCardWidth Full = new("full");
995 public bool IsFull => Full.Equals(Value);
996}
997
998[JsonConverter(typeof(JsonConverter<MentionType>))]
999public class MentionType(string value) : StringEnum(value, caseSensitive: false)
1000{
1001 public static readonly MentionType Person = new("Person");
1002 public bool IsPerson => Person.Equals(Value);
1003
1004 public static readonly MentionType Tag = new("Tag");
1005 public bool IsTag => Tag.Equals(Value);
1006}
1007
1008internal record ObjectType(string[] DiscriminatorPropertyNames, string DiscriminatorValue, Type Type) { }
1009
1010public abstract class SerializableObject { }
1011
1012internal sealed class CardElementJsonConverter : JsonConverter<CardElement>
1013{
1014 private static readonly List<ObjectType> _typeMap = new()
1015 {
1016 new ObjectType(["type"], "AdaptiveCard", typeof(AdaptiveCard)),
1017 new ObjectType(["type"], "ActionSet", typeof(ActionSet)),
1018 new ObjectType(["type"], "Container", typeof(Container)),
1019 new ObjectType(["type"], "ColumnSet", typeof(ColumnSet)),
1020 new ObjectType(["type"], "Media", typeof(Media)),
1021 new ObjectType(["type"], "RichTextBlock", typeof(RichTextBlock)),
1022 new ObjectType(["type"], "Table", typeof(Table)),
1023 new ObjectType(["type"], "TextBlock", typeof(TextBlock)),
1024 new ObjectType(["type"], "FactSet", typeof(FactSet)),
1025 new ObjectType(["type"], "ImageSet", typeof(ImageSet)),
1026 new ObjectType(["type"], "Image", typeof(Image)),
1027 new ObjectType(["type"], "Input.Text", typeof(TextInput)),
1028 new ObjectType(["type"], "Input.Date", typeof(DateInput)),
1029 new ObjectType(["type"], "Input.Time", typeof(TimeInput)),
1030 new ObjectType(["type"], "Input.Number", typeof(NumberInput)),
1031 new ObjectType(["type"], "Input.Toggle", typeof(ToggleInput)),
1032 new ObjectType(["type"], "Input.ChoiceSet", typeof(ChoiceSetInput)),
1033 new ObjectType(["type"], "Input.Rating", typeof(RatingInput)),
1034 new ObjectType(["type"], "Rating", typeof(Rating)),
1035 new ObjectType(["type"], "CompoundButton", typeof(CompoundButton)),
1036 new ObjectType(["type"], "Icon", typeof(Icon)),
1037 new ObjectType(["type"], "Carousel", typeof(Carousel)),
1038 new ObjectType(["type"], "Badge", typeof(Badge)),
1039 new ObjectType(["type"], "ProgressRing", typeof(ProgressRing)),
1040 new ObjectType(["type"], "ProgressBar", typeof(ProgressBar)),
1041 new ObjectType(["type"], "Chart.Donut", typeof(DonutChart)),
1042 new ObjectType(["type"], "Chart.Pie", typeof(PieChart)),
1043 new ObjectType(["type"], "Chart.VerticalBar.Grouped", typeof(GroupedVerticalBarChart)),
1044 new ObjectType(["type"], "Chart.VerticalBar", typeof(VerticalBarChart)),
1045 new ObjectType(["type"], "Chart.HorizontalBar", typeof(HorizontalBarChart)),
1046 new ObjectType(["type"], "Chart.HorizontalBar.Stacked", typeof(StackedHorizontalBarChart)),
1047 new ObjectType(["type"], "Chart.Line", typeof(LineChart)),
1048 new ObjectType(["type"], "Chart.Gauge", typeof(GaugeChart)),
1049 new ObjectType(["type"], "CodeBlock", typeof(CodeBlock)),
1050 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/user", typeof(ComUserMicrosoftGraphComponent)),
1051 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/users", typeof(ComUsersMicrosoftGraphComponent)),
1052 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/resource", typeof(ComResourceMicrosoftGraphComponent)),
1053 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/file", typeof(ComFileMicrosoftGraphComponent)),
1054 new ObjectType(["name", "type"], "Componentgraph.microsoft.com/event", typeof(ComEventMicrosoftGraphComponent)),
1055 new ObjectType(["type"], "CarouselPage", typeof(CarouselPage)),
1056 new ObjectType(["type"], "TableRow", typeof(TableRow)),
1057 new ObjectType(["type"], "TableCell", typeof(TableCell)),
1058 new ObjectType(["type"], "TextRun", typeof(TextRun)),
1059 new ObjectType(["type"], "IconRun", typeof(IconRun)),
1060 new ObjectType(["type"], "ImageRun", typeof(ImageRun)),
1061 new ObjectType(["type"], "Column", typeof(Column)),
1062 };
1063
1064 public override CardElement? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1065 {
1066 if (reader.TokenType == JsonTokenType.Null) return null;
1067
1068 using var doc = JsonDocument.ParseValue(ref reader);
1069 var root = doc.RootElement;
1070
1071 foreach (var type in _typeMap)
1072 {
1073 var discriminatorPropertyValues = new List<string?>();
1074
1075 foreach (var propName in type.DiscriminatorPropertyNames)
1076 {
1077 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
1078 {
1079 discriminatorPropertyValues.Insert(0, prop.GetString());
1080 }
1081 }
1082
1083 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
1084 {
1085 return (CardElement?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
1086 }
1087 }
1088
1089 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
1090 }
1091
1092 public override void Write(Utf8JsonWriter writer, CardElement value, JsonSerializerOptions options)
1093 {
1094 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
1095 }
1096}
1097
1098[JsonConverter(typeof(CardElementJsonConverter))]
1099public abstract class CardElement : SerializableObject { }
1100
1101internal sealed class ActionJsonConverter : JsonConverter<Action>
1102{
1103 private static readonly List<ObjectType> _typeMap = new()
1104 {
1105 new ObjectType(["type"], "Action.Execute", typeof(ExecuteAction)),
1106 new ObjectType(["type"], "Action.InsertImage", typeof(InsertImageAction)),
1107 new ObjectType(["type"], "Action.OpenUrl", typeof(OpenUrlAction)),
1108 new ObjectType(["type"], "Action.OpenUrlDialog", typeof(OpenUrlDialogAction)),
1109 new ObjectType(["type"], "Action.ResetInputs", typeof(ResetInputsAction)),
1110 new ObjectType(["type"], "Action.Submit", typeof(SubmitAction)),
1111 new ObjectType(["type"], "Action.ToggleVisibility", typeof(ToggleVisibilityAction)),
1112 new ObjectType(["type"], "Action.ShowCard", typeof(ShowCardAction)),
1113 new ObjectType(["type"], "Action.Popover", typeof(PopoverAction)),
1114 };
1115
1116 public override Action? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1117 {
1118 if (reader.TokenType == JsonTokenType.Null) return null;
1119
1120 using var doc = JsonDocument.ParseValue(ref reader);
1121 var root = doc.RootElement;
1122
1123 foreach (var type in _typeMap)
1124 {
1125 var discriminatorPropertyValues = new List<string?>();
1126
1127 foreach (var propName in type.DiscriminatorPropertyNames)
1128 {
1129 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
1130 {
1131 discriminatorPropertyValues.Insert(0, prop.GetString());
1132 }
1133 }
1134
1135 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
1136 {
1137 return (Action?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
1138 }
1139 }
1140
1141 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
1142 }
1143
1144 public override void Write(Utf8JsonWriter writer, Action value, JsonSerializerOptions options)
1145 {
1146 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
1147 }
1148}
1149
1150[JsonConverter(typeof(ActionJsonConverter))]
1151public abstract class Action : SerializableObject { }
1152
1153internal sealed class ContainerLayoutJsonConverter : JsonConverter<ContainerLayout>
1154{
1155 private static readonly List<ObjectType> _typeMap = new()
1156 {
1157 new ObjectType(["type"], "Layout.Stack", typeof(StackLayout)),
1158 new ObjectType(["type"], "Layout.Flow", typeof(FlowLayout)),
1159 new ObjectType(["type"], "Layout.AreaGrid", typeof(AreaGridLayout)),
1160 };
1161
1162 public override ContainerLayout? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
1163 {
1164 if (reader.TokenType == JsonTokenType.Null) return null;
1165
1166 using var doc = JsonDocument.ParseValue(ref reader);
1167 var root = doc.RootElement;
1168
1169 foreach (var type in _typeMap)
1170 {
1171 var discriminatorPropertyValues = new List<string?>();
1172
1173 foreach (var propName in type.DiscriminatorPropertyNames)
1174 {
1175 if (root.TryGetProperty(propName, out var prop) && prop.ValueKind == JsonValueKind.String)
1176 {
1177 discriminatorPropertyValues.Insert(0, prop.GetString());
1178 }
1179 }
1180
1181 if (string.Join("", discriminatorPropertyValues) == type.DiscriminatorValue)
1182 {
1183 return (ContainerLayout?)JsonSerializer.Deserialize(root.GetRawText(), type.Type, options);
1184 }
1185 }
1186
1187 throw new NotSupportedException($"Unable to deserialize '{root.GetRawText()}'.");
1188 }
1189
1190 public override void Write(Utf8JsonWriter writer, ContainerLayout value, JsonSerializerOptions options)
1191 {
1192 JsonSerializer.Serialize(writer, (object)value, value.GetType(), options);
1193 }
1194}
1195
1196[JsonConverter(typeof(ContainerLayoutJsonConverter))]
1197public abstract class ContainerLayout : SerializableObject { }
1198
1199/// <summary>
1200/// An Adaptive Card, containing a free-form body of card elements, and an optional set of actions.
1201/// </summary>
1202public class AdaptiveCard : CardElement
1203{
1204 /// <summary>
1205 /// Deserializes a JSON string into an object of type AdaptiveCard.
1206 /// </summary>
1207 public static AdaptiveCard? Deserialize(string json)
1208 {
1209 return JsonSerializer.Deserialize<AdaptiveCard>(json);
1210 }
1211
1212 /// <summary>
1213 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
1214 /// </summary>
1215 [JsonPropertyName("key")]
1216 public string? Key { get; set; }
1217
1218 /// <summary>
1219 /// Must be **AdaptiveCard**.
1220 /// </summary>
1221 [JsonPropertyName("type")]
1222 public string Type { get; } = "AdaptiveCard";
1223
1224 /// <summary>
1225 /// 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.
1226 /// </summary>
1227 [JsonPropertyName("id")]
1228 public string? Id { get; set; }
1229
1230 /// <summary>
1231 /// 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).
1232 /// </summary>
1233 [JsonPropertyName("requires")]
1234 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
1235
1236 /// <summary>
1237 /// The locale associated with the element.
1238 /// </summary>
1239 [JsonPropertyName("lang")]
1240 public string? Lang { get; set; }
1241
1242 /// <summary>
1243 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
1244 /// </summary>
1245 [JsonPropertyName("isSortKey")]
1246 public bool? IsSortKey { get; set; } = false;
1247
1248 /// <summary>
1249 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
1250 /// </summary>
1251 [JsonPropertyName("selectAction")]
1252 public Action? SelectAction { get; set; }
1253
1254 /// <summary>
1255 /// 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.
1256 /// </summary>
1257 [JsonPropertyName("style")]
1258 public ContainerStyle? Style { get; set; }
1259
1260 /// <summary>
1261 /// 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.
1262 /// </summary>
1263 [JsonPropertyName("layouts")]
1264 public IList<ContainerLayout>? Layouts { get; set; }
1265
1266 /// <summary>
1267 /// The minimum height, in pixels, of the container, in the `<number>px` format.
1268 /// </summary>
1269 [JsonPropertyName("minHeight")]
1270 public string? MinHeight { get; set; }
1271
1272 /// <summary>
1273 /// Defines the container's background image.
1274 /// </summary>
1275 [JsonPropertyName("backgroundImage")]
1276 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
1277
1278 /// <summary>
1279 /// Controls how the container's content should be vertically aligned.
1280 /// </summary>
1281 [JsonPropertyName("verticalContentAlignment")]
1282 public VerticalAlignment? VerticalContentAlignment { get; set; }
1283
1284 /// <summary>
1285 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
1286 /// </summary>
1287 [JsonPropertyName("rtl")]
1288 public bool? Rtl { get; set; }
1289
1290 /// <summary>
1291 /// A URL to the Adaptive Card schema the card is authored against.
1292 /// </summary>
1293 [JsonPropertyName("$schema")]
1294 public string? Schema { get; set; }
1295
1296 /// <summary>
1297 /// The Adaptive Card schema version the card is authored against.
1298 /// </summary>
1299 [JsonPropertyName("version")]
1300 public Version? Version { get; set; } = Version.Version1_5;
1301
1302 /// <summary>
1303 /// The text that should be displayed if the client is not able to render the card.
1304 /// </summary>
1305 [JsonPropertyName("fallbackText")]
1306 public string? FallbackText { get; set; }
1307
1308 /// <summary>
1309 /// The text that should be spoken for the entire card.
1310 /// </summary>
1311 [JsonPropertyName("speak")]
1312 public string? Speak { get; set; }
1313
1314 /// <summary>
1315 /// Defines how the card can be refreshed by making a request to the target Bot.
1316 /// </summary>
1317 [JsonPropertyName("refresh")]
1318 public RefreshDefinition? Refresh { get; set; }
1319
1320 /// <summary>
1321 /// 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.
1322 /// </summary>
1323 [JsonPropertyName("authentication")]
1324 public Authentication? Authentication { get; set; }
1325
1326 /// <summary>
1327 /// Teams-specific metadata associated with the card.
1328 /// </summary>
1329 [JsonPropertyName("msteams")]
1330 public TeamsCardProperties? Msteams { get; set; }
1331
1332 /// <summary>
1333 /// Metadata associated with the card.
1334 /// </summary>
1335 [JsonPropertyName("metadata")]
1336 public CardMetadata? Metadata { get; set; }
1337
1338 /// <summary>
1339 /// Resources card elements can reference.
1340 /// </summary>
1341 [JsonPropertyName("resources")]
1342 public Resources? Resources { get; set; }
1343
1344 /// <summary>
1345 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
1346 /// </summary>
1347 [JsonPropertyName("grid.area")]
1348 public string? GridArea { get; set; }
1349
1350 /// <summary>
1351 /// 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.
1352 /// </summary>
1353 [JsonPropertyName("fallback")]
1354 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
1355
1356 /// <summary>
1357 /// 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.
1358 /// </summary>
1359 [JsonPropertyName("body")]
1360 public IList<CardElement>? Body { get; set; }
1361
1362 /// <summary>
1363 /// The card level actions, which always appear at the bottom of the card.
1364 /// </summary>
1365 [JsonPropertyName("actions")]
1366 public IList<Action>? Actions { get; set; }
1367
1368 public AdaptiveCard() { }
1369
1370 public AdaptiveCard(params CardElement[] body)
1371 {
1372 this.Body = new List<CardElement>(body);
1373 }
1374
1375 public AdaptiveCard(IList<CardElement> body)
1376 {
1377 this.Body = body;
1378 }
1379
1380 /// <summary>
1381 /// Serializes this AdaptiveCard into a JSON string.
1382 /// </summary>
1383 public string Serialize()
1384 {
1385 return JsonSerializer.Serialize(
1386 this,
1387 new JsonSerializerOptions
1388 {
1389 WriteIndented = true,
1390 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1391 }
1392 );
1393 }
1394
1395 public AdaptiveCard WithKey(string value)
1396 {
1397 this.Key = value;
1398 return this;
1399 }
1400
1401 public AdaptiveCard WithId(string value)
1402 {
1403 this.Id = value;
1404 return this;
1405 }
1406
1407 public AdaptiveCard WithRequires(HostCapabilities value)
1408 {
1409 this.Requires = value;
1410 return this;
1411 }
1412
1413 public AdaptiveCard WithLang(string value)
1414 {
1415 this.Lang = value;
1416 return this;
1417 }
1418
1419 public AdaptiveCard WithIsSortKey(bool value)
1420 {
1421 this.IsSortKey = value;
1422 return this;
1423 }
1424
1425 public AdaptiveCard WithSelectAction(Action value)
1426 {
1427 this.SelectAction = value;
1428 return this;
1429 }
1430
1431 public AdaptiveCard WithStyle(ContainerStyle value)
1432 {
1433 this.Style = value;
1434 return this;
1435 }
1436
1437 public AdaptiveCard WithLayouts(params ContainerLayout[] value)
1438 {
1439 this.Layouts = new List<ContainerLayout>(value);
1440 return this;
1441 }
1442
1443 public AdaptiveCard WithLayouts(IList<ContainerLayout> value)
1444 {
1445 this.Layouts = value;
1446 return this;
1447 }
1448
1449 public AdaptiveCard WithMinHeight(string value)
1450 {
1451 this.MinHeight = value;
1452 return this;
1453 }
1454
1455 public AdaptiveCard WithBackgroundImage(IUnion<string, BackgroundImage> value)
1456 {
1457 this.BackgroundImage = value;
1458 return this;
1459 }
1460
1461 public AdaptiveCard WithVerticalContentAlignment(VerticalAlignment value)
1462 {
1463 this.VerticalContentAlignment = value;
1464 return this;
1465 }
1466
1467 public AdaptiveCard WithRtl(bool value)
1468 {
1469 this.Rtl = value;
1470 return this;
1471 }
1472
1473 public AdaptiveCard WithSchema(string value)
1474 {
1475 this.Schema = value;
1476 return this;
1477 }
1478
1479 public AdaptiveCard WithVersion(Version value)
1480 {
1481 this.Version = value;
1482 return this;
1483 }
1484
1485 public AdaptiveCard WithFallbackText(string value)
1486 {
1487 this.FallbackText = value;
1488 return this;
1489 }
1490
1491 public AdaptiveCard WithSpeak(string value)
1492 {
1493 this.Speak = value;
1494 return this;
1495 }
1496
1497 public AdaptiveCard WithRefresh(RefreshDefinition value)
1498 {
1499 this.Refresh = value;
1500 return this;
1501 }
1502
1503 public AdaptiveCard WithAuthentication(Authentication value)
1504 {
1505 this.Authentication = value;
1506 return this;
1507 }
1508
1509 public AdaptiveCard WithMsteams(TeamsCardProperties value)
1510 {
1511 this.Msteams = value;
1512 return this;
1513 }
1514
1515 public AdaptiveCard WithMetadata(CardMetadata value)
1516 {
1517 this.Metadata = value;
1518 return this;
1519 }
1520
1521 public AdaptiveCard WithResources(Resources value)
1522 {
1523 this.Resources = value;
1524 return this;
1525 }
1526
1527 public AdaptiveCard WithGridArea(string value)
1528 {
1529 this.GridArea = value;
1530 return this;
1531 }
1532
1533 public AdaptiveCard WithFallback(IUnion<CardElement, FallbackElement> value)
1534 {
1535 this.Fallback = value;
1536 return this;
1537 }
1538
1539 public AdaptiveCard WithBody(params CardElement[] value)
1540 {
1541 this.Body = new List<CardElement>(value);
1542 return this;
1543 }
1544
1545 public AdaptiveCard WithBody(IList<CardElement> value)
1546 {
1547 this.Body = value;
1548 return this;
1549 }
1550
1551 public AdaptiveCard WithActions(params Action[] value)
1552 {
1553 this.Actions = new List<Action>(value);
1554 return this;
1555 }
1556
1557 public AdaptiveCard WithActions(IList<Action> value)
1558 {
1559 this.Actions = value;
1560 return this;
1561 }
1562}
1563
1564/// <summary>
1565/// Represents a list of versioned capabilities a host application must support.
1566/// </summary>
1567public class HostCapabilities : SerializableObject
1568{
1569 /// <summary>
1570 /// Deserializes a JSON string into an object of type HostCapabilities.
1571 /// </summary>
1572 public static HostCapabilities? Deserialize(string json)
1573 {
1574 return JsonSerializer.Deserialize<HostCapabilities>(json);
1575 }
1576
1577 /// <summary>
1578 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
1579 /// </summary>
1580 [JsonPropertyName("key")]
1581 public string? Key { get; set; }
1582
1583 /// <summary>
1584 /// Serializes this HostCapabilities into a JSON string.
1585 /// </summary>
1586 public string Serialize()
1587 {
1588 return JsonSerializer.Serialize(
1589 this,
1590 new JsonSerializerOptions
1591 {
1592 WriteIndented = true,
1593 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1594 }
1595 );
1596 }
1597
1598 public HostCapabilities WithKey(string value)
1599 {
1600 this.Key = value;
1601 return this;
1602 }
1603 [JsonExtensionData]
1604 public IDictionary<string, object?> NonSchemaProperties { get; set; } = new Dictionary<string, object?>();
1605}
1606
1607/// <summary>
1608/// 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.
1609/// </summary>
1610public class ExecuteAction : Action
1611{
1612 /// <summary>
1613 /// Deserializes a JSON string into an object of type ExecuteAction.
1614 /// </summary>
1615 public static ExecuteAction? Deserialize(string json)
1616 {
1617 return JsonSerializer.Deserialize<ExecuteAction>(json);
1618 }
1619
1620 /// <summary>
1621 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
1622 /// </summary>
1623 [JsonPropertyName("key")]
1624 public string? Key { get; set; }
1625
1626 /// <summary>
1627 /// Must be **Action.Execute**.
1628 /// </summary>
1629 [JsonPropertyName("type")]
1630 public string Type { get; } = "Action.Execute";
1631
1632 /// <summary>
1633 /// 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.
1634 /// </summary>
1635 [JsonPropertyName("id")]
1636 public string? Id { get; set; }
1637
1638 /// <summary>
1639 /// 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).
1640 /// </summary>
1641 [JsonPropertyName("requires")]
1642 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
1643
1644 /// <summary>
1645 /// The title of the action, as it appears on buttons.
1646 /// </summary>
1647 [JsonPropertyName("title")]
1648 public string? Title { get; set; }
1649
1650 /// <summary>
1651 /// 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.
1652 ///
1653 /// `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.
1654 /// </summary>
1655 [JsonPropertyName("iconUrl")]
1656 public string? IconUrl { get; set; }
1657
1658 /// <summary>
1659 /// Control the style of the action, affecting its visual and spoken representations.
1660 /// </summary>
1661 [JsonPropertyName("style")]
1662 public ActionStyle? Style { get; set; } = ActionStyle.Default;
1663
1664 /// <summary>
1665 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
1666 /// </summary>
1667 [JsonPropertyName("mode")]
1668 public ActionMode? Mode { get; set; } = ActionMode.Primary;
1669
1670 /// <summary>
1671 /// The tooltip text to display when the action is hovered over.
1672 /// </summary>
1673 [JsonPropertyName("tooltip")]
1674 public string? Tooltip { get; set; }
1675
1676 /// <summary>
1677 /// 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.
1678 /// </summary>
1679 [JsonPropertyName("isEnabled")]
1680 public bool? IsEnabled { get; set; } = true;
1681
1682 /// <summary>
1683 /// The actions to display in the overflow menu of a Split action button.
1684 /// </summary>
1685 [JsonPropertyName("menuActions")]
1686 public IList<Action>? MenuActions { get; set; }
1687
1688 /// <summary>
1689 /// A set of theme-specific icon URLs.
1690 /// </summary>
1691 [JsonPropertyName("themedIconUrls")]
1692 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
1693
1694 /// <summary>
1695 /// 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.
1696 /// </summary>
1697 [JsonPropertyName("data")]
1698 public IUnion<string, SubmitActionData>? Data { get; set; }
1699
1700 /// <summary>
1701 /// 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.
1702 /// </summary>
1703 [JsonPropertyName("associatedInputs")]
1704 public AssociatedInputs? AssociatedInputs { get; set; }
1705
1706 /// <summary>
1707 /// Controls if the action is enabled only if at least one required input has been filled by the user.
1708 /// </summary>
1709 [JsonPropertyName("conditionallyEnabled")]
1710 public bool? ConditionallyEnabled { get; set; } = false;
1711
1712 /// <summary>
1713 /// The verb of the action.
1714 /// </summary>
1715 [JsonPropertyName("verb")]
1716 public string? Verb { get; set; }
1717
1718 /// <summary>
1719 /// 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.
1720 /// </summary>
1721 [JsonPropertyName("fallback")]
1722 public IUnion<Action, FallbackAction>? Fallback { get; set; }
1723
1724 /// <summary>
1725 /// Serializes this ExecuteAction into a JSON string.
1726 /// </summary>
1727 public string Serialize()
1728 {
1729 return JsonSerializer.Serialize(
1730 this,
1731 new JsonSerializerOptions
1732 {
1733 WriteIndented = true,
1734 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1735 }
1736 );
1737 }
1738
1739 public ExecuteAction WithKey(string value)
1740 {
1741 this.Key = value;
1742 return this;
1743 }
1744
1745 public ExecuteAction WithId(string value)
1746 {
1747 this.Id = value;
1748 return this;
1749 }
1750
1751 public ExecuteAction WithRequires(HostCapabilities value)
1752 {
1753 this.Requires = value;
1754 return this;
1755 }
1756
1757 public ExecuteAction WithTitle(string value)
1758 {
1759 this.Title = value;
1760 return this;
1761 }
1762
1763 public ExecuteAction WithIconUrl(string value)
1764 {
1765 this.IconUrl = value;
1766 return this;
1767 }
1768
1769 public ExecuteAction WithStyle(ActionStyle value)
1770 {
1771 this.Style = value;
1772 return this;
1773 }
1774
1775 public ExecuteAction WithMode(ActionMode value)
1776 {
1777 this.Mode = value;
1778 return this;
1779 }
1780
1781 public ExecuteAction WithTooltip(string value)
1782 {
1783 this.Tooltip = value;
1784 return this;
1785 }
1786
1787 public ExecuteAction WithIsEnabled(bool value)
1788 {
1789 this.IsEnabled = value;
1790 return this;
1791 }
1792
1793 public ExecuteAction WithMenuActions(params Action[] value)
1794 {
1795 this.MenuActions = new List<Action>(value);
1796 return this;
1797 }
1798
1799 public ExecuteAction WithMenuActions(IList<Action> value)
1800 {
1801 this.MenuActions = value;
1802 return this;
1803 }
1804
1805 public ExecuteAction WithThemedIconUrls(params ThemedUrl[] value)
1806 {
1807 this.ThemedIconUrls = new List<ThemedUrl>(value);
1808 return this;
1809 }
1810
1811 public ExecuteAction WithThemedIconUrls(IList<ThemedUrl> value)
1812 {
1813 this.ThemedIconUrls = value;
1814 return this;
1815 }
1816
1817 public ExecuteAction WithData(IUnion<string, SubmitActionData> value)
1818 {
1819 this.Data = value;
1820 return this;
1821 }
1822
1823 public ExecuteAction WithAssociatedInputs(AssociatedInputs value)
1824 {
1825 this.AssociatedInputs = value;
1826 return this;
1827 }
1828
1829 public ExecuteAction WithConditionallyEnabled(bool value)
1830 {
1831 this.ConditionallyEnabled = value;
1832 return this;
1833 }
1834
1835 public ExecuteAction WithVerb(string value)
1836 {
1837 this.Verb = value;
1838 return this;
1839 }
1840
1841 public ExecuteAction WithFallback(IUnion<Action, FallbackAction> value)
1842 {
1843 this.Fallback = value;
1844 return this;
1845 }
1846}
1847
1848/// <summary>
1849/// Inserts an image into the host application's canvas.
1850/// </summary>
1851public class InsertImageAction : Action
1852{
1853 /// <summary>
1854 /// Deserializes a JSON string into an object of type InsertImageAction.
1855 /// </summary>
1856 public static InsertImageAction? Deserialize(string json)
1857 {
1858 return JsonSerializer.Deserialize<InsertImageAction>(json);
1859 }
1860
1861 /// <summary>
1862 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
1863 /// </summary>
1864 [JsonPropertyName("key")]
1865 public string? Key { get; set; }
1866
1867 /// <summary>
1868 /// Must be **Action.InsertImage**.
1869 /// </summary>
1870 [JsonPropertyName("type")]
1871 public string Type { get; } = "Action.InsertImage";
1872
1873 /// <summary>
1874 /// 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.
1875 /// </summary>
1876 [JsonPropertyName("id")]
1877 public string? Id { get; set; }
1878
1879 /// <summary>
1880 /// 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).
1881 /// </summary>
1882 [JsonPropertyName("requires")]
1883 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
1884
1885 /// <summary>
1886 /// The title of the action, as it appears on buttons.
1887 /// </summary>
1888 [JsonPropertyName("title")]
1889 public string? Title { get; set; }
1890
1891 /// <summary>
1892 /// 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.
1893 ///
1894 /// `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.
1895 /// </summary>
1896 [JsonPropertyName("iconUrl")]
1897 public string? IconUrl { get; set; }
1898
1899 /// <summary>
1900 /// Control the style of the action, affecting its visual and spoken representations.
1901 /// </summary>
1902 [JsonPropertyName("style")]
1903 public ActionStyle? Style { get; set; } = ActionStyle.Default;
1904
1905 /// <summary>
1906 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
1907 /// </summary>
1908 [JsonPropertyName("mode")]
1909 public ActionMode? Mode { get; set; } = ActionMode.Primary;
1910
1911 /// <summary>
1912 /// The tooltip text to display when the action is hovered over.
1913 /// </summary>
1914 [JsonPropertyName("tooltip")]
1915 public string? Tooltip { get; set; }
1916
1917 /// <summary>
1918 /// 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.
1919 /// </summary>
1920 [JsonPropertyName("isEnabled")]
1921 public bool? IsEnabled { get; set; } = true;
1922
1923 /// <summary>
1924 /// The actions to display in the overflow menu of a Split action button.
1925 /// </summary>
1926 [JsonPropertyName("menuActions")]
1927 public IList<Action>? MenuActions { get; set; }
1928
1929 /// <summary>
1930 /// A set of theme-specific icon URLs.
1931 /// </summary>
1932 [JsonPropertyName("themedIconUrls")]
1933 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
1934
1935 /// <summary>
1936 /// The URL of the image to insert.
1937 /// </summary>
1938 [JsonPropertyName("url")]
1939 public string? Url { get; set; }
1940
1941 /// <summary>
1942 /// The alternate text for the image.
1943 /// </summary>
1944 [JsonPropertyName("altText")]
1945 public string? AltText { get; set; }
1946
1947 /// <summary>
1948 /// The position at which to insert the image.
1949 /// </summary>
1950 [JsonPropertyName("insertPosition")]
1951 public ImageInsertPosition? InsertPosition { get; set; } = ImageInsertPosition.Selection;
1952
1953 /// <summary>
1954 /// 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.
1955 /// </summary>
1956 [JsonPropertyName("fallback")]
1957 public IUnion<Action, FallbackAction>? Fallback { get; set; }
1958
1959 /// <summary>
1960 /// Serializes this InsertImageAction into a JSON string.
1961 /// </summary>
1962 public string Serialize()
1963 {
1964 return JsonSerializer.Serialize(
1965 this,
1966 new JsonSerializerOptions
1967 {
1968 WriteIndented = true,
1969 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
1970 }
1971 );
1972 }
1973
1974 public InsertImageAction WithKey(string value)
1975 {
1976 this.Key = value;
1977 return this;
1978 }
1979
1980 public InsertImageAction WithId(string value)
1981 {
1982 this.Id = value;
1983 return this;
1984 }
1985
1986 public InsertImageAction WithRequires(HostCapabilities value)
1987 {
1988 this.Requires = value;
1989 return this;
1990 }
1991
1992 public InsertImageAction WithTitle(string value)
1993 {
1994 this.Title = value;
1995 return this;
1996 }
1997
1998 public InsertImageAction WithIconUrl(string value)
1999 {
2000 this.IconUrl = value;
2001 return this;
2002 }
2003
2004 public InsertImageAction WithStyle(ActionStyle value)
2005 {
2006 this.Style = value;
2007 return this;
2008 }
2009
2010 public InsertImageAction WithMode(ActionMode value)
2011 {
2012 this.Mode = value;
2013 return this;
2014 }
2015
2016 public InsertImageAction WithTooltip(string value)
2017 {
2018 this.Tooltip = value;
2019 return this;
2020 }
2021
2022 public InsertImageAction WithIsEnabled(bool value)
2023 {
2024 this.IsEnabled = value;
2025 return this;
2026 }
2027
2028 public InsertImageAction WithMenuActions(params Action[] value)
2029 {
2030 this.MenuActions = new List<Action>(value);
2031 return this;
2032 }
2033
2034 public InsertImageAction WithMenuActions(IList<Action> value)
2035 {
2036 this.MenuActions = value;
2037 return this;
2038 }
2039
2040 public InsertImageAction WithThemedIconUrls(params ThemedUrl[] value)
2041 {
2042 this.ThemedIconUrls = new List<ThemedUrl>(value);
2043 return this;
2044 }
2045
2046 public InsertImageAction WithThemedIconUrls(IList<ThemedUrl> value)
2047 {
2048 this.ThemedIconUrls = value;
2049 return this;
2050 }
2051
2052 public InsertImageAction WithUrl(string value)
2053 {
2054 this.Url = value;
2055 return this;
2056 }
2057
2058 public InsertImageAction WithAltText(string value)
2059 {
2060 this.AltText = value;
2061 return this;
2062 }
2063
2064 public InsertImageAction WithInsertPosition(ImageInsertPosition value)
2065 {
2066 this.InsertPosition = value;
2067 return this;
2068 }
2069
2070 public InsertImageAction WithFallback(IUnion<Action, FallbackAction> value)
2071 {
2072 this.Fallback = value;
2073 return this;
2074 }
2075}
2076
2077/// <summary>
2078/// Opens the provided URL in either a separate browser tab or within the host application.
2079/// </summary>
2080public class OpenUrlAction : Action
2081{
2082 /// <summary>
2083 /// Deserializes a JSON string into an object of type OpenUrlAction.
2084 /// </summary>
2085 public static OpenUrlAction? Deserialize(string json)
2086 {
2087 return JsonSerializer.Deserialize<OpenUrlAction>(json);
2088 }
2089
2090 /// <summary>
2091 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
2092 /// </summary>
2093 [JsonPropertyName("key")]
2094 public string? Key { get; set; }
2095
2096 /// <summary>
2097 /// Must be **Action.OpenUrl**.
2098 /// </summary>
2099 [JsonPropertyName("type")]
2100 public string Type { get; } = "Action.OpenUrl";
2101
2102 /// <summary>
2103 /// 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.
2104 /// </summary>
2105 [JsonPropertyName("id")]
2106 public string? Id { get; set; }
2107
2108 /// <summary>
2109 /// 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).
2110 /// </summary>
2111 [JsonPropertyName("requires")]
2112 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
2113
2114 /// <summary>
2115 /// The title of the action, as it appears on buttons.
2116 /// </summary>
2117 [JsonPropertyName("title")]
2118 public string? Title { get; set; }
2119
2120 /// <summary>
2121 /// 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.
2122 ///
2123 /// `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.
2124 /// </summary>
2125 [JsonPropertyName("iconUrl")]
2126 public string? IconUrl { get; set; }
2127
2128 /// <summary>
2129 /// Control the style of the action, affecting its visual and spoken representations.
2130 /// </summary>
2131 [JsonPropertyName("style")]
2132 public ActionStyle? Style { get; set; } = ActionStyle.Default;
2133
2134 /// <summary>
2135 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2136 /// </summary>
2137 [JsonPropertyName("mode")]
2138 public ActionMode? Mode { get; set; } = ActionMode.Primary;
2139
2140 /// <summary>
2141 /// The tooltip text to display when the action is hovered over.
2142 /// </summary>
2143 [JsonPropertyName("tooltip")]
2144 public string? Tooltip { get; set; }
2145
2146 /// <summary>
2147 /// 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.
2148 /// </summary>
2149 [JsonPropertyName("isEnabled")]
2150 public bool? IsEnabled { get; set; } = true;
2151
2152 /// <summary>
2153 /// The actions to display in the overflow menu of a Split action button.
2154 /// </summary>
2155 [JsonPropertyName("menuActions")]
2156 public IList<Action>? MenuActions { get; set; }
2157
2158 /// <summary>
2159 /// A set of theme-specific icon URLs.
2160 /// </summary>
2161 [JsonPropertyName("themedIconUrls")]
2162 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
2163
2164 /// <summary>
2165 /// The URL to open.
2166 /// </summary>
2167 [JsonPropertyName("url")]
2168 public string? Url { get; set; }
2169
2170 /// <summary>
2171 /// 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.
2172 /// </summary>
2173 [JsonPropertyName("fallback")]
2174 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2175
2176 public OpenUrlAction() { }
2177
2178 public OpenUrlAction(string url)
2179 {
2180 this.Url = url;
2181 }
2182
2183 /// <summary>
2184 /// Serializes this OpenUrlAction into a JSON string.
2185 /// </summary>
2186 public string Serialize()
2187 {
2188 return JsonSerializer.Serialize(
2189 this,
2190 new JsonSerializerOptions
2191 {
2192 WriteIndented = true,
2193 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2194 }
2195 );
2196 }
2197
2198 public OpenUrlAction WithKey(string value)
2199 {
2200 this.Key = value;
2201 return this;
2202 }
2203
2204 public OpenUrlAction WithId(string value)
2205 {
2206 this.Id = value;
2207 return this;
2208 }
2209
2210 public OpenUrlAction WithRequires(HostCapabilities value)
2211 {
2212 this.Requires = value;
2213 return this;
2214 }
2215
2216 public OpenUrlAction WithTitle(string value)
2217 {
2218 this.Title = value;
2219 return this;
2220 }
2221
2222 public OpenUrlAction WithIconUrl(string value)
2223 {
2224 this.IconUrl = value;
2225 return this;
2226 }
2227
2228 public OpenUrlAction WithStyle(ActionStyle value)
2229 {
2230 this.Style = value;
2231 return this;
2232 }
2233
2234 public OpenUrlAction WithMode(ActionMode value)
2235 {
2236 this.Mode = value;
2237 return this;
2238 }
2239
2240 public OpenUrlAction WithTooltip(string value)
2241 {
2242 this.Tooltip = value;
2243 return this;
2244 }
2245
2246 public OpenUrlAction WithIsEnabled(bool value)
2247 {
2248 this.IsEnabled = value;
2249 return this;
2250 }
2251
2252 public OpenUrlAction WithMenuActions(params Action[] value)
2253 {
2254 this.MenuActions = new List<Action>(value);
2255 return this;
2256 }
2257
2258 public OpenUrlAction WithMenuActions(IList<Action> value)
2259 {
2260 this.MenuActions = value;
2261 return this;
2262 }
2263
2264 public OpenUrlAction WithThemedIconUrls(params ThemedUrl[] value)
2265 {
2266 this.ThemedIconUrls = new List<ThemedUrl>(value);
2267 return this;
2268 }
2269
2270 public OpenUrlAction WithThemedIconUrls(IList<ThemedUrl> value)
2271 {
2272 this.ThemedIconUrls = value;
2273 return this;
2274 }
2275
2276 public OpenUrlAction WithUrl(string value)
2277 {
2278 this.Url = value;
2279 return this;
2280 }
2281
2282 public OpenUrlAction WithFallback(IUnion<Action, FallbackAction> value)
2283 {
2284 this.Fallback = value;
2285 return this;
2286 }
2287}
2288
2289/// <summary>
2290/// Opens a task module in a modal dialog hosting the content at a provided URL.
2291/// </summary>
2292public class OpenUrlDialogAction : Action
2293{
2294 /// <summary>
2295 /// Deserializes a JSON string into an object of type OpenUrlDialogAction.
2296 /// </summary>
2297 public static OpenUrlDialogAction? Deserialize(string json)
2298 {
2299 return JsonSerializer.Deserialize<OpenUrlDialogAction>(json);
2300 }
2301
2302 /// <summary>
2303 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
2304 /// </summary>
2305 [JsonPropertyName("key")]
2306 public string? Key { get; set; }
2307
2308 /// <summary>
2309 /// Must be **Action.OpenUrlDialog**.
2310 /// </summary>
2311 [JsonPropertyName("type")]
2312 public string Type { get; } = "Action.OpenUrlDialog";
2313
2314 /// <summary>
2315 /// 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.
2316 /// </summary>
2317 [JsonPropertyName("id")]
2318 public string? Id { get; set; }
2319
2320 /// <summary>
2321 /// 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).
2322 /// </summary>
2323 [JsonPropertyName("requires")]
2324 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
2325
2326 /// <summary>
2327 /// The title of the action, as it appears on buttons.
2328 /// </summary>
2329 [JsonPropertyName("title")]
2330 public string? Title { get; set; }
2331
2332 /// <summary>
2333 /// 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.
2334 ///
2335 /// `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.
2336 /// </summary>
2337 [JsonPropertyName("iconUrl")]
2338 public string? IconUrl { get; set; }
2339
2340 /// <summary>
2341 /// Control the style of the action, affecting its visual and spoken representations.
2342 /// </summary>
2343 [JsonPropertyName("style")]
2344 public ActionStyle? Style { get; set; } = ActionStyle.Default;
2345
2346 /// <summary>
2347 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2348 /// </summary>
2349 [JsonPropertyName("mode")]
2350 public ActionMode? Mode { get; set; } = ActionMode.Primary;
2351
2352 /// <summary>
2353 /// The tooltip text to display when the action is hovered over.
2354 /// </summary>
2355 [JsonPropertyName("tooltip")]
2356 public string? Tooltip { get; set; }
2357
2358 /// <summary>
2359 /// 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.
2360 /// </summary>
2361 [JsonPropertyName("isEnabled")]
2362 public bool? IsEnabled { get; set; } = true;
2363
2364 /// <summary>
2365 /// The actions to display in the overflow menu of a Split action button.
2366 /// </summary>
2367 [JsonPropertyName("menuActions")]
2368 public IList<Action>? MenuActions { get; set; }
2369
2370 /// <summary>
2371 /// A set of theme-specific icon URLs.
2372 /// </summary>
2373 [JsonPropertyName("themedIconUrls")]
2374 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
2375
2376 /// <summary>
2377 /// The title of the dialog to be displayed in the dialog header.
2378 /// </summary>
2379 [JsonPropertyName("dialogTitle")]
2380 public string? DialogTitle { get; set; }
2381
2382 /// <summary>
2383 /// The height of the dialog. To define height as a number of pixels, use the <number>px format.
2384 /// </summary>
2385 [JsonPropertyName("dialogHeight")]
2386 public string? DialogHeight { get; set; }
2387
2388 /// <summary>
2389 /// The width of the dialog. To define width as a number of pixels, use the <number>px format.
2390 /// </summary>
2391 [JsonPropertyName("dialogWidth")]
2392 public string? DialogWidth { get; set; }
2393
2394 /// <summary>
2395 /// The URL to open.
2396 /// </summary>
2397 [JsonPropertyName("url")]
2398 public string? Url { get; set; }
2399
2400 /// <summary>
2401 /// 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.
2402 /// </summary>
2403 [JsonPropertyName("fallback")]
2404 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2405
2406 /// <summary>
2407 /// Serializes this OpenUrlDialogAction into a JSON string.
2408 /// </summary>
2409 public string Serialize()
2410 {
2411 return JsonSerializer.Serialize(
2412 this,
2413 new JsonSerializerOptions
2414 {
2415 WriteIndented = true,
2416 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2417 }
2418 );
2419 }
2420
2421 public OpenUrlDialogAction WithKey(string value)
2422 {
2423 this.Key = value;
2424 return this;
2425 }
2426
2427 public OpenUrlDialogAction WithId(string value)
2428 {
2429 this.Id = value;
2430 return this;
2431 }
2432
2433 public OpenUrlDialogAction WithRequires(HostCapabilities value)
2434 {
2435 this.Requires = value;
2436 return this;
2437 }
2438
2439 public OpenUrlDialogAction WithTitle(string value)
2440 {
2441 this.Title = value;
2442 return this;
2443 }
2444
2445 public OpenUrlDialogAction WithIconUrl(string value)
2446 {
2447 this.IconUrl = value;
2448 return this;
2449 }
2450
2451 public OpenUrlDialogAction WithStyle(ActionStyle value)
2452 {
2453 this.Style = value;
2454 return this;
2455 }
2456
2457 public OpenUrlDialogAction WithMode(ActionMode value)
2458 {
2459 this.Mode = value;
2460 return this;
2461 }
2462
2463 public OpenUrlDialogAction WithTooltip(string value)
2464 {
2465 this.Tooltip = value;
2466 return this;
2467 }
2468
2469 public OpenUrlDialogAction WithIsEnabled(bool value)
2470 {
2471 this.IsEnabled = value;
2472 return this;
2473 }
2474
2475 public OpenUrlDialogAction WithMenuActions(params Action[] value)
2476 {
2477 this.MenuActions = new List<Action>(value);
2478 return this;
2479 }
2480
2481 public OpenUrlDialogAction WithMenuActions(IList<Action> value)
2482 {
2483 this.MenuActions = value;
2484 return this;
2485 }
2486
2487 public OpenUrlDialogAction WithThemedIconUrls(params ThemedUrl[] value)
2488 {
2489 this.ThemedIconUrls = new List<ThemedUrl>(value);
2490 return this;
2491 }
2492
2493 public OpenUrlDialogAction WithThemedIconUrls(IList<ThemedUrl> value)
2494 {
2495 this.ThemedIconUrls = value;
2496 return this;
2497 }
2498
2499 public OpenUrlDialogAction WithDialogTitle(string value)
2500 {
2501 this.DialogTitle = value;
2502 return this;
2503 }
2504
2505 public OpenUrlDialogAction WithDialogHeight(string value)
2506 {
2507 this.DialogHeight = value;
2508 return this;
2509 }
2510
2511 public OpenUrlDialogAction WithDialogWidth(string value)
2512 {
2513 this.DialogWidth = value;
2514 return this;
2515 }
2516
2517 public OpenUrlDialogAction WithUrl(string value)
2518 {
2519 this.Url = value;
2520 return this;
2521 }
2522
2523 public OpenUrlDialogAction WithFallback(IUnion<Action, FallbackAction> value)
2524 {
2525 this.Fallback = value;
2526 return this;
2527 }
2528}
2529
2530/// <summary>
2531/// Resets the values of the inputs in the card.
2532/// </summary>
2533public class ResetInputsAction : Action
2534{
2535 /// <summary>
2536 /// Deserializes a JSON string into an object of type ResetInputsAction.
2537 /// </summary>
2538 public static ResetInputsAction? Deserialize(string json)
2539 {
2540 return JsonSerializer.Deserialize<ResetInputsAction>(json);
2541 }
2542
2543 /// <summary>
2544 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
2545 /// </summary>
2546 [JsonPropertyName("key")]
2547 public string? Key { get; set; }
2548
2549 /// <summary>
2550 /// Must be **Action.ResetInputs**.
2551 /// </summary>
2552 [JsonPropertyName("type")]
2553 public string Type { get; } = "Action.ResetInputs";
2554
2555 /// <summary>
2556 /// 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.
2557 /// </summary>
2558 [JsonPropertyName("id")]
2559 public string? Id { get; set; }
2560
2561 /// <summary>
2562 /// 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).
2563 /// </summary>
2564 [JsonPropertyName("requires")]
2565 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
2566
2567 /// <summary>
2568 /// The title of the action, as it appears on buttons.
2569 /// </summary>
2570 [JsonPropertyName("title")]
2571 public string? Title { get; set; }
2572
2573 /// <summary>
2574 /// 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.
2575 ///
2576 /// `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.
2577 /// </summary>
2578 [JsonPropertyName("iconUrl")]
2579 public string? IconUrl { get; set; }
2580
2581 /// <summary>
2582 /// Control the style of the action, affecting its visual and spoken representations.
2583 /// </summary>
2584 [JsonPropertyName("style")]
2585 public ActionStyle? Style { get; set; } = ActionStyle.Default;
2586
2587 /// <summary>
2588 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2589 /// </summary>
2590 [JsonPropertyName("mode")]
2591 public ActionMode? Mode { get; set; } = ActionMode.Primary;
2592
2593 /// <summary>
2594 /// The tooltip text to display when the action is hovered over.
2595 /// </summary>
2596 [JsonPropertyName("tooltip")]
2597 public string? Tooltip { get; set; }
2598
2599 /// <summary>
2600 /// 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.
2601 /// </summary>
2602 [JsonPropertyName("isEnabled")]
2603 public bool? IsEnabled { get; set; } = true;
2604
2605 /// <summary>
2606 /// The actions to display in the overflow menu of a Split action button.
2607 /// </summary>
2608 [JsonPropertyName("menuActions")]
2609 public IList<Action>? MenuActions { get; set; }
2610
2611 /// <summary>
2612 /// A set of theme-specific icon URLs.
2613 /// </summary>
2614 [JsonPropertyName("themedIconUrls")]
2615 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
2616
2617 /// <summary>
2618 /// The Ids of the inputs that should be reset.
2619 /// </summary>
2620 [JsonPropertyName("targetInputIds")]
2621 public IList<string>? TargetInputIds { get; set; }
2622
2623 /// <summary>
2624 /// 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.
2625 /// </summary>
2626 [JsonPropertyName("fallback")]
2627 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2628
2629 /// <summary>
2630 /// Serializes this ResetInputsAction into a JSON string.
2631 /// </summary>
2632 public string Serialize()
2633 {
2634 return JsonSerializer.Serialize(
2635 this,
2636 new JsonSerializerOptions
2637 {
2638 WriteIndented = true,
2639 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2640 }
2641 );
2642 }
2643
2644 public ResetInputsAction WithKey(string value)
2645 {
2646 this.Key = value;
2647 return this;
2648 }
2649
2650 public ResetInputsAction WithId(string value)
2651 {
2652 this.Id = value;
2653 return this;
2654 }
2655
2656 public ResetInputsAction WithRequires(HostCapabilities value)
2657 {
2658 this.Requires = value;
2659 return this;
2660 }
2661
2662 public ResetInputsAction WithTitle(string value)
2663 {
2664 this.Title = value;
2665 return this;
2666 }
2667
2668 public ResetInputsAction WithIconUrl(string value)
2669 {
2670 this.IconUrl = value;
2671 return this;
2672 }
2673
2674 public ResetInputsAction WithStyle(ActionStyle value)
2675 {
2676 this.Style = value;
2677 return this;
2678 }
2679
2680 public ResetInputsAction WithMode(ActionMode value)
2681 {
2682 this.Mode = value;
2683 return this;
2684 }
2685
2686 public ResetInputsAction WithTooltip(string value)
2687 {
2688 this.Tooltip = value;
2689 return this;
2690 }
2691
2692 public ResetInputsAction WithIsEnabled(bool value)
2693 {
2694 this.IsEnabled = value;
2695 return this;
2696 }
2697
2698 public ResetInputsAction WithMenuActions(params Action[] value)
2699 {
2700 this.MenuActions = new List<Action>(value);
2701 return this;
2702 }
2703
2704 public ResetInputsAction WithMenuActions(IList<Action> value)
2705 {
2706 this.MenuActions = value;
2707 return this;
2708 }
2709
2710 public ResetInputsAction WithThemedIconUrls(params ThemedUrl[] value)
2711 {
2712 this.ThemedIconUrls = new List<ThemedUrl>(value);
2713 return this;
2714 }
2715
2716 public ResetInputsAction WithThemedIconUrls(IList<ThemedUrl> value)
2717 {
2718 this.ThemedIconUrls = value;
2719 return this;
2720 }
2721
2722 public ResetInputsAction WithTargetInputIds(params string[] value)
2723 {
2724 this.TargetInputIds = new List<string>(value);
2725 return this;
2726 }
2727
2728 public ResetInputsAction WithTargetInputIds(IList<string> value)
2729 {
2730 this.TargetInputIds = value;
2731 return this;
2732 }
2733
2734 public ResetInputsAction WithFallback(IUnion<Action, FallbackAction> value)
2735 {
2736 this.Fallback = value;
2737 return this;
2738 }
2739}
2740
2741/// <summary>
2742/// 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.
2743/// </summary>
2744public class SubmitAction : Action
2745{
2746 /// <summary>
2747 /// Deserializes a JSON string into an object of type SubmitAction.
2748 /// </summary>
2749 public static SubmitAction? Deserialize(string json)
2750 {
2751 return JsonSerializer.Deserialize<SubmitAction>(json);
2752 }
2753
2754 /// <summary>
2755 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
2756 /// </summary>
2757 [JsonPropertyName("key")]
2758 public string? Key { get; set; }
2759
2760 /// <summary>
2761 /// Must be **Action.Submit**.
2762 /// </summary>
2763 [JsonPropertyName("type")]
2764 public string Type { get; } = "Action.Submit";
2765
2766 /// <summary>
2767 /// 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.
2768 /// </summary>
2769 [JsonPropertyName("id")]
2770 public string? Id { get; set; }
2771
2772 /// <summary>
2773 /// 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).
2774 /// </summary>
2775 [JsonPropertyName("requires")]
2776 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
2777
2778 /// <summary>
2779 /// The title of the action, as it appears on buttons.
2780 /// </summary>
2781 [JsonPropertyName("title")]
2782 public string? Title { get; set; }
2783
2784 /// <summary>
2785 /// 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.
2786 ///
2787 /// `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.
2788 /// </summary>
2789 [JsonPropertyName("iconUrl")]
2790 public string? IconUrl { get; set; }
2791
2792 /// <summary>
2793 /// Control the style of the action, affecting its visual and spoken representations.
2794 /// </summary>
2795 [JsonPropertyName("style")]
2796 public ActionStyle? Style { get; set; } = ActionStyle.Default;
2797
2798 /// <summary>
2799 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
2800 /// </summary>
2801 [JsonPropertyName("mode")]
2802 public ActionMode? Mode { get; set; } = ActionMode.Primary;
2803
2804 /// <summary>
2805 /// The tooltip text to display when the action is hovered over.
2806 /// </summary>
2807 [JsonPropertyName("tooltip")]
2808 public string? Tooltip { get; set; }
2809
2810 /// <summary>
2811 /// 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.
2812 /// </summary>
2813 [JsonPropertyName("isEnabled")]
2814 public bool? IsEnabled { get; set; } = true;
2815
2816 /// <summary>
2817 /// The actions to display in the overflow menu of a Split action button.
2818 /// </summary>
2819 [JsonPropertyName("menuActions")]
2820 public IList<Action>? MenuActions { get; set; }
2821
2822 /// <summary>
2823 /// A set of theme-specific icon URLs.
2824 /// </summary>
2825 [JsonPropertyName("themedIconUrls")]
2826 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
2827
2828 /// <summary>
2829 /// 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.
2830 /// </summary>
2831 [JsonPropertyName("data")]
2832 public IUnion<string, SubmitActionData>? Data { get; set; }
2833
2834 /// <summary>
2835 /// 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.
2836 /// </summary>
2837 [JsonPropertyName("associatedInputs")]
2838 public AssociatedInputs? AssociatedInputs { get; set; }
2839
2840 /// <summary>
2841 /// Controls if the action is enabled only if at least one required input has been filled by the user.
2842 /// </summary>
2843 [JsonPropertyName("conditionallyEnabled")]
2844 public bool? ConditionallyEnabled { get; set; } = false;
2845
2846 /// <summary>
2847 /// Teams-specific metadata associated with the action.
2848 /// </summary>
2849 [JsonPropertyName("msteams")]
2850 public TeamsSubmitActionProperties? Msteams { get; set; }
2851
2852 /// <summary>
2853 /// 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.
2854 /// </summary>
2855 [JsonPropertyName("fallback")]
2856 public IUnion<Action, FallbackAction>? Fallback { get; set; }
2857
2858 /// <summary>
2859 /// Serializes this SubmitAction into a JSON string.
2860 /// </summary>
2861 public string Serialize()
2862 {
2863 return JsonSerializer.Serialize(
2864 this,
2865 new JsonSerializerOptions
2866 {
2867 WriteIndented = true,
2868 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
2869 }
2870 );
2871 }
2872
2873 public SubmitAction WithKey(string value)
2874 {
2875 this.Key = value;
2876 return this;
2877 }
2878
2879 public SubmitAction WithId(string value)
2880 {
2881 this.Id = value;
2882 return this;
2883 }
2884
2885 public SubmitAction WithRequires(HostCapabilities value)
2886 {
2887 this.Requires = value;
2888 return this;
2889 }
2890
2891 public SubmitAction WithTitle(string value)
2892 {
2893 this.Title = value;
2894 return this;
2895 }
2896
2897 public SubmitAction WithIconUrl(string value)
2898 {
2899 this.IconUrl = value;
2900 return this;
2901 }
2902
2903 public SubmitAction WithStyle(ActionStyle value)
2904 {
2905 this.Style = value;
2906 return this;
2907 }
2908
2909 public SubmitAction WithMode(ActionMode value)
2910 {
2911 this.Mode = value;
2912 return this;
2913 }
2914
2915 public SubmitAction WithTooltip(string value)
2916 {
2917 this.Tooltip = value;
2918 return this;
2919 }
2920
2921 public SubmitAction WithIsEnabled(bool value)
2922 {
2923 this.IsEnabled = value;
2924 return this;
2925 }
2926
2927 public SubmitAction WithMenuActions(params Action[] value)
2928 {
2929 this.MenuActions = new List<Action>(value);
2930 return this;
2931 }
2932
2933 public SubmitAction WithMenuActions(IList<Action> value)
2934 {
2935 this.MenuActions = value;
2936 return this;
2937 }
2938
2939 public SubmitAction WithThemedIconUrls(params ThemedUrl[] value)
2940 {
2941 this.ThemedIconUrls = new List<ThemedUrl>(value);
2942 return this;
2943 }
2944
2945 public SubmitAction WithThemedIconUrls(IList<ThemedUrl> value)
2946 {
2947 this.ThemedIconUrls = value;
2948 return this;
2949 }
2950
2951 public SubmitAction WithData(IUnion<string, SubmitActionData> value)
2952 {
2953 this.Data = value;
2954 return this;
2955 }
2956
2957 public SubmitAction WithAssociatedInputs(AssociatedInputs value)
2958 {
2959 this.AssociatedInputs = value;
2960 return this;
2961 }
2962
2963 public SubmitAction WithConditionallyEnabled(bool value)
2964 {
2965 this.ConditionallyEnabled = value;
2966 return this;
2967 }
2968
2969 public SubmitAction WithMsteams(TeamsSubmitActionProperties value)
2970 {
2971 this.Msteams = value;
2972 return this;
2973 }
2974
2975 public SubmitAction WithFallback(IUnion<Action, FallbackAction> value)
2976 {
2977 this.Fallback = value;
2978 return this;
2979 }
2980}
2981
2982/// <summary>
2983/// Toggles the visibility of a set of elements. Action.ToggleVisibility is useful for creating "Show more" type UI patterns.
2984/// </summary>
2985public class ToggleVisibilityAction : Action
2986{
2987 /// <summary>
2988 /// Deserializes a JSON string into an object of type ToggleVisibilityAction.
2989 /// </summary>
2990 public static ToggleVisibilityAction? Deserialize(string json)
2991 {
2992 return JsonSerializer.Deserialize<ToggleVisibilityAction>(json);
2993 }
2994
2995 /// <summary>
2996 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
2997 /// </summary>
2998 [JsonPropertyName("key")]
2999 public string? Key { get; set; }
3000
3001 /// <summary>
3002 /// Must be **Action.ToggleVisibility**.
3003 /// </summary>
3004 [JsonPropertyName("type")]
3005 public string Type { get; } = "Action.ToggleVisibility";
3006
3007 /// <summary>
3008 /// 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.
3009 /// </summary>
3010 [JsonPropertyName("id")]
3011 public string? Id { get; set; }
3012
3013 /// <summary>
3014 /// 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).
3015 /// </summary>
3016 [JsonPropertyName("requires")]
3017 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
3018
3019 /// <summary>
3020 /// The title of the action, as it appears on buttons.
3021 /// </summary>
3022 [JsonPropertyName("title")]
3023 public string? Title { get; set; }
3024
3025 /// <summary>
3026 /// 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.
3027 ///
3028 /// `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.
3029 /// </summary>
3030 [JsonPropertyName("iconUrl")]
3031 public string? IconUrl { get; set; }
3032
3033 /// <summary>
3034 /// Control the style of the action, affecting its visual and spoken representations.
3035 /// </summary>
3036 [JsonPropertyName("style")]
3037 public ActionStyle? Style { get; set; } = ActionStyle.Default;
3038
3039 /// <summary>
3040 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
3041 /// </summary>
3042 [JsonPropertyName("mode")]
3043 public ActionMode? Mode { get; set; } = ActionMode.Primary;
3044
3045 /// <summary>
3046 /// The tooltip text to display when the action is hovered over.
3047 /// </summary>
3048 [JsonPropertyName("tooltip")]
3049 public string? Tooltip { get; set; }
3050
3051 /// <summary>
3052 /// 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.
3053 /// </summary>
3054 [JsonPropertyName("isEnabled")]
3055 public bool? IsEnabled { get; set; } = true;
3056
3057 /// <summary>
3058 /// The actions to display in the overflow menu of a Split action button.
3059 /// </summary>
3060 [JsonPropertyName("menuActions")]
3061 public IList<Action>? MenuActions { get; set; }
3062
3063 /// <summary>
3064 /// A set of theme-specific icon URLs.
3065 /// </summary>
3066 [JsonPropertyName("themedIconUrls")]
3067 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
3068
3069 /// <summary>
3070 /// The Ids of the elements to toggle the visibility of.
3071 /// </summary>
3072 [JsonPropertyName("targetElements")]
3073 public IUnion<IList<string>, IList<TargetElement>>? TargetElements { get; set; }
3074
3075 /// <summary>
3076 /// 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.
3077 /// </summary>
3078 [JsonPropertyName("fallback")]
3079 public IUnion<Action, FallbackAction>? Fallback { get; set; }
3080
3081 /// <summary>
3082 /// Serializes this ToggleVisibilityAction into a JSON string.
3083 /// </summary>
3084 public string Serialize()
3085 {
3086 return JsonSerializer.Serialize(
3087 this,
3088 new JsonSerializerOptions
3089 {
3090 WriteIndented = true,
3091 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3092 }
3093 );
3094 }
3095
3096 public ToggleVisibilityAction WithKey(string value)
3097 {
3098 this.Key = value;
3099 return this;
3100 }
3101
3102 public ToggleVisibilityAction WithId(string value)
3103 {
3104 this.Id = value;
3105 return this;
3106 }
3107
3108 public ToggleVisibilityAction WithRequires(HostCapabilities value)
3109 {
3110 this.Requires = value;
3111 return this;
3112 }
3113
3114 public ToggleVisibilityAction WithTitle(string value)
3115 {
3116 this.Title = value;
3117 return this;
3118 }
3119
3120 public ToggleVisibilityAction WithIconUrl(string value)
3121 {
3122 this.IconUrl = value;
3123 return this;
3124 }
3125
3126 public ToggleVisibilityAction WithStyle(ActionStyle value)
3127 {
3128 this.Style = value;
3129 return this;
3130 }
3131
3132 public ToggleVisibilityAction WithMode(ActionMode value)
3133 {
3134 this.Mode = value;
3135 return this;
3136 }
3137
3138 public ToggleVisibilityAction WithTooltip(string value)
3139 {
3140 this.Tooltip = value;
3141 return this;
3142 }
3143
3144 public ToggleVisibilityAction WithIsEnabled(bool value)
3145 {
3146 this.IsEnabled = value;
3147 return this;
3148 }
3149
3150 public ToggleVisibilityAction WithMenuActions(params Action[] value)
3151 {
3152 this.MenuActions = new List<Action>(value);
3153 return this;
3154 }
3155
3156 public ToggleVisibilityAction WithMenuActions(IList<Action> value)
3157 {
3158 this.MenuActions = value;
3159 return this;
3160 }
3161
3162 public ToggleVisibilityAction WithThemedIconUrls(params ThemedUrl[] value)
3163 {
3164 this.ThemedIconUrls = new List<ThemedUrl>(value);
3165 return this;
3166 }
3167
3168 public ToggleVisibilityAction WithThemedIconUrls(IList<ThemedUrl> value)
3169 {
3170 this.ThemedIconUrls = value;
3171 return this;
3172 }
3173
3174 public ToggleVisibilityAction WithTargetElements(IUnion<IList<string>, IList<TargetElement>> value)
3175 {
3176 this.TargetElements = value;
3177 return this;
3178 }
3179
3180 public ToggleVisibilityAction WithFallback(IUnion<Action, FallbackAction> value)
3181 {
3182 this.Fallback = value;
3183 return this;
3184 }
3185}
3186
3187/// <summary>
3188/// Defines a theme-specific URL.
3189/// </summary>
3190public class ThemedUrl : SerializableObject
3191{
3192 /// <summary>
3193 /// Deserializes a JSON string into an object of type ThemedUrl.
3194 /// </summary>
3195 public static ThemedUrl? Deserialize(string json)
3196 {
3197 return JsonSerializer.Deserialize<ThemedUrl>(json);
3198 }
3199
3200 /// <summary>
3201 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
3202 /// </summary>
3203 [JsonPropertyName("key")]
3204 public string? Key { get; set; }
3205
3206 /// <summary>
3207 /// The theme this URL applies to.
3208 /// </summary>
3209 [JsonPropertyName("theme")]
3210 public ThemeName? Theme { get; set; } = ThemeName.Light;
3211
3212 /// <summary>
3213 /// The URL to use for the associated theme.
3214 /// </summary>
3215 [JsonPropertyName("url")]
3216 public string? Url { get; set; }
3217
3218 /// <summary>
3219 /// Serializes this ThemedUrl into a JSON string.
3220 /// </summary>
3221 public string Serialize()
3222 {
3223 return JsonSerializer.Serialize(
3224 this,
3225 new JsonSerializerOptions
3226 {
3227 WriteIndented = true,
3228 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3229 }
3230 );
3231 }
3232
3233 public ThemedUrl WithKey(string value)
3234 {
3235 this.Key = value;
3236 return this;
3237 }
3238
3239 public ThemedUrl WithTheme(ThemeName value)
3240 {
3241 this.Theme = value;
3242 return this;
3243 }
3244
3245 public ThemedUrl WithUrl(string value)
3246 {
3247 this.Url = value;
3248 return this;
3249 }
3250}
3251
3252/// <summary>
3253/// Defines a target element in an Action.ToggleVisibility.
3254/// </summary>
3255public class TargetElement : SerializableObject
3256{
3257 /// <summary>
3258 /// Deserializes a JSON string into an object of type TargetElement.
3259 /// </summary>
3260 public static TargetElement? Deserialize(string json)
3261 {
3262 return JsonSerializer.Deserialize<TargetElement>(json);
3263 }
3264
3265 /// <summary>
3266 /// The Id of the element to change the visibility of.
3267 /// </summary>
3268 [JsonPropertyName("elementId")]
3269 public string? ElementId { get; set; }
3270
3271 /// <summary>
3272 /// The new visibility state of the element.
3273 /// </summary>
3274 [JsonPropertyName("isVisible")]
3275 public bool? IsVisible { get; set; }
3276
3277 /// <summary>
3278 /// Serializes this TargetElement into a JSON string.
3279 /// </summary>
3280 public string Serialize()
3281 {
3282 return JsonSerializer.Serialize(
3283 this,
3284 new JsonSerializerOptions
3285 {
3286 WriteIndented = true,
3287 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3288 }
3289 );
3290 }
3291
3292 public TargetElement WithElementId(string value)
3293 {
3294 this.ElementId = value;
3295 return this;
3296 }
3297
3298 public TargetElement WithIsVisible(bool value)
3299 {
3300 this.IsVisible = value;
3301 return this;
3302 }
3303}
3304
3305/// <summary>
3306/// Expands or collapses an embedded card within the main card.
3307/// </summary>
3308public class ShowCardAction : Action
3309{
3310 /// <summary>
3311 /// Deserializes a JSON string into an object of type ShowCardAction.
3312 /// </summary>
3313 public static ShowCardAction? Deserialize(string json)
3314 {
3315 return JsonSerializer.Deserialize<ShowCardAction>(json);
3316 }
3317
3318 /// <summary>
3319 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
3320 /// </summary>
3321 [JsonPropertyName("key")]
3322 public string? Key { get; set; }
3323
3324 /// <summary>
3325 /// Must be **Action.ShowCard**.
3326 /// </summary>
3327 [JsonPropertyName("type")]
3328 public string Type { get; } = "Action.ShowCard";
3329
3330 /// <summary>
3331 /// 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.
3332 /// </summary>
3333 [JsonPropertyName("id")]
3334 public string? Id { get; set; }
3335
3336 /// <summary>
3337 /// 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).
3338 /// </summary>
3339 [JsonPropertyName("requires")]
3340 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
3341
3342 /// <summary>
3343 /// The title of the action, as it appears on buttons.
3344 /// </summary>
3345 [JsonPropertyName("title")]
3346 public string? Title { get; set; }
3347
3348 /// <summary>
3349 /// 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.
3350 ///
3351 /// `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.
3352 /// </summary>
3353 [JsonPropertyName("iconUrl")]
3354 public string? IconUrl { get; set; }
3355
3356 /// <summary>
3357 /// Control the style of the action, affecting its visual and spoken representations.
3358 /// </summary>
3359 [JsonPropertyName("style")]
3360 public ActionStyle? Style { get; set; } = ActionStyle.Default;
3361
3362 /// <summary>
3363 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
3364 /// </summary>
3365 [JsonPropertyName("mode")]
3366 public ActionMode? Mode { get; set; } = ActionMode.Primary;
3367
3368 /// <summary>
3369 /// The tooltip text to display when the action is hovered over.
3370 /// </summary>
3371 [JsonPropertyName("tooltip")]
3372 public string? Tooltip { get; set; }
3373
3374 /// <summary>
3375 /// 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.
3376 /// </summary>
3377 [JsonPropertyName("isEnabled")]
3378 public bool? IsEnabled { get; set; } = true;
3379
3380 /// <summary>
3381 /// The actions to display in the overflow menu of a Split action button.
3382 /// </summary>
3383 [JsonPropertyName("menuActions")]
3384 public IList<Action>? MenuActions { get; set; }
3385
3386 /// <summary>
3387 /// A set of theme-specific icon URLs.
3388 /// </summary>
3389 [JsonPropertyName("themedIconUrls")]
3390 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
3391
3392 /// <summary>
3393 /// 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.
3394 /// </summary>
3395 [JsonPropertyName("fallback")]
3396 public IUnion<Action, FallbackAction>? Fallback { get; set; }
3397
3398 /// <summary>
3399 /// The card that should be displayed when the action is executed.
3400 /// </summary>
3401 [JsonPropertyName("card")]
3402 public AdaptiveCard? Card { get; set; }
3403
3404 /// <summary>
3405 /// Serializes this ShowCardAction into a JSON string.
3406 /// </summary>
3407 public string Serialize()
3408 {
3409 return JsonSerializer.Serialize(
3410 this,
3411 new JsonSerializerOptions
3412 {
3413 WriteIndented = true,
3414 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3415 }
3416 );
3417 }
3418
3419 public ShowCardAction WithKey(string value)
3420 {
3421 this.Key = value;
3422 return this;
3423 }
3424
3425 public ShowCardAction WithId(string value)
3426 {
3427 this.Id = value;
3428 return this;
3429 }
3430
3431 public ShowCardAction WithRequires(HostCapabilities value)
3432 {
3433 this.Requires = value;
3434 return this;
3435 }
3436
3437 public ShowCardAction WithTitle(string value)
3438 {
3439 this.Title = value;
3440 return this;
3441 }
3442
3443 public ShowCardAction WithIconUrl(string value)
3444 {
3445 this.IconUrl = value;
3446 return this;
3447 }
3448
3449 public ShowCardAction WithStyle(ActionStyle value)
3450 {
3451 this.Style = value;
3452 return this;
3453 }
3454
3455 public ShowCardAction WithMode(ActionMode value)
3456 {
3457 this.Mode = value;
3458 return this;
3459 }
3460
3461 public ShowCardAction WithTooltip(string value)
3462 {
3463 this.Tooltip = value;
3464 return this;
3465 }
3466
3467 public ShowCardAction WithIsEnabled(bool value)
3468 {
3469 this.IsEnabled = value;
3470 return this;
3471 }
3472
3473 public ShowCardAction WithMenuActions(params Action[] value)
3474 {
3475 this.MenuActions = new List<Action>(value);
3476 return this;
3477 }
3478
3479 public ShowCardAction WithMenuActions(IList<Action> value)
3480 {
3481 this.MenuActions = value;
3482 return this;
3483 }
3484
3485 public ShowCardAction WithThemedIconUrls(params ThemedUrl[] value)
3486 {
3487 this.ThemedIconUrls = new List<ThemedUrl>(value);
3488 return this;
3489 }
3490
3491 public ShowCardAction WithThemedIconUrls(IList<ThemedUrl> value)
3492 {
3493 this.ThemedIconUrls = value;
3494 return this;
3495 }
3496
3497 public ShowCardAction WithFallback(IUnion<Action, FallbackAction> value)
3498 {
3499 this.Fallback = value;
3500 return this;
3501 }
3502
3503 public ShowCardAction WithCard(AdaptiveCard value)
3504 {
3505 this.Card = value;
3506 return this;
3507 }
3508}
3509
3510/// <summary>
3511/// Shows a popover to display more information to the user.
3512/// </summary>
3513public class PopoverAction : Action
3514{
3515 /// <summary>
3516 /// Deserializes a JSON string into an object of type PopoverAction.
3517 /// </summary>
3518 public static PopoverAction? Deserialize(string json)
3519 {
3520 return JsonSerializer.Deserialize<PopoverAction>(json);
3521 }
3522
3523 /// <summary>
3524 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
3525 /// </summary>
3526 [JsonPropertyName("key")]
3527 public string? Key { get; set; }
3528
3529 /// <summary>
3530 /// Must be **Action.Popover**.
3531 /// </summary>
3532 [JsonPropertyName("type")]
3533 public string Type { get; } = "Action.Popover";
3534
3535 /// <summary>
3536 /// 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.
3537 /// </summary>
3538 [JsonPropertyName("id")]
3539 public string? Id { get; set; }
3540
3541 /// <summary>
3542 /// 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).
3543 /// </summary>
3544 [JsonPropertyName("requires")]
3545 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
3546
3547 /// <summary>
3548 /// The title of the action, as it appears on buttons.
3549 /// </summary>
3550 [JsonPropertyName("title")]
3551 public string? Title { get; set; }
3552
3553 /// <summary>
3554 /// 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.
3555 ///
3556 /// `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.
3557 /// </summary>
3558 [JsonPropertyName("iconUrl")]
3559 public string? IconUrl { get; set; }
3560
3561 /// <summary>
3562 /// Control the style of the action, affecting its visual and spoken representations.
3563 /// </summary>
3564 [JsonPropertyName("style")]
3565 public ActionStyle? Style { get; set; } = ActionStyle.Default;
3566
3567 /// <summary>
3568 /// Controls if the action is primary or secondary. Secondary actions appear in an overflow menu.
3569 /// </summary>
3570 [JsonPropertyName("mode")]
3571 public ActionMode? Mode { get; set; } = ActionMode.Primary;
3572
3573 /// <summary>
3574 /// The tooltip text to display when the action is hovered over.
3575 /// </summary>
3576 [JsonPropertyName("tooltip")]
3577 public string? Tooltip { get; set; }
3578
3579 /// <summary>
3580 /// 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.
3581 /// </summary>
3582 [JsonPropertyName("isEnabled")]
3583 public bool? IsEnabled { get; set; } = true;
3584
3585 /// <summary>
3586 /// A set of theme-specific icon URLs.
3587 /// </summary>
3588 [JsonPropertyName("themedIconUrls")]
3589 public IList<ThemedUrl>? ThemedIconUrls { get; set; }
3590
3591 /// <summary>
3592 /// The content of the popover, which can be any element.
3593 /// </summary>
3594 [JsonPropertyName("content")]
3595 public CardElement? Content { get; set; }
3596
3597 /// <summary>
3598 /// Controls if an arrow should be displayed towards the element that triggered the popover.
3599 /// </summary>
3600 [JsonPropertyName("displayArrow")]
3601 public bool? DisplayArrow { get; set; } = true;
3602
3603 /// <summary>
3604 /// Controls where the popover should be displayed with regards to the element that triggered it.
3605 /// </summary>
3606 [JsonPropertyName("position")]
3607 public PopoverPosition? Position { get; set; } = PopoverPosition.Above;
3608
3609 /// <summary>
3610 /// The maximum width of the popover in pixels, in the `<number>px` format
3611 /// </summary>
3612 [JsonPropertyName("maxPopoverWidth")]
3613 public string? MaxPopoverWidth { get; set; }
3614
3615 /// <summary>
3616 /// 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.
3617 /// </summary>
3618 [JsonPropertyName("fallback")]
3619 public IUnion<Action, FallbackAction>? Fallback { get; set; }
3620
3621 /// <summary>
3622 /// Serializes this PopoverAction into a JSON string.
3623 /// </summary>
3624 public string Serialize()
3625 {
3626 return JsonSerializer.Serialize(
3627 this,
3628 new JsonSerializerOptions
3629 {
3630 WriteIndented = true,
3631 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3632 }
3633 );
3634 }
3635
3636 public PopoverAction WithKey(string value)
3637 {
3638 this.Key = value;
3639 return this;
3640 }
3641
3642 public PopoverAction WithId(string value)
3643 {
3644 this.Id = value;
3645 return this;
3646 }
3647
3648 public PopoverAction WithRequires(HostCapabilities value)
3649 {
3650 this.Requires = value;
3651 return this;
3652 }
3653
3654 public PopoverAction WithTitle(string value)
3655 {
3656 this.Title = value;
3657 return this;
3658 }
3659
3660 public PopoverAction WithIconUrl(string value)
3661 {
3662 this.IconUrl = value;
3663 return this;
3664 }
3665
3666 public PopoverAction WithStyle(ActionStyle value)
3667 {
3668 this.Style = value;
3669 return this;
3670 }
3671
3672 public PopoverAction WithMode(ActionMode value)
3673 {
3674 this.Mode = value;
3675 return this;
3676 }
3677
3678 public PopoverAction WithTooltip(string value)
3679 {
3680 this.Tooltip = value;
3681 return this;
3682 }
3683
3684 public PopoverAction WithIsEnabled(bool value)
3685 {
3686 this.IsEnabled = value;
3687 return this;
3688 }
3689
3690 public PopoverAction WithThemedIconUrls(params ThemedUrl[] value)
3691 {
3692 this.ThemedIconUrls = new List<ThemedUrl>(value);
3693 return this;
3694 }
3695
3696 public PopoverAction WithThemedIconUrls(IList<ThemedUrl> value)
3697 {
3698 this.ThemedIconUrls = value;
3699 return this;
3700 }
3701
3702 public PopoverAction WithContent(CardElement value)
3703 {
3704 this.Content = value;
3705 return this;
3706 }
3707
3708 public PopoverAction WithDisplayArrow(bool value)
3709 {
3710 this.DisplayArrow = value;
3711 return this;
3712 }
3713
3714 public PopoverAction WithPosition(PopoverPosition value)
3715 {
3716 this.Position = value;
3717 return this;
3718 }
3719
3720 public PopoverAction WithMaxPopoverWidth(string value)
3721 {
3722 this.MaxPopoverWidth = value;
3723 return this;
3724 }
3725
3726 public PopoverAction WithFallback(IUnion<Action, FallbackAction> value)
3727 {
3728 this.Fallback = value;
3729 return this;
3730 }
3731}
3732
3733/// <summary>
3734/// Displays a set of action, which can be placed anywhere in the card.
3735/// </summary>
3736public class ActionSet : CardElement
3737{
3738 /// <summary>
3739 /// Deserializes a JSON string into an object of type ActionSet.
3740 /// </summary>
3741 public static ActionSet? Deserialize(string json)
3742 {
3743 return JsonSerializer.Deserialize<ActionSet>(json);
3744 }
3745
3746 /// <summary>
3747 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
3748 /// </summary>
3749 [JsonPropertyName("key")]
3750 public string? Key { get; set; }
3751
3752 /// <summary>
3753 /// Must be **ActionSet**.
3754 /// </summary>
3755 [JsonPropertyName("type")]
3756 public string Type { get; } = "ActionSet";
3757
3758 /// <summary>
3759 /// 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.
3760 /// </summary>
3761 [JsonPropertyName("id")]
3762 public string? Id { get; set; }
3763
3764 /// <summary>
3765 /// 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).
3766 /// </summary>
3767 [JsonPropertyName("requires")]
3768 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
3769
3770 /// <summary>
3771 /// The locale associated with the element.
3772 /// </summary>
3773 [JsonPropertyName("lang")]
3774 public string? Lang { get; set; }
3775
3776 /// <summary>
3777 /// Controls the visibility of the element.
3778 /// </summary>
3779 [JsonPropertyName("isVisible")]
3780 public bool? IsVisible { get; set; } = true;
3781
3782 /// <summary>
3783 /// 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.
3784 /// </summary>
3785 [JsonPropertyName("separator")]
3786 public bool? Separator { get; set; } = false;
3787
3788 /// <summary>
3789 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
3790 /// </summary>
3791 [JsonPropertyName("height")]
3792 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
3793
3794 /// <summary>
3795 /// Controls how the element should be horizontally aligned.
3796 /// </summary>
3797 [JsonPropertyName("horizontalAlignment")]
3798 public HorizontalAlignment? HorizontalAlignment { get; set; }
3799
3800 /// <summary>
3801 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
3802 /// </summary>
3803 [JsonPropertyName("spacing")]
3804 public Spacing? Spacing { get; set; } = Spacing.Default;
3805
3806 /// <summary>
3807 /// 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).
3808 /// </summary>
3809 [JsonPropertyName("targetWidth")]
3810 public TargetWidth? TargetWidth { get; set; }
3811
3812 /// <summary>
3813 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
3814 /// </summary>
3815 [JsonPropertyName("isSortKey")]
3816 public bool? IsSortKey { get; set; } = false;
3817
3818 /// <summary>
3819 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
3820 /// </summary>
3821 [JsonPropertyName("grid.area")]
3822 public string? GridArea { get; set; }
3823
3824 /// <summary>
3825 /// 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.
3826 /// </summary>
3827 [JsonPropertyName("fallback")]
3828 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
3829
3830 /// <summary>
3831 /// The actions in the set.
3832 /// </summary>
3833 [JsonPropertyName("actions")]
3834 public IList<Action>? Actions { get; set; }
3835
3836 public ActionSet() { }
3837
3838 public ActionSet(params Action[] actions)
3839 {
3840 this.Actions = new List<Action>(actions);
3841 }
3842
3843 public ActionSet(IList<Action> actions)
3844 {
3845 this.Actions = actions;
3846 }
3847
3848 /// <summary>
3849 /// Serializes this ActionSet into a JSON string.
3850 /// </summary>
3851 public string Serialize()
3852 {
3853 return JsonSerializer.Serialize(
3854 this,
3855 new JsonSerializerOptions
3856 {
3857 WriteIndented = true,
3858 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
3859 }
3860 );
3861 }
3862
3863 public ActionSet WithKey(string value)
3864 {
3865 this.Key = value;
3866 return this;
3867 }
3868
3869 public ActionSet WithId(string value)
3870 {
3871 this.Id = value;
3872 return this;
3873 }
3874
3875 public ActionSet WithRequires(HostCapabilities value)
3876 {
3877 this.Requires = value;
3878 return this;
3879 }
3880
3881 public ActionSet WithLang(string value)
3882 {
3883 this.Lang = value;
3884 return this;
3885 }
3886
3887 public ActionSet WithIsVisible(bool value)
3888 {
3889 this.IsVisible = value;
3890 return this;
3891 }
3892
3893 public ActionSet WithSeparator(bool value)
3894 {
3895 this.Separator = value;
3896 return this;
3897 }
3898
3899 public ActionSet WithHeight(ElementHeight value)
3900 {
3901 this.Height = value;
3902 return this;
3903 }
3904
3905 public ActionSet WithHorizontalAlignment(HorizontalAlignment value)
3906 {
3907 this.HorizontalAlignment = value;
3908 return this;
3909 }
3910
3911 public ActionSet WithSpacing(Spacing value)
3912 {
3913 this.Spacing = value;
3914 return this;
3915 }
3916
3917 public ActionSet WithTargetWidth(TargetWidth value)
3918 {
3919 this.TargetWidth = value;
3920 return this;
3921 }
3922
3923 public ActionSet WithIsSortKey(bool value)
3924 {
3925 this.IsSortKey = value;
3926 return this;
3927 }
3928
3929 public ActionSet WithGridArea(string value)
3930 {
3931 this.GridArea = value;
3932 return this;
3933 }
3934
3935 public ActionSet WithFallback(IUnion<CardElement, FallbackElement> value)
3936 {
3937 this.Fallback = value;
3938 return this;
3939 }
3940
3941 public ActionSet WithActions(params Action[] value)
3942 {
3943 this.Actions = new List<Action>(value);
3944 return this;
3945 }
3946
3947 public ActionSet WithActions(IList<Action> value)
3948 {
3949 this.Actions = value;
3950 return this;
3951 }
3952}
3953
3954/// <summary>
3955/// 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.
3956/// </summary>
3957public class Container : CardElement
3958{
3959 /// <summary>
3960 /// Deserializes a JSON string into an object of type Container.
3961 /// </summary>
3962 public static Container? Deserialize(string json)
3963 {
3964 return JsonSerializer.Deserialize<Container>(json);
3965 }
3966
3967 /// <summary>
3968 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
3969 /// </summary>
3970 [JsonPropertyName("key")]
3971 public string? Key { get; set; }
3972
3973 /// <summary>
3974 /// Must be **Container**.
3975 /// </summary>
3976 [JsonPropertyName("type")]
3977 public string Type { get; } = "Container";
3978
3979 /// <summary>
3980 /// 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.
3981 /// </summary>
3982 [JsonPropertyName("id")]
3983 public string? Id { get; set; }
3984
3985 /// <summary>
3986 /// 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).
3987 /// </summary>
3988 [JsonPropertyName("requires")]
3989 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
3990
3991 /// <summary>
3992 /// The locale associated with the element.
3993 /// </summary>
3994 [JsonPropertyName("lang")]
3995 public string? Lang { get; set; }
3996
3997 /// <summary>
3998 /// Controls the visibility of the element.
3999 /// </summary>
4000 [JsonPropertyName("isVisible")]
4001 public bool? IsVisible { get; set; } = true;
4002
4003 /// <summary>
4004 /// 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.
4005 /// </summary>
4006 [JsonPropertyName("separator")]
4007 public bool? Separator { get; set; } = false;
4008
4009 /// <summary>
4010 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
4011 /// </summary>
4012 [JsonPropertyName("height")]
4013 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
4014
4015 /// <summary>
4016 /// Controls how the element should be horizontally aligned.
4017 /// </summary>
4018 [JsonPropertyName("horizontalAlignment")]
4019 public HorizontalAlignment? HorizontalAlignment { get; set; }
4020
4021 /// <summary>
4022 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
4023 /// </summary>
4024 [JsonPropertyName("spacing")]
4025 public Spacing? Spacing { get; set; } = Spacing.Default;
4026
4027 /// <summary>
4028 /// 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).
4029 /// </summary>
4030 [JsonPropertyName("targetWidth")]
4031 public TargetWidth? TargetWidth { get; set; }
4032
4033 /// <summary>
4034 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
4035 /// </summary>
4036 [JsonPropertyName("isSortKey")]
4037 public bool? IsSortKey { get; set; } = false;
4038
4039 /// <summary>
4040 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
4041 /// </summary>
4042 [JsonPropertyName("selectAction")]
4043 public Action? SelectAction { get; set; }
4044
4045 /// <summary>
4046 /// 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.
4047 /// </summary>
4048 [JsonPropertyName("style")]
4049 public ContainerStyle? Style { get; set; }
4050
4051 /// <summary>
4052 /// Controls if a border should be displayed around the container.
4053 /// </summary>
4054 [JsonPropertyName("showBorder")]
4055 public bool? ShowBorder { get; set; } = false;
4056
4057 /// <summary>
4058 /// Controls if the container should have rounded corners.
4059 /// </summary>
4060 [JsonPropertyName("roundedCorners")]
4061 public bool? RoundedCorners { get; set; } = false;
4062
4063 /// <summary>
4064 /// 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.
4065 /// </summary>
4066 [JsonPropertyName("layouts")]
4067 public IList<ContainerLayout>? Layouts { get; set; }
4068
4069 /// <summary>
4070 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
4071 /// </summary>
4072 [JsonPropertyName("bleed")]
4073 public bool? Bleed { get; set; } = false;
4074
4075 /// <summary>
4076 /// The minimum height, in pixels, of the container, in the `<number>px` format.
4077 /// </summary>
4078 [JsonPropertyName("minHeight")]
4079 public string? MinHeight { get; set; }
4080
4081 /// <summary>
4082 /// Defines the container's background image.
4083 /// </summary>
4084 [JsonPropertyName("backgroundImage")]
4085 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
4086
4087 /// <summary>
4088 /// Controls how the container's content should be vertically aligned.
4089 /// </summary>
4090 [JsonPropertyName("verticalContentAlignment")]
4091 public VerticalAlignment? VerticalContentAlignment { get; set; }
4092
4093 /// <summary>
4094 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
4095 /// </summary>
4096 [JsonPropertyName("rtl")]
4097 public bool? Rtl { get; set; }
4098
4099 /// <summary>
4100 /// 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.
4101 /// </summary>
4102 [JsonPropertyName("maxHeight")]
4103 public string? MaxHeight { get; set; }
4104
4105 /// <summary>
4106 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4107 /// </summary>
4108 [JsonPropertyName("grid.area")]
4109 public string? GridArea { get; set; }
4110
4111 /// <summary>
4112 /// 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.
4113 /// </summary>
4114 [JsonPropertyName("fallback")]
4115 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4116
4117 /// <summary>
4118 /// The elements in the container.
4119 /// </summary>
4120 [JsonPropertyName("items")]
4121 public IList<CardElement>? Items { get; set; }
4122
4123 public Container() { }
4124
4125 public Container(params CardElement[] items)
4126 {
4127 this.Items = new List<CardElement>(items);
4128 }
4129
4130 public Container(IList<CardElement> items)
4131 {
4132 this.Items = items;
4133 }
4134
4135 /// <summary>
4136 /// Serializes this Container into a JSON string.
4137 /// </summary>
4138 public string Serialize()
4139 {
4140 return JsonSerializer.Serialize(
4141 this,
4142 new JsonSerializerOptions
4143 {
4144 WriteIndented = true,
4145 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4146 }
4147 );
4148 }
4149
4150 public Container WithKey(string value)
4151 {
4152 this.Key = value;
4153 return this;
4154 }
4155
4156 public Container WithId(string value)
4157 {
4158 this.Id = value;
4159 return this;
4160 }
4161
4162 public Container WithRequires(HostCapabilities value)
4163 {
4164 this.Requires = value;
4165 return this;
4166 }
4167
4168 public Container WithLang(string value)
4169 {
4170 this.Lang = value;
4171 return this;
4172 }
4173
4174 public Container WithIsVisible(bool value)
4175 {
4176 this.IsVisible = value;
4177 return this;
4178 }
4179
4180 public Container WithSeparator(bool value)
4181 {
4182 this.Separator = value;
4183 return this;
4184 }
4185
4186 public Container WithHeight(ElementHeight value)
4187 {
4188 this.Height = value;
4189 return this;
4190 }
4191
4192 public Container WithHorizontalAlignment(HorizontalAlignment value)
4193 {
4194 this.HorizontalAlignment = value;
4195 return this;
4196 }
4197
4198 public Container WithSpacing(Spacing value)
4199 {
4200 this.Spacing = value;
4201 return this;
4202 }
4203
4204 public Container WithTargetWidth(TargetWidth value)
4205 {
4206 this.TargetWidth = value;
4207 return this;
4208 }
4209
4210 public Container WithIsSortKey(bool value)
4211 {
4212 this.IsSortKey = value;
4213 return this;
4214 }
4215
4216 public Container WithSelectAction(Action value)
4217 {
4218 this.SelectAction = value;
4219 return this;
4220 }
4221
4222 public Container WithStyle(ContainerStyle value)
4223 {
4224 this.Style = value;
4225 return this;
4226 }
4227
4228 public Container WithShowBorder(bool value)
4229 {
4230 this.ShowBorder = value;
4231 return this;
4232 }
4233
4234 public Container WithRoundedCorners(bool value)
4235 {
4236 this.RoundedCorners = value;
4237 return this;
4238 }
4239
4240 public Container WithLayouts(params ContainerLayout[] value)
4241 {
4242 this.Layouts = new List<ContainerLayout>(value);
4243 return this;
4244 }
4245
4246 public Container WithLayouts(IList<ContainerLayout> value)
4247 {
4248 this.Layouts = value;
4249 return this;
4250 }
4251
4252 public Container WithBleed(bool value)
4253 {
4254 this.Bleed = value;
4255 return this;
4256 }
4257
4258 public Container WithMinHeight(string value)
4259 {
4260 this.MinHeight = value;
4261 return this;
4262 }
4263
4264 public Container WithBackgroundImage(IUnion<string, BackgroundImage> value)
4265 {
4266 this.BackgroundImage = value;
4267 return this;
4268 }
4269
4270 public Container WithVerticalContentAlignment(VerticalAlignment value)
4271 {
4272 this.VerticalContentAlignment = value;
4273 return this;
4274 }
4275
4276 public Container WithRtl(bool value)
4277 {
4278 this.Rtl = value;
4279 return this;
4280 }
4281
4282 public Container WithMaxHeight(string value)
4283 {
4284 this.MaxHeight = value;
4285 return this;
4286 }
4287
4288 public Container WithGridArea(string value)
4289 {
4290 this.GridArea = value;
4291 return this;
4292 }
4293
4294 public Container WithFallback(IUnion<CardElement, FallbackElement> value)
4295 {
4296 this.Fallback = value;
4297 return this;
4298 }
4299
4300 public Container WithItems(params CardElement[] value)
4301 {
4302 this.Items = new List<CardElement>(value);
4303 return this;
4304 }
4305
4306 public Container WithItems(IList<CardElement> value)
4307 {
4308 this.Items = value;
4309 return this;
4310 }
4311}
4312
4313/// <summary>
4314/// A layout that stacks elements on top of each other. Layout.Stack is the default layout used by AdaptiveCard and all containers.
4315/// </summary>
4316public class StackLayout : ContainerLayout
4317{
4318 /// <summary>
4319 /// Deserializes a JSON string into an object of type StackLayout.
4320 /// </summary>
4321 public static StackLayout? Deserialize(string json)
4322 {
4323 return JsonSerializer.Deserialize<StackLayout>(json);
4324 }
4325
4326 /// <summary>
4327 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4328 /// </summary>
4329 [JsonPropertyName("key")]
4330 public string? Key { get; set; }
4331
4332 /// <summary>
4333 /// Must be **Layout.Stack**.
4334 /// </summary>
4335 [JsonPropertyName("type")]
4336 public string Type { get; } = "Layout.Stack";
4337
4338 /// <summary>
4339 /// Controls for which card width the layout should be used.
4340 /// </summary>
4341 [JsonPropertyName("targetWidth")]
4342 public TargetWidth? TargetWidth { get; set; }
4343
4344 /// <summary>
4345 /// Serializes this StackLayout into a JSON string.
4346 /// </summary>
4347 public string Serialize()
4348 {
4349 return JsonSerializer.Serialize(
4350 this,
4351 new JsonSerializerOptions
4352 {
4353 WriteIndented = true,
4354 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4355 }
4356 );
4357 }
4358
4359 public StackLayout WithKey(string value)
4360 {
4361 this.Key = value;
4362 return this;
4363 }
4364
4365 public StackLayout WithTargetWidth(TargetWidth value)
4366 {
4367 this.TargetWidth = value;
4368 return this;
4369 }
4370}
4371
4372/// <summary>
4373/// A layout that spreads elements horizontally and wraps them across multiple rows, as needed.
4374/// </summary>
4375public class FlowLayout : ContainerLayout
4376{
4377 /// <summary>
4378 /// Deserializes a JSON string into an object of type FlowLayout.
4379 /// </summary>
4380 public static FlowLayout? Deserialize(string json)
4381 {
4382 return JsonSerializer.Deserialize<FlowLayout>(json);
4383 }
4384
4385 /// <summary>
4386 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4387 /// </summary>
4388 [JsonPropertyName("key")]
4389 public string? Key { get; set; }
4390
4391 /// <summary>
4392 /// Must be **Layout.Flow**.
4393 /// </summary>
4394 [JsonPropertyName("type")]
4395 public string Type { get; } = "Layout.Flow";
4396
4397 /// <summary>
4398 /// Controls for which card width the layout should be used.
4399 /// </summary>
4400 [JsonPropertyName("targetWidth")]
4401 public TargetWidth? TargetWidth { get; set; }
4402
4403 /// <summary>
4404 /// Controls how the content of the container should be horizontally aligned.
4405 /// </summary>
4406 [JsonPropertyName("horizontalItemsAlignment")]
4407 public HorizontalAlignment? HorizontalItemsAlignment { get; set; } = HorizontalAlignment.Center;
4408
4409 /// <summary>
4410 /// Controls how the content of the container should be vertically aligned.
4411 /// </summary>
4412 [JsonPropertyName("verticalItemsAlignment")]
4413 public VerticalAlignment? VerticalItemsAlignment { get; set; } = VerticalAlignment.Top;
4414
4415 /// <summary>
4416 /// Controls how item should fit inside the container.
4417 /// </summary>
4418 [JsonPropertyName("itemFit")]
4419 public FlowLayoutItemFit? ItemFit { get; set; } = FlowLayoutItemFit.Fit;
4420
4421 /// <summary>
4422 /// The minimum width, in pixels, of each item, in the `<number>px` format. Should not be used if itemWidth is set.
4423 /// </summary>
4424 [JsonPropertyName("minItemWidth")]
4425 public string? MinItemWidth { get; set; }
4426
4427 /// <summary>
4428 /// The maximum width, in pixels, of each item, in the `<number>px` format. Should not be used if itemWidth is set.
4429 /// </summary>
4430 [JsonPropertyName("maxItemWidth")]
4431 public string? MaxItemWidth { get; set; }
4432
4433 /// <summary>
4434 /// The width, in pixels, of each item, in the `<number>px` format. Should not be used if maxItemWidth and/or minItemWidth are set.
4435 /// </summary>
4436 [JsonPropertyName("itemWidth")]
4437 public string? ItemWidth { get; set; }
4438
4439 /// <summary>
4440 /// The space between items.
4441 /// </summary>
4442 [JsonPropertyName("columnSpacing")]
4443 public Spacing? ColumnSpacing { get; set; } = Spacing.Default;
4444
4445 /// <summary>
4446 /// The space between rows of items.
4447 /// </summary>
4448 [JsonPropertyName("rowSpacing")]
4449 public Spacing? RowSpacing { get; set; } = Spacing.Default;
4450
4451 /// <summary>
4452 /// Serializes this FlowLayout into a JSON string.
4453 /// </summary>
4454 public string Serialize()
4455 {
4456 return JsonSerializer.Serialize(
4457 this,
4458 new JsonSerializerOptions
4459 {
4460 WriteIndented = true,
4461 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4462 }
4463 );
4464 }
4465
4466 public FlowLayout WithKey(string value)
4467 {
4468 this.Key = value;
4469 return this;
4470 }
4471
4472 public FlowLayout WithTargetWidth(TargetWidth value)
4473 {
4474 this.TargetWidth = value;
4475 return this;
4476 }
4477
4478 public FlowLayout WithHorizontalItemsAlignment(HorizontalAlignment value)
4479 {
4480 this.HorizontalItemsAlignment = value;
4481 return this;
4482 }
4483
4484 public FlowLayout WithVerticalItemsAlignment(VerticalAlignment value)
4485 {
4486 this.VerticalItemsAlignment = value;
4487 return this;
4488 }
4489
4490 public FlowLayout WithItemFit(FlowLayoutItemFit value)
4491 {
4492 this.ItemFit = value;
4493 return this;
4494 }
4495
4496 public FlowLayout WithMinItemWidth(string value)
4497 {
4498 this.MinItemWidth = value;
4499 return this;
4500 }
4501
4502 public FlowLayout WithMaxItemWidth(string value)
4503 {
4504 this.MaxItemWidth = value;
4505 return this;
4506 }
4507
4508 public FlowLayout WithItemWidth(string value)
4509 {
4510 this.ItemWidth = value;
4511 return this;
4512 }
4513
4514 public FlowLayout WithColumnSpacing(Spacing value)
4515 {
4516 this.ColumnSpacing = value;
4517 return this;
4518 }
4519
4520 public FlowLayout WithRowSpacing(Spacing value)
4521 {
4522 this.RowSpacing = value;
4523 return this;
4524 }
4525}
4526
4527/// <summary>
4528/// A layout that divides a container into named areas into which elements can be placed.
4529/// </summary>
4530public class AreaGridLayout : ContainerLayout
4531{
4532 /// <summary>
4533 /// Deserializes a JSON string into an object of type AreaGridLayout.
4534 /// </summary>
4535 public static AreaGridLayout? Deserialize(string json)
4536 {
4537 return JsonSerializer.Deserialize<AreaGridLayout>(json);
4538 }
4539
4540 /// <summary>
4541 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4542 /// </summary>
4543 [JsonPropertyName("key")]
4544 public string? Key { get; set; }
4545
4546 /// <summary>
4547 /// Must be **Layout.AreaGrid**.
4548 /// </summary>
4549 [JsonPropertyName("type")]
4550 public string Type { get; } = "Layout.AreaGrid";
4551
4552 /// <summary>
4553 /// Controls for which card width the layout should be used.
4554 /// </summary>
4555 [JsonPropertyName("targetWidth")]
4556 public TargetWidth? TargetWidth { get; set; }
4557
4558 /// <summary>
4559 /// The columns in the grid layout, defined as a percentage of the available width or in pixels using the `<number>px` format.
4560 /// </summary>
4561 [JsonPropertyName("columns")]
4562 public IUnion<IList<float>, IList<string>>? Columns { get; set; }
4563
4564 /// <summary>
4565 /// The areas in the grid layout.
4566 /// </summary>
4567 [JsonPropertyName("areas")]
4568 public IList<GridArea>? Areas { get; set; }
4569
4570 /// <summary>
4571 /// The space between columns.
4572 /// </summary>
4573 [JsonPropertyName("columnSpacing")]
4574 public Spacing? ColumnSpacing { get; set; } = Spacing.Default;
4575
4576 /// <summary>
4577 /// The space between rows.
4578 /// </summary>
4579 [JsonPropertyName("rowSpacing")]
4580 public Spacing? RowSpacing { get; set; } = Spacing.Default;
4581
4582 /// <summary>
4583 /// Serializes this AreaGridLayout into a JSON string.
4584 /// </summary>
4585 public string Serialize()
4586 {
4587 return JsonSerializer.Serialize(
4588 this,
4589 new JsonSerializerOptions
4590 {
4591 WriteIndented = true,
4592 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4593 }
4594 );
4595 }
4596
4597 public AreaGridLayout WithKey(string value)
4598 {
4599 this.Key = value;
4600 return this;
4601 }
4602
4603 public AreaGridLayout WithTargetWidth(TargetWidth value)
4604 {
4605 this.TargetWidth = value;
4606 return this;
4607 }
4608
4609 public AreaGridLayout WithColumns(IUnion<IList<float>, IList<string>> value)
4610 {
4611 this.Columns = value;
4612 return this;
4613 }
4614
4615 public AreaGridLayout WithAreas(params GridArea[] value)
4616 {
4617 this.Areas = new List<GridArea>(value);
4618 return this;
4619 }
4620
4621 public AreaGridLayout WithAreas(IList<GridArea> value)
4622 {
4623 this.Areas = value;
4624 return this;
4625 }
4626
4627 public AreaGridLayout WithColumnSpacing(Spacing value)
4628 {
4629 this.ColumnSpacing = value;
4630 return this;
4631 }
4632
4633 public AreaGridLayout WithRowSpacing(Spacing value)
4634 {
4635 this.RowSpacing = value;
4636 return this;
4637 }
4638}
4639
4640/// <summary>
4641/// Defines an area in a Layout.AreaGrid layout.
4642/// </summary>
4643public class GridArea : SerializableObject
4644{
4645 /// <summary>
4646 /// Deserializes a JSON string into an object of type GridArea.
4647 /// </summary>
4648 public static GridArea? Deserialize(string json)
4649 {
4650 return JsonSerializer.Deserialize<GridArea>(json);
4651 }
4652
4653 /// <summary>
4654 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4655 /// </summary>
4656 [JsonPropertyName("key")]
4657 public string? Key { get; set; }
4658
4659 /// <summary>
4660 /// The name of the area. To place an element in this area, set its `grid.area` property to match the name of the area.
4661 /// </summary>
4662 [JsonPropertyName("name")]
4663 public string? Name { get; set; }
4664
4665 /// <summary>
4666 /// The start column index of the area. Column indices start at 1.
4667 /// </summary>
4668 [JsonPropertyName("column")]
4669 public float? Column { get; set; } = 1;
4670
4671 /// <summary>
4672 /// Defines how many columns the area should span.
4673 /// </summary>
4674 [JsonPropertyName("columnSpan")]
4675 public float? ColumnSpan { get; set; } = 1;
4676
4677 /// <summary>
4678 /// The start row index of the area. Row indices start at 1.
4679 /// </summary>
4680 [JsonPropertyName("row")]
4681 public float? Row { get; set; } = 1;
4682
4683 /// <summary>
4684 /// Defines how many rows the area should span.
4685 /// </summary>
4686 [JsonPropertyName("rowSpan")]
4687 public float? RowSpan { get; set; } = 1;
4688
4689 /// <summary>
4690 /// Serializes this GridArea into a JSON string.
4691 /// </summary>
4692 public string Serialize()
4693 {
4694 return JsonSerializer.Serialize(
4695 this,
4696 new JsonSerializerOptions
4697 {
4698 WriteIndented = true,
4699 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4700 }
4701 );
4702 }
4703
4704 public GridArea WithKey(string value)
4705 {
4706 this.Key = value;
4707 return this;
4708 }
4709
4710 public GridArea WithName(string value)
4711 {
4712 this.Name = value;
4713 return this;
4714 }
4715
4716 public GridArea WithColumn(float value)
4717 {
4718 this.Column = value;
4719 return this;
4720 }
4721
4722 public GridArea WithColumnSpan(float value)
4723 {
4724 this.ColumnSpan = value;
4725 return this;
4726 }
4727
4728 public GridArea WithRow(float value)
4729 {
4730 this.Row = value;
4731 return this;
4732 }
4733
4734 public GridArea WithRowSpan(float value)
4735 {
4736 this.RowSpan = value;
4737 return this;
4738 }
4739}
4740
4741/// <summary>
4742/// Defines a container's background image and the way it should be rendered.
4743/// </summary>
4744public class BackgroundImage : SerializableObject
4745{
4746 /// <summary>
4747 /// Deserializes a JSON string into an object of type BackgroundImage.
4748 /// </summary>
4749 public static BackgroundImage? Deserialize(string json)
4750 {
4751 return JsonSerializer.Deserialize<BackgroundImage>(json);
4752 }
4753
4754 /// <summary>
4755 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4756 /// </summary>
4757 [JsonPropertyName("key")]
4758 public string? Key { get; set; }
4759
4760 /// <summary>
4761 /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
4762 /// </summary>
4763 [JsonPropertyName("url")]
4764 public string? Url { get; set; }
4765
4766 /// <summary>
4767 /// Controls how the image should fill the area.
4768 /// </summary>
4769 [JsonPropertyName("fillMode")]
4770 public FillMode? FillMode { get; set; } = FillMode.Cover;
4771
4772 /// <summary>
4773 /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
4774 /// </summary>
4775 [JsonPropertyName("horizontalAlignment")]
4776 public HorizontalAlignment? HorizontalAlignment { get; set; } = HorizontalAlignment.Left;
4777
4778 /// <summary>
4779 /// Controls how the image should be aligned if it must be cropped or if using repeat fill mode.
4780 /// </summary>
4781 [JsonPropertyName("verticalAlignment")]
4782 public VerticalAlignment? VerticalAlignment { get; set; } = VerticalAlignment.Top;
4783
4784 /// <summary>
4785 /// A set of theme-specific image URLs.
4786 /// </summary>
4787 [JsonPropertyName("themedUrls")]
4788 public IList<ThemedUrl>? ThemedUrls { get; set; }
4789
4790 /// <summary>
4791 /// Serializes this BackgroundImage into a JSON string.
4792 /// </summary>
4793 public string Serialize()
4794 {
4795 return JsonSerializer.Serialize(
4796 this,
4797 new JsonSerializerOptions
4798 {
4799 WriteIndented = true,
4800 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
4801 }
4802 );
4803 }
4804
4805 public BackgroundImage WithKey(string value)
4806 {
4807 this.Key = value;
4808 return this;
4809 }
4810
4811 public BackgroundImage WithUrl(string value)
4812 {
4813 this.Url = value;
4814 return this;
4815 }
4816
4817 public BackgroundImage WithFillMode(FillMode value)
4818 {
4819 this.FillMode = value;
4820 return this;
4821 }
4822
4823 public BackgroundImage WithHorizontalAlignment(HorizontalAlignment value)
4824 {
4825 this.HorizontalAlignment = value;
4826 return this;
4827 }
4828
4829 public BackgroundImage WithVerticalAlignment(VerticalAlignment value)
4830 {
4831 this.VerticalAlignment = value;
4832 return this;
4833 }
4834
4835 public BackgroundImage WithThemedUrls(params ThemedUrl[] value)
4836 {
4837 this.ThemedUrls = new List<ThemedUrl>(value);
4838 return this;
4839 }
4840
4841 public BackgroundImage WithThemedUrls(IList<ThemedUrl> value)
4842 {
4843 this.ThemedUrls = value;
4844 return this;
4845 }
4846}
4847
4848/// <summary>
4849/// Splits the available horizontal space into separate columns, so elements can be organized in a row.
4850/// </summary>
4851public class ColumnSet : CardElement
4852{
4853 /// <summary>
4854 /// Deserializes a JSON string into an object of type ColumnSet.
4855 /// </summary>
4856 public static ColumnSet? Deserialize(string json)
4857 {
4858 return JsonSerializer.Deserialize<ColumnSet>(json);
4859 }
4860
4861 /// <summary>
4862 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
4863 /// </summary>
4864 [JsonPropertyName("key")]
4865 public string? Key { get; set; }
4866
4867 /// <summary>
4868 /// Must be **ColumnSet**.
4869 /// </summary>
4870 [JsonPropertyName("type")]
4871 public string Type { get; } = "ColumnSet";
4872
4873 /// <summary>
4874 /// 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.
4875 /// </summary>
4876 [JsonPropertyName("id")]
4877 public string? Id { get; set; }
4878
4879 /// <summary>
4880 /// 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).
4881 /// </summary>
4882 [JsonPropertyName("requires")]
4883 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
4884
4885 /// <summary>
4886 /// The locale associated with the element.
4887 /// </summary>
4888 [JsonPropertyName("lang")]
4889 public string? Lang { get; set; }
4890
4891 /// <summary>
4892 /// Controls the visibility of the element.
4893 /// </summary>
4894 [JsonPropertyName("isVisible")]
4895 public bool? IsVisible { get; set; } = true;
4896
4897 /// <summary>
4898 /// 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.
4899 /// </summary>
4900 [JsonPropertyName("separator")]
4901 public bool? Separator { get; set; } = false;
4902
4903 /// <summary>
4904 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
4905 /// </summary>
4906 [JsonPropertyName("height")]
4907 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
4908
4909 /// <summary>
4910 /// Controls how the element should be horizontally aligned.
4911 /// </summary>
4912 [JsonPropertyName("horizontalAlignment")]
4913 public HorizontalAlignment? HorizontalAlignment { get; set; }
4914
4915 /// <summary>
4916 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
4917 /// </summary>
4918 [JsonPropertyName("spacing")]
4919 public Spacing? Spacing { get; set; } = Spacing.Default;
4920
4921 /// <summary>
4922 /// 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).
4923 /// </summary>
4924 [JsonPropertyName("targetWidth")]
4925 public TargetWidth? TargetWidth { get; set; }
4926
4927 /// <summary>
4928 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
4929 /// </summary>
4930 [JsonPropertyName("isSortKey")]
4931 public bool? IsSortKey { get; set; } = false;
4932
4933 /// <summary>
4934 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
4935 /// </summary>
4936 [JsonPropertyName("selectAction")]
4937 public Action? SelectAction { get; set; }
4938
4939 /// <summary>
4940 /// 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.
4941 /// </summary>
4942 [JsonPropertyName("style")]
4943 public ContainerStyle? Style { get; set; }
4944
4945 /// <summary>
4946 /// Controls if a border should be displayed around the container.
4947 /// </summary>
4948 [JsonPropertyName("showBorder")]
4949 public bool? ShowBorder { get; set; } = false;
4950
4951 /// <summary>
4952 /// Controls if the container should have rounded corners.
4953 /// </summary>
4954 [JsonPropertyName("roundedCorners")]
4955 public bool? RoundedCorners { get; set; } = false;
4956
4957 /// <summary>
4958 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
4959 /// </summary>
4960 [JsonPropertyName("bleed")]
4961 public bool? Bleed { get; set; } = false;
4962
4963 /// <summary>
4964 /// The minimum height, in pixels, of the container, in the `<number>px` format.
4965 /// </summary>
4966 [JsonPropertyName("minHeight")]
4967 public string? MinHeight { get; set; }
4968
4969 /// <summary>
4970 /// The minimum width of the column set. `auto` will automatically adjust the column set's minimum width according to its content and using the `<number>px` format will give the column set an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width.
4971 /// </summary>
4972 [JsonPropertyName("minWidth")]
4973 public string? MinWidth { get; set; }
4974
4975 /// <summary>
4976 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
4977 /// </summary>
4978 [JsonPropertyName("grid.area")]
4979 public string? GridArea { get; set; }
4980
4981 /// <summary>
4982 /// 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.
4983 /// </summary>
4984 [JsonPropertyName("fallback")]
4985 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
4986
4987 /// <summary>
4988 /// The columns in the set.
4989 /// </summary>
4990 [JsonPropertyName("columns")]
4991 public IList<Column>? Columns { get; set; }
4992
4993 /// <summary>
4994 /// Serializes this ColumnSet into a JSON string.
4995 /// </summary>
4996 public string Serialize()
4997 {
4998 return JsonSerializer.Serialize(
4999 this,
5000 new JsonSerializerOptions
5001 {
5002 WriteIndented = true,
5003 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5004 }
5005 );
5006 }
5007
5008 public ColumnSet WithKey(string value)
5009 {
5010 this.Key = value;
5011 return this;
5012 }
5013
5014 public ColumnSet WithId(string value)
5015 {
5016 this.Id = value;
5017 return this;
5018 }
5019
5020 public ColumnSet WithRequires(HostCapabilities value)
5021 {
5022 this.Requires = value;
5023 return this;
5024 }
5025
5026 public ColumnSet WithLang(string value)
5027 {
5028 this.Lang = value;
5029 return this;
5030 }
5031
5032 public ColumnSet WithIsVisible(bool value)
5033 {
5034 this.IsVisible = value;
5035 return this;
5036 }
5037
5038 public ColumnSet WithSeparator(bool value)
5039 {
5040 this.Separator = value;
5041 return this;
5042 }
5043
5044 public ColumnSet WithHeight(ElementHeight value)
5045 {
5046 this.Height = value;
5047 return this;
5048 }
5049
5050 public ColumnSet WithHorizontalAlignment(HorizontalAlignment value)
5051 {
5052 this.HorizontalAlignment = value;
5053 return this;
5054 }
5055
5056 public ColumnSet WithSpacing(Spacing value)
5057 {
5058 this.Spacing = value;
5059 return this;
5060 }
5061
5062 public ColumnSet WithTargetWidth(TargetWidth value)
5063 {
5064 this.TargetWidth = value;
5065 return this;
5066 }
5067
5068 public ColumnSet WithIsSortKey(bool value)
5069 {
5070 this.IsSortKey = value;
5071 return this;
5072 }
5073
5074 public ColumnSet WithSelectAction(Action value)
5075 {
5076 this.SelectAction = value;
5077 return this;
5078 }
5079
5080 public ColumnSet WithStyle(ContainerStyle value)
5081 {
5082 this.Style = value;
5083 return this;
5084 }
5085
5086 public ColumnSet WithShowBorder(bool value)
5087 {
5088 this.ShowBorder = value;
5089 return this;
5090 }
5091
5092 public ColumnSet WithRoundedCorners(bool value)
5093 {
5094 this.RoundedCorners = value;
5095 return this;
5096 }
5097
5098 public ColumnSet WithBleed(bool value)
5099 {
5100 this.Bleed = value;
5101 return this;
5102 }
5103
5104 public ColumnSet WithMinHeight(string value)
5105 {
5106 this.MinHeight = value;
5107 return this;
5108 }
5109
5110 public ColumnSet WithMinWidth(string value)
5111 {
5112 this.MinWidth = value;
5113 return this;
5114 }
5115
5116 public ColumnSet WithGridArea(string value)
5117 {
5118 this.GridArea = value;
5119 return this;
5120 }
5121
5122 public ColumnSet WithFallback(IUnion<CardElement, FallbackElement> value)
5123 {
5124 this.Fallback = value;
5125 return this;
5126 }
5127
5128 public ColumnSet WithColumns(params Column[] value)
5129 {
5130 this.Columns = new List<Column>(value);
5131 return this;
5132 }
5133
5134 public ColumnSet WithColumns(IList<Column> value)
5135 {
5136 this.Columns = value;
5137 return this;
5138 }
5139}
5140
5141/// <summary>
5142/// A media element, that makes it possible to embed videos inside a card.
5143/// </summary>
5144public class Media : CardElement
5145{
5146 /// <summary>
5147 /// Deserializes a JSON string into an object of type Media.
5148 /// </summary>
5149 public static Media? Deserialize(string json)
5150 {
5151 return JsonSerializer.Deserialize<Media>(json);
5152 }
5153
5154 /// <summary>
5155 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
5156 /// </summary>
5157 [JsonPropertyName("key")]
5158 public string? Key { get; set; }
5159
5160 /// <summary>
5161 /// Must be **Media**.
5162 /// </summary>
5163 [JsonPropertyName("type")]
5164 public string Type { get; } = "Media";
5165
5166 /// <summary>
5167 /// 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.
5168 /// </summary>
5169 [JsonPropertyName("id")]
5170 public string? Id { get; set; }
5171
5172 /// <summary>
5173 /// 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).
5174 /// </summary>
5175 [JsonPropertyName("requires")]
5176 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
5177
5178 /// <summary>
5179 /// The locale associated with the element.
5180 /// </summary>
5181 [JsonPropertyName("lang")]
5182 public string? Lang { get; set; }
5183
5184 /// <summary>
5185 /// Controls the visibility of the element.
5186 /// </summary>
5187 [JsonPropertyName("isVisible")]
5188 public bool? IsVisible { get; set; } = true;
5189
5190 /// <summary>
5191 /// 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.
5192 /// </summary>
5193 [JsonPropertyName("separator")]
5194 public bool? Separator { get; set; } = false;
5195
5196 /// <summary>
5197 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5198 /// </summary>
5199 [JsonPropertyName("height")]
5200 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
5201
5202 /// <summary>
5203 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5204 /// </summary>
5205 [JsonPropertyName("spacing")]
5206 public Spacing? Spacing { get; set; } = Spacing.Default;
5207
5208 /// <summary>
5209 /// 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).
5210 /// </summary>
5211 [JsonPropertyName("targetWidth")]
5212 public TargetWidth? TargetWidth { get; set; }
5213
5214 /// <summary>
5215 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5216 /// </summary>
5217 [JsonPropertyName("isSortKey")]
5218 public bool? IsSortKey { get; set; } = false;
5219
5220 /// <summary>
5221 /// The sources for the media. For YouTube, Dailymotion and Vimeo, only one source can be specified.
5222 /// </summary>
5223 [JsonPropertyName("sources")]
5224 public IList<MediaSource>? Sources { get; set; }
5225
5226 /// <summary>
5227 /// The caption sources for the media. Caption sources are not used for YouTube, Dailymotion or Vimeo sources.
5228 /// </summary>
5229 [JsonPropertyName("captionSources")]
5230 public IList<CaptionSource>? CaptionSources { get; set; }
5231
5232 /// <summary>
5233 /// The URL of the poster image to display.
5234 /// </summary>
5235 [JsonPropertyName("poster")]
5236 public string? Poster { get; set; }
5237
5238 /// <summary>
5239 /// The alternate text for the media, used for accessibility purposes.
5240 /// </summary>
5241 [JsonPropertyName("altText")]
5242 public string? AltText { get; set; }
5243
5244 /// <summary>
5245 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5246 /// </summary>
5247 [JsonPropertyName("grid.area")]
5248 public string? GridArea { get; set; }
5249
5250 /// <summary>
5251 /// 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.
5252 /// </summary>
5253 [JsonPropertyName("fallback")]
5254 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5255
5256 /// <summary>
5257 /// Serializes this Media into a JSON string.
5258 /// </summary>
5259 public string Serialize()
5260 {
5261 return JsonSerializer.Serialize(
5262 this,
5263 new JsonSerializerOptions
5264 {
5265 WriteIndented = true,
5266 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5267 }
5268 );
5269 }
5270
5271 public Media WithKey(string value)
5272 {
5273 this.Key = value;
5274 return this;
5275 }
5276
5277 public Media WithId(string value)
5278 {
5279 this.Id = value;
5280 return this;
5281 }
5282
5283 public Media WithRequires(HostCapabilities value)
5284 {
5285 this.Requires = value;
5286 return this;
5287 }
5288
5289 public Media WithLang(string value)
5290 {
5291 this.Lang = value;
5292 return this;
5293 }
5294
5295 public Media WithIsVisible(bool value)
5296 {
5297 this.IsVisible = value;
5298 return this;
5299 }
5300
5301 public Media WithSeparator(bool value)
5302 {
5303 this.Separator = value;
5304 return this;
5305 }
5306
5307 public Media WithHeight(ElementHeight value)
5308 {
5309 this.Height = value;
5310 return this;
5311 }
5312
5313 public Media WithSpacing(Spacing value)
5314 {
5315 this.Spacing = value;
5316 return this;
5317 }
5318
5319 public Media WithTargetWidth(TargetWidth value)
5320 {
5321 this.TargetWidth = value;
5322 return this;
5323 }
5324
5325 public Media WithIsSortKey(bool value)
5326 {
5327 this.IsSortKey = value;
5328 return this;
5329 }
5330
5331 public Media WithSources(params MediaSource[] value)
5332 {
5333 this.Sources = new List<MediaSource>(value);
5334 return this;
5335 }
5336
5337 public Media WithSources(IList<MediaSource> value)
5338 {
5339 this.Sources = value;
5340 return this;
5341 }
5342
5343 public Media WithCaptionSources(params CaptionSource[] value)
5344 {
5345 this.CaptionSources = new List<CaptionSource>(value);
5346 return this;
5347 }
5348
5349 public Media WithCaptionSources(IList<CaptionSource> value)
5350 {
5351 this.CaptionSources = value;
5352 return this;
5353 }
5354
5355 public Media WithPoster(string value)
5356 {
5357 this.Poster = value;
5358 return this;
5359 }
5360
5361 public Media WithAltText(string value)
5362 {
5363 this.AltText = value;
5364 return this;
5365 }
5366
5367 public Media WithGridArea(string value)
5368 {
5369 this.GridArea = value;
5370 return this;
5371 }
5372
5373 public Media WithFallback(IUnion<CardElement, FallbackElement> value)
5374 {
5375 this.Fallback = value;
5376 return this;
5377 }
5378}
5379
5380/// <summary>
5381/// Defines the source URL of a media stream. YouTube, Dailymotion, Vimeo and Microsoft Stream URLs are supported.
5382/// </summary>
5383public class MediaSource : SerializableObject
5384{
5385 /// <summary>
5386 /// Deserializes a JSON string into an object of type MediaSource.
5387 /// </summary>
5388 public static MediaSource? Deserialize(string json)
5389 {
5390 return JsonSerializer.Deserialize<MediaSource>(json);
5391 }
5392
5393 /// <summary>
5394 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
5395 /// </summary>
5396 [JsonPropertyName("key")]
5397 public string? Key { get; set; }
5398
5399 /// <summary>
5400 /// The MIME type of the source.
5401 /// </summary>
5402 [JsonPropertyName("mimeType")]
5403 public string? MimeType { get; set; }
5404
5405 /// <summary>
5406 /// The URL of the source.
5407 /// </summary>
5408 [JsonPropertyName("url")]
5409 public string? Url { get; set; }
5410
5411 /// <summary>
5412 /// Serializes this MediaSource into a JSON string.
5413 /// </summary>
5414 public string Serialize()
5415 {
5416 return JsonSerializer.Serialize(
5417 this,
5418 new JsonSerializerOptions
5419 {
5420 WriteIndented = true,
5421 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5422 }
5423 );
5424 }
5425
5426 public MediaSource WithKey(string value)
5427 {
5428 this.Key = value;
5429 return this;
5430 }
5431
5432 public MediaSource WithMimeType(string value)
5433 {
5434 this.MimeType = value;
5435 return this;
5436 }
5437
5438 public MediaSource WithUrl(string value)
5439 {
5440 this.Url = value;
5441 return this;
5442 }
5443}
5444
5445/// <summary>
5446/// Defines a source URL for a video captions.
5447/// </summary>
5448public class CaptionSource : SerializableObject
5449{
5450 /// <summary>
5451 /// Deserializes a JSON string into an object of type CaptionSource.
5452 /// </summary>
5453 public static CaptionSource? Deserialize(string json)
5454 {
5455 return JsonSerializer.Deserialize<CaptionSource>(json);
5456 }
5457
5458 /// <summary>
5459 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
5460 /// </summary>
5461 [JsonPropertyName("key")]
5462 public string? Key { get; set; }
5463
5464 /// <summary>
5465 /// The MIME type of the source.
5466 /// </summary>
5467 [JsonPropertyName("mimeType")]
5468 public string? MimeType { get; set; }
5469
5470 /// <summary>
5471 /// The URL of the source.
5472 /// </summary>
5473 [JsonPropertyName("url")]
5474 public string? Url { get; set; }
5475
5476 /// <summary>
5477 /// The label of this caption source.
5478 /// </summary>
5479 [JsonPropertyName("label")]
5480 public string? Label { get; set; }
5481
5482 /// <summary>
5483 /// Serializes this CaptionSource into a JSON string.
5484 /// </summary>
5485 public string Serialize()
5486 {
5487 return JsonSerializer.Serialize(
5488 this,
5489 new JsonSerializerOptions
5490 {
5491 WriteIndented = true,
5492 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5493 }
5494 );
5495 }
5496
5497 public CaptionSource WithKey(string value)
5498 {
5499 this.Key = value;
5500 return this;
5501 }
5502
5503 public CaptionSource WithMimeType(string value)
5504 {
5505 this.MimeType = value;
5506 return this;
5507 }
5508
5509 public CaptionSource WithUrl(string value)
5510 {
5511 this.Url = value;
5512 return this;
5513 }
5514
5515 public CaptionSource WithLabel(string value)
5516 {
5517 this.Label = value;
5518 return this;
5519 }
5520}
5521
5522/// <summary>
5523/// A rich text block that displays formatted text.
5524/// </summary>
5525public class RichTextBlock : CardElement
5526{
5527 /// <summary>
5528 /// Deserializes a JSON string into an object of type RichTextBlock.
5529 /// </summary>
5530 public static RichTextBlock? Deserialize(string json)
5531 {
5532 return JsonSerializer.Deserialize<RichTextBlock>(json);
5533 }
5534
5535 /// <summary>
5536 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
5537 /// </summary>
5538 [JsonPropertyName("key")]
5539 public string? Key { get; set; }
5540
5541 /// <summary>
5542 /// Must be **RichTextBlock**.
5543 /// </summary>
5544 [JsonPropertyName("type")]
5545 public string Type { get; } = "RichTextBlock";
5546
5547 /// <summary>
5548 /// 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.
5549 /// </summary>
5550 [JsonPropertyName("id")]
5551 public string? Id { get; set; }
5552
5553 /// <summary>
5554 /// 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).
5555 /// </summary>
5556 [JsonPropertyName("requires")]
5557 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
5558
5559 /// <summary>
5560 /// The locale associated with the element.
5561 /// </summary>
5562 [JsonPropertyName("lang")]
5563 public string? Lang { get; set; }
5564
5565 /// <summary>
5566 /// Controls the visibility of the element.
5567 /// </summary>
5568 [JsonPropertyName("isVisible")]
5569 public bool? IsVisible { get; set; } = true;
5570
5571 /// <summary>
5572 /// 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.
5573 /// </summary>
5574 [JsonPropertyName("separator")]
5575 public bool? Separator { get; set; } = false;
5576
5577 /// <summary>
5578 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5579 /// </summary>
5580 [JsonPropertyName("height")]
5581 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
5582
5583 /// <summary>
5584 /// Controls how the element should be horizontally aligned.
5585 /// </summary>
5586 [JsonPropertyName("horizontalAlignment")]
5587 public HorizontalAlignment? HorizontalAlignment { get; set; }
5588
5589 /// <summary>
5590 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5591 /// </summary>
5592 [JsonPropertyName("spacing")]
5593 public Spacing? Spacing { get; set; } = Spacing.Default;
5594
5595 /// <summary>
5596 /// 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).
5597 /// </summary>
5598 [JsonPropertyName("targetWidth")]
5599 public TargetWidth? TargetWidth { get; set; }
5600
5601 /// <summary>
5602 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5603 /// </summary>
5604 [JsonPropertyName("isSortKey")]
5605 public bool? IsSortKey { get; set; } = false;
5606
5607 /// <summary>
5608 /// The Id of the input the RichTextBlock should act as the label of.
5609 /// </summary>
5610 [JsonPropertyName("labelFor")]
5611 public string? LabelFor { get; set; }
5612
5613 /// <summary>
5614 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5615 /// </summary>
5616 [JsonPropertyName("grid.area")]
5617 public string? GridArea { get; set; }
5618
5619 /// <summary>
5620 /// 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.
5621 /// </summary>
5622 [JsonPropertyName("fallback")]
5623 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5624
5625 /// <summary>
5626 /// The inlines making up the rich text block.
5627 /// </summary>
5628 [JsonPropertyName("inlines")]
5629 public IUnion<IList<CardElement>, IList<string>>? Inlines { get; set; }
5630
5631 /// <summary>
5632 /// Serializes this RichTextBlock into a JSON string.
5633 /// </summary>
5634 public string Serialize()
5635 {
5636 return JsonSerializer.Serialize(
5637 this,
5638 new JsonSerializerOptions
5639 {
5640 WriteIndented = true,
5641 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5642 }
5643 );
5644 }
5645
5646 public RichTextBlock WithKey(string value)
5647 {
5648 this.Key = value;
5649 return this;
5650 }
5651
5652 public RichTextBlock WithId(string value)
5653 {
5654 this.Id = value;
5655 return this;
5656 }
5657
5658 public RichTextBlock WithRequires(HostCapabilities value)
5659 {
5660 this.Requires = value;
5661 return this;
5662 }
5663
5664 public RichTextBlock WithLang(string value)
5665 {
5666 this.Lang = value;
5667 return this;
5668 }
5669
5670 public RichTextBlock WithIsVisible(bool value)
5671 {
5672 this.IsVisible = value;
5673 return this;
5674 }
5675
5676 public RichTextBlock WithSeparator(bool value)
5677 {
5678 this.Separator = value;
5679 return this;
5680 }
5681
5682 public RichTextBlock WithHeight(ElementHeight value)
5683 {
5684 this.Height = value;
5685 return this;
5686 }
5687
5688 public RichTextBlock WithHorizontalAlignment(HorizontalAlignment value)
5689 {
5690 this.HorizontalAlignment = value;
5691 return this;
5692 }
5693
5694 public RichTextBlock WithSpacing(Spacing value)
5695 {
5696 this.Spacing = value;
5697 return this;
5698 }
5699
5700 public RichTextBlock WithTargetWidth(TargetWidth value)
5701 {
5702 this.TargetWidth = value;
5703 return this;
5704 }
5705
5706 public RichTextBlock WithIsSortKey(bool value)
5707 {
5708 this.IsSortKey = value;
5709 return this;
5710 }
5711
5712 public RichTextBlock WithLabelFor(string value)
5713 {
5714 this.LabelFor = value;
5715 return this;
5716 }
5717
5718 public RichTextBlock WithGridArea(string value)
5719 {
5720 this.GridArea = value;
5721 return this;
5722 }
5723
5724 public RichTextBlock WithFallback(IUnion<CardElement, FallbackElement> value)
5725 {
5726 this.Fallback = value;
5727 return this;
5728 }
5729
5730 public RichTextBlock WithInlines(IUnion<IList<CardElement>, IList<string>> value)
5731 {
5732 this.Inlines = value;
5733 return this;
5734 }
5735}
5736
5737/// <summary>
5738/// Use tables to display data in a tabular way, with rows, columns and cells.
5739/// </summary>
5740public class Table : CardElement
5741{
5742 /// <summary>
5743 /// Deserializes a JSON string into an object of type Table.
5744 /// </summary>
5745 public static Table? Deserialize(string json)
5746 {
5747 return JsonSerializer.Deserialize<Table>(json);
5748 }
5749
5750 /// <summary>
5751 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
5752 /// </summary>
5753 [JsonPropertyName("key")]
5754 public string? Key { get; set; }
5755
5756 /// <summary>
5757 /// Must be **Table**.
5758 /// </summary>
5759 [JsonPropertyName("type")]
5760 public string Type { get; } = "Table";
5761
5762 /// <summary>
5763 /// 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.
5764 /// </summary>
5765 [JsonPropertyName("id")]
5766 public string? Id { get; set; }
5767
5768 /// <summary>
5769 /// 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).
5770 /// </summary>
5771 [JsonPropertyName("requires")]
5772 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
5773
5774 /// <summary>
5775 /// The locale associated with the element.
5776 /// </summary>
5777 [JsonPropertyName("lang")]
5778 public string? Lang { get; set; }
5779
5780 /// <summary>
5781 /// Controls the visibility of the element.
5782 /// </summary>
5783 [JsonPropertyName("isVisible")]
5784 public bool? IsVisible { get; set; } = true;
5785
5786 /// <summary>
5787 /// 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.
5788 /// </summary>
5789 [JsonPropertyName("separator")]
5790 public bool? Separator { get; set; } = false;
5791
5792 /// <summary>
5793 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
5794 /// </summary>
5795 [JsonPropertyName("height")]
5796 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
5797
5798 /// <summary>
5799 /// Controls how the element should be horizontally aligned.
5800 /// </summary>
5801 [JsonPropertyName("horizontalAlignment")]
5802 public HorizontalAlignment? HorizontalAlignment { get; set; }
5803
5804 /// <summary>
5805 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
5806 /// </summary>
5807 [JsonPropertyName("spacing")]
5808 public Spacing? Spacing { get; set; } = Spacing.Default;
5809
5810 /// <summary>
5811 /// 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).
5812 /// </summary>
5813 [JsonPropertyName("targetWidth")]
5814 public TargetWidth? TargetWidth { get; set; }
5815
5816 /// <summary>
5817 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
5818 /// </summary>
5819 [JsonPropertyName("isSortKey")]
5820 public bool? IsSortKey { get; set; } = false;
5821
5822 /// <summary>
5823 /// 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.
5824 /// </summary>
5825 [JsonPropertyName("style")]
5826 public ContainerStyle? Style { get; set; }
5827
5828 /// <summary>
5829 /// Controls if a border should be displayed around the container.
5830 /// </summary>
5831 [JsonPropertyName("showBorder")]
5832 public bool? ShowBorder { get; set; } = false;
5833
5834 /// <summary>
5835 /// Controls if the container should have rounded corners.
5836 /// </summary>
5837 [JsonPropertyName("roundedCorners")]
5838 public bool? RoundedCorners { get; set; } = false;
5839
5840 /// <summary>
5841 /// The columns in the table.
5842 /// </summary>
5843 [JsonPropertyName("columns")]
5844 public IList<ColumnDefinition>? Columns { get; set; }
5845
5846 /// <summary>
5847 /// The minimum width of the table in pixels. `auto` will automatically adjust the table's minimum width according to its content and using the `<number>px` format will give the table an explicit minimum width in pixels. A scrollbar will be displayed if the available width is less than the specified minimum width.
5848 /// </summary>
5849 [JsonPropertyName("minWidth")]
5850 public string? MinWidth { get; set; }
5851
5852 /// <summary>
5853 /// Controls whether the first row of the table should be treated as a header.
5854 /// </summary>
5855 [JsonPropertyName("firstRowAsHeaders")]
5856 public bool? FirstRowAsHeaders { get; set; } = true;
5857
5858 /// <summary>
5859 /// Controls if grid lines should be displayed.
5860 /// </summary>
5861 [JsonPropertyName("showGridLines")]
5862 public bool? ShowGridLines { get; set; } = true;
5863
5864 /// <summary>
5865 /// The style of the grid lines between cells.
5866 /// </summary>
5867 [JsonPropertyName("gridStyle")]
5868 public ContainerStyle? GridStyle { get; set; }
5869
5870 /// <summary>
5871 /// Controls how the content of every cell in the table should be horizontally aligned by default.
5872 /// </summary>
5873 [JsonPropertyName("horizontalCellContentAlignment")]
5874 public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
5875
5876 /// <summary>
5877 /// Controls how the content of every cell in the table should be vertically aligned by default.
5878 /// </summary>
5879 [JsonPropertyName("verticalCellContentAlignment")]
5880 public VerticalAlignment? VerticalCellContentAlignment { get; set; }
5881
5882 /// <summary>
5883 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
5884 /// </summary>
5885 [JsonPropertyName("grid.area")]
5886 public string? GridArea { get; set; }
5887
5888 /// <summary>
5889 /// 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.
5890 /// </summary>
5891 [JsonPropertyName("fallback")]
5892 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
5893
5894 /// <summary>
5895 /// The rows of the table.
5896 /// </summary>
5897 [JsonPropertyName("rows")]
5898 public IList<TableRow>? Rows { get; set; }
5899
5900 /// <summary>
5901 /// Serializes this Table into a JSON string.
5902 /// </summary>
5903 public string Serialize()
5904 {
5905 return JsonSerializer.Serialize(
5906 this,
5907 new JsonSerializerOptions
5908 {
5909 WriteIndented = true,
5910 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
5911 }
5912 );
5913 }
5914
5915 public Table WithKey(string value)
5916 {
5917 this.Key = value;
5918 return this;
5919 }
5920
5921 public Table WithId(string value)
5922 {
5923 this.Id = value;
5924 return this;
5925 }
5926
5927 public Table WithRequires(HostCapabilities value)
5928 {
5929 this.Requires = value;
5930 return this;
5931 }
5932
5933 public Table WithLang(string value)
5934 {
5935 this.Lang = value;
5936 return this;
5937 }
5938
5939 public Table WithIsVisible(bool value)
5940 {
5941 this.IsVisible = value;
5942 return this;
5943 }
5944
5945 public Table WithSeparator(bool value)
5946 {
5947 this.Separator = value;
5948 return this;
5949 }
5950
5951 public Table WithHeight(ElementHeight value)
5952 {
5953 this.Height = value;
5954 return this;
5955 }
5956
5957 public Table WithHorizontalAlignment(HorizontalAlignment value)
5958 {
5959 this.HorizontalAlignment = value;
5960 return this;
5961 }
5962
5963 public Table WithSpacing(Spacing value)
5964 {
5965 this.Spacing = value;
5966 return this;
5967 }
5968
5969 public Table WithTargetWidth(TargetWidth value)
5970 {
5971 this.TargetWidth = value;
5972 return this;
5973 }
5974
5975 public Table WithIsSortKey(bool value)
5976 {
5977 this.IsSortKey = value;
5978 return this;
5979 }
5980
5981 public Table WithStyle(ContainerStyle value)
5982 {
5983 this.Style = value;
5984 return this;
5985 }
5986
5987 public Table WithShowBorder(bool value)
5988 {
5989 this.ShowBorder = value;
5990 return this;
5991 }
5992
5993 public Table WithRoundedCorners(bool value)
5994 {
5995 this.RoundedCorners = value;
5996 return this;
5997 }
5998
5999 public Table WithColumns(params ColumnDefinition[] value)
6000 {
6001 this.Columns = new List<ColumnDefinition>(value);
6002 return this;
6003 }
6004
6005 public Table WithColumns(IList<ColumnDefinition> value)
6006 {
6007 this.Columns = value;
6008 return this;
6009 }
6010
6011 public Table WithMinWidth(string value)
6012 {
6013 this.MinWidth = value;
6014 return this;
6015 }
6016
6017 public Table WithFirstRowAsHeaders(bool value)
6018 {
6019 this.FirstRowAsHeaders = value;
6020 return this;
6021 }
6022
6023 public Table WithShowGridLines(bool value)
6024 {
6025 this.ShowGridLines = value;
6026 return this;
6027 }
6028
6029 public Table WithGridStyle(ContainerStyle value)
6030 {
6031 this.GridStyle = value;
6032 return this;
6033 }
6034
6035 public Table WithHorizontalCellContentAlignment(HorizontalAlignment value)
6036 {
6037 this.HorizontalCellContentAlignment = value;
6038 return this;
6039 }
6040
6041 public Table WithVerticalCellContentAlignment(VerticalAlignment value)
6042 {
6043 this.VerticalCellContentAlignment = value;
6044 return this;
6045 }
6046
6047 public Table WithGridArea(string value)
6048 {
6049 this.GridArea = value;
6050 return this;
6051 }
6052
6053 public Table WithFallback(IUnion<CardElement, FallbackElement> value)
6054 {
6055 this.Fallback = value;
6056 return this;
6057 }
6058
6059 public Table WithRows(params TableRow[] value)
6060 {
6061 this.Rows = new List<TableRow>(value);
6062 return this;
6063 }
6064
6065 public Table WithRows(IList<TableRow> value)
6066 {
6067 this.Rows = value;
6068 return this;
6069 }
6070}
6071
6072/// <summary>
6073/// Defines a column in a Table element.
6074/// </summary>
6075public class ColumnDefinition : SerializableObject
6076{
6077 /// <summary>
6078 /// Deserializes a JSON string into an object of type ColumnDefinition.
6079 /// </summary>
6080 public static ColumnDefinition? Deserialize(string json)
6081 {
6082 return JsonSerializer.Deserialize<ColumnDefinition>(json);
6083 }
6084
6085 /// <summary>
6086 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6087 /// </summary>
6088 [JsonPropertyName("key")]
6089 public string? Key { get; set; }
6090
6091 /// <summary>
6092 /// 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.
6093 /// </summary>
6094 [JsonPropertyName("horizontalCellContentAlignment")]
6095 public HorizontalAlignment? HorizontalCellContentAlignment { get; set; }
6096
6097 /// <summary>
6098 /// 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.
6099 /// </summary>
6100 [JsonPropertyName("verticalCellContentAlignment")]
6101 public VerticalAlignment? VerticalCellContentAlignment { get; set; }
6102
6103 /// <summary>
6104 /// The width of the column in the table. If expressed as a number, represents the relative weight of the column in the table. If expressed as a string, `auto` will automatically adjust the column's width according to its content and using the `<number>px` format will give the column an explicit width in pixels.
6105 /// </summary>
6106 [JsonPropertyName("width")]
6107 public IUnion<string, float>? Width { get; set; }
6108
6109 /// <summary>
6110 /// Serializes this ColumnDefinition into a JSON string.
6111 /// </summary>
6112 public string Serialize()
6113 {
6114 return JsonSerializer.Serialize(
6115 this,
6116 new JsonSerializerOptions
6117 {
6118 WriteIndented = true,
6119 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6120 }
6121 );
6122 }
6123
6124 public ColumnDefinition WithKey(string value)
6125 {
6126 this.Key = value;
6127 return this;
6128 }
6129
6130 public ColumnDefinition WithHorizontalCellContentAlignment(HorizontalAlignment value)
6131 {
6132 this.HorizontalCellContentAlignment = value;
6133 return this;
6134 }
6135
6136 public ColumnDefinition WithVerticalCellContentAlignment(VerticalAlignment value)
6137 {
6138 this.VerticalCellContentAlignment = value;
6139 return this;
6140 }
6141
6142 public ColumnDefinition WithWidth(IUnion<string, float> value)
6143 {
6144 this.Width = value;
6145 return this;
6146 }
6147}
6148
6149/// <summary>
6150/// A block of text, optionally formatted using Markdown.
6151/// </summary>
6152public class TextBlock : CardElement
6153{
6154 /// <summary>
6155 /// Deserializes a JSON string into an object of type TextBlock.
6156 /// </summary>
6157 public static TextBlock? Deserialize(string json)
6158 {
6159 return JsonSerializer.Deserialize<TextBlock>(json);
6160 }
6161
6162 /// <summary>
6163 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6164 /// </summary>
6165 [JsonPropertyName("key")]
6166 public string? Key { get; set; }
6167
6168 /// <summary>
6169 /// Must be **TextBlock**.
6170 /// </summary>
6171 [JsonPropertyName("type")]
6172 public string Type { get; } = "TextBlock";
6173
6174 /// <summary>
6175 /// 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.
6176 /// </summary>
6177 [JsonPropertyName("id")]
6178 public string? Id { get; set; }
6179
6180 /// <summary>
6181 /// 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).
6182 /// </summary>
6183 [JsonPropertyName("requires")]
6184 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
6185
6186 /// <summary>
6187 /// The locale associated with the element.
6188 /// </summary>
6189 [JsonPropertyName("lang")]
6190 public string? Lang { get; set; }
6191
6192 /// <summary>
6193 /// Controls the visibility of the element.
6194 /// </summary>
6195 [JsonPropertyName("isVisible")]
6196 public bool? IsVisible { get; set; } = true;
6197
6198 /// <summary>
6199 /// 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.
6200 /// </summary>
6201 [JsonPropertyName("separator")]
6202 public bool? Separator { get; set; } = false;
6203
6204 /// <summary>
6205 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
6206 /// </summary>
6207 [JsonPropertyName("height")]
6208 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
6209
6210 /// <summary>
6211 /// Controls how the element should be horizontally aligned.
6212 /// </summary>
6213 [JsonPropertyName("horizontalAlignment")]
6214 public HorizontalAlignment? HorizontalAlignment { get; set; }
6215
6216 /// <summary>
6217 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6218 /// </summary>
6219 [JsonPropertyName("spacing")]
6220 public Spacing? Spacing { get; set; } = Spacing.Default;
6221
6222 /// <summary>
6223 /// 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).
6224 /// </summary>
6225 [JsonPropertyName("targetWidth")]
6226 public TargetWidth? TargetWidth { get; set; }
6227
6228 /// <summary>
6229 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6230 /// </summary>
6231 [JsonPropertyName("isSortKey")]
6232 public bool? IsSortKey { get; set; } = false;
6233
6234 /// <summary>
6235 /// The text to display. A subset of markdown is supported.
6236 /// </summary>
6237 [JsonPropertyName("text")]
6238 public string? Text { get; set; }
6239
6240 /// <summary>
6241 /// The size of the text.
6242 /// </summary>
6243 [JsonPropertyName("size")]
6244 public TextSize? Size { get; set; }
6245
6246 /// <summary>
6247 /// The weight of the text.
6248 /// </summary>
6249 [JsonPropertyName("weight")]
6250 public TextWeight? Weight { get; set; }
6251
6252 /// <summary>
6253 /// The color of the text.
6254 /// </summary>
6255 [JsonPropertyName("color")]
6256 public TextColor? Color { get; set; }
6257
6258 /// <summary>
6259 /// Controls whether the text should be renderer using a subtler variant of the select color.
6260 /// </summary>
6261 [JsonPropertyName("isSubtle")]
6262 public bool? IsSubtle { get; set; }
6263
6264 /// <summary>
6265 /// The type of font to use for rendering.
6266 /// </summary>
6267 [JsonPropertyName("fontType")]
6268 public FontType? FontType { get; set; }
6269
6270 /// <summary>
6271 /// Controls if the text should wrap.
6272 /// </summary>
6273 [JsonPropertyName("wrap")]
6274 public bool? Wrap { get; set; } = false;
6275
6276 /// <summary>
6277 /// The maximum number of lines to display.
6278 /// </summary>
6279 [JsonPropertyName("maxLines")]
6280 public float? MaxLines { get; set; }
6281
6282 /// <summary>
6283 /// The style of the text.
6284 /// </summary>
6285 [JsonPropertyName("style")]
6286 public TextBlockStyle? Style { get; set; }
6287
6288 /// <summary>
6289 /// The Id of the input the TextBlock should act as the label of.
6290 /// </summary>
6291 [JsonPropertyName("labelFor")]
6292 public string? LabelFor { get; set; }
6293
6294 /// <summary>
6295 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6296 /// </summary>
6297 [JsonPropertyName("grid.area")]
6298 public string? GridArea { get; set; }
6299
6300 /// <summary>
6301 /// 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.
6302 /// </summary>
6303 [JsonPropertyName("fallback")]
6304 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6305
6306 public TextBlock() { }
6307
6308 public TextBlock(string text)
6309 {
6310 this.Text = text;
6311 }
6312
6313 /// <summary>
6314 /// Serializes this TextBlock into a JSON string.
6315 /// </summary>
6316 public string Serialize()
6317 {
6318 return JsonSerializer.Serialize(
6319 this,
6320 new JsonSerializerOptions
6321 {
6322 WriteIndented = true,
6323 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6324 }
6325 );
6326 }
6327
6328 public TextBlock WithKey(string value)
6329 {
6330 this.Key = value;
6331 return this;
6332 }
6333
6334 public TextBlock WithId(string value)
6335 {
6336 this.Id = value;
6337 return this;
6338 }
6339
6340 public TextBlock WithRequires(HostCapabilities value)
6341 {
6342 this.Requires = value;
6343 return this;
6344 }
6345
6346 public TextBlock WithLang(string value)
6347 {
6348 this.Lang = value;
6349 return this;
6350 }
6351
6352 public TextBlock WithIsVisible(bool value)
6353 {
6354 this.IsVisible = value;
6355 return this;
6356 }
6357
6358 public TextBlock WithSeparator(bool value)
6359 {
6360 this.Separator = value;
6361 return this;
6362 }
6363
6364 public TextBlock WithHeight(ElementHeight value)
6365 {
6366 this.Height = value;
6367 return this;
6368 }
6369
6370 public TextBlock WithHorizontalAlignment(HorizontalAlignment value)
6371 {
6372 this.HorizontalAlignment = value;
6373 return this;
6374 }
6375
6376 public TextBlock WithSpacing(Spacing value)
6377 {
6378 this.Spacing = value;
6379 return this;
6380 }
6381
6382 public TextBlock WithTargetWidth(TargetWidth value)
6383 {
6384 this.TargetWidth = value;
6385 return this;
6386 }
6387
6388 public TextBlock WithIsSortKey(bool value)
6389 {
6390 this.IsSortKey = value;
6391 return this;
6392 }
6393
6394 public TextBlock WithText(string value)
6395 {
6396 this.Text = value;
6397 return this;
6398 }
6399
6400 public TextBlock WithSize(TextSize value)
6401 {
6402 this.Size = value;
6403 return this;
6404 }
6405
6406 public TextBlock WithWeight(TextWeight value)
6407 {
6408 this.Weight = value;
6409 return this;
6410 }
6411
6412 public TextBlock WithColor(TextColor value)
6413 {
6414 this.Color = value;
6415 return this;
6416 }
6417
6418 public TextBlock WithIsSubtle(bool value)
6419 {
6420 this.IsSubtle = value;
6421 return this;
6422 }
6423
6424 public TextBlock WithFontType(FontType value)
6425 {
6426 this.FontType = value;
6427 return this;
6428 }
6429
6430 public TextBlock WithWrap(bool value)
6431 {
6432 this.Wrap = value;
6433 return this;
6434 }
6435
6436 public TextBlock WithMaxLines(float value)
6437 {
6438 this.MaxLines = value;
6439 return this;
6440 }
6441
6442 public TextBlock WithStyle(TextBlockStyle value)
6443 {
6444 this.Style = value;
6445 return this;
6446 }
6447
6448 public TextBlock WithLabelFor(string value)
6449 {
6450 this.LabelFor = value;
6451 return this;
6452 }
6453
6454 public TextBlock WithGridArea(string value)
6455 {
6456 this.GridArea = value;
6457 return this;
6458 }
6459
6460 public TextBlock WithFallback(IUnion<CardElement, FallbackElement> value)
6461 {
6462 this.Fallback = value;
6463 return this;
6464 }
6465}
6466
6467/// <summary>
6468/// A set of facts, displayed as a table or a vertical list when horizontal space is constrained.
6469/// </summary>
6470public class FactSet : CardElement
6471{
6472 /// <summary>
6473 /// Deserializes a JSON string into an object of type FactSet.
6474 /// </summary>
6475 public static FactSet? Deserialize(string json)
6476 {
6477 return JsonSerializer.Deserialize<FactSet>(json);
6478 }
6479
6480 /// <summary>
6481 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6482 /// </summary>
6483 [JsonPropertyName("key")]
6484 public string? Key { get; set; }
6485
6486 /// <summary>
6487 /// Must be **FactSet**.
6488 /// </summary>
6489 [JsonPropertyName("type")]
6490 public string Type { get; } = "FactSet";
6491
6492 /// <summary>
6493 /// 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.
6494 /// </summary>
6495 [JsonPropertyName("id")]
6496 public string? Id { get; set; }
6497
6498 /// <summary>
6499 /// 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).
6500 /// </summary>
6501 [JsonPropertyName("requires")]
6502 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
6503
6504 /// <summary>
6505 /// The locale associated with the element.
6506 /// </summary>
6507 [JsonPropertyName("lang")]
6508 public string? Lang { get; set; }
6509
6510 /// <summary>
6511 /// Controls the visibility of the element.
6512 /// </summary>
6513 [JsonPropertyName("isVisible")]
6514 public bool? IsVisible { get; set; } = true;
6515
6516 /// <summary>
6517 /// 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.
6518 /// </summary>
6519 [JsonPropertyName("separator")]
6520 public bool? Separator { get; set; } = false;
6521
6522 /// <summary>
6523 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
6524 /// </summary>
6525 [JsonPropertyName("height")]
6526 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
6527
6528 /// <summary>
6529 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6530 /// </summary>
6531 [JsonPropertyName("spacing")]
6532 public Spacing? Spacing { get; set; } = Spacing.Default;
6533
6534 /// <summary>
6535 /// 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).
6536 /// </summary>
6537 [JsonPropertyName("targetWidth")]
6538 public TargetWidth? TargetWidth { get; set; }
6539
6540 /// <summary>
6541 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6542 /// </summary>
6543 [JsonPropertyName("isSortKey")]
6544 public bool? IsSortKey { get; set; } = false;
6545
6546 /// <summary>
6547 /// The facts in the set.
6548 /// </summary>
6549 [JsonPropertyName("facts")]
6550 public IList<Fact>? Facts { get; set; }
6551
6552 /// <summary>
6553 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6554 /// </summary>
6555 [JsonPropertyName("grid.area")]
6556 public string? GridArea { get; set; }
6557
6558 /// <summary>
6559 /// 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.
6560 /// </summary>
6561 [JsonPropertyName("fallback")]
6562 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6563
6564 public FactSet() { }
6565
6566 public FactSet(params Fact[] facts)
6567 {
6568 this.Facts = new List<Fact>(facts);
6569 }
6570
6571 public FactSet(IList<Fact> facts)
6572 {
6573 this.Facts = facts;
6574 }
6575
6576 /// <summary>
6577 /// Serializes this FactSet into a JSON string.
6578 /// </summary>
6579 public string Serialize()
6580 {
6581 return JsonSerializer.Serialize(
6582 this,
6583 new JsonSerializerOptions
6584 {
6585 WriteIndented = true,
6586 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6587 }
6588 );
6589 }
6590
6591 public FactSet WithKey(string value)
6592 {
6593 this.Key = value;
6594 return this;
6595 }
6596
6597 public FactSet WithId(string value)
6598 {
6599 this.Id = value;
6600 return this;
6601 }
6602
6603 public FactSet WithRequires(HostCapabilities value)
6604 {
6605 this.Requires = value;
6606 return this;
6607 }
6608
6609 public FactSet WithLang(string value)
6610 {
6611 this.Lang = value;
6612 return this;
6613 }
6614
6615 public FactSet WithIsVisible(bool value)
6616 {
6617 this.IsVisible = value;
6618 return this;
6619 }
6620
6621 public FactSet WithSeparator(bool value)
6622 {
6623 this.Separator = value;
6624 return this;
6625 }
6626
6627 public FactSet WithHeight(ElementHeight value)
6628 {
6629 this.Height = value;
6630 return this;
6631 }
6632
6633 public FactSet WithSpacing(Spacing value)
6634 {
6635 this.Spacing = value;
6636 return this;
6637 }
6638
6639 public FactSet WithTargetWidth(TargetWidth value)
6640 {
6641 this.TargetWidth = value;
6642 return this;
6643 }
6644
6645 public FactSet WithIsSortKey(bool value)
6646 {
6647 this.IsSortKey = value;
6648 return this;
6649 }
6650
6651 public FactSet WithFacts(params Fact[] value)
6652 {
6653 this.Facts = new List<Fact>(value);
6654 return this;
6655 }
6656
6657 public FactSet WithFacts(IList<Fact> value)
6658 {
6659 this.Facts = value;
6660 return this;
6661 }
6662
6663 public FactSet WithGridArea(string value)
6664 {
6665 this.GridArea = value;
6666 return this;
6667 }
6668
6669 public FactSet WithFallback(IUnion<CardElement, FallbackElement> value)
6670 {
6671 this.Fallback = value;
6672 return this;
6673 }
6674}
6675
6676/// <summary>
6677/// A fact in a FactSet element.
6678/// </summary>
6679public class Fact : SerializableObject
6680{
6681 /// <summary>
6682 /// Deserializes a JSON string into an object of type Fact.
6683 /// </summary>
6684 public static Fact? Deserialize(string json)
6685 {
6686 return JsonSerializer.Deserialize<Fact>(json);
6687 }
6688
6689 /// <summary>
6690 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6691 /// </summary>
6692 [JsonPropertyName("key")]
6693 public string? Key { get; set; }
6694
6695 /// <summary>
6696 /// The fact's title.
6697 /// </summary>
6698 [JsonPropertyName("title")]
6699 public string? Title { get; set; }
6700
6701 /// <summary>
6702 /// The fact's value.
6703 /// </summary>
6704 [JsonPropertyName("value")]
6705 public string? Value { get; set; }
6706
6707 public Fact() { }
6708
6709 public Fact(string title, string value)
6710 {
6711 this.Title = title;
6712 this.Value = value;
6713 }
6714
6715 /// <summary>
6716 /// Serializes this Fact into a JSON string.
6717 /// </summary>
6718 public string Serialize()
6719 {
6720 return JsonSerializer.Serialize(
6721 this,
6722 new JsonSerializerOptions
6723 {
6724 WriteIndented = true,
6725 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6726 }
6727 );
6728 }
6729
6730 public Fact WithKey(string value)
6731 {
6732 this.Key = value;
6733 return this;
6734 }
6735
6736 public Fact WithTitle(string value)
6737 {
6738 this.Title = value;
6739 return this;
6740 }
6741
6742 public Fact WithValue(string value)
6743 {
6744 this.Value = value;
6745 return this;
6746 }
6747}
6748
6749/// <summary>
6750/// A set of images, displayed side-by-side and wrapped across multiple rows as needed.
6751/// </summary>
6752public class ImageSet : CardElement
6753{
6754 /// <summary>
6755 /// Deserializes a JSON string into an object of type ImageSet.
6756 /// </summary>
6757 public static ImageSet? Deserialize(string json)
6758 {
6759 return JsonSerializer.Deserialize<ImageSet>(json);
6760 }
6761
6762 /// <summary>
6763 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6764 /// </summary>
6765 [JsonPropertyName("key")]
6766 public string? Key { get; set; }
6767
6768 /// <summary>
6769 /// Must be **ImageSet**.
6770 /// </summary>
6771 [JsonPropertyName("type")]
6772 public string Type { get; } = "ImageSet";
6773
6774 /// <summary>
6775 /// 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.
6776 /// </summary>
6777 [JsonPropertyName("id")]
6778 public string? Id { get; set; }
6779
6780 /// <summary>
6781 /// 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).
6782 /// </summary>
6783 [JsonPropertyName("requires")]
6784 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
6785
6786 /// <summary>
6787 /// The locale associated with the element.
6788 /// </summary>
6789 [JsonPropertyName("lang")]
6790 public string? Lang { get; set; }
6791
6792 /// <summary>
6793 /// Controls the visibility of the element.
6794 /// </summary>
6795 [JsonPropertyName("isVisible")]
6796 public bool? IsVisible { get; set; } = true;
6797
6798 /// <summary>
6799 /// 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.
6800 /// </summary>
6801 [JsonPropertyName("separator")]
6802 public bool? Separator { get; set; } = false;
6803
6804 /// <summary>
6805 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
6806 /// </summary>
6807 [JsonPropertyName("height")]
6808 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
6809
6810 /// <summary>
6811 /// Controls how the element should be horizontally aligned.
6812 /// </summary>
6813 [JsonPropertyName("horizontalAlignment")]
6814 public HorizontalAlignment? HorizontalAlignment { get; set; }
6815
6816 /// <summary>
6817 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
6818 /// </summary>
6819 [JsonPropertyName("spacing")]
6820 public Spacing? Spacing { get; set; } = Spacing.Default;
6821
6822 /// <summary>
6823 /// 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).
6824 /// </summary>
6825 [JsonPropertyName("targetWidth")]
6826 public TargetWidth? TargetWidth { get; set; }
6827
6828 /// <summary>
6829 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
6830 /// </summary>
6831 [JsonPropertyName("isSortKey")]
6832 public bool? IsSortKey { get; set; } = false;
6833
6834 /// <summary>
6835 /// The images in the set.
6836 /// </summary>
6837 [JsonPropertyName("images")]
6838 public IList<Image>? Images { get; set; }
6839
6840 /// <summary>
6841 /// The size to use to render all images in the set.
6842 /// </summary>
6843 [JsonPropertyName("imageSize")]
6844 public ImageSize? ImageSize { get; set; } = ImageSize.Medium;
6845
6846 /// <summary>
6847 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
6848 /// </summary>
6849 [JsonPropertyName("grid.area")]
6850 public string? GridArea { get; set; }
6851
6852 /// <summary>
6853 /// 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.
6854 /// </summary>
6855 [JsonPropertyName("fallback")]
6856 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
6857
6858 public ImageSet() { }
6859
6860 public ImageSet(params Image[] images)
6861 {
6862 this.Images = new List<Image>(images);
6863 }
6864
6865 public ImageSet(IList<Image> images)
6866 {
6867 this.Images = images;
6868 }
6869
6870 /// <summary>
6871 /// Serializes this ImageSet into a JSON string.
6872 /// </summary>
6873 public string Serialize()
6874 {
6875 return JsonSerializer.Serialize(
6876 this,
6877 new JsonSerializerOptions
6878 {
6879 WriteIndented = true,
6880 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
6881 }
6882 );
6883 }
6884
6885 public ImageSet WithKey(string value)
6886 {
6887 this.Key = value;
6888 return this;
6889 }
6890
6891 public ImageSet WithId(string value)
6892 {
6893 this.Id = value;
6894 return this;
6895 }
6896
6897 public ImageSet WithRequires(HostCapabilities value)
6898 {
6899 this.Requires = value;
6900 return this;
6901 }
6902
6903 public ImageSet WithLang(string value)
6904 {
6905 this.Lang = value;
6906 return this;
6907 }
6908
6909 public ImageSet WithIsVisible(bool value)
6910 {
6911 this.IsVisible = value;
6912 return this;
6913 }
6914
6915 public ImageSet WithSeparator(bool value)
6916 {
6917 this.Separator = value;
6918 return this;
6919 }
6920
6921 public ImageSet WithHeight(ElementHeight value)
6922 {
6923 this.Height = value;
6924 return this;
6925 }
6926
6927 public ImageSet WithHorizontalAlignment(HorizontalAlignment value)
6928 {
6929 this.HorizontalAlignment = value;
6930 return this;
6931 }
6932
6933 public ImageSet WithSpacing(Spacing value)
6934 {
6935 this.Spacing = value;
6936 return this;
6937 }
6938
6939 public ImageSet WithTargetWidth(TargetWidth value)
6940 {
6941 this.TargetWidth = value;
6942 return this;
6943 }
6944
6945 public ImageSet WithIsSortKey(bool value)
6946 {
6947 this.IsSortKey = value;
6948 return this;
6949 }
6950
6951 public ImageSet WithImages(params Image[] value)
6952 {
6953 this.Images = new List<Image>(value);
6954 return this;
6955 }
6956
6957 public ImageSet WithImages(IList<Image> value)
6958 {
6959 this.Images = value;
6960 return this;
6961 }
6962
6963 public ImageSet WithImageSize(ImageSize value)
6964 {
6965 this.ImageSize = value;
6966 return this;
6967 }
6968
6969 public ImageSet WithGridArea(string value)
6970 {
6971 this.GridArea = value;
6972 return this;
6973 }
6974
6975 public ImageSet WithFallback(IUnion<CardElement, FallbackElement> value)
6976 {
6977 this.Fallback = value;
6978 return this;
6979 }
6980}
6981
6982/// <summary>
6983/// A standalone image element.
6984/// </summary>
6985public class Image : CardElement
6986{
6987 /// <summary>
6988 /// Deserializes a JSON string into an object of type Image.
6989 /// </summary>
6990 public static Image? Deserialize(string json)
6991 {
6992 return JsonSerializer.Deserialize<Image>(json);
6993 }
6994
6995 /// <summary>
6996 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
6997 /// </summary>
6998 [JsonPropertyName("key")]
6999 public string? Key { get; set; }
7000
7001 /// <summary>
7002 /// Must be **Image**.
7003 /// </summary>
7004 [JsonPropertyName("type")]
7005 public string Type { get; } = "Image";
7006
7007 /// <summary>
7008 /// 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.
7009 /// </summary>
7010 [JsonPropertyName("id")]
7011 public string? Id { get; set; }
7012
7013 /// <summary>
7014 /// 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).
7015 /// </summary>
7016 [JsonPropertyName("requires")]
7017 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
7018
7019 /// <summary>
7020 /// The locale associated with the element.
7021 /// </summary>
7022 [JsonPropertyName("lang")]
7023 public string? Lang { get; set; }
7024
7025 /// <summary>
7026 /// Controls the visibility of the element.
7027 /// </summary>
7028 [JsonPropertyName("isVisible")]
7029 public bool? IsVisible { get; set; } = true;
7030
7031 /// <summary>
7032 /// 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.
7033 /// </summary>
7034 [JsonPropertyName("separator")]
7035 public bool? Separator { get; set; } = false;
7036
7037 /// <summary>
7038 /// Controls how the element should be horizontally aligned.
7039 /// </summary>
7040 [JsonPropertyName("horizontalAlignment")]
7041 public HorizontalAlignment? HorizontalAlignment { get; set; }
7042
7043 /// <summary>
7044 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7045 /// </summary>
7046 [JsonPropertyName("spacing")]
7047 public Spacing? Spacing { get; set; } = Spacing.Default;
7048
7049 /// <summary>
7050 /// 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).
7051 /// </summary>
7052 [JsonPropertyName("targetWidth")]
7053 public TargetWidth? TargetWidth { get; set; }
7054
7055 /// <summary>
7056 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7057 /// </summary>
7058 [JsonPropertyName("isSortKey")]
7059 public bool? IsSortKey { get; set; } = false;
7060
7061 /// <summary>
7062 /// The URL (or Base64-encoded Data URI) of the image. Acceptable formats are PNG, JPEG, GIF and SVG.
7063 /// </summary>
7064 [JsonPropertyName("url")]
7065 public string? Url { get; set; }
7066
7067 /// <summary>
7068 /// The alternate text for the image, used for accessibility purposes.
7069 /// </summary>
7070 [JsonPropertyName("altText")]
7071 public string? AltText { get; set; }
7072
7073 /// <summary>
7074 /// The background color of the image.
7075 /// </summary>
7076 [JsonPropertyName("backgroundColor")]
7077 public string? BackgroundColor { get; set; }
7078
7079 /// <summary>
7080 /// The style of the image.
7081 /// </summary>
7082 [JsonPropertyName("style")]
7083 public ImageStyle? Style { get; set; } = ImageStyle.Default;
7084
7085 /// <summary>
7086 /// The size of the image.
7087 /// </summary>
7088 [JsonPropertyName("size")]
7089 public Size? Size { get; set; } = Size.Auto;
7090
7091 /// <summary>
7092 /// The width of the image.
7093 /// </summary>
7094 [JsonPropertyName("width")]
7095 public string? Width { get; set; } = "auto";
7096
7097 /// <summary>
7098 /// An Action that will be invoked when the image is tapped or clicked. Action.ShowCard is not supported.
7099 /// </summary>
7100 [JsonPropertyName("selectAction")]
7101 public Action? SelectAction { get; set; }
7102
7103 /// <summary>
7104 /// Controls if the image can be expanded to full screen.
7105 /// </summary>
7106 [JsonPropertyName("allowExpand")]
7107 public bool? AllowExpand { get; set; } = false;
7108
7109 /// <summary>
7110 /// Teams-specific metadata associated with the image.
7111 /// </summary>
7112 [JsonPropertyName("msteams")]
7113 public TeamsImageProperties? Msteams { get; set; }
7114
7115 /// <summary>
7116 /// A set of theme-specific image URLs.
7117 /// </summary>
7118 [JsonPropertyName("themedUrls")]
7119 public IList<ThemedUrl>? ThemedUrls { get; set; }
7120
7121 /// <summary>
7122 /// Controls how the image should be fitted inside its bounding box. imageFit is only meaningful when both the width and height properties are set. When fitMode is set to contain, the default style is always used.
7123 /// </summary>
7124 [JsonPropertyName("fitMode")]
7125 public ImageFitMode? FitMode { get; set; } = ImageFitMode.Fill;
7126
7127 /// <summary>
7128 /// Controls the horizontal position of the image within its bounding box. horizontalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain.
7129 /// </summary>
7130 [JsonPropertyName("horizontalContentAlignment")]
7131 public HorizontalAlignment? HorizontalContentAlignment { get; set; } = HorizontalAlignment.Left;
7132
7133 /// <summary>
7134 /// Controls the vertical position of the image within its bounding box. verticalContentAlignment is only meaningful when both the width and height properties are set and fitMode is set to either cover or contain.
7135 /// </summary>
7136 [JsonPropertyName("verticalContentAlignment")]
7137 public VerticalAlignment? VerticalContentAlignment { get; set; } = VerticalAlignment.Top;
7138
7139 /// <summary>
7140 /// The height of the image.
7141 /// </summary>
7142 [JsonPropertyName("height")]
7143 public string? Height { get; set; } = "auto";
7144
7145 /// <summary>
7146 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7147 /// </summary>
7148 [JsonPropertyName("grid.area")]
7149 public string? GridArea { get; set; }
7150
7151 /// <summary>
7152 /// 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.
7153 /// </summary>
7154 [JsonPropertyName("fallback")]
7155 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7156
7157 public Image() { }
7158
7159 public Image(string url)
7160 {
7161 this.Url = url;
7162 }
7163
7164 /// <summary>
7165 /// Serializes this Image into a JSON string.
7166 /// </summary>
7167 public string Serialize()
7168 {
7169 return JsonSerializer.Serialize(
7170 this,
7171 new JsonSerializerOptions
7172 {
7173 WriteIndented = true,
7174 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7175 }
7176 );
7177 }
7178
7179 public Image WithKey(string value)
7180 {
7181 this.Key = value;
7182 return this;
7183 }
7184
7185 public Image WithId(string value)
7186 {
7187 this.Id = value;
7188 return this;
7189 }
7190
7191 public Image WithRequires(HostCapabilities value)
7192 {
7193 this.Requires = value;
7194 return this;
7195 }
7196
7197 public Image WithLang(string value)
7198 {
7199 this.Lang = value;
7200 return this;
7201 }
7202
7203 public Image WithIsVisible(bool value)
7204 {
7205 this.IsVisible = value;
7206 return this;
7207 }
7208
7209 public Image WithSeparator(bool value)
7210 {
7211 this.Separator = value;
7212 return this;
7213 }
7214
7215 public Image WithHorizontalAlignment(HorizontalAlignment value)
7216 {
7217 this.HorizontalAlignment = value;
7218 return this;
7219 }
7220
7221 public Image WithSpacing(Spacing value)
7222 {
7223 this.Spacing = value;
7224 return this;
7225 }
7226
7227 public Image WithTargetWidth(TargetWidth value)
7228 {
7229 this.TargetWidth = value;
7230 return this;
7231 }
7232
7233 public Image WithIsSortKey(bool value)
7234 {
7235 this.IsSortKey = value;
7236 return this;
7237 }
7238
7239 public Image WithUrl(string value)
7240 {
7241 this.Url = value;
7242 return this;
7243 }
7244
7245 public Image WithAltText(string value)
7246 {
7247 this.AltText = value;
7248 return this;
7249 }
7250
7251 public Image WithBackgroundColor(string value)
7252 {
7253 this.BackgroundColor = value;
7254 return this;
7255 }
7256
7257 public Image WithStyle(ImageStyle value)
7258 {
7259 this.Style = value;
7260 return this;
7261 }
7262
7263 public Image WithSize(Size value)
7264 {
7265 this.Size = value;
7266 return this;
7267 }
7268
7269 public Image WithWidth(string value)
7270 {
7271 this.Width = value;
7272 return this;
7273 }
7274
7275 public Image WithSelectAction(Action value)
7276 {
7277 this.SelectAction = value;
7278 return this;
7279 }
7280
7281 public Image WithAllowExpand(bool value)
7282 {
7283 this.AllowExpand = value;
7284 return this;
7285 }
7286
7287 public Image WithMsteams(TeamsImageProperties value)
7288 {
7289 this.Msteams = value;
7290 return this;
7291 }
7292
7293 public Image WithThemedUrls(params ThemedUrl[] value)
7294 {
7295 this.ThemedUrls = new List<ThemedUrl>(value);
7296 return this;
7297 }
7298
7299 public Image WithThemedUrls(IList<ThemedUrl> value)
7300 {
7301 this.ThemedUrls = value;
7302 return this;
7303 }
7304
7305 public Image WithFitMode(ImageFitMode value)
7306 {
7307 this.FitMode = value;
7308 return this;
7309 }
7310
7311 public Image WithHorizontalContentAlignment(HorizontalAlignment value)
7312 {
7313 this.HorizontalContentAlignment = value;
7314 return this;
7315 }
7316
7317 public Image WithVerticalContentAlignment(VerticalAlignment value)
7318 {
7319 this.VerticalContentAlignment = value;
7320 return this;
7321 }
7322
7323 public Image WithHeight(string value)
7324 {
7325 this.Height = value;
7326 return this;
7327 }
7328
7329 public Image WithGridArea(string value)
7330 {
7331 this.GridArea = value;
7332 return this;
7333 }
7334
7335 public Image WithFallback(IUnion<CardElement, FallbackElement> value)
7336 {
7337 this.Fallback = value;
7338 return this;
7339 }
7340}
7341
7342/// <summary>
7343/// Represents a set of Teams-specific properties on an image.
7344/// </summary>
7345public class TeamsImageProperties : SerializableObject
7346{
7347 /// <summary>
7348 /// Deserializes a JSON string into an object of type TeamsImageProperties.
7349 /// </summary>
7350 public static TeamsImageProperties? Deserialize(string json)
7351 {
7352 return JsonSerializer.Deserialize<TeamsImageProperties>(json);
7353 }
7354
7355 /// <summary>
7356 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
7357 /// </summary>
7358 [JsonPropertyName("key")]
7359 public string? Key { get; set; }
7360
7361 /// <summary>
7362 /// Controls if the image is expandable in Teams. This property is equivalent to the Image.allowExpand property.
7363 /// </summary>
7364 [JsonPropertyName("allowExpand")]
7365 public bool? AllowExpand { get; set; }
7366
7367 /// <summary>
7368 /// Serializes this TeamsImageProperties into a JSON string.
7369 /// </summary>
7370 public string Serialize()
7371 {
7372 return JsonSerializer.Serialize(
7373 this,
7374 new JsonSerializerOptions
7375 {
7376 WriteIndented = true,
7377 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7378 }
7379 );
7380 }
7381
7382 public TeamsImageProperties WithKey(string value)
7383 {
7384 this.Key = value;
7385 return this;
7386 }
7387
7388 public TeamsImageProperties WithAllowExpand(bool value)
7389 {
7390 this.AllowExpand = value;
7391 return this;
7392 }
7393}
7394
7395/// <summary>
7396/// An input to allow the user to enter text.
7397/// </summary>
7398public class TextInput : CardElement
7399{
7400 /// <summary>
7401 /// Deserializes a JSON string into an object of type TextInput.
7402 /// </summary>
7403 public static TextInput? Deserialize(string json)
7404 {
7405 return JsonSerializer.Deserialize<TextInput>(json);
7406 }
7407
7408 /// <summary>
7409 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
7410 /// </summary>
7411 [JsonPropertyName("key")]
7412 public string? Key { get; set; }
7413
7414 /// <summary>
7415 /// Must be **Input.Text**.
7416 /// </summary>
7417 [JsonPropertyName("type")]
7418 public string Type { get; } = "Input.Text";
7419
7420 /// <summary>
7421 /// 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.
7422 /// </summary>
7423 [JsonPropertyName("id")]
7424 public string? Id { get; set; }
7425
7426 /// <summary>
7427 /// 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).
7428 /// </summary>
7429 [JsonPropertyName("requires")]
7430 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
7431
7432 /// <summary>
7433 /// The locale associated with the element.
7434 /// </summary>
7435 [JsonPropertyName("lang")]
7436 public string? Lang { get; set; }
7437
7438 /// <summary>
7439 /// Controls the visibility of the element.
7440 /// </summary>
7441 [JsonPropertyName("isVisible")]
7442 public bool? IsVisible { get; set; } = true;
7443
7444 /// <summary>
7445 /// 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.
7446 /// </summary>
7447 [JsonPropertyName("separator")]
7448 public bool? Separator { get; set; } = false;
7449
7450 /// <summary>
7451 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7452 /// </summary>
7453 [JsonPropertyName("height")]
7454 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
7455
7456 /// <summary>
7457 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7458 /// </summary>
7459 [JsonPropertyName("spacing")]
7460 public Spacing? Spacing { get; set; } = Spacing.Default;
7461
7462 /// <summary>
7463 /// 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).
7464 /// </summary>
7465 [JsonPropertyName("targetWidth")]
7466 public TargetWidth? TargetWidth { get; set; }
7467
7468 /// <summary>
7469 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7470 /// </summary>
7471 [JsonPropertyName("isSortKey")]
7472 public bool? IsSortKey { get; set; } = false;
7473
7474 /// <summary>
7475 /// The label of the input.
7476 ///
7477 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7478 /// </summary>
7479 [JsonPropertyName("label")]
7480 public string? Label { get; set; }
7481
7482 /// <summary>
7483 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7484 /// </summary>
7485 [JsonPropertyName("isRequired")]
7486 public bool? IsRequired { get; set; } = false;
7487
7488 /// <summary>
7489 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7490 /// </summary>
7491 [JsonPropertyName("errorMessage")]
7492 public string? ErrorMessage { get; set; }
7493
7494 /// <summary>
7495 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7496 /// </summary>
7497 [JsonPropertyName("valueChangedAction")]
7498 public Action? ValueChangedAction { get; set; }
7499
7500 /// <summary>
7501 /// The default value of the input.
7502 /// </summary>
7503 [JsonPropertyName("value")]
7504 public string? Value { get; set; }
7505
7506 /// <summary>
7507 /// The maximum length of the text in the input.
7508 /// </summary>
7509 [JsonPropertyName("maxLength")]
7510 public float? MaxLength { get; set; }
7511
7512 /// <summary>
7513 /// Controls if the input should allow multiple lines of text.
7514 /// </summary>
7515 [JsonPropertyName("isMultiline")]
7516 public bool? IsMultiline { get; set; } = false;
7517
7518 /// <summary>
7519 /// The text to display as a placeholder when the user hasn't entered a value.
7520 /// </summary>
7521 [JsonPropertyName("placeholder")]
7522 public string? Placeholder { get; set; }
7523
7524 /// <summary>
7525 /// The style of the input.
7526 /// </summary>
7527 [JsonPropertyName("style")]
7528 public InputTextStyle? Style { get; set; } = InputTextStyle.Text;
7529
7530 /// <summary>
7531 /// The action that should be displayed as a button alongside the input. Action.ShowCard is not supported.
7532 /// </summary>
7533 [JsonPropertyName("inlineAction")]
7534 public Action? InlineAction { get; set; }
7535
7536 /// <summary>
7537 /// The regular expression to validate the input.
7538 /// </summary>
7539 [JsonPropertyName("regex")]
7540 public string? Regex { get; set; }
7541
7542 /// <summary>
7543 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7544 /// </summary>
7545 [JsonPropertyName("grid.area")]
7546 public string? GridArea { get; set; }
7547
7548 /// <summary>
7549 /// 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.
7550 /// </summary>
7551 [JsonPropertyName("fallback")]
7552 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7553
7554 /// <summary>
7555 /// Serializes this TextInput into a JSON string.
7556 /// </summary>
7557 public string Serialize()
7558 {
7559 return JsonSerializer.Serialize(
7560 this,
7561 new JsonSerializerOptions
7562 {
7563 WriteIndented = true,
7564 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7565 }
7566 );
7567 }
7568
7569 public TextInput WithKey(string value)
7570 {
7571 this.Key = value;
7572 return this;
7573 }
7574
7575 public TextInput WithId(string value)
7576 {
7577 this.Id = value;
7578 return this;
7579 }
7580
7581 public TextInput WithRequires(HostCapabilities value)
7582 {
7583 this.Requires = value;
7584 return this;
7585 }
7586
7587 public TextInput WithLang(string value)
7588 {
7589 this.Lang = value;
7590 return this;
7591 }
7592
7593 public TextInput WithIsVisible(bool value)
7594 {
7595 this.IsVisible = value;
7596 return this;
7597 }
7598
7599 public TextInput WithSeparator(bool value)
7600 {
7601 this.Separator = value;
7602 return this;
7603 }
7604
7605 public TextInput WithHeight(ElementHeight value)
7606 {
7607 this.Height = value;
7608 return this;
7609 }
7610
7611 public TextInput WithSpacing(Spacing value)
7612 {
7613 this.Spacing = value;
7614 return this;
7615 }
7616
7617 public TextInput WithTargetWidth(TargetWidth value)
7618 {
7619 this.TargetWidth = value;
7620 return this;
7621 }
7622
7623 public TextInput WithIsSortKey(bool value)
7624 {
7625 this.IsSortKey = value;
7626 return this;
7627 }
7628
7629 public TextInput WithLabel(string value)
7630 {
7631 this.Label = value;
7632 return this;
7633 }
7634
7635 public TextInput WithIsRequired(bool value)
7636 {
7637 this.IsRequired = value;
7638 return this;
7639 }
7640
7641 public TextInput WithErrorMessage(string value)
7642 {
7643 this.ErrorMessage = value;
7644 return this;
7645 }
7646
7647 public TextInput WithValueChangedAction(Action value)
7648 {
7649 this.ValueChangedAction = value;
7650 return this;
7651 }
7652
7653 public TextInput WithValue(string value)
7654 {
7655 this.Value = value;
7656 return this;
7657 }
7658
7659 public TextInput WithMaxLength(float value)
7660 {
7661 this.MaxLength = value;
7662 return this;
7663 }
7664
7665 public TextInput WithIsMultiline(bool value)
7666 {
7667 this.IsMultiline = value;
7668 return this;
7669 }
7670
7671 public TextInput WithPlaceholder(string value)
7672 {
7673 this.Placeholder = value;
7674 return this;
7675 }
7676
7677 public TextInput WithStyle(InputTextStyle value)
7678 {
7679 this.Style = value;
7680 return this;
7681 }
7682
7683 public TextInput WithInlineAction(Action value)
7684 {
7685 this.InlineAction = value;
7686 return this;
7687 }
7688
7689 public TextInput WithRegex(string value)
7690 {
7691 this.Regex = value;
7692 return this;
7693 }
7694
7695 public TextInput WithGridArea(string value)
7696 {
7697 this.GridArea = value;
7698 return this;
7699 }
7700
7701 public TextInput WithFallback(IUnion<CardElement, FallbackElement> value)
7702 {
7703 this.Fallback = value;
7704 return this;
7705 }
7706}
7707
7708/// <summary>
7709/// An input to allow the user to select a date.
7710/// </summary>
7711public class DateInput : CardElement
7712{
7713 /// <summary>
7714 /// Deserializes a JSON string into an object of type DateInput.
7715 /// </summary>
7716 public static DateInput? Deserialize(string json)
7717 {
7718 return JsonSerializer.Deserialize<DateInput>(json);
7719 }
7720
7721 /// <summary>
7722 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
7723 /// </summary>
7724 [JsonPropertyName("key")]
7725 public string? Key { get; set; }
7726
7727 /// <summary>
7728 /// Must be **Input.Date**.
7729 /// </summary>
7730 [JsonPropertyName("type")]
7731 public string Type { get; } = "Input.Date";
7732
7733 /// <summary>
7734 /// 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.
7735 /// </summary>
7736 [JsonPropertyName("id")]
7737 public string? Id { get; set; }
7738
7739 /// <summary>
7740 /// 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).
7741 /// </summary>
7742 [JsonPropertyName("requires")]
7743 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
7744
7745 /// <summary>
7746 /// The locale associated with the element.
7747 /// </summary>
7748 [JsonPropertyName("lang")]
7749 public string? Lang { get; set; }
7750
7751 /// <summary>
7752 /// Controls the visibility of the element.
7753 /// </summary>
7754 [JsonPropertyName("isVisible")]
7755 public bool? IsVisible { get; set; } = true;
7756
7757 /// <summary>
7758 /// 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.
7759 /// </summary>
7760 [JsonPropertyName("separator")]
7761 public bool? Separator { get; set; } = false;
7762
7763 /// <summary>
7764 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
7765 /// </summary>
7766 [JsonPropertyName("height")]
7767 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
7768
7769 /// <summary>
7770 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
7771 /// </summary>
7772 [JsonPropertyName("spacing")]
7773 public Spacing? Spacing { get; set; } = Spacing.Default;
7774
7775 /// <summary>
7776 /// 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).
7777 /// </summary>
7778 [JsonPropertyName("targetWidth")]
7779 public TargetWidth? TargetWidth { get; set; }
7780
7781 /// <summary>
7782 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
7783 /// </summary>
7784 [JsonPropertyName("isSortKey")]
7785 public bool? IsSortKey { get; set; } = false;
7786
7787 /// <summary>
7788 /// The label of the input.
7789 ///
7790 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
7791 /// </summary>
7792 [JsonPropertyName("label")]
7793 public string? Label { get; set; }
7794
7795 /// <summary>
7796 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7797 /// </summary>
7798 [JsonPropertyName("isRequired")]
7799 public bool? IsRequired { get; set; } = false;
7800
7801 /// <summary>
7802 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
7803 /// </summary>
7804 [JsonPropertyName("errorMessage")]
7805 public string? ErrorMessage { get; set; }
7806
7807 /// <summary>
7808 /// An Action.ResetInputs action that will be executed when the value of the input changes.
7809 /// </summary>
7810 [JsonPropertyName("valueChangedAction")]
7811 public Action? ValueChangedAction { get; set; }
7812
7813 /// <summary>
7814 /// The default value of the input, in the `YYYY-MM-DD` format.
7815 /// </summary>
7816 [JsonPropertyName("value")]
7817 public string? Value { get; set; }
7818
7819 /// <summary>
7820 /// The text to display as a placeholder when the user has not selected a date.
7821 /// </summary>
7822 [JsonPropertyName("placeholder")]
7823 public string? Placeholder { get; set; }
7824
7825 /// <summary>
7826 /// The minimum date that can be selected.
7827 /// </summary>
7828 [JsonPropertyName("min")]
7829 public string? Min { get; set; }
7830
7831 /// <summary>
7832 /// The maximum date that can be selected.
7833 /// </summary>
7834 [JsonPropertyName("max")]
7835 public string? Max { get; set; }
7836
7837 /// <summary>
7838 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
7839 /// </summary>
7840 [JsonPropertyName("grid.area")]
7841 public string? GridArea { get; set; }
7842
7843 /// <summary>
7844 /// 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.
7845 /// </summary>
7846 [JsonPropertyName("fallback")]
7847 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
7848
7849 /// <summary>
7850 /// Serializes this DateInput into a JSON string.
7851 /// </summary>
7852 public string Serialize()
7853 {
7854 return JsonSerializer.Serialize(
7855 this,
7856 new JsonSerializerOptions
7857 {
7858 WriteIndented = true,
7859 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
7860 }
7861 );
7862 }
7863
7864 public DateInput WithKey(string value)
7865 {
7866 this.Key = value;
7867 return this;
7868 }
7869
7870 public DateInput WithId(string value)
7871 {
7872 this.Id = value;
7873 return this;
7874 }
7875
7876 public DateInput WithRequires(HostCapabilities value)
7877 {
7878 this.Requires = value;
7879 return this;
7880 }
7881
7882 public DateInput WithLang(string value)
7883 {
7884 this.Lang = value;
7885 return this;
7886 }
7887
7888 public DateInput WithIsVisible(bool value)
7889 {
7890 this.IsVisible = value;
7891 return this;
7892 }
7893
7894 public DateInput WithSeparator(bool value)
7895 {
7896 this.Separator = value;
7897 return this;
7898 }
7899
7900 public DateInput WithHeight(ElementHeight value)
7901 {
7902 this.Height = value;
7903 return this;
7904 }
7905
7906 public DateInput WithSpacing(Spacing value)
7907 {
7908 this.Spacing = value;
7909 return this;
7910 }
7911
7912 public DateInput WithTargetWidth(TargetWidth value)
7913 {
7914 this.TargetWidth = value;
7915 return this;
7916 }
7917
7918 public DateInput WithIsSortKey(bool value)
7919 {
7920 this.IsSortKey = value;
7921 return this;
7922 }
7923
7924 public DateInput WithLabel(string value)
7925 {
7926 this.Label = value;
7927 return this;
7928 }
7929
7930 public DateInput WithIsRequired(bool value)
7931 {
7932 this.IsRequired = value;
7933 return this;
7934 }
7935
7936 public DateInput WithErrorMessage(string value)
7937 {
7938 this.ErrorMessage = value;
7939 return this;
7940 }
7941
7942 public DateInput WithValueChangedAction(Action value)
7943 {
7944 this.ValueChangedAction = value;
7945 return this;
7946 }
7947
7948 public DateInput WithValue(string value)
7949 {
7950 this.Value = value;
7951 return this;
7952 }
7953
7954 public DateInput WithPlaceholder(string value)
7955 {
7956 this.Placeholder = value;
7957 return this;
7958 }
7959
7960 public DateInput WithMin(string value)
7961 {
7962 this.Min = value;
7963 return this;
7964 }
7965
7966 public DateInput WithMax(string value)
7967 {
7968 this.Max = value;
7969 return this;
7970 }
7971
7972 public DateInput WithGridArea(string value)
7973 {
7974 this.GridArea = value;
7975 return this;
7976 }
7977
7978 public DateInput WithFallback(IUnion<CardElement, FallbackElement> value)
7979 {
7980 this.Fallback = value;
7981 return this;
7982 }
7983}
7984
7985/// <summary>
7986/// An input to allow the user to select a time.
7987/// </summary>
7988public class TimeInput : CardElement
7989{
7990 /// <summary>
7991 /// Deserializes a JSON string into an object of type TimeInput.
7992 /// </summary>
7993 public static TimeInput? Deserialize(string json)
7994 {
7995 return JsonSerializer.Deserialize<TimeInput>(json);
7996 }
7997
7998 /// <summary>
7999 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
8000 /// </summary>
8001 [JsonPropertyName("key")]
8002 public string? Key { get; set; }
8003
8004 /// <summary>
8005 /// Must be **Input.Time**.
8006 /// </summary>
8007 [JsonPropertyName("type")]
8008 public string Type { get; } = "Input.Time";
8009
8010 /// <summary>
8011 /// 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.
8012 /// </summary>
8013 [JsonPropertyName("id")]
8014 public string? Id { get; set; }
8015
8016 /// <summary>
8017 /// 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).
8018 /// </summary>
8019 [JsonPropertyName("requires")]
8020 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
8021
8022 /// <summary>
8023 /// The locale associated with the element.
8024 /// </summary>
8025 [JsonPropertyName("lang")]
8026 public string? Lang { get; set; }
8027
8028 /// <summary>
8029 /// Controls the visibility of the element.
8030 /// </summary>
8031 [JsonPropertyName("isVisible")]
8032 public bool? IsVisible { get; set; } = true;
8033
8034 /// <summary>
8035 /// 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.
8036 /// </summary>
8037 [JsonPropertyName("separator")]
8038 public bool? Separator { get; set; } = false;
8039
8040 /// <summary>
8041 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8042 /// </summary>
8043 [JsonPropertyName("height")]
8044 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
8045
8046 /// <summary>
8047 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8048 /// </summary>
8049 [JsonPropertyName("spacing")]
8050 public Spacing? Spacing { get; set; } = Spacing.Default;
8051
8052 /// <summary>
8053 /// 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).
8054 /// </summary>
8055 [JsonPropertyName("targetWidth")]
8056 public TargetWidth? TargetWidth { get; set; }
8057
8058 /// <summary>
8059 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8060 /// </summary>
8061 [JsonPropertyName("isSortKey")]
8062 public bool? IsSortKey { get; set; } = false;
8063
8064 /// <summary>
8065 /// The label of the input.
8066 ///
8067 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8068 /// </summary>
8069 [JsonPropertyName("label")]
8070 public string? Label { get; set; }
8071
8072 /// <summary>
8073 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8074 /// </summary>
8075 [JsonPropertyName("isRequired")]
8076 public bool? IsRequired { get; set; } = false;
8077
8078 /// <summary>
8079 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8080 /// </summary>
8081 [JsonPropertyName("errorMessage")]
8082 public string? ErrorMessage { get; set; }
8083
8084 /// <summary>
8085 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8086 /// </summary>
8087 [JsonPropertyName("valueChangedAction")]
8088 public Action? ValueChangedAction { get; set; }
8089
8090 /// <summary>
8091 /// The default value of the input, in the `HH:MM` format.
8092 /// </summary>
8093 [JsonPropertyName("value")]
8094 public string? Value { get; set; }
8095
8096 /// <summary>
8097 /// The text to display as a placeholder when the user hasn't entered a value.
8098 /// </summary>
8099 [JsonPropertyName("placeholder")]
8100 public string? Placeholder { get; set; }
8101
8102 /// <summary>
8103 /// The minimum time that can be selected, in the `HH:MM` format.
8104 /// </summary>
8105 [JsonPropertyName("min")]
8106 public string? Min { get; set; }
8107
8108 /// <summary>
8109 /// The maximum time that can be selected, in the `HH:MM` format.
8110 /// </summary>
8111 [JsonPropertyName("max")]
8112 public string? Max { get; set; }
8113
8114 /// <summary>
8115 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8116 /// </summary>
8117 [JsonPropertyName("grid.area")]
8118 public string? GridArea { get; set; }
8119
8120 /// <summary>
8121 /// 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.
8122 /// </summary>
8123 [JsonPropertyName("fallback")]
8124 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8125
8126 /// <summary>
8127 /// Serializes this TimeInput into a JSON string.
8128 /// </summary>
8129 public string Serialize()
8130 {
8131 return JsonSerializer.Serialize(
8132 this,
8133 new JsonSerializerOptions
8134 {
8135 WriteIndented = true,
8136 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8137 }
8138 );
8139 }
8140
8141 public TimeInput WithKey(string value)
8142 {
8143 this.Key = value;
8144 return this;
8145 }
8146
8147 public TimeInput WithId(string value)
8148 {
8149 this.Id = value;
8150 return this;
8151 }
8152
8153 public TimeInput WithRequires(HostCapabilities value)
8154 {
8155 this.Requires = value;
8156 return this;
8157 }
8158
8159 public TimeInput WithLang(string value)
8160 {
8161 this.Lang = value;
8162 return this;
8163 }
8164
8165 public TimeInput WithIsVisible(bool value)
8166 {
8167 this.IsVisible = value;
8168 return this;
8169 }
8170
8171 public TimeInput WithSeparator(bool value)
8172 {
8173 this.Separator = value;
8174 return this;
8175 }
8176
8177 public TimeInput WithHeight(ElementHeight value)
8178 {
8179 this.Height = value;
8180 return this;
8181 }
8182
8183 public TimeInput WithSpacing(Spacing value)
8184 {
8185 this.Spacing = value;
8186 return this;
8187 }
8188
8189 public TimeInput WithTargetWidth(TargetWidth value)
8190 {
8191 this.TargetWidth = value;
8192 return this;
8193 }
8194
8195 public TimeInput WithIsSortKey(bool value)
8196 {
8197 this.IsSortKey = value;
8198 return this;
8199 }
8200
8201 public TimeInput WithLabel(string value)
8202 {
8203 this.Label = value;
8204 return this;
8205 }
8206
8207 public TimeInput WithIsRequired(bool value)
8208 {
8209 this.IsRequired = value;
8210 return this;
8211 }
8212
8213 public TimeInput WithErrorMessage(string value)
8214 {
8215 this.ErrorMessage = value;
8216 return this;
8217 }
8218
8219 public TimeInput WithValueChangedAction(Action value)
8220 {
8221 this.ValueChangedAction = value;
8222 return this;
8223 }
8224
8225 public TimeInput WithValue(string value)
8226 {
8227 this.Value = value;
8228 return this;
8229 }
8230
8231 public TimeInput WithPlaceholder(string value)
8232 {
8233 this.Placeholder = value;
8234 return this;
8235 }
8236
8237 public TimeInput WithMin(string value)
8238 {
8239 this.Min = value;
8240 return this;
8241 }
8242
8243 public TimeInput WithMax(string value)
8244 {
8245 this.Max = value;
8246 return this;
8247 }
8248
8249 public TimeInput WithGridArea(string value)
8250 {
8251 this.GridArea = value;
8252 return this;
8253 }
8254
8255 public TimeInput WithFallback(IUnion<CardElement, FallbackElement> value)
8256 {
8257 this.Fallback = value;
8258 return this;
8259 }
8260}
8261
8262/// <summary>
8263/// An input to allow the user to enter a number.
8264/// </summary>
8265public class NumberInput : CardElement
8266{
8267 /// <summary>
8268 /// Deserializes a JSON string into an object of type NumberInput.
8269 /// </summary>
8270 public static NumberInput? Deserialize(string json)
8271 {
8272 return JsonSerializer.Deserialize<NumberInput>(json);
8273 }
8274
8275 /// <summary>
8276 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
8277 /// </summary>
8278 [JsonPropertyName("key")]
8279 public string? Key { get; set; }
8280
8281 /// <summary>
8282 /// Must be **Input.Number**.
8283 /// </summary>
8284 [JsonPropertyName("type")]
8285 public string Type { get; } = "Input.Number";
8286
8287 /// <summary>
8288 /// 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.
8289 /// </summary>
8290 [JsonPropertyName("id")]
8291 public string? Id { get; set; }
8292
8293 /// <summary>
8294 /// 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).
8295 /// </summary>
8296 [JsonPropertyName("requires")]
8297 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
8298
8299 /// <summary>
8300 /// The locale associated with the element.
8301 /// </summary>
8302 [JsonPropertyName("lang")]
8303 public string? Lang { get; set; }
8304
8305 /// <summary>
8306 /// Controls the visibility of the element.
8307 /// </summary>
8308 [JsonPropertyName("isVisible")]
8309 public bool? IsVisible { get; set; } = true;
8310
8311 /// <summary>
8312 /// 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.
8313 /// </summary>
8314 [JsonPropertyName("separator")]
8315 public bool? Separator { get; set; } = false;
8316
8317 /// <summary>
8318 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8319 /// </summary>
8320 [JsonPropertyName("height")]
8321 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
8322
8323 /// <summary>
8324 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8325 /// </summary>
8326 [JsonPropertyName("spacing")]
8327 public Spacing? Spacing { get; set; } = Spacing.Default;
8328
8329 /// <summary>
8330 /// 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).
8331 /// </summary>
8332 [JsonPropertyName("targetWidth")]
8333 public TargetWidth? TargetWidth { get; set; }
8334
8335 /// <summary>
8336 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8337 /// </summary>
8338 [JsonPropertyName("isSortKey")]
8339 public bool? IsSortKey { get; set; } = false;
8340
8341 /// <summary>
8342 /// The label of the input.
8343 ///
8344 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8345 /// </summary>
8346 [JsonPropertyName("label")]
8347 public string? Label { get; set; }
8348
8349 /// <summary>
8350 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8351 /// </summary>
8352 [JsonPropertyName("isRequired")]
8353 public bool? IsRequired { get; set; } = false;
8354
8355 /// <summary>
8356 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8357 /// </summary>
8358 [JsonPropertyName("errorMessage")]
8359 public string? ErrorMessage { get; set; }
8360
8361 /// <summary>
8362 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8363 /// </summary>
8364 [JsonPropertyName("valueChangedAction")]
8365 public Action? ValueChangedAction { get; set; }
8366
8367 /// <summary>
8368 /// The default value of the input.
8369 /// </summary>
8370 [JsonPropertyName("value")]
8371 public float? Value { get; set; }
8372
8373 /// <summary>
8374 /// The text to display as a placeholder when the user hasn't entered a value.
8375 /// </summary>
8376 [JsonPropertyName("placeholder")]
8377 public string? Placeholder { get; set; }
8378
8379 /// <summary>
8380 /// The minimum value that can be entered.
8381 /// </summary>
8382 [JsonPropertyName("min")]
8383 public float? Min { get; set; }
8384
8385 /// <summary>
8386 /// The maximum value that can be entered.
8387 /// </summary>
8388 [JsonPropertyName("max")]
8389 public float? Max { get; set; }
8390
8391 /// <summary>
8392 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8393 /// </summary>
8394 [JsonPropertyName("grid.area")]
8395 public string? GridArea { get; set; }
8396
8397 /// <summary>
8398 /// 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.
8399 /// </summary>
8400 [JsonPropertyName("fallback")]
8401 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8402
8403 /// <summary>
8404 /// Serializes this NumberInput into a JSON string.
8405 /// </summary>
8406 public string Serialize()
8407 {
8408 return JsonSerializer.Serialize(
8409 this,
8410 new JsonSerializerOptions
8411 {
8412 WriteIndented = true,
8413 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8414 }
8415 );
8416 }
8417
8418 public NumberInput WithKey(string value)
8419 {
8420 this.Key = value;
8421 return this;
8422 }
8423
8424 public NumberInput WithId(string value)
8425 {
8426 this.Id = value;
8427 return this;
8428 }
8429
8430 public NumberInput WithRequires(HostCapabilities value)
8431 {
8432 this.Requires = value;
8433 return this;
8434 }
8435
8436 public NumberInput WithLang(string value)
8437 {
8438 this.Lang = value;
8439 return this;
8440 }
8441
8442 public NumberInput WithIsVisible(bool value)
8443 {
8444 this.IsVisible = value;
8445 return this;
8446 }
8447
8448 public NumberInput WithSeparator(bool value)
8449 {
8450 this.Separator = value;
8451 return this;
8452 }
8453
8454 public NumberInput WithHeight(ElementHeight value)
8455 {
8456 this.Height = value;
8457 return this;
8458 }
8459
8460 public NumberInput WithSpacing(Spacing value)
8461 {
8462 this.Spacing = value;
8463 return this;
8464 }
8465
8466 public NumberInput WithTargetWidth(TargetWidth value)
8467 {
8468 this.TargetWidth = value;
8469 return this;
8470 }
8471
8472 public NumberInput WithIsSortKey(bool value)
8473 {
8474 this.IsSortKey = value;
8475 return this;
8476 }
8477
8478 public NumberInput WithLabel(string value)
8479 {
8480 this.Label = value;
8481 return this;
8482 }
8483
8484 public NumberInput WithIsRequired(bool value)
8485 {
8486 this.IsRequired = value;
8487 return this;
8488 }
8489
8490 public NumberInput WithErrorMessage(string value)
8491 {
8492 this.ErrorMessage = value;
8493 return this;
8494 }
8495
8496 public NumberInput WithValueChangedAction(Action value)
8497 {
8498 this.ValueChangedAction = value;
8499 return this;
8500 }
8501
8502 public NumberInput WithValue(float value)
8503 {
8504 this.Value = value;
8505 return this;
8506 }
8507
8508 public NumberInput WithPlaceholder(string value)
8509 {
8510 this.Placeholder = value;
8511 return this;
8512 }
8513
8514 public NumberInput WithMin(float value)
8515 {
8516 this.Min = value;
8517 return this;
8518 }
8519
8520 public NumberInput WithMax(float value)
8521 {
8522 this.Max = value;
8523 return this;
8524 }
8525
8526 public NumberInput WithGridArea(string value)
8527 {
8528 this.GridArea = value;
8529 return this;
8530 }
8531
8532 public NumberInput WithFallback(IUnion<CardElement, FallbackElement> value)
8533 {
8534 this.Fallback = value;
8535 return this;
8536 }
8537}
8538
8539/// <summary>
8540/// An input to allow the user to select between on/off states.
8541/// </summary>
8542public class ToggleInput : CardElement
8543{
8544 /// <summary>
8545 /// Deserializes a JSON string into an object of type ToggleInput.
8546 /// </summary>
8547 public static ToggleInput? Deserialize(string json)
8548 {
8549 return JsonSerializer.Deserialize<ToggleInput>(json);
8550 }
8551
8552 /// <summary>
8553 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
8554 /// </summary>
8555 [JsonPropertyName("key")]
8556 public string? Key { get; set; }
8557
8558 /// <summary>
8559 /// Must be **Input.Toggle**.
8560 /// </summary>
8561 [JsonPropertyName("type")]
8562 public string Type { get; } = "Input.Toggle";
8563
8564 /// <summary>
8565 /// 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.
8566 /// </summary>
8567 [JsonPropertyName("id")]
8568 public string? Id { get; set; }
8569
8570 /// <summary>
8571 /// 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).
8572 /// </summary>
8573 [JsonPropertyName("requires")]
8574 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
8575
8576 /// <summary>
8577 /// The locale associated with the element.
8578 /// </summary>
8579 [JsonPropertyName("lang")]
8580 public string? Lang { get; set; }
8581
8582 /// <summary>
8583 /// Controls the visibility of the element.
8584 /// </summary>
8585 [JsonPropertyName("isVisible")]
8586 public bool? IsVisible { get; set; } = true;
8587
8588 /// <summary>
8589 /// 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.
8590 /// </summary>
8591 [JsonPropertyName("separator")]
8592 public bool? Separator { get; set; } = false;
8593
8594 /// <summary>
8595 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8596 /// </summary>
8597 [JsonPropertyName("height")]
8598 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
8599
8600 /// <summary>
8601 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8602 /// </summary>
8603 [JsonPropertyName("spacing")]
8604 public Spacing? Spacing { get; set; } = Spacing.Default;
8605
8606 /// <summary>
8607 /// 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).
8608 /// </summary>
8609 [JsonPropertyName("targetWidth")]
8610 public TargetWidth? TargetWidth { get; set; }
8611
8612 /// <summary>
8613 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8614 /// </summary>
8615 [JsonPropertyName("isSortKey")]
8616 public bool? IsSortKey { get; set; } = false;
8617
8618 /// <summary>
8619 /// The label of the input.
8620 ///
8621 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8622 /// </summary>
8623 [JsonPropertyName("label")]
8624 public string? Label { get; set; }
8625
8626 /// <summary>
8627 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8628 /// </summary>
8629 [JsonPropertyName("isRequired")]
8630 public bool? IsRequired { get; set; } = false;
8631
8632 /// <summary>
8633 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8634 /// </summary>
8635 [JsonPropertyName("errorMessage")]
8636 public string? ErrorMessage { get; set; }
8637
8638 /// <summary>
8639 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8640 /// </summary>
8641 [JsonPropertyName("valueChangedAction")]
8642 public Action? ValueChangedAction { get; set; }
8643
8644 /// <summary>
8645 /// The default value of the input.
8646 /// </summary>
8647 [JsonPropertyName("value")]
8648 public string? Value { get; set; } = "false";
8649
8650 /// <summary>
8651 /// The title (caption) to display next to the toggle.
8652 /// </summary>
8653 [JsonPropertyName("title")]
8654 public string? Title { get; set; }
8655
8656 /// <summary>
8657 /// The value to send to the Bot when the toggle is on.
8658 /// </summary>
8659 [JsonPropertyName("valueOn")]
8660 public string? ValueOn { get; set; } = "true";
8661
8662 /// <summary>
8663 /// The value to send to the Bot when the toggle is off.
8664 /// </summary>
8665 [JsonPropertyName("valueOff")]
8666 public string? ValueOff { get; set; } = "false";
8667
8668 /// <summary>
8669 /// Controls if the title should wrap.
8670 /// </summary>
8671 [JsonPropertyName("wrap")]
8672 public bool? Wrap { get; set; } = true;
8673
8674 /// <summary>
8675 /// Controls whether the title is visually displayed. When set to false, the title is hidden from view but remains accessible to screen readers for accessibility purposes.
8676 /// </summary>
8677 [JsonPropertyName("showTitle")]
8678 public bool? ShowTitle { get; set; } = true;
8679
8680 /// <summary>
8681 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
8682 /// </summary>
8683 [JsonPropertyName("grid.area")]
8684 public string? GridArea { get; set; }
8685
8686 /// <summary>
8687 /// 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.
8688 /// </summary>
8689 [JsonPropertyName("fallback")]
8690 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
8691
8692 public ToggleInput() { }
8693
8694 public ToggleInput(string title)
8695 {
8696 this.Title = title;
8697 }
8698
8699 /// <summary>
8700 /// Serializes this ToggleInput into a JSON string.
8701 /// </summary>
8702 public string Serialize()
8703 {
8704 return JsonSerializer.Serialize(
8705 this,
8706 new JsonSerializerOptions
8707 {
8708 WriteIndented = true,
8709 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
8710 }
8711 );
8712 }
8713
8714 public ToggleInput WithKey(string value)
8715 {
8716 this.Key = value;
8717 return this;
8718 }
8719
8720 public ToggleInput WithId(string value)
8721 {
8722 this.Id = value;
8723 return this;
8724 }
8725
8726 public ToggleInput WithRequires(HostCapabilities value)
8727 {
8728 this.Requires = value;
8729 return this;
8730 }
8731
8732 public ToggleInput WithLang(string value)
8733 {
8734 this.Lang = value;
8735 return this;
8736 }
8737
8738 public ToggleInput WithIsVisible(bool value)
8739 {
8740 this.IsVisible = value;
8741 return this;
8742 }
8743
8744 public ToggleInput WithSeparator(bool value)
8745 {
8746 this.Separator = value;
8747 return this;
8748 }
8749
8750 public ToggleInput WithHeight(ElementHeight value)
8751 {
8752 this.Height = value;
8753 return this;
8754 }
8755
8756 public ToggleInput WithSpacing(Spacing value)
8757 {
8758 this.Spacing = value;
8759 return this;
8760 }
8761
8762 public ToggleInput WithTargetWidth(TargetWidth value)
8763 {
8764 this.TargetWidth = value;
8765 return this;
8766 }
8767
8768 public ToggleInput WithIsSortKey(bool value)
8769 {
8770 this.IsSortKey = value;
8771 return this;
8772 }
8773
8774 public ToggleInput WithLabel(string value)
8775 {
8776 this.Label = value;
8777 return this;
8778 }
8779
8780 public ToggleInput WithIsRequired(bool value)
8781 {
8782 this.IsRequired = value;
8783 return this;
8784 }
8785
8786 public ToggleInput WithErrorMessage(string value)
8787 {
8788 this.ErrorMessage = value;
8789 return this;
8790 }
8791
8792 public ToggleInput WithValueChangedAction(Action value)
8793 {
8794 this.ValueChangedAction = value;
8795 return this;
8796 }
8797
8798 public ToggleInput WithValue(string value)
8799 {
8800 this.Value = value;
8801 return this;
8802 }
8803
8804 public ToggleInput WithTitle(string value)
8805 {
8806 this.Title = value;
8807 return this;
8808 }
8809
8810 public ToggleInput WithValueOn(string value)
8811 {
8812 this.ValueOn = value;
8813 return this;
8814 }
8815
8816 public ToggleInput WithValueOff(string value)
8817 {
8818 this.ValueOff = value;
8819 return this;
8820 }
8821
8822 public ToggleInput WithWrap(bool value)
8823 {
8824 this.Wrap = value;
8825 return this;
8826 }
8827
8828 public ToggleInput WithShowTitle(bool value)
8829 {
8830 this.ShowTitle = value;
8831 return this;
8832 }
8833
8834 public ToggleInput WithGridArea(string value)
8835 {
8836 this.GridArea = value;
8837 return this;
8838 }
8839
8840 public ToggleInput WithFallback(IUnion<CardElement, FallbackElement> value)
8841 {
8842 this.Fallback = value;
8843 return this;
8844 }
8845}
8846
8847/// <summary>
8848/// An input to allow the user to select one or more values.
8849/// </summary>
8850public class ChoiceSetInput : CardElement
8851{
8852 /// <summary>
8853 /// Deserializes a JSON string into an object of type ChoiceSetInput.
8854 /// </summary>
8855 public static ChoiceSetInput? Deserialize(string json)
8856 {
8857 return JsonSerializer.Deserialize<ChoiceSetInput>(json);
8858 }
8859
8860 /// <summary>
8861 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
8862 /// </summary>
8863 [JsonPropertyName("key")]
8864 public string? Key { get; set; }
8865
8866 /// <summary>
8867 /// Must be **Input.ChoiceSet**.
8868 /// </summary>
8869 [JsonPropertyName("type")]
8870 public string Type { get; } = "Input.ChoiceSet";
8871
8872 /// <summary>
8873 /// 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.
8874 /// </summary>
8875 [JsonPropertyName("id")]
8876 public string? Id { get; set; }
8877
8878 /// <summary>
8879 /// 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).
8880 /// </summary>
8881 [JsonPropertyName("requires")]
8882 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
8883
8884 /// <summary>
8885 /// The locale associated with the element.
8886 /// </summary>
8887 [JsonPropertyName("lang")]
8888 public string? Lang { get; set; }
8889
8890 /// <summary>
8891 /// Controls the visibility of the element.
8892 /// </summary>
8893 [JsonPropertyName("isVisible")]
8894 public bool? IsVisible { get; set; } = true;
8895
8896 /// <summary>
8897 /// 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.
8898 /// </summary>
8899 [JsonPropertyName("separator")]
8900 public bool? Separator { get; set; } = false;
8901
8902 /// <summary>
8903 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
8904 /// </summary>
8905 [JsonPropertyName("height")]
8906 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
8907
8908 /// <summary>
8909 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
8910 /// </summary>
8911 [JsonPropertyName("spacing")]
8912 public Spacing? Spacing { get; set; } = Spacing.Default;
8913
8914 /// <summary>
8915 /// 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).
8916 /// </summary>
8917 [JsonPropertyName("targetWidth")]
8918 public TargetWidth? TargetWidth { get; set; }
8919
8920 /// <summary>
8921 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
8922 /// </summary>
8923 [JsonPropertyName("isSortKey")]
8924 public bool? IsSortKey { get; set; } = false;
8925
8926 /// <summary>
8927 /// The label of the input.
8928 ///
8929 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
8930 /// </summary>
8931 [JsonPropertyName("label")]
8932 public string? Label { get; set; }
8933
8934 /// <summary>
8935 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8936 /// </summary>
8937 [JsonPropertyName("isRequired")]
8938 public bool? IsRequired { get; set; } = false;
8939
8940 /// <summary>
8941 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
8942 /// </summary>
8943 [JsonPropertyName("errorMessage")]
8944 public string? ErrorMessage { get; set; }
8945
8946 /// <summary>
8947 /// An Action.ResetInputs action that will be executed when the value of the input changes.
8948 /// </summary>
8949 [JsonPropertyName("valueChangedAction")]
8950 public Action? ValueChangedAction { get; set; }
8951
8952 /// <summary>
8953 /// The default value of the input.
8954 /// </summary>
8955 [JsonPropertyName("value")]
8956 public string? Value { get; set; }
8957
8958 /// <summary>
8959 /// The choices associated with the input.
8960 /// </summary>
8961 [JsonPropertyName("choices")]
8962 public IList<Choice>? Choices { get; set; }
8963
8964 /// <summary>
8965 /// A Data.Query object that defines the dataset from which to dynamically fetch the choices for the input.
8966 /// </summary>
8967 [JsonPropertyName("choices.data")]
8968 public QueryData? ChoicesData { get; set; }
8969
8970 /// <summary>
8971 /// Controls whether the input should be displayed as a dropdown (compact) or a list of radio buttons or checkboxes (expanded).
8972 /// </summary>
8973 [JsonPropertyName("style")]
8974 public ChoiceSetInputStyle? Style { get; set; } = ChoiceSetInputStyle.Compact;
8975
8976 /// <summary>
8977 /// Controls whether multiple choices can be selected.
8978 /// </summary>
8979 [JsonPropertyName("isMultiSelect")]
8980 public bool? IsMultiSelect { get; set; } = false;
8981
8982 /// <summary>
8983 /// The text to display as a placeholder when the user has not entered any value.
8984 /// </summary>
8985 [JsonPropertyName("placeholder")]
8986 public string? Placeholder { get; set; }
8987
8988 /// <summary>
8989 /// Controls if choice titles should wrap.
8990 /// </summary>
8991 [JsonPropertyName("wrap")]
8992 public bool? Wrap { get; set; } = true;
8993
8994 /// <summary>
8995 /// Controls whether choice items are arranged in multiple columns in expanded mode, or in a single column. Default is false.
8996 /// </summary>
8997 [JsonPropertyName("useMultipleColumns")]
8998 public bool? UseMultipleColumns { get; set; } = false;
8999
9000 /// <summary>
9001 /// 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.
9002 /// </summary>
9003 [JsonPropertyName("minColumnWidth")]
9004 public string? MinColumnWidth { get; set; }
9005
9006 /// <summary>
9007 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9008 /// </summary>
9009 [JsonPropertyName("grid.area")]
9010 public string? GridArea { get; set; }
9011
9012 /// <summary>
9013 /// 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.
9014 /// </summary>
9015 [JsonPropertyName("fallback")]
9016 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9017
9018 public ChoiceSetInput() { }
9019
9020 public ChoiceSetInput(params Choice[] choices)
9021 {
9022 this.Choices = new List<Choice>(choices);
9023 }
9024
9025 public ChoiceSetInput(IList<Choice> choices)
9026 {
9027 this.Choices = choices;
9028 }
9029
9030 /// <summary>
9031 /// Serializes this ChoiceSetInput into a JSON string.
9032 /// </summary>
9033 public string Serialize()
9034 {
9035 return JsonSerializer.Serialize(
9036 this,
9037 new JsonSerializerOptions
9038 {
9039 WriteIndented = true,
9040 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9041 }
9042 );
9043 }
9044
9045 public ChoiceSetInput WithKey(string value)
9046 {
9047 this.Key = value;
9048 return this;
9049 }
9050
9051 public ChoiceSetInput WithId(string value)
9052 {
9053 this.Id = value;
9054 return this;
9055 }
9056
9057 public ChoiceSetInput WithRequires(HostCapabilities value)
9058 {
9059 this.Requires = value;
9060 return this;
9061 }
9062
9063 public ChoiceSetInput WithLang(string value)
9064 {
9065 this.Lang = value;
9066 return this;
9067 }
9068
9069 public ChoiceSetInput WithIsVisible(bool value)
9070 {
9071 this.IsVisible = value;
9072 return this;
9073 }
9074
9075 public ChoiceSetInput WithSeparator(bool value)
9076 {
9077 this.Separator = value;
9078 return this;
9079 }
9080
9081 public ChoiceSetInput WithHeight(ElementHeight value)
9082 {
9083 this.Height = value;
9084 return this;
9085 }
9086
9087 public ChoiceSetInput WithSpacing(Spacing value)
9088 {
9089 this.Spacing = value;
9090 return this;
9091 }
9092
9093 public ChoiceSetInput WithTargetWidth(TargetWidth value)
9094 {
9095 this.TargetWidth = value;
9096 return this;
9097 }
9098
9099 public ChoiceSetInput WithIsSortKey(bool value)
9100 {
9101 this.IsSortKey = value;
9102 return this;
9103 }
9104
9105 public ChoiceSetInput WithLabel(string value)
9106 {
9107 this.Label = value;
9108 return this;
9109 }
9110
9111 public ChoiceSetInput WithIsRequired(bool value)
9112 {
9113 this.IsRequired = value;
9114 return this;
9115 }
9116
9117 public ChoiceSetInput WithErrorMessage(string value)
9118 {
9119 this.ErrorMessage = value;
9120 return this;
9121 }
9122
9123 public ChoiceSetInput WithValueChangedAction(Action value)
9124 {
9125 this.ValueChangedAction = value;
9126 return this;
9127 }
9128
9129 public ChoiceSetInput WithValue(string value)
9130 {
9131 this.Value = value;
9132 return this;
9133 }
9134
9135 public ChoiceSetInput WithChoices(params Choice[] value)
9136 {
9137 this.Choices = new List<Choice>(value);
9138 return this;
9139 }
9140
9141 public ChoiceSetInput WithChoices(IList<Choice> value)
9142 {
9143 this.Choices = value;
9144 return this;
9145 }
9146
9147 public ChoiceSetInput WithChoicesData(QueryData value)
9148 {
9149 this.ChoicesData = value;
9150 return this;
9151 }
9152
9153 public ChoiceSetInput WithStyle(ChoiceSetInputStyle value)
9154 {
9155 this.Style = value;
9156 return this;
9157 }
9158
9159 public ChoiceSetInput WithIsMultiSelect(bool value)
9160 {
9161 this.IsMultiSelect = value;
9162 return this;
9163 }
9164
9165 public ChoiceSetInput WithPlaceholder(string value)
9166 {
9167 this.Placeholder = value;
9168 return this;
9169 }
9170
9171 public ChoiceSetInput WithWrap(bool value)
9172 {
9173 this.Wrap = value;
9174 return this;
9175 }
9176
9177 public ChoiceSetInput WithUseMultipleColumns(bool value)
9178 {
9179 this.UseMultipleColumns = value;
9180 return this;
9181 }
9182
9183 public ChoiceSetInput WithMinColumnWidth(string value)
9184 {
9185 this.MinColumnWidth = value;
9186 return this;
9187 }
9188
9189 public ChoiceSetInput WithGridArea(string value)
9190 {
9191 this.GridArea = value;
9192 return this;
9193 }
9194
9195 public ChoiceSetInput WithFallback(IUnion<CardElement, FallbackElement> value)
9196 {
9197 this.Fallback = value;
9198 return this;
9199 }
9200}
9201
9202/// <summary>
9203/// A choice as used by the Input.ChoiceSet input.
9204/// </summary>
9205public class Choice : SerializableObject
9206{
9207 /// <summary>
9208 /// Deserializes a JSON string into an object of type Choice.
9209 /// </summary>
9210 public static Choice? Deserialize(string json)
9211 {
9212 return JsonSerializer.Deserialize<Choice>(json);
9213 }
9214
9215 /// <summary>
9216 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
9217 /// </summary>
9218 [JsonPropertyName("key")]
9219 public string? Key { get; set; }
9220
9221 /// <summary>
9222 /// The text to display for the choice.
9223 /// </summary>
9224 [JsonPropertyName("title")]
9225 public string? Title { get; set; }
9226
9227 /// <summary>
9228 /// The value associated with the choice, as sent to the Bot when an Action.Submit or Action.Execute is invoked
9229 /// </summary>
9230 [JsonPropertyName("value")]
9231 public string? Value { get; set; }
9232
9233 /// <summary>
9234 /// Serializes this Choice into a JSON string.
9235 /// </summary>
9236 public string Serialize()
9237 {
9238 return JsonSerializer.Serialize(
9239 this,
9240 new JsonSerializerOptions
9241 {
9242 WriteIndented = true,
9243 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9244 }
9245 );
9246 }
9247
9248 public Choice WithKey(string value)
9249 {
9250 this.Key = value;
9251 return this;
9252 }
9253
9254 public Choice WithTitle(string value)
9255 {
9256 this.Title = value;
9257 return this;
9258 }
9259
9260 public Choice WithValue(string value)
9261 {
9262 this.Value = value;
9263 return this;
9264 }
9265}
9266
9267/// <summary>
9268/// Defines a query to dynamically fetch data from a Bot.
9269/// </summary>
9270public class QueryData : SerializableObject
9271{
9272 /// <summary>
9273 /// Deserializes a JSON string into an object of type QueryData.
9274 /// </summary>
9275 public static QueryData? Deserialize(string json)
9276 {
9277 return JsonSerializer.Deserialize<QueryData>(json);
9278 }
9279
9280 /// <summary>
9281 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
9282 /// </summary>
9283 [JsonPropertyName("key")]
9284 public string? Key { get; set; }
9285
9286 /// <summary>
9287 /// Must be **Data.Query**.
9288 /// </summary>
9289 [JsonPropertyName("type")]
9290 public string Type { get; } = "Data.Query";
9291
9292 /// <summary>
9293 /// The dataset from which to fetch the data.
9294 /// </summary>
9295 [JsonPropertyName("dataset")]
9296 public string? Dataset { get; set; }
9297
9298 /// <summary>
9299 /// 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.
9300 /// </summary>
9301 [JsonPropertyName("associatedInputs")]
9302 public AssociatedInputs? AssociatedInputs { get; set; }
9303
9304 /// <summary>
9305 /// 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.
9306 /// </summary>
9307 [JsonPropertyName("count")]
9308 public float? Count { get; set; }
9309
9310 /// <summary>
9311 /// 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.
9312 /// </summary>
9313 [JsonPropertyName("skip")]
9314 public float? Skip { get; set; }
9315
9316 /// <summary>
9317 /// Serializes this QueryData into a JSON string.
9318 /// </summary>
9319 public string Serialize()
9320 {
9321 return JsonSerializer.Serialize(
9322 this,
9323 new JsonSerializerOptions
9324 {
9325 WriteIndented = true,
9326 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9327 }
9328 );
9329 }
9330
9331 public QueryData WithKey(string value)
9332 {
9333 this.Key = value;
9334 return this;
9335 }
9336
9337 public QueryData WithDataset(string value)
9338 {
9339 this.Dataset = value;
9340 return this;
9341 }
9342
9343 public QueryData WithAssociatedInputs(AssociatedInputs value)
9344 {
9345 this.AssociatedInputs = value;
9346 return this;
9347 }
9348
9349 public QueryData WithCount(float value)
9350 {
9351 this.Count = value;
9352 return this;
9353 }
9354
9355 public QueryData WithSkip(float value)
9356 {
9357 this.Skip = value;
9358 return this;
9359 }
9360}
9361
9362/// <summary>
9363/// An input to allow the user to rate something using stars.
9364/// </summary>
9365public class RatingInput : CardElement
9366{
9367 /// <summary>
9368 /// Deserializes a JSON string into an object of type RatingInput.
9369 /// </summary>
9370 public static RatingInput? Deserialize(string json)
9371 {
9372 return JsonSerializer.Deserialize<RatingInput>(json);
9373 }
9374
9375 /// <summary>
9376 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
9377 /// </summary>
9378 [JsonPropertyName("key")]
9379 public string? Key { get; set; }
9380
9381 /// <summary>
9382 /// Must be **Input.Rating**.
9383 /// </summary>
9384 [JsonPropertyName("type")]
9385 public string Type { get; } = "Input.Rating";
9386
9387 /// <summary>
9388 /// 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.
9389 /// </summary>
9390 [JsonPropertyName("id")]
9391 public string? Id { get; set; }
9392
9393 /// <summary>
9394 /// 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).
9395 /// </summary>
9396 [JsonPropertyName("requires")]
9397 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
9398
9399 /// <summary>
9400 /// The locale associated with the element.
9401 /// </summary>
9402 [JsonPropertyName("lang")]
9403 public string? Lang { get; set; }
9404
9405 /// <summary>
9406 /// Controls the visibility of the element.
9407 /// </summary>
9408 [JsonPropertyName("isVisible")]
9409 public bool? IsVisible { get; set; } = true;
9410
9411 /// <summary>
9412 /// 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.
9413 /// </summary>
9414 [JsonPropertyName("separator")]
9415 public bool? Separator { get; set; } = false;
9416
9417 /// <summary>
9418 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9419 /// </summary>
9420 [JsonPropertyName("height")]
9421 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
9422
9423 /// <summary>
9424 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9425 /// </summary>
9426 [JsonPropertyName("spacing")]
9427 public Spacing? Spacing { get; set; } = Spacing.Default;
9428
9429 /// <summary>
9430 /// 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).
9431 /// </summary>
9432 [JsonPropertyName("targetWidth")]
9433 public TargetWidth? TargetWidth { get; set; }
9434
9435 /// <summary>
9436 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9437 /// </summary>
9438 [JsonPropertyName("isSortKey")]
9439 public bool? IsSortKey { get; set; } = false;
9440
9441 /// <summary>
9442 /// The label of the input.
9443 ///
9444 /// A label should **always** be provided to ensure the best user experience especially for users of assistive technology.
9445 /// </summary>
9446 [JsonPropertyName("label")]
9447 public string? Label { get; set; }
9448
9449 /// <summary>
9450 /// Controls whether the input is required. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
9451 /// </summary>
9452 [JsonPropertyName("isRequired")]
9453 public bool? IsRequired { get; set; } = false;
9454
9455 /// <summary>
9456 /// The error message to display when the input fails validation. See [Input validation](https://adaptivecards.microsoft.com/?topic=input-validation) for more details.
9457 /// </summary>
9458 [JsonPropertyName("errorMessage")]
9459 public string? ErrorMessage { get; set; }
9460
9461 /// <summary>
9462 /// An Action.ResetInputs action that will be executed when the value of the input changes.
9463 /// </summary>
9464 [JsonPropertyName("valueChangedAction")]
9465 public Action? ValueChangedAction { get; set; }
9466
9467 /// <summary>
9468 /// The default value of the input.
9469 /// </summary>
9470 [JsonPropertyName("value")]
9471 public float? Value { get; set; }
9472
9473 /// <summary>
9474 /// The number of stars to display.
9475 /// </summary>
9476 [JsonPropertyName("max")]
9477 public float? Max { get; set; } = 5;
9478
9479 /// <summary>
9480 /// Controls if the user can select half stars.
9481 /// </summary>
9482 [JsonPropertyName("allowHalfSteps")]
9483 public bool? AllowHalfSteps { get; set; } = false;
9484
9485 /// <summary>
9486 /// The size of the stars.
9487 /// </summary>
9488 [JsonPropertyName("size")]
9489 public RatingSize? Size { get; set; } = RatingSize.Large;
9490
9491 /// <summary>
9492 /// The color of the stars.
9493 /// </summary>
9494 [JsonPropertyName("color")]
9495 public RatingColor? Color { get; set; } = RatingColor.Neutral;
9496
9497 /// <summary>
9498 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9499 /// </summary>
9500 [JsonPropertyName("grid.area")]
9501 public string? GridArea { get; set; }
9502
9503 /// <summary>
9504 /// 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.
9505 /// </summary>
9506 [JsonPropertyName("fallback")]
9507 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9508
9509 /// <summary>
9510 /// Serializes this RatingInput into a JSON string.
9511 /// </summary>
9512 public string Serialize()
9513 {
9514 return JsonSerializer.Serialize(
9515 this,
9516 new JsonSerializerOptions
9517 {
9518 WriteIndented = true,
9519 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9520 }
9521 );
9522 }
9523
9524 public RatingInput WithKey(string value)
9525 {
9526 this.Key = value;
9527 return this;
9528 }
9529
9530 public RatingInput WithId(string value)
9531 {
9532 this.Id = value;
9533 return this;
9534 }
9535
9536 public RatingInput WithRequires(HostCapabilities value)
9537 {
9538 this.Requires = value;
9539 return this;
9540 }
9541
9542 public RatingInput WithLang(string value)
9543 {
9544 this.Lang = value;
9545 return this;
9546 }
9547
9548 public RatingInput WithIsVisible(bool value)
9549 {
9550 this.IsVisible = value;
9551 return this;
9552 }
9553
9554 public RatingInput WithSeparator(bool value)
9555 {
9556 this.Separator = value;
9557 return this;
9558 }
9559
9560 public RatingInput WithHeight(ElementHeight value)
9561 {
9562 this.Height = value;
9563 return this;
9564 }
9565
9566 public RatingInput WithSpacing(Spacing value)
9567 {
9568 this.Spacing = value;
9569 return this;
9570 }
9571
9572 public RatingInput WithTargetWidth(TargetWidth value)
9573 {
9574 this.TargetWidth = value;
9575 return this;
9576 }
9577
9578 public RatingInput WithIsSortKey(bool value)
9579 {
9580 this.IsSortKey = value;
9581 return this;
9582 }
9583
9584 public RatingInput WithLabel(string value)
9585 {
9586 this.Label = value;
9587 return this;
9588 }
9589
9590 public RatingInput WithIsRequired(bool value)
9591 {
9592 this.IsRequired = value;
9593 return this;
9594 }
9595
9596 public RatingInput WithErrorMessage(string value)
9597 {
9598 this.ErrorMessage = value;
9599 return this;
9600 }
9601
9602 public RatingInput WithValueChangedAction(Action value)
9603 {
9604 this.ValueChangedAction = value;
9605 return this;
9606 }
9607
9608 public RatingInput WithValue(float value)
9609 {
9610 this.Value = value;
9611 return this;
9612 }
9613
9614 public RatingInput WithMax(float value)
9615 {
9616 this.Max = value;
9617 return this;
9618 }
9619
9620 public RatingInput WithAllowHalfSteps(bool value)
9621 {
9622 this.AllowHalfSteps = value;
9623 return this;
9624 }
9625
9626 public RatingInput WithSize(RatingSize value)
9627 {
9628 this.Size = value;
9629 return this;
9630 }
9631
9632 public RatingInput WithColor(RatingColor value)
9633 {
9634 this.Color = value;
9635 return this;
9636 }
9637
9638 public RatingInput WithGridArea(string value)
9639 {
9640 this.GridArea = value;
9641 return this;
9642 }
9643
9644 public RatingInput WithFallback(IUnion<CardElement, FallbackElement> value)
9645 {
9646 this.Fallback = value;
9647 return this;
9648 }
9649}
9650
9651/// <summary>
9652/// A read-only star rating element, to display the rating of something.
9653/// </summary>
9654public class Rating : CardElement
9655{
9656 /// <summary>
9657 /// Deserializes a JSON string into an object of type Rating.
9658 /// </summary>
9659 public static Rating? Deserialize(string json)
9660 {
9661 return JsonSerializer.Deserialize<Rating>(json);
9662 }
9663
9664 /// <summary>
9665 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
9666 /// </summary>
9667 [JsonPropertyName("key")]
9668 public string? Key { get; set; }
9669
9670 /// <summary>
9671 /// Must be **Rating**.
9672 /// </summary>
9673 [JsonPropertyName("type")]
9674 public string Type { get; } = "Rating";
9675
9676 /// <summary>
9677 /// 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.
9678 /// </summary>
9679 [JsonPropertyName("id")]
9680 public string? Id { get; set; }
9681
9682 /// <summary>
9683 /// 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).
9684 /// </summary>
9685 [JsonPropertyName("requires")]
9686 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
9687
9688 /// <summary>
9689 /// The locale associated with the element.
9690 /// </summary>
9691 [JsonPropertyName("lang")]
9692 public string? Lang { get; set; }
9693
9694 /// <summary>
9695 /// Controls the visibility of the element.
9696 /// </summary>
9697 [JsonPropertyName("isVisible")]
9698 public bool? IsVisible { get; set; } = true;
9699
9700 /// <summary>
9701 /// 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.
9702 /// </summary>
9703 [JsonPropertyName("separator")]
9704 public bool? Separator { get; set; } = false;
9705
9706 /// <summary>
9707 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9708 /// </summary>
9709 [JsonPropertyName("height")]
9710 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
9711
9712 /// <summary>
9713 /// Controls how the element should be horizontally aligned.
9714 /// </summary>
9715 [JsonPropertyName("horizontalAlignment")]
9716 public HorizontalAlignment? HorizontalAlignment { get; set; }
9717
9718 /// <summary>
9719 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9720 /// </summary>
9721 [JsonPropertyName("spacing")]
9722 public Spacing? Spacing { get; set; } = Spacing.Default;
9723
9724 /// <summary>
9725 /// 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).
9726 /// </summary>
9727 [JsonPropertyName("targetWidth")]
9728 public TargetWidth? TargetWidth { get; set; }
9729
9730 /// <summary>
9731 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9732 /// </summary>
9733 [JsonPropertyName("isSortKey")]
9734 public bool? IsSortKey { get; set; } = false;
9735
9736 /// <summary>
9737 /// The value of the rating. Must be between 0 and max.
9738 /// </summary>
9739 [JsonPropertyName("value")]
9740 public float? Value { get; set; }
9741
9742 /// <summary>
9743 /// The number of "votes" associated with the rating.
9744 /// </summary>
9745 [JsonPropertyName("count")]
9746 public float? Count { get; set; }
9747
9748 /// <summary>
9749 /// The number of stars to display.
9750 /// </summary>
9751 [JsonPropertyName("max")]
9752 public float? Max { get; set; } = 5;
9753
9754 /// <summary>
9755 /// The size of the stars.
9756 /// </summary>
9757 [JsonPropertyName("size")]
9758 public RatingSize? Size { get; set; } = RatingSize.Large;
9759
9760 /// <summary>
9761 /// The color of the stars.
9762 /// </summary>
9763 [JsonPropertyName("color")]
9764 public RatingColor? Color { get; set; } = RatingColor.Neutral;
9765
9766 /// <summary>
9767 /// The style of the stars.
9768 /// </summary>
9769 [JsonPropertyName("style")]
9770 public RatingStyle? Style { get; set; } = RatingStyle.Default;
9771
9772 /// <summary>
9773 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
9774 /// </summary>
9775 [JsonPropertyName("grid.area")]
9776 public string? GridArea { get; set; }
9777
9778 /// <summary>
9779 /// 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.
9780 /// </summary>
9781 [JsonPropertyName("fallback")]
9782 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
9783
9784 /// <summary>
9785 /// Serializes this Rating into a JSON string.
9786 /// </summary>
9787 public string Serialize()
9788 {
9789 return JsonSerializer.Serialize(
9790 this,
9791 new JsonSerializerOptions
9792 {
9793 WriteIndented = true,
9794 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
9795 }
9796 );
9797 }
9798
9799 public Rating WithKey(string value)
9800 {
9801 this.Key = value;
9802 return this;
9803 }
9804
9805 public Rating WithId(string value)
9806 {
9807 this.Id = value;
9808 return this;
9809 }
9810
9811 public Rating WithRequires(HostCapabilities value)
9812 {
9813 this.Requires = value;
9814 return this;
9815 }
9816
9817 public Rating WithLang(string value)
9818 {
9819 this.Lang = value;
9820 return this;
9821 }
9822
9823 public Rating WithIsVisible(bool value)
9824 {
9825 this.IsVisible = value;
9826 return this;
9827 }
9828
9829 public Rating WithSeparator(bool value)
9830 {
9831 this.Separator = value;
9832 return this;
9833 }
9834
9835 public Rating WithHeight(ElementHeight value)
9836 {
9837 this.Height = value;
9838 return this;
9839 }
9840
9841 public Rating WithHorizontalAlignment(HorizontalAlignment value)
9842 {
9843 this.HorizontalAlignment = value;
9844 return this;
9845 }
9846
9847 public Rating WithSpacing(Spacing value)
9848 {
9849 this.Spacing = value;
9850 return this;
9851 }
9852
9853 public Rating WithTargetWidth(TargetWidth value)
9854 {
9855 this.TargetWidth = value;
9856 return this;
9857 }
9858
9859 public Rating WithIsSortKey(bool value)
9860 {
9861 this.IsSortKey = value;
9862 return this;
9863 }
9864
9865 public Rating WithValue(float value)
9866 {
9867 this.Value = value;
9868 return this;
9869 }
9870
9871 public Rating WithCount(float value)
9872 {
9873 this.Count = value;
9874 return this;
9875 }
9876
9877 public Rating WithMax(float value)
9878 {
9879 this.Max = value;
9880 return this;
9881 }
9882
9883 public Rating WithSize(RatingSize value)
9884 {
9885 this.Size = value;
9886 return this;
9887 }
9888
9889 public Rating WithColor(RatingColor value)
9890 {
9891 this.Color = value;
9892 return this;
9893 }
9894
9895 public Rating WithStyle(RatingStyle value)
9896 {
9897 this.Style = value;
9898 return this;
9899 }
9900
9901 public Rating WithGridArea(string value)
9902 {
9903 this.GridArea = value;
9904 return this;
9905 }
9906
9907 public Rating WithFallback(IUnion<CardElement, FallbackElement> value)
9908 {
9909 this.Fallback = value;
9910 return this;
9911 }
9912}
9913
9914/// <summary>
9915/// A special type of button with an icon, title and description.
9916/// </summary>
9917public class CompoundButton : CardElement
9918{
9919 /// <summary>
9920 /// Deserializes a JSON string into an object of type CompoundButton.
9921 /// </summary>
9922 public static CompoundButton? Deserialize(string json)
9923 {
9924 return JsonSerializer.Deserialize<CompoundButton>(json);
9925 }
9926
9927 /// <summary>
9928 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
9929 /// </summary>
9930 [JsonPropertyName("key")]
9931 public string? Key { get; set; }
9932
9933 /// <summary>
9934 /// Must be **CompoundButton**.
9935 /// </summary>
9936 [JsonPropertyName("type")]
9937 public string Type { get; } = "CompoundButton";
9938
9939 /// <summary>
9940 /// 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.
9941 /// </summary>
9942 [JsonPropertyName("id")]
9943 public string? Id { get; set; }
9944
9945 /// <summary>
9946 /// 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).
9947 /// </summary>
9948 [JsonPropertyName("requires")]
9949 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
9950
9951 /// <summary>
9952 /// The locale associated with the element.
9953 /// </summary>
9954 [JsonPropertyName("lang")]
9955 public string? Lang { get; set; }
9956
9957 /// <summary>
9958 /// Controls the visibility of the element.
9959 /// </summary>
9960 [JsonPropertyName("isVisible")]
9961 public bool? IsVisible { get; set; } = true;
9962
9963 /// <summary>
9964 /// 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.
9965 /// </summary>
9966 [JsonPropertyName("separator")]
9967 public bool? Separator { get; set; } = false;
9968
9969 /// <summary>
9970 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
9971 /// </summary>
9972 [JsonPropertyName("height")]
9973 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
9974
9975 /// <summary>
9976 /// Controls how the element should be horizontally aligned.
9977 /// </summary>
9978 [JsonPropertyName("horizontalAlignment")]
9979 public HorizontalAlignment? HorizontalAlignment { get; set; }
9980
9981 /// <summary>
9982 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
9983 /// </summary>
9984 [JsonPropertyName("spacing")]
9985 public Spacing? Spacing { get; set; } = Spacing.Default;
9986
9987 /// <summary>
9988 /// 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).
9989 /// </summary>
9990 [JsonPropertyName("targetWidth")]
9991 public TargetWidth? TargetWidth { get; set; }
9992
9993 /// <summary>
9994 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
9995 /// </summary>
9996 [JsonPropertyName("isSortKey")]
9997 public bool? IsSortKey { get; set; } = false;
9998
9999 /// <summary>
10000 /// The icon to show on the button.
10001 /// </summary>
10002 [JsonPropertyName("icon")]
10003 public IconInfo? Icon { get; set; }
10004
10005 /// <summary>
10006 /// The badge to show on the button.
10007 /// </summary>
10008 [JsonPropertyName("badge")]
10009 public string? Badge { get; set; }
10010
10011 /// <summary>
10012 /// The title of the button.
10013 /// </summary>
10014 [JsonPropertyName("title")]
10015 public string? Title { get; set; }
10016
10017 /// <summary>
10018 /// The description text of the button.
10019 /// </summary>
10020 [JsonPropertyName("description")]
10021 public string? Description { get; set; }
10022
10023 /// <summary>
10024 /// An Action that will be invoked when the button is tapped or clicked. Action.ShowCard is not supported.
10025 /// </summary>
10026 [JsonPropertyName("selectAction")]
10027 public Action? SelectAction { get; set; }
10028
10029 /// <summary>
10030 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10031 /// </summary>
10032 [JsonPropertyName("grid.area")]
10033 public string? GridArea { get; set; }
10034
10035 /// <summary>
10036 /// 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.
10037 /// </summary>
10038 [JsonPropertyName("fallback")]
10039 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10040
10041 /// <summary>
10042 /// Serializes this CompoundButton into a JSON string.
10043 /// </summary>
10044 public string Serialize()
10045 {
10046 return JsonSerializer.Serialize(
10047 this,
10048 new JsonSerializerOptions
10049 {
10050 WriteIndented = true,
10051 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10052 }
10053 );
10054 }
10055
10056 public CompoundButton WithKey(string value)
10057 {
10058 this.Key = value;
10059 return this;
10060 }
10061
10062 public CompoundButton WithId(string value)
10063 {
10064 this.Id = value;
10065 return this;
10066 }
10067
10068 public CompoundButton WithRequires(HostCapabilities value)
10069 {
10070 this.Requires = value;
10071 return this;
10072 }
10073
10074 public CompoundButton WithLang(string value)
10075 {
10076 this.Lang = value;
10077 return this;
10078 }
10079
10080 public CompoundButton WithIsVisible(bool value)
10081 {
10082 this.IsVisible = value;
10083 return this;
10084 }
10085
10086 public CompoundButton WithSeparator(bool value)
10087 {
10088 this.Separator = value;
10089 return this;
10090 }
10091
10092 public CompoundButton WithHeight(ElementHeight value)
10093 {
10094 this.Height = value;
10095 return this;
10096 }
10097
10098 public CompoundButton WithHorizontalAlignment(HorizontalAlignment value)
10099 {
10100 this.HorizontalAlignment = value;
10101 return this;
10102 }
10103
10104 public CompoundButton WithSpacing(Spacing value)
10105 {
10106 this.Spacing = value;
10107 return this;
10108 }
10109
10110 public CompoundButton WithTargetWidth(TargetWidth value)
10111 {
10112 this.TargetWidth = value;
10113 return this;
10114 }
10115
10116 public CompoundButton WithIsSortKey(bool value)
10117 {
10118 this.IsSortKey = value;
10119 return this;
10120 }
10121
10122 public CompoundButton WithIcon(IconInfo value)
10123 {
10124 this.Icon = value;
10125 return this;
10126 }
10127
10128 public CompoundButton WithBadge(string value)
10129 {
10130 this.Badge = value;
10131 return this;
10132 }
10133
10134 public CompoundButton WithTitle(string value)
10135 {
10136 this.Title = value;
10137 return this;
10138 }
10139
10140 public CompoundButton WithDescription(string value)
10141 {
10142 this.Description = value;
10143 return this;
10144 }
10145
10146 public CompoundButton WithSelectAction(Action value)
10147 {
10148 this.SelectAction = value;
10149 return this;
10150 }
10151
10152 public CompoundButton WithGridArea(string value)
10153 {
10154 this.GridArea = value;
10155 return this;
10156 }
10157
10158 public CompoundButton WithFallback(IUnion<CardElement, FallbackElement> value)
10159 {
10160 this.Fallback = value;
10161 return this;
10162 }
10163}
10164
10165/// <summary>
10166/// Defines information about a Fluent icon and how it should be rendered.
10167/// </summary>
10168public class IconInfo : SerializableObject
10169{
10170 /// <summary>
10171 /// Deserializes a JSON string into an object of type IconInfo.
10172 /// </summary>
10173 public static IconInfo? Deserialize(string json)
10174 {
10175 return JsonSerializer.Deserialize<IconInfo>(json);
10176 }
10177
10178 /// <summary>
10179 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
10180 /// </summary>
10181 [JsonPropertyName("key")]
10182 public string? Key { get; set; }
10183
10184 /// <summary>
10185 /// The name of the icon to display.
10186 /// </summary>
10187 [JsonPropertyName("name")]
10188 public string? Name { get; set; }
10189
10190 /// <summary>
10191 /// The size of the icon.
10192 /// </summary>
10193 [JsonPropertyName("size")]
10194 public IconSize? Size { get; set; } = IconSize.XSmall;
10195
10196 /// <summary>
10197 /// The style of the icon.
10198 /// </summary>
10199 [JsonPropertyName("style")]
10200 public IconStyle? Style { get; set; } = IconStyle.Regular;
10201
10202 /// <summary>
10203 /// The color of the icon.
10204 /// </summary>
10205 [JsonPropertyName("color")]
10206 public TextColor? Color { get; set; } = TextColor.Default;
10207
10208 /// <summary>
10209 /// Serializes this IconInfo into a JSON string.
10210 /// </summary>
10211 public string Serialize()
10212 {
10213 return JsonSerializer.Serialize(
10214 this,
10215 new JsonSerializerOptions
10216 {
10217 WriteIndented = true,
10218 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10219 }
10220 );
10221 }
10222
10223 public IconInfo WithKey(string value)
10224 {
10225 this.Key = value;
10226 return this;
10227 }
10228
10229 public IconInfo WithName(string value)
10230 {
10231 this.Name = value;
10232 return this;
10233 }
10234
10235 public IconInfo WithSize(IconSize value)
10236 {
10237 this.Size = value;
10238 return this;
10239 }
10240
10241 public IconInfo WithStyle(IconStyle value)
10242 {
10243 this.Style = value;
10244 return this;
10245 }
10246
10247 public IconInfo WithColor(TextColor value)
10248 {
10249 this.Color = value;
10250 return this;
10251 }
10252}
10253
10254/// <summary>
10255/// A standalone icon element. Icons can be picked from the vast [Adaptive Card icon catalog](https://adaptivecards.microsoft.com/?topic=icon-catalog).
10256/// </summary>
10257public class Icon : CardElement
10258{
10259 /// <summary>
10260 /// Deserializes a JSON string into an object of type Icon.
10261 /// </summary>
10262 public static Icon? Deserialize(string json)
10263 {
10264 return JsonSerializer.Deserialize<Icon>(json);
10265 }
10266
10267 /// <summary>
10268 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
10269 /// </summary>
10270 [JsonPropertyName("key")]
10271 public string? Key { get; set; }
10272
10273 /// <summary>
10274 /// Must be **Icon**.
10275 /// </summary>
10276 [JsonPropertyName("type")]
10277 public string Type { get; } = "Icon";
10278
10279 /// <summary>
10280 /// 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.
10281 /// </summary>
10282 [JsonPropertyName("id")]
10283 public string? Id { get; set; }
10284
10285 /// <summary>
10286 /// 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).
10287 /// </summary>
10288 [JsonPropertyName("requires")]
10289 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
10290
10291 /// <summary>
10292 /// The locale associated with the element.
10293 /// </summary>
10294 [JsonPropertyName("lang")]
10295 public string? Lang { get; set; }
10296
10297 /// <summary>
10298 /// Controls the visibility of the element.
10299 /// </summary>
10300 [JsonPropertyName("isVisible")]
10301 public bool? IsVisible { get; set; } = true;
10302
10303 /// <summary>
10304 /// 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.
10305 /// </summary>
10306 [JsonPropertyName("separator")]
10307 public bool? Separator { get; set; } = false;
10308
10309 /// <summary>
10310 /// Controls how the element should be horizontally aligned.
10311 /// </summary>
10312 [JsonPropertyName("horizontalAlignment")]
10313 public HorizontalAlignment? HorizontalAlignment { get; set; }
10314
10315 /// <summary>
10316 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10317 /// </summary>
10318 [JsonPropertyName("spacing")]
10319 public Spacing? Spacing { get; set; } = Spacing.Default;
10320
10321 /// <summary>
10322 /// 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).
10323 /// </summary>
10324 [JsonPropertyName("targetWidth")]
10325 public TargetWidth? TargetWidth { get; set; }
10326
10327 /// <summary>
10328 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10329 /// </summary>
10330 [JsonPropertyName("isSortKey")]
10331 public bool? IsSortKey { get; set; } = false;
10332
10333 /// <summary>
10334 /// The name of the icon to display.
10335 /// </summary>
10336 [JsonPropertyName("name")]
10337 public string? Name { get; set; }
10338
10339 /// <summary>
10340 /// The size of the icon.
10341 /// </summary>
10342 [JsonPropertyName("size")]
10343 public IconSize? Size { get; set; } = IconSize.Standard;
10344
10345 /// <summary>
10346 /// The style of the icon.
10347 /// </summary>
10348 [JsonPropertyName("style")]
10349 public IconStyle? Style { get; set; } = IconStyle.Regular;
10350
10351 /// <summary>
10352 /// The color of the icon.
10353 /// </summary>
10354 [JsonPropertyName("color")]
10355 public TextColor? Color { get; set; } = TextColor.Default;
10356
10357 /// <summary>
10358 /// An Action that will be invoked when the icon is tapped or clicked. Action.ShowCard is not supported.
10359 /// </summary>
10360 [JsonPropertyName("selectAction")]
10361 public Action? SelectAction { get; set; }
10362
10363 /// <summary>
10364 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10365 /// </summary>
10366 [JsonPropertyName("grid.area")]
10367 public string? GridArea { get; set; }
10368
10369 /// <summary>
10370 /// 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.
10371 /// </summary>
10372 [JsonPropertyName("fallback")]
10373 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10374
10375 public Icon() { }
10376
10377 public Icon(string name)
10378 {
10379 this.Name = name;
10380 }
10381
10382 /// <summary>
10383 /// Serializes this Icon into a JSON string.
10384 /// </summary>
10385 public string Serialize()
10386 {
10387 return JsonSerializer.Serialize(
10388 this,
10389 new JsonSerializerOptions
10390 {
10391 WriteIndented = true,
10392 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10393 }
10394 );
10395 }
10396
10397 public Icon WithKey(string value)
10398 {
10399 this.Key = value;
10400 return this;
10401 }
10402
10403 public Icon WithId(string value)
10404 {
10405 this.Id = value;
10406 return this;
10407 }
10408
10409 public Icon WithRequires(HostCapabilities value)
10410 {
10411 this.Requires = value;
10412 return this;
10413 }
10414
10415 public Icon WithLang(string value)
10416 {
10417 this.Lang = value;
10418 return this;
10419 }
10420
10421 public Icon WithIsVisible(bool value)
10422 {
10423 this.IsVisible = value;
10424 return this;
10425 }
10426
10427 public Icon WithSeparator(bool value)
10428 {
10429 this.Separator = value;
10430 return this;
10431 }
10432
10433 public Icon WithHorizontalAlignment(HorizontalAlignment value)
10434 {
10435 this.HorizontalAlignment = value;
10436 return this;
10437 }
10438
10439 public Icon WithSpacing(Spacing value)
10440 {
10441 this.Spacing = value;
10442 return this;
10443 }
10444
10445 public Icon WithTargetWidth(TargetWidth value)
10446 {
10447 this.TargetWidth = value;
10448 return this;
10449 }
10450
10451 public Icon WithIsSortKey(bool value)
10452 {
10453 this.IsSortKey = value;
10454 return this;
10455 }
10456
10457 public Icon WithName(string value)
10458 {
10459 this.Name = value;
10460 return this;
10461 }
10462
10463 public Icon WithSize(IconSize value)
10464 {
10465 this.Size = value;
10466 return this;
10467 }
10468
10469 public Icon WithStyle(IconStyle value)
10470 {
10471 this.Style = value;
10472 return this;
10473 }
10474
10475 public Icon WithColor(TextColor value)
10476 {
10477 this.Color = value;
10478 return this;
10479 }
10480
10481 public Icon WithSelectAction(Action value)
10482 {
10483 this.SelectAction = value;
10484 return this;
10485 }
10486
10487 public Icon WithGridArea(string value)
10488 {
10489 this.GridArea = value;
10490 return this;
10491 }
10492
10493 public Icon WithFallback(IUnion<CardElement, FallbackElement> value)
10494 {
10495 this.Fallback = value;
10496 return this;
10497 }
10498}
10499
10500/// <summary>
10501/// A carousel with sliding pages.
10502/// </summary>
10503public class Carousel : CardElement
10504{
10505 /// <summary>
10506 /// Deserializes a JSON string into an object of type Carousel.
10507 /// </summary>
10508 public static Carousel? Deserialize(string json)
10509 {
10510 return JsonSerializer.Deserialize<Carousel>(json);
10511 }
10512
10513 /// <summary>
10514 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
10515 /// </summary>
10516 [JsonPropertyName("key")]
10517 public string? Key { get; set; }
10518
10519 /// <summary>
10520 /// Must be **Carousel**.
10521 /// </summary>
10522 [JsonPropertyName("type")]
10523 public string Type { get; } = "Carousel";
10524
10525 /// <summary>
10526 /// 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.
10527 /// </summary>
10528 [JsonPropertyName("id")]
10529 public string? Id { get; set; }
10530
10531 /// <summary>
10532 /// 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).
10533 /// </summary>
10534 [JsonPropertyName("requires")]
10535 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
10536
10537 /// <summary>
10538 /// The locale associated with the element.
10539 /// </summary>
10540 [JsonPropertyName("lang")]
10541 public string? Lang { get; set; }
10542
10543 /// <summary>
10544 /// Controls the visibility of the element.
10545 /// </summary>
10546 [JsonPropertyName("isVisible")]
10547 public bool? IsVisible { get; set; } = true;
10548
10549 /// <summary>
10550 /// 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.
10551 /// </summary>
10552 [JsonPropertyName("separator")]
10553 public bool? Separator { get; set; } = false;
10554
10555 /// <summary>
10556 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
10557 /// </summary>
10558 [JsonPropertyName("height")]
10559 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
10560
10561 /// <summary>
10562 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10563 /// </summary>
10564 [JsonPropertyName("spacing")]
10565 public Spacing? Spacing { get; set; } = Spacing.Default;
10566
10567 /// <summary>
10568 /// 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).
10569 /// </summary>
10570 [JsonPropertyName("targetWidth")]
10571 public TargetWidth? TargetWidth { get; set; }
10572
10573 /// <summary>
10574 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10575 /// </summary>
10576 [JsonPropertyName("isSortKey")]
10577 public bool? IsSortKey { get; set; } = false;
10578
10579 /// <summary>
10580 /// Controls if the container should bleed into its parent. A bleeding container extends into its parent's padding.
10581 /// </summary>
10582 [JsonPropertyName("bleed")]
10583 public bool? Bleed { get; set; } = false;
10584
10585 /// <summary>
10586 /// The minimum height, in pixels, of the container, in the `<number>px` format.
10587 /// </summary>
10588 [JsonPropertyName("minHeight")]
10589 public string? MinHeight { get; set; }
10590
10591 /// <summary>
10592 /// Controls the type of animation to use to navigate between pages.
10593 /// </summary>
10594 [JsonPropertyName("pageAnimation")]
10595 public CarouselPageAnimation? PageAnimation { get; set; } = CarouselPageAnimation.Slide;
10596
10597 /// <summary>
10598 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10599 /// </summary>
10600 [JsonPropertyName("grid.area")]
10601 public string? GridArea { get; set; }
10602
10603 /// <summary>
10604 /// 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.
10605 /// </summary>
10606 [JsonPropertyName("fallback")]
10607 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10608
10609 /// <summary>
10610 /// The pages in the carousel.
10611 /// </summary>
10612 [JsonPropertyName("pages")]
10613 public IList<CarouselPage>? Pages { get; set; }
10614
10615 /// <summary>
10616 /// Serializes this Carousel into a JSON string.
10617 /// </summary>
10618 public string Serialize()
10619 {
10620 return JsonSerializer.Serialize(
10621 this,
10622 new JsonSerializerOptions
10623 {
10624 WriteIndented = true,
10625 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10626 }
10627 );
10628 }
10629
10630 public Carousel WithKey(string value)
10631 {
10632 this.Key = value;
10633 return this;
10634 }
10635
10636 public Carousel WithId(string value)
10637 {
10638 this.Id = value;
10639 return this;
10640 }
10641
10642 public Carousel WithRequires(HostCapabilities value)
10643 {
10644 this.Requires = value;
10645 return this;
10646 }
10647
10648 public Carousel WithLang(string value)
10649 {
10650 this.Lang = value;
10651 return this;
10652 }
10653
10654 public Carousel WithIsVisible(bool value)
10655 {
10656 this.IsVisible = value;
10657 return this;
10658 }
10659
10660 public Carousel WithSeparator(bool value)
10661 {
10662 this.Separator = value;
10663 return this;
10664 }
10665
10666 public Carousel WithHeight(ElementHeight value)
10667 {
10668 this.Height = value;
10669 return this;
10670 }
10671
10672 public Carousel WithSpacing(Spacing value)
10673 {
10674 this.Spacing = value;
10675 return this;
10676 }
10677
10678 public Carousel WithTargetWidth(TargetWidth value)
10679 {
10680 this.TargetWidth = value;
10681 return this;
10682 }
10683
10684 public Carousel WithIsSortKey(bool value)
10685 {
10686 this.IsSortKey = value;
10687 return this;
10688 }
10689
10690 public Carousel WithBleed(bool value)
10691 {
10692 this.Bleed = value;
10693 return this;
10694 }
10695
10696 public Carousel WithMinHeight(string value)
10697 {
10698 this.MinHeight = value;
10699 return this;
10700 }
10701
10702 public Carousel WithPageAnimation(CarouselPageAnimation value)
10703 {
10704 this.PageAnimation = value;
10705 return this;
10706 }
10707
10708 public Carousel WithGridArea(string value)
10709 {
10710 this.GridArea = value;
10711 return this;
10712 }
10713
10714 public Carousel WithFallback(IUnion<CardElement, FallbackElement> value)
10715 {
10716 this.Fallback = value;
10717 return this;
10718 }
10719
10720 public Carousel WithPages(params CarouselPage[] value)
10721 {
10722 this.Pages = new List<CarouselPage>(value);
10723 return this;
10724 }
10725
10726 public Carousel WithPages(IList<CarouselPage> value)
10727 {
10728 this.Pages = value;
10729 return this;
10730 }
10731}
10732
10733/// <summary>
10734/// A badge element to show an icon and/or text in a compact form over a colored background.
10735/// </summary>
10736public class Badge : CardElement
10737{
10738 /// <summary>
10739 /// Deserializes a JSON string into an object of type Badge.
10740 /// </summary>
10741 public static Badge? Deserialize(string json)
10742 {
10743 return JsonSerializer.Deserialize<Badge>(json);
10744 }
10745
10746 /// <summary>
10747 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
10748 /// </summary>
10749 [JsonPropertyName("key")]
10750 public string? Key { get; set; }
10751
10752 /// <summary>
10753 /// Must be **Badge**.
10754 /// </summary>
10755 [JsonPropertyName("type")]
10756 public string Type { get; } = "Badge";
10757
10758 /// <summary>
10759 /// 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.
10760 /// </summary>
10761 [JsonPropertyName("id")]
10762 public string? Id { get; set; }
10763
10764 /// <summary>
10765 /// 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).
10766 /// </summary>
10767 [JsonPropertyName("requires")]
10768 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
10769
10770 /// <summary>
10771 /// The locale associated with the element.
10772 /// </summary>
10773 [JsonPropertyName("lang")]
10774 public string? Lang { get; set; }
10775
10776 /// <summary>
10777 /// Controls the visibility of the element.
10778 /// </summary>
10779 [JsonPropertyName("isVisible")]
10780 public bool? IsVisible { get; set; } = true;
10781
10782 /// <summary>
10783 /// 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.
10784 /// </summary>
10785 [JsonPropertyName("separator")]
10786 public bool? Separator { get; set; } = false;
10787
10788 /// <summary>
10789 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
10790 /// </summary>
10791 [JsonPropertyName("height")]
10792 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
10793
10794 /// <summary>
10795 /// Controls how the element should be horizontally aligned.
10796 /// </summary>
10797 [JsonPropertyName("horizontalAlignment")]
10798 public HorizontalAlignment? HorizontalAlignment { get; set; }
10799
10800 /// <summary>
10801 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
10802 /// </summary>
10803 [JsonPropertyName("spacing")]
10804 public Spacing? Spacing { get; set; } = Spacing.Default;
10805
10806 /// <summary>
10807 /// 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).
10808 /// </summary>
10809 [JsonPropertyName("targetWidth")]
10810 public TargetWidth? TargetWidth { get; set; }
10811
10812 /// <summary>
10813 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
10814 /// </summary>
10815 [JsonPropertyName("isSortKey")]
10816 public bool? IsSortKey { get; set; } = false;
10817
10818 /// <summary>
10819 /// The text to display.
10820 /// </summary>
10821 [JsonPropertyName("text")]
10822 public string? Text { get; set; }
10823
10824 /// <summary>
10825 /// 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.
10826 /// </summary>
10827 [JsonPropertyName("icon")]
10828 public string? Icon { get; set; }
10829
10830 /// <summary>
10831 /// Controls the position of the icon.
10832 /// </summary>
10833 [JsonPropertyName("iconPosition")]
10834 public BadgeIconPosition? IconPosition { get; set; } = BadgeIconPosition.Before;
10835
10836 /// <summary>
10837 /// Controls the strength of the background color.
10838 /// </summary>
10839 [JsonPropertyName("appearance")]
10840 public BadgeAppearance? Appearance { get; set; } = BadgeAppearance.Filled;
10841
10842 /// <summary>
10843 /// The size of the badge.
10844 /// </summary>
10845 [JsonPropertyName("size")]
10846 public BadgeSize? Size { get; set; } = BadgeSize.Medium;
10847
10848 /// <summary>
10849 /// Controls the shape of the badge.
10850 /// </summary>
10851 [JsonPropertyName("shape")]
10852 public BadgeShape? Shape { get; set; } = BadgeShape.Circular;
10853
10854 /// <summary>
10855 /// The style of the badge.
10856 /// </summary>
10857 [JsonPropertyName("style")]
10858 public BadgeStyle? Style { get; set; } = BadgeStyle.Default;
10859
10860 /// <summary>
10861 /// Controls the tooltip text to display when the badge is hovered over.
10862 /// </summary>
10863 [JsonPropertyName("tooltip")]
10864 public string? Tooltip { get; set; }
10865
10866 /// <summary>
10867 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
10868 /// </summary>
10869 [JsonPropertyName("grid.area")]
10870 public string? GridArea { get; set; }
10871
10872 /// <summary>
10873 /// 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.
10874 /// </summary>
10875 [JsonPropertyName("fallback")]
10876 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
10877
10878 /// <summary>
10879 /// Serializes this Badge into a JSON string.
10880 /// </summary>
10881 public string Serialize()
10882 {
10883 return JsonSerializer.Serialize(
10884 this,
10885 new JsonSerializerOptions
10886 {
10887 WriteIndented = true,
10888 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
10889 }
10890 );
10891 }
10892
10893 public Badge WithKey(string value)
10894 {
10895 this.Key = value;
10896 return this;
10897 }
10898
10899 public Badge WithId(string value)
10900 {
10901 this.Id = value;
10902 return this;
10903 }
10904
10905 public Badge WithRequires(HostCapabilities value)
10906 {
10907 this.Requires = value;
10908 return this;
10909 }
10910
10911 public Badge WithLang(string value)
10912 {
10913 this.Lang = value;
10914 return this;
10915 }
10916
10917 public Badge WithIsVisible(bool value)
10918 {
10919 this.IsVisible = value;
10920 return this;
10921 }
10922
10923 public Badge WithSeparator(bool value)
10924 {
10925 this.Separator = value;
10926 return this;
10927 }
10928
10929 public Badge WithHeight(ElementHeight value)
10930 {
10931 this.Height = value;
10932 return this;
10933 }
10934
10935 public Badge WithHorizontalAlignment(HorizontalAlignment value)
10936 {
10937 this.HorizontalAlignment = value;
10938 return this;
10939 }
10940
10941 public Badge WithSpacing(Spacing value)
10942 {
10943 this.Spacing = value;
10944 return this;
10945 }
10946
10947 public Badge WithTargetWidth(TargetWidth value)
10948 {
10949 this.TargetWidth = value;
10950 return this;
10951 }
10952
10953 public Badge WithIsSortKey(bool value)
10954 {
10955 this.IsSortKey = value;
10956 return this;
10957 }
10958
10959 public Badge WithText(string value)
10960 {
10961 this.Text = value;
10962 return this;
10963 }
10964
10965 public Badge WithIcon(string value)
10966 {
10967 this.Icon = value;
10968 return this;
10969 }
10970
10971 public Badge WithIconPosition(BadgeIconPosition value)
10972 {
10973 this.IconPosition = value;
10974 return this;
10975 }
10976
10977 public Badge WithAppearance(BadgeAppearance value)
10978 {
10979 this.Appearance = value;
10980 return this;
10981 }
10982
10983 public Badge WithSize(BadgeSize value)
10984 {
10985 this.Size = value;
10986 return this;
10987 }
10988
10989 public Badge WithShape(BadgeShape value)
10990 {
10991 this.Shape = value;
10992 return this;
10993 }
10994
10995 public Badge WithStyle(BadgeStyle value)
10996 {
10997 this.Style = value;
10998 return this;
10999 }
11000
11001 public Badge WithTooltip(string value)
11002 {
11003 this.Tooltip = value;
11004 return this;
11005 }
11006
11007 public Badge WithGridArea(string value)
11008 {
11009 this.GridArea = value;
11010 return this;
11011 }
11012
11013 public Badge WithFallback(IUnion<CardElement, FallbackElement> value)
11014 {
11015 this.Fallback = value;
11016 return this;
11017 }
11018}
11019
11020/// <summary>
11021/// A spinning ring element, to indicate progress.
11022/// </summary>
11023public class ProgressRing : CardElement
11024{
11025 /// <summary>
11026 /// Deserializes a JSON string into an object of type ProgressRing.
11027 /// </summary>
11028 public static ProgressRing? Deserialize(string json)
11029 {
11030 return JsonSerializer.Deserialize<ProgressRing>(json);
11031 }
11032
11033 /// <summary>
11034 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
11035 /// </summary>
11036 [JsonPropertyName("key")]
11037 public string? Key { get; set; }
11038
11039 /// <summary>
11040 /// Must be **ProgressRing**.
11041 /// </summary>
11042 [JsonPropertyName("type")]
11043 public string Type { get; } = "ProgressRing";
11044
11045 /// <summary>
11046 /// 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.
11047 /// </summary>
11048 [JsonPropertyName("id")]
11049 public string? Id { get; set; }
11050
11051 /// <summary>
11052 /// 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).
11053 /// </summary>
11054 [JsonPropertyName("requires")]
11055 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
11056
11057 /// <summary>
11058 /// The locale associated with the element.
11059 /// </summary>
11060 [JsonPropertyName("lang")]
11061 public string? Lang { get; set; }
11062
11063 /// <summary>
11064 /// Controls the visibility of the element.
11065 /// </summary>
11066 [JsonPropertyName("isVisible")]
11067 public bool? IsVisible { get; set; } = true;
11068
11069 /// <summary>
11070 /// 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.
11071 /// </summary>
11072 [JsonPropertyName("separator")]
11073 public bool? Separator { get; set; } = false;
11074
11075 /// <summary>
11076 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11077 /// </summary>
11078 [JsonPropertyName("height")]
11079 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
11080
11081 /// <summary>
11082 /// Controls how the element should be horizontally aligned.
11083 /// </summary>
11084 [JsonPropertyName("horizontalAlignment")]
11085 public HorizontalAlignment? HorizontalAlignment { get; set; }
11086
11087 /// <summary>
11088 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11089 /// </summary>
11090 [JsonPropertyName("spacing")]
11091 public Spacing? Spacing { get; set; } = Spacing.Default;
11092
11093 /// <summary>
11094 /// 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).
11095 /// </summary>
11096 [JsonPropertyName("targetWidth")]
11097 public TargetWidth? TargetWidth { get; set; }
11098
11099 /// <summary>
11100 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11101 /// </summary>
11102 [JsonPropertyName("isSortKey")]
11103 public bool? IsSortKey { get; set; } = false;
11104
11105 /// <summary>
11106 /// The label of the progress ring.
11107 /// </summary>
11108 [JsonPropertyName("label")]
11109 public string? Label { get; set; }
11110
11111 /// <summary>
11112 /// Controls the relative position of the label to the progress ring.
11113 /// </summary>
11114 [JsonPropertyName("labelPosition")]
11115 public ProgressRingLabelPosition? LabelPosition { get; set; } = ProgressRingLabelPosition.Below;
11116
11117 /// <summary>
11118 /// The size of the progress ring.
11119 /// </summary>
11120 [JsonPropertyName("size")]
11121 public ProgressRingSize? Size { get; set; } = ProgressRingSize.Medium;
11122
11123 /// <summary>
11124 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11125 /// </summary>
11126 [JsonPropertyName("grid.area")]
11127 public string? GridArea { get; set; }
11128
11129 /// <summary>
11130 /// 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.
11131 /// </summary>
11132 [JsonPropertyName("fallback")]
11133 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11134
11135 /// <summary>
11136 /// Serializes this ProgressRing into a JSON string.
11137 /// </summary>
11138 public string Serialize()
11139 {
11140 return JsonSerializer.Serialize(
11141 this,
11142 new JsonSerializerOptions
11143 {
11144 WriteIndented = true,
11145 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11146 }
11147 );
11148 }
11149
11150 public ProgressRing WithKey(string value)
11151 {
11152 this.Key = value;
11153 return this;
11154 }
11155
11156 public ProgressRing WithId(string value)
11157 {
11158 this.Id = value;
11159 return this;
11160 }
11161
11162 public ProgressRing WithRequires(HostCapabilities value)
11163 {
11164 this.Requires = value;
11165 return this;
11166 }
11167
11168 public ProgressRing WithLang(string value)
11169 {
11170 this.Lang = value;
11171 return this;
11172 }
11173
11174 public ProgressRing WithIsVisible(bool value)
11175 {
11176 this.IsVisible = value;
11177 return this;
11178 }
11179
11180 public ProgressRing WithSeparator(bool value)
11181 {
11182 this.Separator = value;
11183 return this;
11184 }
11185
11186 public ProgressRing WithHeight(ElementHeight value)
11187 {
11188 this.Height = value;
11189 return this;
11190 }
11191
11192 public ProgressRing WithHorizontalAlignment(HorizontalAlignment value)
11193 {
11194 this.HorizontalAlignment = value;
11195 return this;
11196 }
11197
11198 public ProgressRing WithSpacing(Spacing value)
11199 {
11200 this.Spacing = value;
11201 return this;
11202 }
11203
11204 public ProgressRing WithTargetWidth(TargetWidth value)
11205 {
11206 this.TargetWidth = value;
11207 return this;
11208 }
11209
11210 public ProgressRing WithIsSortKey(bool value)
11211 {
11212 this.IsSortKey = value;
11213 return this;
11214 }
11215
11216 public ProgressRing WithLabel(string value)
11217 {
11218 this.Label = value;
11219 return this;
11220 }
11221
11222 public ProgressRing WithLabelPosition(ProgressRingLabelPosition value)
11223 {
11224 this.LabelPosition = value;
11225 return this;
11226 }
11227
11228 public ProgressRing WithSize(ProgressRingSize value)
11229 {
11230 this.Size = value;
11231 return this;
11232 }
11233
11234 public ProgressRing WithGridArea(string value)
11235 {
11236 this.GridArea = value;
11237 return this;
11238 }
11239
11240 public ProgressRing WithFallback(IUnion<CardElement, FallbackElement> value)
11241 {
11242 this.Fallback = value;
11243 return this;
11244 }
11245}
11246
11247/// <summary>
11248/// A progress bar element, to represent a value within a range.
11249/// </summary>
11250public class ProgressBar : CardElement
11251{
11252 /// <summary>
11253 /// Deserializes a JSON string into an object of type ProgressBar.
11254 /// </summary>
11255 public static ProgressBar? Deserialize(string json)
11256 {
11257 return JsonSerializer.Deserialize<ProgressBar>(json);
11258 }
11259
11260 /// <summary>
11261 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
11262 /// </summary>
11263 [JsonPropertyName("key")]
11264 public string? Key { get; set; }
11265
11266 /// <summary>
11267 /// Must be **ProgressBar**.
11268 /// </summary>
11269 [JsonPropertyName("type")]
11270 public string Type { get; } = "ProgressBar";
11271
11272 /// <summary>
11273 /// 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.
11274 /// </summary>
11275 [JsonPropertyName("id")]
11276 public string? Id { get; set; }
11277
11278 /// <summary>
11279 /// 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).
11280 /// </summary>
11281 [JsonPropertyName("requires")]
11282 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
11283
11284 /// <summary>
11285 /// The locale associated with the element.
11286 /// </summary>
11287 [JsonPropertyName("lang")]
11288 public string? Lang { get; set; }
11289
11290 /// <summary>
11291 /// Controls the visibility of the element.
11292 /// </summary>
11293 [JsonPropertyName("isVisible")]
11294 public bool? IsVisible { get; set; } = true;
11295
11296 /// <summary>
11297 /// 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.
11298 /// </summary>
11299 [JsonPropertyName("separator")]
11300 public bool? Separator { get; set; } = false;
11301
11302 /// <summary>
11303 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11304 /// </summary>
11305 [JsonPropertyName("height")]
11306 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
11307
11308 /// <summary>
11309 /// Controls how the element should be horizontally aligned.
11310 /// </summary>
11311 [JsonPropertyName("horizontalAlignment")]
11312 public HorizontalAlignment? HorizontalAlignment { get; set; }
11313
11314 /// <summary>
11315 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11316 /// </summary>
11317 [JsonPropertyName("spacing")]
11318 public Spacing? Spacing { get; set; } = Spacing.Default;
11319
11320 /// <summary>
11321 /// 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).
11322 /// </summary>
11323 [JsonPropertyName("targetWidth")]
11324 public TargetWidth? TargetWidth { get; set; }
11325
11326 /// <summary>
11327 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11328 /// </summary>
11329 [JsonPropertyName("isSortKey")]
11330 public bool? IsSortKey { get; set; } = false;
11331
11332 /// <summary>
11333 /// The value of the progress bar. Must be between 0 and max.
11334 /// </summary>
11335 [JsonPropertyName("value")]
11336 public float? Value { get; set; }
11337
11338 /// <summary>
11339 /// The maximum value of the progress bar.
11340 /// </summary>
11341 [JsonPropertyName("max")]
11342 public float? Max { get; set; } = 100;
11343
11344 /// <summary>
11345 /// The color of the progress bar. `color` has no effect when the `ProgressBar` is in indeterminate mode, in which case the "accent" color is always used.
11346 /// </summary>
11347 [JsonPropertyName("color")]
11348 public ProgressBarColor? Color { get; set; } = ProgressBarColor.Accent;
11349
11350 /// <summary>
11351 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11352 /// </summary>
11353 [JsonPropertyName("grid.area")]
11354 public string? GridArea { get; set; }
11355
11356 /// <summary>
11357 /// 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.
11358 /// </summary>
11359 [JsonPropertyName("fallback")]
11360 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11361
11362 /// <summary>
11363 /// Serializes this ProgressBar into a JSON string.
11364 /// </summary>
11365 public string Serialize()
11366 {
11367 return JsonSerializer.Serialize(
11368 this,
11369 new JsonSerializerOptions
11370 {
11371 WriteIndented = true,
11372 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11373 }
11374 );
11375 }
11376
11377 public ProgressBar WithKey(string value)
11378 {
11379 this.Key = value;
11380 return this;
11381 }
11382
11383 public ProgressBar WithId(string value)
11384 {
11385 this.Id = value;
11386 return this;
11387 }
11388
11389 public ProgressBar WithRequires(HostCapabilities value)
11390 {
11391 this.Requires = value;
11392 return this;
11393 }
11394
11395 public ProgressBar WithLang(string value)
11396 {
11397 this.Lang = value;
11398 return this;
11399 }
11400
11401 public ProgressBar WithIsVisible(bool value)
11402 {
11403 this.IsVisible = value;
11404 return this;
11405 }
11406
11407 public ProgressBar WithSeparator(bool value)
11408 {
11409 this.Separator = value;
11410 return this;
11411 }
11412
11413 public ProgressBar WithHeight(ElementHeight value)
11414 {
11415 this.Height = value;
11416 return this;
11417 }
11418
11419 public ProgressBar WithHorizontalAlignment(HorizontalAlignment value)
11420 {
11421 this.HorizontalAlignment = value;
11422 return this;
11423 }
11424
11425 public ProgressBar WithSpacing(Spacing value)
11426 {
11427 this.Spacing = value;
11428 return this;
11429 }
11430
11431 public ProgressBar WithTargetWidth(TargetWidth value)
11432 {
11433 this.TargetWidth = value;
11434 return this;
11435 }
11436
11437 public ProgressBar WithIsSortKey(bool value)
11438 {
11439 this.IsSortKey = value;
11440 return this;
11441 }
11442
11443 public ProgressBar WithValue(float value)
11444 {
11445 this.Value = value;
11446 return this;
11447 }
11448
11449 public ProgressBar WithMax(float value)
11450 {
11451 this.Max = value;
11452 return this;
11453 }
11454
11455 public ProgressBar WithColor(ProgressBarColor value)
11456 {
11457 this.Color = value;
11458 return this;
11459 }
11460
11461 public ProgressBar WithGridArea(string value)
11462 {
11463 this.GridArea = value;
11464 return this;
11465 }
11466
11467 public ProgressBar WithFallback(IUnion<CardElement, FallbackElement> value)
11468 {
11469 this.Fallback = value;
11470 return this;
11471 }
11472}
11473
11474/// <summary>
11475/// A donut chart.
11476/// </summary>
11477public class DonutChart : CardElement
11478{
11479 /// <summary>
11480 /// Deserializes a JSON string into an object of type DonutChart.
11481 /// </summary>
11482 public static DonutChart? Deserialize(string json)
11483 {
11484 return JsonSerializer.Deserialize<DonutChart>(json);
11485 }
11486
11487 /// <summary>
11488 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
11489 /// </summary>
11490 [JsonPropertyName("key")]
11491 public string? Key { get; set; }
11492
11493 /// <summary>
11494 /// Must be **Chart.Donut**.
11495 /// </summary>
11496 [JsonPropertyName("type")]
11497 public string Type { get; } = "Chart.Donut";
11498
11499 /// <summary>
11500 /// 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.
11501 /// </summary>
11502 [JsonPropertyName("id")]
11503 public string? Id { get; set; }
11504
11505 /// <summary>
11506 /// 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).
11507 /// </summary>
11508 [JsonPropertyName("requires")]
11509 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
11510
11511 /// <summary>
11512 /// The locale associated with the element.
11513 /// </summary>
11514 [JsonPropertyName("lang")]
11515 public string? Lang { get; set; }
11516
11517 /// <summary>
11518 /// Controls the visibility of the element.
11519 /// </summary>
11520 [JsonPropertyName("isVisible")]
11521 public bool? IsVisible { get; set; } = true;
11522
11523 /// <summary>
11524 /// 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.
11525 /// </summary>
11526 [JsonPropertyName("separator")]
11527 public bool? Separator { get; set; } = false;
11528
11529 /// <summary>
11530 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11531 /// </summary>
11532 [JsonPropertyName("height")]
11533 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
11534
11535 /// <summary>
11536 /// Controls how the element should be horizontally aligned.
11537 /// </summary>
11538 [JsonPropertyName("horizontalAlignment")]
11539 public HorizontalAlignment? HorizontalAlignment { get; set; }
11540
11541 /// <summary>
11542 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11543 /// </summary>
11544 [JsonPropertyName("spacing")]
11545 public Spacing? Spacing { get; set; } = Spacing.Default;
11546
11547 /// <summary>
11548 /// 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).
11549 /// </summary>
11550 [JsonPropertyName("targetWidth")]
11551 public TargetWidth? TargetWidth { get; set; }
11552
11553 /// <summary>
11554 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11555 /// </summary>
11556 [JsonPropertyName("isSortKey")]
11557 public bool? IsSortKey { get; set; } = false;
11558
11559 /// <summary>
11560 /// The title of the chart.
11561 /// </summary>
11562 [JsonPropertyName("title")]
11563 public string? Title { get; set; }
11564
11565 /// <summary>
11566 /// Controls whether the chart's title should be displayed. Defaults to `false`.
11567 /// </summary>
11568 [JsonPropertyName("showTitle")]
11569 public bool? ShowTitle { get; set; } = false;
11570
11571 /// <summary>
11572 /// 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).
11573 /// </summary>
11574 [JsonPropertyName("colorSet")]
11575 public ChartColorSet? ColorSet { get; set; }
11576
11577 /// <summary>
11578 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
11579 /// </summary>
11580 [JsonPropertyName("maxWidth")]
11581 public string? MaxWidth { get; set; }
11582
11583 /// <summary>
11584 /// Controls whether the chart's legend should be displayed.
11585 /// </summary>
11586 [JsonPropertyName("showLegend")]
11587 public bool? ShowLegend { get; set; } = true;
11588
11589 /// <summary>
11590 /// The data to display in the chart.
11591 /// </summary>
11592 [JsonPropertyName("data")]
11593 public IList<DonutChartData>? Data { get; set; }
11594
11595 /// <summary>
11596 /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts.
11597 /// </summary>
11598 [JsonPropertyName("value")]
11599 public string? Value { get; set; }
11600
11601 /// <summary>
11602 /// Controls the color of the value displayed in the center of a Donut chart.
11603 /// </summary>
11604 [JsonPropertyName("valueColor")]
11605 public ChartColor? ValueColor { get; set; }
11606
11607 /// <summary>
11608 /// Controls the thickness of the donut segments. Default is **Thick**.
11609 /// </summary>
11610 [JsonPropertyName("thickness")]
11611 public DonutThickness? Thickness { get; set; }
11612
11613 /// <summary>
11614 /// Controls whether the outlines of the donut segments are displayed.
11615 /// </summary>
11616 [JsonPropertyName("showOutlines")]
11617 public bool? ShowOutlines { get; set; } = true;
11618
11619 /// <summary>
11620 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
11621 /// </summary>
11622 [JsonPropertyName("grid.area")]
11623 public string? GridArea { get; set; }
11624
11625 /// <summary>
11626 /// 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.
11627 /// </summary>
11628 [JsonPropertyName("fallback")]
11629 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
11630
11631 /// <summary>
11632 /// Serializes this DonutChart into a JSON string.
11633 /// </summary>
11634 public string Serialize()
11635 {
11636 return JsonSerializer.Serialize(
11637 this,
11638 new JsonSerializerOptions
11639 {
11640 WriteIndented = true,
11641 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11642 }
11643 );
11644 }
11645
11646 public DonutChart WithKey(string value)
11647 {
11648 this.Key = value;
11649 return this;
11650 }
11651
11652 public DonutChart WithId(string value)
11653 {
11654 this.Id = value;
11655 return this;
11656 }
11657
11658 public DonutChart WithRequires(HostCapabilities value)
11659 {
11660 this.Requires = value;
11661 return this;
11662 }
11663
11664 public DonutChart WithLang(string value)
11665 {
11666 this.Lang = value;
11667 return this;
11668 }
11669
11670 public DonutChart WithIsVisible(bool value)
11671 {
11672 this.IsVisible = value;
11673 return this;
11674 }
11675
11676 public DonutChart WithSeparator(bool value)
11677 {
11678 this.Separator = value;
11679 return this;
11680 }
11681
11682 public DonutChart WithHeight(ElementHeight value)
11683 {
11684 this.Height = value;
11685 return this;
11686 }
11687
11688 public DonutChart WithHorizontalAlignment(HorizontalAlignment value)
11689 {
11690 this.HorizontalAlignment = value;
11691 return this;
11692 }
11693
11694 public DonutChart WithSpacing(Spacing value)
11695 {
11696 this.Spacing = value;
11697 return this;
11698 }
11699
11700 public DonutChart WithTargetWidth(TargetWidth value)
11701 {
11702 this.TargetWidth = value;
11703 return this;
11704 }
11705
11706 public DonutChart WithIsSortKey(bool value)
11707 {
11708 this.IsSortKey = value;
11709 return this;
11710 }
11711
11712 public DonutChart WithTitle(string value)
11713 {
11714 this.Title = value;
11715 return this;
11716 }
11717
11718 public DonutChart WithShowTitle(bool value)
11719 {
11720 this.ShowTitle = value;
11721 return this;
11722 }
11723
11724 public DonutChart WithColorSet(ChartColorSet value)
11725 {
11726 this.ColorSet = value;
11727 return this;
11728 }
11729
11730 public DonutChart WithMaxWidth(string value)
11731 {
11732 this.MaxWidth = value;
11733 return this;
11734 }
11735
11736 public DonutChart WithShowLegend(bool value)
11737 {
11738 this.ShowLegend = value;
11739 return this;
11740 }
11741
11742 public DonutChart WithData(params DonutChartData[] value)
11743 {
11744 this.Data = new List<DonutChartData>(value);
11745 return this;
11746 }
11747
11748 public DonutChart WithData(IList<DonutChartData> value)
11749 {
11750 this.Data = value;
11751 return this;
11752 }
11753
11754 public DonutChart WithValue(string value)
11755 {
11756 this.Value = value;
11757 return this;
11758 }
11759
11760 public DonutChart WithValueColor(ChartColor value)
11761 {
11762 this.ValueColor = value;
11763 return this;
11764 }
11765
11766 public DonutChart WithThickness(DonutThickness value)
11767 {
11768 this.Thickness = value;
11769 return this;
11770 }
11771
11772 public DonutChart WithShowOutlines(bool value)
11773 {
11774 this.ShowOutlines = value;
11775 return this;
11776 }
11777
11778 public DonutChart WithGridArea(string value)
11779 {
11780 this.GridArea = value;
11781 return this;
11782 }
11783
11784 public DonutChart WithFallback(IUnion<CardElement, FallbackElement> value)
11785 {
11786 this.Fallback = value;
11787 return this;
11788 }
11789}
11790
11791/// <summary>
11792/// A data point in a Donut chart.
11793/// </summary>
11794public class DonutChartData : SerializableObject
11795{
11796 /// <summary>
11797 /// Deserializes a JSON string into an object of type DonutChartData.
11798 /// </summary>
11799 public static DonutChartData? Deserialize(string json)
11800 {
11801 return JsonSerializer.Deserialize<DonutChartData>(json);
11802 }
11803
11804 /// <summary>
11805 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
11806 /// </summary>
11807 [JsonPropertyName("key")]
11808 public string? Key { get; set; }
11809
11810 /// <summary>
11811 /// The legend of the chart.
11812 /// </summary>
11813 [JsonPropertyName("legend")]
11814 public string? Legend { get; set; }
11815
11816 /// <summary>
11817 /// The value associated with the data point.
11818 /// </summary>
11819 [JsonPropertyName("value")]
11820 public float? Value { get; set; } = 0;
11821
11822 /// <summary>
11823 /// The color to use for the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
11824 /// </summary>
11825 [JsonPropertyName("color")]
11826 public ChartColor? Color { get; set; }
11827
11828 /// <summary>
11829 /// Serializes this DonutChartData into a JSON string.
11830 /// </summary>
11831 public string Serialize()
11832 {
11833 return JsonSerializer.Serialize(
11834 this,
11835 new JsonSerializerOptions
11836 {
11837 WriteIndented = true,
11838 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
11839 }
11840 );
11841 }
11842
11843 public DonutChartData WithKey(string value)
11844 {
11845 this.Key = value;
11846 return this;
11847 }
11848
11849 public DonutChartData WithLegend(string value)
11850 {
11851 this.Legend = value;
11852 return this;
11853 }
11854
11855 public DonutChartData WithValue(float value)
11856 {
11857 this.Value = value;
11858 return this;
11859 }
11860
11861 public DonutChartData WithColor(ChartColor value)
11862 {
11863 this.Color = value;
11864 return this;
11865 }
11866}
11867
11868/// <summary>
11869/// A pie chart.
11870/// </summary>
11871public class PieChart : CardElement
11872{
11873 /// <summary>
11874 /// Deserializes a JSON string into an object of type PieChart.
11875 /// </summary>
11876 public static PieChart? Deserialize(string json)
11877 {
11878 return JsonSerializer.Deserialize<PieChart>(json);
11879 }
11880
11881 /// <summary>
11882 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
11883 /// </summary>
11884 [JsonPropertyName("key")]
11885 public string? Key { get; set; }
11886
11887 /// <summary>
11888 /// Must be **Chart.Pie**.
11889 /// </summary>
11890 [JsonPropertyName("type")]
11891 public string Type { get; } = "Chart.Pie";
11892
11893 /// <summary>
11894 /// 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.
11895 /// </summary>
11896 [JsonPropertyName("id")]
11897 public string? Id { get; set; }
11898
11899 /// <summary>
11900 /// 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).
11901 /// </summary>
11902 [JsonPropertyName("requires")]
11903 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
11904
11905 /// <summary>
11906 /// The locale associated with the element.
11907 /// </summary>
11908 [JsonPropertyName("lang")]
11909 public string? Lang { get; set; }
11910
11911 /// <summary>
11912 /// Controls the visibility of the element.
11913 /// </summary>
11914 [JsonPropertyName("isVisible")]
11915 public bool? IsVisible { get; set; } = true;
11916
11917 /// <summary>
11918 /// 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.
11919 /// </summary>
11920 [JsonPropertyName("separator")]
11921 public bool? Separator { get; set; } = false;
11922
11923 /// <summary>
11924 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
11925 /// </summary>
11926 [JsonPropertyName("height")]
11927 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
11928
11929 /// <summary>
11930 /// Controls how the element should be horizontally aligned.
11931 /// </summary>
11932 [JsonPropertyName("horizontalAlignment")]
11933 public HorizontalAlignment? HorizontalAlignment { get; set; }
11934
11935 /// <summary>
11936 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
11937 /// </summary>
11938 [JsonPropertyName("spacing")]
11939 public Spacing? Spacing { get; set; } = Spacing.Default;
11940
11941 /// <summary>
11942 /// 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).
11943 /// </summary>
11944 [JsonPropertyName("targetWidth")]
11945 public TargetWidth? TargetWidth { get; set; }
11946
11947 /// <summary>
11948 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
11949 /// </summary>
11950 [JsonPropertyName("isSortKey")]
11951 public bool? IsSortKey { get; set; } = false;
11952
11953 /// <summary>
11954 /// The title of the chart.
11955 /// </summary>
11956 [JsonPropertyName("title")]
11957 public string? Title { get; set; }
11958
11959 /// <summary>
11960 /// Controls whether the chart's title should be displayed. Defaults to `false`.
11961 /// </summary>
11962 [JsonPropertyName("showTitle")]
11963 public bool? ShowTitle { get; set; } = false;
11964
11965 /// <summary>
11966 /// 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).
11967 /// </summary>
11968 [JsonPropertyName("colorSet")]
11969 public ChartColorSet? ColorSet { get; set; }
11970
11971 /// <summary>
11972 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
11973 /// </summary>
11974 [JsonPropertyName("maxWidth")]
11975 public string? MaxWidth { get; set; }
11976
11977 /// <summary>
11978 /// Controls whether the chart's legend should be displayed.
11979 /// </summary>
11980 [JsonPropertyName("showLegend")]
11981 public bool? ShowLegend { get; set; } = true;
11982
11983 /// <summary>
11984 /// The data to display in the chart.
11985 /// </summary>
11986 [JsonPropertyName("data")]
11987 public IList<DonutChartData>? Data { get; set; }
11988
11989 /// <summary>
11990 /// The value that should be displayed in the center of a Donut chart. `value` is ignored for Pie charts.
11991 /// </summary>
11992 [JsonPropertyName("value")]
11993 public string? Value { get; set; }
11994
11995 /// <summary>
11996 /// Controls the color of the value displayed in the center of a Donut chart.
11997 /// </summary>
11998 [JsonPropertyName("valueColor")]
11999 public ChartColor? ValueColor { get; set; }
12000
12001 /// <summary>
12002 /// Controls the thickness of the donut segments. Default is **Thick**.
12003 /// </summary>
12004 [JsonPropertyName("thickness")]
12005 public DonutThickness? Thickness { get; set; }
12006
12007 /// <summary>
12008 /// Controls whether the outlines of the donut segments are displayed.
12009 /// </summary>
12010 [JsonPropertyName("showOutlines")]
12011 public bool? ShowOutlines { get; set; } = true;
12012
12013 /// <summary>
12014 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12015 /// </summary>
12016 [JsonPropertyName("grid.area")]
12017 public string? GridArea { get; set; }
12018
12019 /// <summary>
12020 /// 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.
12021 /// </summary>
12022 [JsonPropertyName("fallback")]
12023 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12024
12025 /// <summary>
12026 /// Serializes this PieChart into a JSON string.
12027 /// </summary>
12028 public string Serialize()
12029 {
12030 return JsonSerializer.Serialize(
12031 this,
12032 new JsonSerializerOptions
12033 {
12034 WriteIndented = true,
12035 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12036 }
12037 );
12038 }
12039
12040 public PieChart WithKey(string value)
12041 {
12042 this.Key = value;
12043 return this;
12044 }
12045
12046 public PieChart WithId(string value)
12047 {
12048 this.Id = value;
12049 return this;
12050 }
12051
12052 public PieChart WithRequires(HostCapabilities value)
12053 {
12054 this.Requires = value;
12055 return this;
12056 }
12057
12058 public PieChart WithLang(string value)
12059 {
12060 this.Lang = value;
12061 return this;
12062 }
12063
12064 public PieChart WithIsVisible(bool value)
12065 {
12066 this.IsVisible = value;
12067 return this;
12068 }
12069
12070 public PieChart WithSeparator(bool value)
12071 {
12072 this.Separator = value;
12073 return this;
12074 }
12075
12076 public PieChart WithHeight(ElementHeight value)
12077 {
12078 this.Height = value;
12079 return this;
12080 }
12081
12082 public PieChart WithHorizontalAlignment(HorizontalAlignment value)
12083 {
12084 this.HorizontalAlignment = value;
12085 return this;
12086 }
12087
12088 public PieChart WithSpacing(Spacing value)
12089 {
12090 this.Spacing = value;
12091 return this;
12092 }
12093
12094 public PieChart WithTargetWidth(TargetWidth value)
12095 {
12096 this.TargetWidth = value;
12097 return this;
12098 }
12099
12100 public PieChart WithIsSortKey(bool value)
12101 {
12102 this.IsSortKey = value;
12103 return this;
12104 }
12105
12106 public PieChart WithTitle(string value)
12107 {
12108 this.Title = value;
12109 return this;
12110 }
12111
12112 public PieChart WithShowTitle(bool value)
12113 {
12114 this.ShowTitle = value;
12115 return this;
12116 }
12117
12118 public PieChart WithColorSet(ChartColorSet value)
12119 {
12120 this.ColorSet = value;
12121 return this;
12122 }
12123
12124 public PieChart WithMaxWidth(string value)
12125 {
12126 this.MaxWidth = value;
12127 return this;
12128 }
12129
12130 public PieChart WithShowLegend(bool value)
12131 {
12132 this.ShowLegend = value;
12133 return this;
12134 }
12135
12136 public PieChart WithData(params DonutChartData[] value)
12137 {
12138 this.Data = new List<DonutChartData>(value);
12139 return this;
12140 }
12141
12142 public PieChart WithData(IList<DonutChartData> value)
12143 {
12144 this.Data = value;
12145 return this;
12146 }
12147
12148 public PieChart WithValue(string value)
12149 {
12150 this.Value = value;
12151 return this;
12152 }
12153
12154 public PieChart WithValueColor(ChartColor value)
12155 {
12156 this.ValueColor = value;
12157 return this;
12158 }
12159
12160 public PieChart WithThickness(DonutThickness value)
12161 {
12162 this.Thickness = value;
12163 return this;
12164 }
12165
12166 public PieChart WithShowOutlines(bool value)
12167 {
12168 this.ShowOutlines = value;
12169 return this;
12170 }
12171
12172 public PieChart WithGridArea(string value)
12173 {
12174 this.GridArea = value;
12175 return this;
12176 }
12177
12178 public PieChart WithFallback(IUnion<CardElement, FallbackElement> value)
12179 {
12180 this.Fallback = value;
12181 return this;
12182 }
12183}
12184
12185/// <summary>
12186/// A grouped vertical bar chart.
12187/// </summary>
12188public class GroupedVerticalBarChart : CardElement
12189{
12190 /// <summary>
12191 /// Deserializes a JSON string into an object of type GroupedVerticalBarChart.
12192 /// </summary>
12193 public static GroupedVerticalBarChart? Deserialize(string json)
12194 {
12195 return JsonSerializer.Deserialize<GroupedVerticalBarChart>(json);
12196 }
12197
12198 /// <summary>
12199 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
12200 /// </summary>
12201 [JsonPropertyName("key")]
12202 public string? Key { get; set; }
12203
12204 /// <summary>
12205 /// Must be **Chart.VerticalBar.Grouped**.
12206 /// </summary>
12207 [JsonPropertyName("type")]
12208 public string Type { get; } = "Chart.VerticalBar.Grouped";
12209
12210 /// <summary>
12211 /// 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.
12212 /// </summary>
12213 [JsonPropertyName("id")]
12214 public string? Id { get; set; }
12215
12216 /// <summary>
12217 /// 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).
12218 /// </summary>
12219 [JsonPropertyName("requires")]
12220 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
12221
12222 /// <summary>
12223 /// The locale associated with the element.
12224 /// </summary>
12225 [JsonPropertyName("lang")]
12226 public string? Lang { get; set; }
12227
12228 /// <summary>
12229 /// Controls the visibility of the element.
12230 /// </summary>
12231 [JsonPropertyName("isVisible")]
12232 public bool? IsVisible { get; set; } = true;
12233
12234 /// <summary>
12235 /// 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.
12236 /// </summary>
12237 [JsonPropertyName("separator")]
12238 public bool? Separator { get; set; } = false;
12239
12240 /// <summary>
12241 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
12242 /// </summary>
12243 [JsonPropertyName("height")]
12244 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
12245
12246 /// <summary>
12247 /// Controls how the element should be horizontally aligned.
12248 /// </summary>
12249 [JsonPropertyName("horizontalAlignment")]
12250 public HorizontalAlignment? HorizontalAlignment { get; set; }
12251
12252 /// <summary>
12253 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
12254 /// </summary>
12255 [JsonPropertyName("spacing")]
12256 public Spacing? Spacing { get; set; } = Spacing.Default;
12257
12258 /// <summary>
12259 /// 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).
12260 /// </summary>
12261 [JsonPropertyName("targetWidth")]
12262 public TargetWidth? TargetWidth { get; set; }
12263
12264 /// <summary>
12265 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
12266 /// </summary>
12267 [JsonPropertyName("isSortKey")]
12268 public bool? IsSortKey { get; set; } = false;
12269
12270 /// <summary>
12271 /// The title of the chart.
12272 /// </summary>
12273 [JsonPropertyName("title")]
12274 public string? Title { get; set; }
12275
12276 /// <summary>
12277 /// Controls whether the chart's title should be displayed. Defaults to `false`.
12278 /// </summary>
12279 [JsonPropertyName("showTitle")]
12280 public bool? ShowTitle { get; set; } = false;
12281
12282 /// <summary>
12283 /// 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).
12284 /// </summary>
12285 [JsonPropertyName("colorSet")]
12286 public ChartColorSet? ColorSet { get; set; }
12287
12288 /// <summary>
12289 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
12290 /// </summary>
12291 [JsonPropertyName("maxWidth")]
12292 public string? MaxWidth { get; set; }
12293
12294 /// <summary>
12295 /// Controls whether the chart's legend should be displayed.
12296 /// </summary>
12297 [JsonPropertyName("showLegend")]
12298 public bool? ShowLegend { get; set; } = true;
12299
12300 /// <summary>
12301 /// The title of the x axis.
12302 /// </summary>
12303 [JsonPropertyName("xAxisTitle")]
12304 public string? XAxisTitle { get; set; }
12305
12306 /// <summary>
12307 /// The title of the y axis.
12308 /// </summary>
12309 [JsonPropertyName("yAxisTitle")]
12310 public string? YAxisTitle { get; set; }
12311
12312 /// <summary>
12313 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12314 /// </summary>
12315 [JsonPropertyName("color")]
12316 public ChartColor? Color { get; set; }
12317
12318 /// <summary>
12319 /// Controls if bars in the chart should be displayed as stacks instead of groups.
12320 ///
12321 /// **Note:** stacked vertical bar charts do not support custom Y ranges nor negative Y values.
12322 /// </summary>
12323 [JsonPropertyName("stacked")]
12324 public bool? Stacked { get; set; } = false;
12325
12326 /// <summary>
12327 /// The data points in a series.
12328 /// </summary>
12329 [JsonPropertyName("data")]
12330 public IList<GroupedVerticalBarChartData>? Data { get; set; }
12331
12332 /// <summary>
12333 /// Controls if values should be displayed on each bar.
12334 /// </summary>
12335 [JsonPropertyName("showBarValues")]
12336 public bool? ShowBarValues { get; set; } = false;
12337
12338 /// <summary>
12339 /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
12340 ///
12341 /// `yMin` is ignored if `stacked` is set to `true`.
12342 /// </summary>
12343 [JsonPropertyName("yMin")]
12344 public float? YMin { get; set; }
12345
12346 /// <summary>
12347 /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
12348 ///
12349 /// `yMax` is ignored if `stacked` is set to `true`.
12350 /// </summary>
12351 [JsonPropertyName("yMax")]
12352 public float? YMax { get; set; }
12353
12354 /// <summary>
12355 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12356 /// </summary>
12357 [JsonPropertyName("grid.area")]
12358 public string? GridArea { get; set; }
12359
12360 /// <summary>
12361 /// 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.
12362 /// </summary>
12363 [JsonPropertyName("fallback")]
12364 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12365
12366 /// <summary>
12367 /// Serializes this GroupedVerticalBarChart into a JSON string.
12368 /// </summary>
12369 public string Serialize()
12370 {
12371 return JsonSerializer.Serialize(
12372 this,
12373 new JsonSerializerOptions
12374 {
12375 WriteIndented = true,
12376 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12377 }
12378 );
12379 }
12380
12381 public GroupedVerticalBarChart WithKey(string value)
12382 {
12383 this.Key = value;
12384 return this;
12385 }
12386
12387 public GroupedVerticalBarChart WithId(string value)
12388 {
12389 this.Id = value;
12390 return this;
12391 }
12392
12393 public GroupedVerticalBarChart WithRequires(HostCapabilities value)
12394 {
12395 this.Requires = value;
12396 return this;
12397 }
12398
12399 public GroupedVerticalBarChart WithLang(string value)
12400 {
12401 this.Lang = value;
12402 return this;
12403 }
12404
12405 public GroupedVerticalBarChart WithIsVisible(bool value)
12406 {
12407 this.IsVisible = value;
12408 return this;
12409 }
12410
12411 public GroupedVerticalBarChart WithSeparator(bool value)
12412 {
12413 this.Separator = value;
12414 return this;
12415 }
12416
12417 public GroupedVerticalBarChart WithHeight(ElementHeight value)
12418 {
12419 this.Height = value;
12420 return this;
12421 }
12422
12423 public GroupedVerticalBarChart WithHorizontalAlignment(HorizontalAlignment value)
12424 {
12425 this.HorizontalAlignment = value;
12426 return this;
12427 }
12428
12429 public GroupedVerticalBarChart WithSpacing(Spacing value)
12430 {
12431 this.Spacing = value;
12432 return this;
12433 }
12434
12435 public GroupedVerticalBarChart WithTargetWidth(TargetWidth value)
12436 {
12437 this.TargetWidth = value;
12438 return this;
12439 }
12440
12441 public GroupedVerticalBarChart WithIsSortKey(bool value)
12442 {
12443 this.IsSortKey = value;
12444 return this;
12445 }
12446
12447 public GroupedVerticalBarChart WithTitle(string value)
12448 {
12449 this.Title = value;
12450 return this;
12451 }
12452
12453 public GroupedVerticalBarChart WithShowTitle(bool value)
12454 {
12455 this.ShowTitle = value;
12456 return this;
12457 }
12458
12459 public GroupedVerticalBarChart WithColorSet(ChartColorSet value)
12460 {
12461 this.ColorSet = value;
12462 return this;
12463 }
12464
12465 public GroupedVerticalBarChart WithMaxWidth(string value)
12466 {
12467 this.MaxWidth = value;
12468 return this;
12469 }
12470
12471 public GroupedVerticalBarChart WithShowLegend(bool value)
12472 {
12473 this.ShowLegend = value;
12474 return this;
12475 }
12476
12477 public GroupedVerticalBarChart WithXAxisTitle(string value)
12478 {
12479 this.XAxisTitle = value;
12480 return this;
12481 }
12482
12483 public GroupedVerticalBarChart WithYAxisTitle(string value)
12484 {
12485 this.YAxisTitle = value;
12486 return this;
12487 }
12488
12489 public GroupedVerticalBarChart WithColor(ChartColor value)
12490 {
12491 this.Color = value;
12492 return this;
12493 }
12494
12495 public GroupedVerticalBarChart WithStacked(bool value)
12496 {
12497 this.Stacked = value;
12498 return this;
12499 }
12500
12501 public GroupedVerticalBarChart WithData(params GroupedVerticalBarChartData[] value)
12502 {
12503 this.Data = new List<GroupedVerticalBarChartData>(value);
12504 return this;
12505 }
12506
12507 public GroupedVerticalBarChart WithData(IList<GroupedVerticalBarChartData> value)
12508 {
12509 this.Data = value;
12510 return this;
12511 }
12512
12513 public GroupedVerticalBarChart WithShowBarValues(bool value)
12514 {
12515 this.ShowBarValues = value;
12516 return this;
12517 }
12518
12519 public GroupedVerticalBarChart WithYMin(float value)
12520 {
12521 this.YMin = value;
12522 return this;
12523 }
12524
12525 public GroupedVerticalBarChart WithYMax(float value)
12526 {
12527 this.YMax = value;
12528 return this;
12529 }
12530
12531 public GroupedVerticalBarChart WithGridArea(string value)
12532 {
12533 this.GridArea = value;
12534 return this;
12535 }
12536
12537 public GroupedVerticalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
12538 {
12539 this.Fallback = value;
12540 return this;
12541 }
12542}
12543
12544/// <summary>
12545/// Represents a series of data points.
12546/// </summary>
12547public class GroupedVerticalBarChartData : SerializableObject
12548{
12549 /// <summary>
12550 /// Deserializes a JSON string into an object of type GroupedVerticalBarChartData.
12551 /// </summary>
12552 public static GroupedVerticalBarChartData? Deserialize(string json)
12553 {
12554 return JsonSerializer.Deserialize<GroupedVerticalBarChartData>(json);
12555 }
12556
12557 /// <summary>
12558 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
12559 /// </summary>
12560 [JsonPropertyName("key")]
12561 public string? Key { get; set; }
12562
12563 /// <summary>
12564 /// The legend of the chart.
12565 /// </summary>
12566 [JsonPropertyName("legend")]
12567 public string? Legend { get; set; }
12568
12569 /// <summary>
12570 /// The data points in the series.
12571 /// </summary>
12572 [JsonPropertyName("values")]
12573 public IList<BarChartDataValue>? Values { get; set; }
12574
12575 /// <summary>
12576 /// The color to use for all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12577 /// </summary>
12578 [JsonPropertyName("color")]
12579 public ChartColor? Color { get; set; }
12580
12581 /// <summary>
12582 /// Serializes this GroupedVerticalBarChartData into a JSON string.
12583 /// </summary>
12584 public string Serialize()
12585 {
12586 return JsonSerializer.Serialize(
12587 this,
12588 new JsonSerializerOptions
12589 {
12590 WriteIndented = true,
12591 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12592 }
12593 );
12594 }
12595
12596 public GroupedVerticalBarChartData WithKey(string value)
12597 {
12598 this.Key = value;
12599 return this;
12600 }
12601
12602 public GroupedVerticalBarChartData WithLegend(string value)
12603 {
12604 this.Legend = value;
12605 return this;
12606 }
12607
12608 public GroupedVerticalBarChartData WithValues(params BarChartDataValue[] value)
12609 {
12610 this.Values = new List<BarChartDataValue>(value);
12611 return this;
12612 }
12613
12614 public GroupedVerticalBarChartData WithValues(IList<BarChartDataValue> value)
12615 {
12616 this.Values = value;
12617 return this;
12618 }
12619
12620 public GroupedVerticalBarChartData WithColor(ChartColor value)
12621 {
12622 this.Color = value;
12623 return this;
12624 }
12625}
12626
12627/// <summary>
12628/// A single data point in a bar chart.
12629/// </summary>
12630public class BarChartDataValue : SerializableObject
12631{
12632 /// <summary>
12633 /// Deserializes a JSON string into an object of type BarChartDataValue.
12634 /// </summary>
12635 public static BarChartDataValue? Deserialize(string json)
12636 {
12637 return JsonSerializer.Deserialize<BarChartDataValue>(json);
12638 }
12639
12640 /// <summary>
12641 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
12642 /// </summary>
12643 [JsonPropertyName("key")]
12644 public string? Key { get; set; }
12645
12646 /// <summary>
12647 /// The x axis value of the data point.
12648 /// </summary>
12649 [JsonPropertyName("x")]
12650 public string? X { get; set; }
12651
12652 /// <summary>
12653 /// The y axis value of the data point.
12654 /// </summary>
12655 [JsonPropertyName("y")]
12656 public float? Y { get; set; } = 0;
12657
12658 /// <summary>
12659 /// Serializes this BarChartDataValue into a JSON string.
12660 /// </summary>
12661 public string Serialize()
12662 {
12663 return JsonSerializer.Serialize(
12664 this,
12665 new JsonSerializerOptions
12666 {
12667 WriteIndented = true,
12668 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12669 }
12670 );
12671 }
12672
12673 public BarChartDataValue WithKey(string value)
12674 {
12675 this.Key = value;
12676 return this;
12677 }
12678
12679 public BarChartDataValue WithX(string value)
12680 {
12681 this.X = value;
12682 return this;
12683 }
12684
12685 public BarChartDataValue WithY(float value)
12686 {
12687 this.Y = value;
12688 return this;
12689 }
12690}
12691
12692/// <summary>
12693/// A vertical bar chart.
12694/// </summary>
12695public class VerticalBarChart : CardElement
12696{
12697 /// <summary>
12698 /// Deserializes a JSON string into an object of type VerticalBarChart.
12699 /// </summary>
12700 public static VerticalBarChart? Deserialize(string json)
12701 {
12702 return JsonSerializer.Deserialize<VerticalBarChart>(json);
12703 }
12704
12705 /// <summary>
12706 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
12707 /// </summary>
12708 [JsonPropertyName("key")]
12709 public string? Key { get; set; }
12710
12711 /// <summary>
12712 /// Must be **Chart.VerticalBar**.
12713 /// </summary>
12714 [JsonPropertyName("type")]
12715 public string Type { get; } = "Chart.VerticalBar";
12716
12717 /// <summary>
12718 /// 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.
12719 /// </summary>
12720 [JsonPropertyName("id")]
12721 public string? Id { get; set; }
12722
12723 /// <summary>
12724 /// 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).
12725 /// </summary>
12726 [JsonPropertyName("requires")]
12727 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
12728
12729 /// <summary>
12730 /// The locale associated with the element.
12731 /// </summary>
12732 [JsonPropertyName("lang")]
12733 public string? Lang { get; set; }
12734
12735 /// <summary>
12736 /// Controls the visibility of the element.
12737 /// </summary>
12738 [JsonPropertyName("isVisible")]
12739 public bool? IsVisible { get; set; } = true;
12740
12741 /// <summary>
12742 /// 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.
12743 /// </summary>
12744 [JsonPropertyName("separator")]
12745 public bool? Separator { get; set; } = false;
12746
12747 /// <summary>
12748 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
12749 /// </summary>
12750 [JsonPropertyName("height")]
12751 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
12752
12753 /// <summary>
12754 /// Controls how the element should be horizontally aligned.
12755 /// </summary>
12756 [JsonPropertyName("horizontalAlignment")]
12757 public HorizontalAlignment? HorizontalAlignment { get; set; }
12758
12759 /// <summary>
12760 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
12761 /// </summary>
12762 [JsonPropertyName("spacing")]
12763 public Spacing? Spacing { get; set; } = Spacing.Default;
12764
12765 /// <summary>
12766 /// 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).
12767 /// </summary>
12768 [JsonPropertyName("targetWidth")]
12769 public TargetWidth? TargetWidth { get; set; }
12770
12771 /// <summary>
12772 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
12773 /// </summary>
12774 [JsonPropertyName("isSortKey")]
12775 public bool? IsSortKey { get; set; } = false;
12776
12777 /// <summary>
12778 /// The title of the chart.
12779 /// </summary>
12780 [JsonPropertyName("title")]
12781 public string? Title { get; set; }
12782
12783 /// <summary>
12784 /// Controls whether the chart's title should be displayed. Defaults to `false`.
12785 /// </summary>
12786 [JsonPropertyName("showTitle")]
12787 public bool? ShowTitle { get; set; } = false;
12788
12789 /// <summary>
12790 /// 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).
12791 /// </summary>
12792 [JsonPropertyName("colorSet")]
12793 public ChartColorSet? ColorSet { get; set; }
12794
12795 /// <summary>
12796 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
12797 /// </summary>
12798 [JsonPropertyName("maxWidth")]
12799 public string? MaxWidth { get; set; }
12800
12801 /// <summary>
12802 /// Controls whether the chart's legend should be displayed.
12803 /// </summary>
12804 [JsonPropertyName("showLegend")]
12805 public bool? ShowLegend { get; set; } = true;
12806
12807 /// <summary>
12808 /// The title of the x axis.
12809 /// </summary>
12810 [JsonPropertyName("xAxisTitle")]
12811 public string? XAxisTitle { get; set; }
12812
12813 /// <summary>
12814 /// The title of the y axis.
12815 /// </summary>
12816 [JsonPropertyName("yAxisTitle")]
12817 public string? YAxisTitle { get; set; }
12818
12819 /// <summary>
12820 /// The data to display in the chart.
12821 /// </summary>
12822 [JsonPropertyName("data")]
12823 public IList<VerticalBarChartDataValue>? Data { get; set; }
12824
12825 /// <summary>
12826 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
12827 /// </summary>
12828 [JsonPropertyName("color")]
12829 public ChartColor? Color { get; set; }
12830
12831 /// <summary>
12832 /// Controls if the bar values should be displayed.
12833 /// </summary>
12834 [JsonPropertyName("showBarValues")]
12835 public bool? ShowBarValues { get; set; } = false;
12836
12837 /// <summary>
12838 /// The requested minimum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
12839 /// </summary>
12840 [JsonPropertyName("yMin")]
12841 public float? YMin { get; set; }
12842
12843 /// <summary>
12844 /// The requested maximum for the Y axis range. The value used at runtime may be different to optimize visual presentation.
12845 /// </summary>
12846 [JsonPropertyName("yMax")]
12847 public float? YMax { get; set; }
12848
12849 /// <summary>
12850 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
12851 /// </summary>
12852 [JsonPropertyName("grid.area")]
12853 public string? GridArea { get; set; }
12854
12855 /// <summary>
12856 /// 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.
12857 /// </summary>
12858 [JsonPropertyName("fallback")]
12859 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
12860
12861 /// <summary>
12862 /// Serializes this VerticalBarChart into a JSON string.
12863 /// </summary>
12864 public string Serialize()
12865 {
12866 return JsonSerializer.Serialize(
12867 this,
12868 new JsonSerializerOptions
12869 {
12870 WriteIndented = true,
12871 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
12872 }
12873 );
12874 }
12875
12876 public VerticalBarChart WithKey(string value)
12877 {
12878 this.Key = value;
12879 return this;
12880 }
12881
12882 public VerticalBarChart WithId(string value)
12883 {
12884 this.Id = value;
12885 return this;
12886 }
12887
12888 public VerticalBarChart WithRequires(HostCapabilities value)
12889 {
12890 this.Requires = value;
12891 return this;
12892 }
12893
12894 public VerticalBarChart WithLang(string value)
12895 {
12896 this.Lang = value;
12897 return this;
12898 }
12899
12900 public VerticalBarChart WithIsVisible(bool value)
12901 {
12902 this.IsVisible = value;
12903 return this;
12904 }
12905
12906 public VerticalBarChart WithSeparator(bool value)
12907 {
12908 this.Separator = value;
12909 return this;
12910 }
12911
12912 public VerticalBarChart WithHeight(ElementHeight value)
12913 {
12914 this.Height = value;
12915 return this;
12916 }
12917
12918 public VerticalBarChart WithHorizontalAlignment(HorizontalAlignment value)
12919 {
12920 this.HorizontalAlignment = value;
12921 return this;
12922 }
12923
12924 public VerticalBarChart WithSpacing(Spacing value)
12925 {
12926 this.Spacing = value;
12927 return this;
12928 }
12929
12930 public VerticalBarChart WithTargetWidth(TargetWidth value)
12931 {
12932 this.TargetWidth = value;
12933 return this;
12934 }
12935
12936 public VerticalBarChart WithIsSortKey(bool value)
12937 {
12938 this.IsSortKey = value;
12939 return this;
12940 }
12941
12942 public VerticalBarChart WithTitle(string value)
12943 {
12944 this.Title = value;
12945 return this;
12946 }
12947
12948 public VerticalBarChart WithShowTitle(bool value)
12949 {
12950 this.ShowTitle = value;
12951 return this;
12952 }
12953
12954 public VerticalBarChart WithColorSet(ChartColorSet value)
12955 {
12956 this.ColorSet = value;
12957 return this;
12958 }
12959
12960 public VerticalBarChart WithMaxWidth(string value)
12961 {
12962 this.MaxWidth = value;
12963 return this;
12964 }
12965
12966 public VerticalBarChart WithShowLegend(bool value)
12967 {
12968 this.ShowLegend = value;
12969 return this;
12970 }
12971
12972 public VerticalBarChart WithXAxisTitle(string value)
12973 {
12974 this.XAxisTitle = value;
12975 return this;
12976 }
12977
12978 public VerticalBarChart WithYAxisTitle(string value)
12979 {
12980 this.YAxisTitle = value;
12981 return this;
12982 }
12983
12984 public VerticalBarChart WithData(params VerticalBarChartDataValue[] value)
12985 {
12986 this.Data = new List<VerticalBarChartDataValue>(value);
12987 return this;
12988 }
12989
12990 public VerticalBarChart WithData(IList<VerticalBarChartDataValue> value)
12991 {
12992 this.Data = value;
12993 return this;
12994 }
12995
12996 public VerticalBarChart WithColor(ChartColor value)
12997 {
12998 this.Color = value;
12999 return this;
13000 }
13001
13002 public VerticalBarChart WithShowBarValues(bool value)
13003 {
13004 this.ShowBarValues = value;
13005 return this;
13006 }
13007
13008 public VerticalBarChart WithYMin(float value)
13009 {
13010 this.YMin = value;
13011 return this;
13012 }
13013
13014 public VerticalBarChart WithYMax(float value)
13015 {
13016 this.YMax = value;
13017 return this;
13018 }
13019
13020 public VerticalBarChart WithGridArea(string value)
13021 {
13022 this.GridArea = value;
13023 return this;
13024 }
13025
13026 public VerticalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
13027 {
13028 this.Fallback = value;
13029 return this;
13030 }
13031}
13032
13033/// <summary>
13034/// Represents a data point in a vertical bar chart.
13035/// </summary>
13036public class VerticalBarChartDataValue : SerializableObject
13037{
13038 /// <summary>
13039 /// Deserializes a JSON string into an object of type VerticalBarChartDataValue.
13040 /// </summary>
13041 public static VerticalBarChartDataValue? Deserialize(string json)
13042 {
13043 return JsonSerializer.Deserialize<VerticalBarChartDataValue>(json);
13044 }
13045
13046 /// <summary>
13047 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13048 /// </summary>
13049 [JsonPropertyName("key")]
13050 public string? Key { get; set; }
13051
13052 /// <summary>
13053 /// The x axis value of the data point.
13054 /// </summary>
13055 [JsonPropertyName("x")]
13056 public IUnion<string, float>? X { get; set; }
13057
13058 /// <summary>
13059 /// The y axis value of the data point.
13060 /// </summary>
13061 [JsonPropertyName("y")]
13062 public float? Y { get; set; } = 0;
13063
13064 /// <summary>
13065 /// The color to use for the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
13066 /// </summary>
13067 [JsonPropertyName("color")]
13068 public ChartColor? Color { get; set; }
13069
13070 /// <summary>
13071 /// Serializes this VerticalBarChartDataValue into a JSON string.
13072 /// </summary>
13073 public string Serialize()
13074 {
13075 return JsonSerializer.Serialize(
13076 this,
13077 new JsonSerializerOptions
13078 {
13079 WriteIndented = true,
13080 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13081 }
13082 );
13083 }
13084
13085 public VerticalBarChartDataValue WithKey(string value)
13086 {
13087 this.Key = value;
13088 return this;
13089 }
13090
13091 public VerticalBarChartDataValue WithX(IUnion<string, float> value)
13092 {
13093 this.X = value;
13094 return this;
13095 }
13096
13097 public VerticalBarChartDataValue WithY(float value)
13098 {
13099 this.Y = value;
13100 return this;
13101 }
13102
13103 public VerticalBarChartDataValue WithColor(ChartColor value)
13104 {
13105 this.Color = value;
13106 return this;
13107 }
13108}
13109
13110/// <summary>
13111/// A horizontal bar chart.
13112/// </summary>
13113public class HorizontalBarChart : CardElement
13114{
13115 /// <summary>
13116 /// Deserializes a JSON string into an object of type HorizontalBarChart.
13117 /// </summary>
13118 public static HorizontalBarChart? Deserialize(string json)
13119 {
13120 return JsonSerializer.Deserialize<HorizontalBarChart>(json);
13121 }
13122
13123 /// <summary>
13124 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13125 /// </summary>
13126 [JsonPropertyName("key")]
13127 public string? Key { get; set; }
13128
13129 /// <summary>
13130 /// Must be **Chart.HorizontalBar**.
13131 /// </summary>
13132 [JsonPropertyName("type")]
13133 public string Type { get; } = "Chart.HorizontalBar";
13134
13135 /// <summary>
13136 /// 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.
13137 /// </summary>
13138 [JsonPropertyName("id")]
13139 public string? Id { get; set; }
13140
13141 /// <summary>
13142 /// 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).
13143 /// </summary>
13144 [JsonPropertyName("requires")]
13145 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
13146
13147 /// <summary>
13148 /// The locale associated with the element.
13149 /// </summary>
13150 [JsonPropertyName("lang")]
13151 public string? Lang { get; set; }
13152
13153 /// <summary>
13154 /// Controls the visibility of the element.
13155 /// </summary>
13156 [JsonPropertyName("isVisible")]
13157 public bool? IsVisible { get; set; } = true;
13158
13159 /// <summary>
13160 /// 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.
13161 /// </summary>
13162 [JsonPropertyName("separator")]
13163 public bool? Separator { get; set; } = false;
13164
13165 /// <summary>
13166 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13167 /// </summary>
13168 [JsonPropertyName("height")]
13169 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
13170
13171 /// <summary>
13172 /// Controls how the element should be horizontally aligned.
13173 /// </summary>
13174 [JsonPropertyName("horizontalAlignment")]
13175 public HorizontalAlignment? HorizontalAlignment { get; set; }
13176
13177 /// <summary>
13178 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13179 /// </summary>
13180 [JsonPropertyName("spacing")]
13181 public Spacing? Spacing { get; set; } = Spacing.Default;
13182
13183 /// <summary>
13184 /// 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).
13185 /// </summary>
13186 [JsonPropertyName("targetWidth")]
13187 public TargetWidth? TargetWidth { get; set; }
13188
13189 /// <summary>
13190 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13191 /// </summary>
13192 [JsonPropertyName("isSortKey")]
13193 public bool? IsSortKey { get; set; } = false;
13194
13195 /// <summary>
13196 /// The title of the chart.
13197 /// </summary>
13198 [JsonPropertyName("title")]
13199 public string? Title { get; set; }
13200
13201 /// <summary>
13202 /// Controls whether the chart's title should be displayed. Defaults to `false`.
13203 /// </summary>
13204 [JsonPropertyName("showTitle")]
13205 public bool? ShowTitle { get; set; } = false;
13206
13207 /// <summary>
13208 /// 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).
13209 /// </summary>
13210 [JsonPropertyName("colorSet")]
13211 public ChartColorSet? ColorSet { get; set; }
13212
13213 /// <summary>
13214 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
13215 /// </summary>
13216 [JsonPropertyName("maxWidth")]
13217 public string? MaxWidth { get; set; }
13218
13219 /// <summary>
13220 /// Controls whether the chart's legend should be displayed.
13221 /// </summary>
13222 [JsonPropertyName("showLegend")]
13223 public bool? ShowLegend { get; set; } = true;
13224
13225 /// <summary>
13226 /// The title of the x axis.
13227 /// </summary>
13228 [JsonPropertyName("xAxisTitle")]
13229 public string? XAxisTitle { get; set; }
13230
13231 /// <summary>
13232 /// The title of the y axis.
13233 /// </summary>
13234 [JsonPropertyName("yAxisTitle")]
13235 public string? YAxisTitle { get; set; }
13236
13237 /// <summary>
13238 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
13239 /// </summary>
13240 [JsonPropertyName("color")]
13241 public ChartColor? Color { get; set; }
13242
13243 /// <summary>
13244 /// The data points in the chart.
13245 /// </summary>
13246 [JsonPropertyName("data")]
13247 public IList<HorizontalBarChartDataValue>? Data { get; set; }
13248
13249 /// <summary>
13250 /// Controls how the chart should be visually laid out.
13251 /// </summary>
13252 [JsonPropertyName("displayMode")]
13253 public HorizontalBarChartDisplayMode? DisplayMode { get; set; } = HorizontalBarChartDisplayMode.AbsoluteWithAxis;
13254
13255 /// <summary>
13256 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13257 /// </summary>
13258 [JsonPropertyName("grid.area")]
13259 public string? GridArea { get; set; }
13260
13261 /// <summary>
13262 /// 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.
13263 /// </summary>
13264 [JsonPropertyName("fallback")]
13265 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13266
13267 /// <summary>
13268 /// Serializes this HorizontalBarChart into a JSON string.
13269 /// </summary>
13270 public string Serialize()
13271 {
13272 return JsonSerializer.Serialize(
13273 this,
13274 new JsonSerializerOptions
13275 {
13276 WriteIndented = true,
13277 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13278 }
13279 );
13280 }
13281
13282 public HorizontalBarChart WithKey(string value)
13283 {
13284 this.Key = value;
13285 return this;
13286 }
13287
13288 public HorizontalBarChart WithId(string value)
13289 {
13290 this.Id = value;
13291 return this;
13292 }
13293
13294 public HorizontalBarChart WithRequires(HostCapabilities value)
13295 {
13296 this.Requires = value;
13297 return this;
13298 }
13299
13300 public HorizontalBarChart WithLang(string value)
13301 {
13302 this.Lang = value;
13303 return this;
13304 }
13305
13306 public HorizontalBarChart WithIsVisible(bool value)
13307 {
13308 this.IsVisible = value;
13309 return this;
13310 }
13311
13312 public HorizontalBarChart WithSeparator(bool value)
13313 {
13314 this.Separator = value;
13315 return this;
13316 }
13317
13318 public HorizontalBarChart WithHeight(ElementHeight value)
13319 {
13320 this.Height = value;
13321 return this;
13322 }
13323
13324 public HorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value)
13325 {
13326 this.HorizontalAlignment = value;
13327 return this;
13328 }
13329
13330 public HorizontalBarChart WithSpacing(Spacing value)
13331 {
13332 this.Spacing = value;
13333 return this;
13334 }
13335
13336 public HorizontalBarChart WithTargetWidth(TargetWidth value)
13337 {
13338 this.TargetWidth = value;
13339 return this;
13340 }
13341
13342 public HorizontalBarChart WithIsSortKey(bool value)
13343 {
13344 this.IsSortKey = value;
13345 return this;
13346 }
13347
13348 public HorizontalBarChart WithTitle(string value)
13349 {
13350 this.Title = value;
13351 return this;
13352 }
13353
13354 public HorizontalBarChart WithShowTitle(bool value)
13355 {
13356 this.ShowTitle = value;
13357 return this;
13358 }
13359
13360 public HorizontalBarChart WithColorSet(ChartColorSet value)
13361 {
13362 this.ColorSet = value;
13363 return this;
13364 }
13365
13366 public HorizontalBarChart WithMaxWidth(string value)
13367 {
13368 this.MaxWidth = value;
13369 return this;
13370 }
13371
13372 public HorizontalBarChart WithShowLegend(bool value)
13373 {
13374 this.ShowLegend = value;
13375 return this;
13376 }
13377
13378 public HorizontalBarChart WithXAxisTitle(string value)
13379 {
13380 this.XAxisTitle = value;
13381 return this;
13382 }
13383
13384 public HorizontalBarChart WithYAxisTitle(string value)
13385 {
13386 this.YAxisTitle = value;
13387 return this;
13388 }
13389
13390 public HorizontalBarChart WithColor(ChartColor value)
13391 {
13392 this.Color = value;
13393 return this;
13394 }
13395
13396 public HorizontalBarChart WithData(params HorizontalBarChartDataValue[] value)
13397 {
13398 this.Data = new List<HorizontalBarChartDataValue>(value);
13399 return this;
13400 }
13401
13402 public HorizontalBarChart WithData(IList<HorizontalBarChartDataValue> value)
13403 {
13404 this.Data = value;
13405 return this;
13406 }
13407
13408 public HorizontalBarChart WithDisplayMode(HorizontalBarChartDisplayMode value)
13409 {
13410 this.DisplayMode = value;
13411 return this;
13412 }
13413
13414 public HorizontalBarChart WithGridArea(string value)
13415 {
13416 this.GridArea = value;
13417 return this;
13418 }
13419
13420 public HorizontalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
13421 {
13422 this.Fallback = value;
13423 return this;
13424 }
13425}
13426
13427/// <summary>
13428/// Represents a single data point in a horizontal bar chart.
13429/// </summary>
13430public class HorizontalBarChartDataValue : SerializableObject
13431{
13432 /// <summary>
13433 /// Deserializes a JSON string into an object of type HorizontalBarChartDataValue.
13434 /// </summary>
13435 public static HorizontalBarChartDataValue? Deserialize(string json)
13436 {
13437 return JsonSerializer.Deserialize<HorizontalBarChartDataValue>(json);
13438 }
13439
13440 /// <summary>
13441 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13442 /// </summary>
13443 [JsonPropertyName("key")]
13444 public string? Key { get; set; }
13445
13446 /// <summary>
13447 /// The x axis value of the data point.
13448 /// </summary>
13449 [JsonPropertyName("x")]
13450 public string? X { get; set; }
13451
13452 /// <summary>
13453 /// The y axis value of the data point.
13454 /// </summary>
13455 [JsonPropertyName("y")]
13456 public float? Y { get; set; } = 0;
13457
13458 /// <summary>
13459 /// The color of the bar associated with the data point. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
13460 /// </summary>
13461 [JsonPropertyName("color")]
13462 public ChartColor? Color { get; set; }
13463
13464 /// <summary>
13465 /// Serializes this HorizontalBarChartDataValue into a JSON string.
13466 /// </summary>
13467 public string Serialize()
13468 {
13469 return JsonSerializer.Serialize(
13470 this,
13471 new JsonSerializerOptions
13472 {
13473 WriteIndented = true,
13474 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13475 }
13476 );
13477 }
13478
13479 public HorizontalBarChartDataValue WithKey(string value)
13480 {
13481 this.Key = value;
13482 return this;
13483 }
13484
13485 public HorizontalBarChartDataValue WithX(string value)
13486 {
13487 this.X = value;
13488 return this;
13489 }
13490
13491 public HorizontalBarChartDataValue WithY(float value)
13492 {
13493 this.Y = value;
13494 return this;
13495 }
13496
13497 public HorizontalBarChartDataValue WithColor(ChartColor value)
13498 {
13499 this.Color = value;
13500 return this;
13501 }
13502}
13503
13504/// <summary>
13505/// A stacked horizontal bar chart.
13506/// </summary>
13507public class StackedHorizontalBarChart : CardElement
13508{
13509 /// <summary>
13510 /// Deserializes a JSON string into an object of type StackedHorizontalBarChart.
13511 /// </summary>
13512 public static StackedHorizontalBarChart? Deserialize(string json)
13513 {
13514 return JsonSerializer.Deserialize<StackedHorizontalBarChart>(json);
13515 }
13516
13517 /// <summary>
13518 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13519 /// </summary>
13520 [JsonPropertyName("key")]
13521 public string? Key { get; set; }
13522
13523 /// <summary>
13524 /// Must be **Chart.HorizontalBar.Stacked**.
13525 /// </summary>
13526 [JsonPropertyName("type")]
13527 public string Type { get; } = "Chart.HorizontalBar.Stacked";
13528
13529 /// <summary>
13530 /// 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.
13531 /// </summary>
13532 [JsonPropertyName("id")]
13533 public string? Id { get; set; }
13534
13535 /// <summary>
13536 /// 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).
13537 /// </summary>
13538 [JsonPropertyName("requires")]
13539 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
13540
13541 /// <summary>
13542 /// The locale associated with the element.
13543 /// </summary>
13544 [JsonPropertyName("lang")]
13545 public string? Lang { get; set; }
13546
13547 /// <summary>
13548 /// Controls the visibility of the element.
13549 /// </summary>
13550 [JsonPropertyName("isVisible")]
13551 public bool? IsVisible { get; set; } = true;
13552
13553 /// <summary>
13554 /// 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.
13555 /// </summary>
13556 [JsonPropertyName("separator")]
13557 public bool? Separator { get; set; } = false;
13558
13559 /// <summary>
13560 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
13561 /// </summary>
13562 [JsonPropertyName("height")]
13563 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
13564
13565 /// <summary>
13566 /// Controls how the element should be horizontally aligned.
13567 /// </summary>
13568 [JsonPropertyName("horizontalAlignment")]
13569 public HorizontalAlignment? HorizontalAlignment { get; set; }
13570
13571 /// <summary>
13572 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
13573 /// </summary>
13574 [JsonPropertyName("spacing")]
13575 public Spacing? Spacing { get; set; } = Spacing.Default;
13576
13577 /// <summary>
13578 /// 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).
13579 /// </summary>
13580 [JsonPropertyName("targetWidth")]
13581 public TargetWidth? TargetWidth { get; set; }
13582
13583 /// <summary>
13584 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
13585 /// </summary>
13586 [JsonPropertyName("isSortKey")]
13587 public bool? IsSortKey { get; set; } = false;
13588
13589 /// <summary>
13590 /// The title of the chart.
13591 /// </summary>
13592 [JsonPropertyName("title")]
13593 public string? Title { get; set; }
13594
13595 /// <summary>
13596 /// Controls whether the chart's title should be displayed. Defaults to `false`.
13597 /// </summary>
13598 [JsonPropertyName("showTitle")]
13599 public bool? ShowTitle { get; set; } = false;
13600
13601 /// <summary>
13602 /// 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).
13603 /// </summary>
13604 [JsonPropertyName("colorSet")]
13605 public ChartColorSet? ColorSet { get; set; }
13606
13607 /// <summary>
13608 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
13609 /// </summary>
13610 [JsonPropertyName("maxWidth")]
13611 public string? MaxWidth { get; set; }
13612
13613 /// <summary>
13614 /// Controls whether the chart's legend should be displayed.
13615 /// </summary>
13616 [JsonPropertyName("showLegend")]
13617 public bool? ShowLegend { get; set; } = true;
13618
13619 /// <summary>
13620 /// The title of the x axis.
13621 /// </summary>
13622 [JsonPropertyName("xAxisTitle")]
13623 public string? XAxisTitle { get; set; }
13624
13625 /// <summary>
13626 /// The title of the y axis.
13627 /// </summary>
13628 [JsonPropertyName("yAxisTitle")]
13629 public string? YAxisTitle { get; set; }
13630
13631 /// <summary>
13632 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
13633 /// </summary>
13634 [JsonPropertyName("color")]
13635 public ChartColor? Color { get; set; }
13636
13637 /// <summary>
13638 /// The data to display in the chart.
13639 /// </summary>
13640 [JsonPropertyName("data")]
13641 public IList<StackedHorizontalBarChartData>? Data { get; set; }
13642
13643 /// <summary>
13644 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
13645 /// </summary>
13646 [JsonPropertyName("grid.area")]
13647 public string? GridArea { get; set; }
13648
13649 /// <summary>
13650 /// 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.
13651 /// </summary>
13652 [JsonPropertyName("fallback")]
13653 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
13654
13655 /// <summary>
13656 /// Serializes this StackedHorizontalBarChart into a JSON string.
13657 /// </summary>
13658 public string Serialize()
13659 {
13660 return JsonSerializer.Serialize(
13661 this,
13662 new JsonSerializerOptions
13663 {
13664 WriteIndented = true,
13665 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13666 }
13667 );
13668 }
13669
13670 public StackedHorizontalBarChart WithKey(string value)
13671 {
13672 this.Key = value;
13673 return this;
13674 }
13675
13676 public StackedHorizontalBarChart WithId(string value)
13677 {
13678 this.Id = value;
13679 return this;
13680 }
13681
13682 public StackedHorizontalBarChart WithRequires(HostCapabilities value)
13683 {
13684 this.Requires = value;
13685 return this;
13686 }
13687
13688 public StackedHorizontalBarChart WithLang(string value)
13689 {
13690 this.Lang = value;
13691 return this;
13692 }
13693
13694 public StackedHorizontalBarChart WithIsVisible(bool value)
13695 {
13696 this.IsVisible = value;
13697 return this;
13698 }
13699
13700 public StackedHorizontalBarChart WithSeparator(bool value)
13701 {
13702 this.Separator = value;
13703 return this;
13704 }
13705
13706 public StackedHorizontalBarChart WithHeight(ElementHeight value)
13707 {
13708 this.Height = value;
13709 return this;
13710 }
13711
13712 public StackedHorizontalBarChart WithHorizontalAlignment(HorizontalAlignment value)
13713 {
13714 this.HorizontalAlignment = value;
13715 return this;
13716 }
13717
13718 public StackedHorizontalBarChart WithSpacing(Spacing value)
13719 {
13720 this.Spacing = value;
13721 return this;
13722 }
13723
13724 public StackedHorizontalBarChart WithTargetWidth(TargetWidth value)
13725 {
13726 this.TargetWidth = value;
13727 return this;
13728 }
13729
13730 public StackedHorizontalBarChart WithIsSortKey(bool value)
13731 {
13732 this.IsSortKey = value;
13733 return this;
13734 }
13735
13736 public StackedHorizontalBarChart WithTitle(string value)
13737 {
13738 this.Title = value;
13739 return this;
13740 }
13741
13742 public StackedHorizontalBarChart WithShowTitle(bool value)
13743 {
13744 this.ShowTitle = value;
13745 return this;
13746 }
13747
13748 public StackedHorizontalBarChart WithColorSet(ChartColorSet value)
13749 {
13750 this.ColorSet = value;
13751 return this;
13752 }
13753
13754 public StackedHorizontalBarChart WithMaxWidth(string value)
13755 {
13756 this.MaxWidth = value;
13757 return this;
13758 }
13759
13760 public StackedHorizontalBarChart WithShowLegend(bool value)
13761 {
13762 this.ShowLegend = value;
13763 return this;
13764 }
13765
13766 public StackedHorizontalBarChart WithXAxisTitle(string value)
13767 {
13768 this.XAxisTitle = value;
13769 return this;
13770 }
13771
13772 public StackedHorizontalBarChart WithYAxisTitle(string value)
13773 {
13774 this.YAxisTitle = value;
13775 return this;
13776 }
13777
13778 public StackedHorizontalBarChart WithColor(ChartColor value)
13779 {
13780 this.Color = value;
13781 return this;
13782 }
13783
13784 public StackedHorizontalBarChart WithData(params StackedHorizontalBarChartData[] value)
13785 {
13786 this.Data = new List<StackedHorizontalBarChartData>(value);
13787 return this;
13788 }
13789
13790 public StackedHorizontalBarChart WithData(IList<StackedHorizontalBarChartData> value)
13791 {
13792 this.Data = value;
13793 return this;
13794 }
13795
13796 public StackedHorizontalBarChart WithGridArea(string value)
13797 {
13798 this.GridArea = value;
13799 return this;
13800 }
13801
13802 public StackedHorizontalBarChart WithFallback(IUnion<CardElement, FallbackElement> value)
13803 {
13804 this.Fallback = value;
13805 return this;
13806 }
13807}
13808
13809/// <summary>
13810/// Defines the collection of data series to display in as a stacked horizontal bar chart.
13811/// </summary>
13812public class StackedHorizontalBarChartData : SerializableObject
13813{
13814 /// <summary>
13815 /// Deserializes a JSON string into an object of type StackedHorizontalBarChartData.
13816 /// </summary>
13817 public static StackedHorizontalBarChartData? Deserialize(string json)
13818 {
13819 return JsonSerializer.Deserialize<StackedHorizontalBarChartData>(json);
13820 }
13821
13822 /// <summary>
13823 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13824 /// </summary>
13825 [JsonPropertyName("key")]
13826 public string? Key { get; set; }
13827
13828 /// <summary>
13829 /// The title of the series.
13830 /// </summary>
13831 [JsonPropertyName("title")]
13832 public string? Title { get; set; }
13833
13834 /// <summary>
13835 /// The data points in the series.
13836 /// </summary>
13837 [JsonPropertyName("data")]
13838 public IList<StackedHorizontalBarChartDataPoint>? Data { get; set; }
13839
13840 /// <summary>
13841 /// Serializes this StackedHorizontalBarChartData into a JSON string.
13842 /// </summary>
13843 public string Serialize()
13844 {
13845 return JsonSerializer.Serialize(
13846 this,
13847 new JsonSerializerOptions
13848 {
13849 WriteIndented = true,
13850 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13851 }
13852 );
13853 }
13854
13855 public StackedHorizontalBarChartData WithKey(string value)
13856 {
13857 this.Key = value;
13858 return this;
13859 }
13860
13861 public StackedHorizontalBarChartData WithTitle(string value)
13862 {
13863 this.Title = value;
13864 return this;
13865 }
13866
13867 public StackedHorizontalBarChartData WithData(params StackedHorizontalBarChartDataPoint[] value)
13868 {
13869 this.Data = new List<StackedHorizontalBarChartDataPoint>(value);
13870 return this;
13871 }
13872
13873 public StackedHorizontalBarChartData WithData(IList<StackedHorizontalBarChartDataPoint> value)
13874 {
13875 this.Data = value;
13876 return this;
13877 }
13878}
13879
13880/// <summary>
13881/// A data point in a series.
13882/// </summary>
13883public class StackedHorizontalBarChartDataPoint : SerializableObject
13884{
13885 /// <summary>
13886 /// Deserializes a JSON string into an object of type StackedHorizontalBarChartDataPoint.
13887 /// </summary>
13888 public static StackedHorizontalBarChartDataPoint? Deserialize(string json)
13889 {
13890 return JsonSerializer.Deserialize<StackedHorizontalBarChartDataPoint>(json);
13891 }
13892
13893 /// <summary>
13894 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13895 /// </summary>
13896 [JsonPropertyName("key")]
13897 public string? Key { get; set; }
13898
13899 /// <summary>
13900 /// The legend associated with the data point.
13901 /// </summary>
13902 [JsonPropertyName("legend")]
13903 public string? Legend { get; set; }
13904
13905 /// <summary>
13906 /// The value of the data point.
13907 /// </summary>
13908 [JsonPropertyName("value")]
13909 public float? Value { get; set; } = 0;
13910
13911 /// <summary>
13912 /// 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).
13913 /// </summary>
13914 [JsonPropertyName("color")]
13915 public ChartColor? Color { get; set; }
13916
13917 /// <summary>
13918 /// Serializes this StackedHorizontalBarChartDataPoint into a JSON string.
13919 /// </summary>
13920 public string Serialize()
13921 {
13922 return JsonSerializer.Serialize(
13923 this,
13924 new JsonSerializerOptions
13925 {
13926 WriteIndented = true,
13927 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
13928 }
13929 );
13930 }
13931
13932 public StackedHorizontalBarChartDataPoint WithKey(string value)
13933 {
13934 this.Key = value;
13935 return this;
13936 }
13937
13938 public StackedHorizontalBarChartDataPoint WithLegend(string value)
13939 {
13940 this.Legend = value;
13941 return this;
13942 }
13943
13944 public StackedHorizontalBarChartDataPoint WithValue(float value)
13945 {
13946 this.Value = value;
13947 return this;
13948 }
13949
13950 public StackedHorizontalBarChartDataPoint WithColor(ChartColor value)
13951 {
13952 this.Color = value;
13953 return this;
13954 }
13955}
13956
13957/// <summary>
13958/// A line chart.
13959/// </summary>
13960public class LineChart : CardElement
13961{
13962 /// <summary>
13963 /// Deserializes a JSON string into an object of type LineChart.
13964 /// </summary>
13965 public static LineChart? Deserialize(string json)
13966 {
13967 return JsonSerializer.Deserialize<LineChart>(json);
13968 }
13969
13970 /// <summary>
13971 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
13972 /// </summary>
13973 [JsonPropertyName("key")]
13974 public string? Key { get; set; }
13975
13976 /// <summary>
13977 /// Must be **Chart.Line**.
13978 /// </summary>
13979 [JsonPropertyName("type")]
13980 public string Type { get; } = "Chart.Line";
13981
13982 /// <summary>
13983 /// 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.
13984 /// </summary>
13985 [JsonPropertyName("id")]
13986 public string? Id { get; set; }
13987
13988 /// <summary>
13989 /// 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).
13990 /// </summary>
13991 [JsonPropertyName("requires")]
13992 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
13993
13994 /// <summary>
13995 /// The locale associated with the element.
13996 /// </summary>
13997 [JsonPropertyName("lang")]
13998 public string? Lang { get; set; }
13999
14000 /// <summary>
14001 /// Controls the visibility of the element.
14002 /// </summary>
14003 [JsonPropertyName("isVisible")]
14004 public bool? IsVisible { get; set; } = true;
14005
14006 /// <summary>
14007 /// 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.
14008 /// </summary>
14009 [JsonPropertyName("separator")]
14010 public bool? Separator { get; set; } = false;
14011
14012 /// <summary>
14013 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14014 /// </summary>
14015 [JsonPropertyName("height")]
14016 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
14017
14018 /// <summary>
14019 /// Controls how the element should be horizontally aligned.
14020 /// </summary>
14021 [JsonPropertyName("horizontalAlignment")]
14022 public HorizontalAlignment? HorizontalAlignment { get; set; }
14023
14024 /// <summary>
14025 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
14026 /// </summary>
14027 [JsonPropertyName("spacing")]
14028 public Spacing? Spacing { get; set; } = Spacing.Default;
14029
14030 /// <summary>
14031 /// 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).
14032 /// </summary>
14033 [JsonPropertyName("targetWidth")]
14034 public TargetWidth? TargetWidth { get; set; }
14035
14036 /// <summary>
14037 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14038 /// </summary>
14039 [JsonPropertyName("isSortKey")]
14040 public bool? IsSortKey { get; set; } = false;
14041
14042 /// <summary>
14043 /// The title of the chart.
14044 /// </summary>
14045 [JsonPropertyName("title")]
14046 public string? Title { get; set; }
14047
14048 /// <summary>
14049 /// Controls whether the chart's title should be displayed. Defaults to `false`.
14050 /// </summary>
14051 [JsonPropertyName("showTitle")]
14052 public bool? ShowTitle { get; set; } = false;
14053
14054 /// <summary>
14055 /// 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).
14056 /// </summary>
14057 [JsonPropertyName("colorSet")]
14058 public ChartColorSet? ColorSet { get; set; }
14059
14060 /// <summary>
14061 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
14062 /// </summary>
14063 [JsonPropertyName("maxWidth")]
14064 public string? MaxWidth { get; set; }
14065
14066 /// <summary>
14067 /// Controls whether the chart's legend should be displayed.
14068 /// </summary>
14069 [JsonPropertyName("showLegend")]
14070 public bool? ShowLegend { get; set; } = true;
14071
14072 /// <summary>
14073 /// The title of the x axis.
14074 /// </summary>
14075 [JsonPropertyName("xAxisTitle")]
14076 public string? XAxisTitle { get; set; }
14077
14078 /// <summary>
14079 /// The title of the y axis.
14080 /// </summary>
14081 [JsonPropertyName("yAxisTitle")]
14082 public string? YAxisTitle { get; set; }
14083
14084 /// <summary>
14085 /// The color to use for all data points. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
14086 /// </summary>
14087 [JsonPropertyName("color")]
14088 public ChartColor? Color { get; set; }
14089
14090 /// <summary>
14091 /// The data point series in the line chart.
14092 /// </summary>
14093 [JsonPropertyName("data")]
14094 public IList<LineChartData>? Data { get; set; }
14095
14096 /// <summary>
14097 /// The maximum y range.
14098 /// </summary>
14099 [JsonPropertyName("yMin")]
14100 public float? YMin { get; set; }
14101
14102 /// <summary>
14103 /// The minimum y range.
14104 /// </summary>
14105 [JsonPropertyName("yMax")]
14106 public float? YMax { get; set; }
14107
14108 /// <summary>
14109 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14110 /// </summary>
14111 [JsonPropertyName("grid.area")]
14112 public string? GridArea { get; set; }
14113
14114 /// <summary>
14115 /// 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.
14116 /// </summary>
14117 [JsonPropertyName("fallback")]
14118 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14119
14120 /// <summary>
14121 /// Serializes this LineChart into a JSON string.
14122 /// </summary>
14123 public string Serialize()
14124 {
14125 return JsonSerializer.Serialize(
14126 this,
14127 new JsonSerializerOptions
14128 {
14129 WriteIndented = true,
14130 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14131 }
14132 );
14133 }
14134
14135 public LineChart WithKey(string value)
14136 {
14137 this.Key = value;
14138 return this;
14139 }
14140
14141 public LineChart WithId(string value)
14142 {
14143 this.Id = value;
14144 return this;
14145 }
14146
14147 public LineChart WithRequires(HostCapabilities value)
14148 {
14149 this.Requires = value;
14150 return this;
14151 }
14152
14153 public LineChart WithLang(string value)
14154 {
14155 this.Lang = value;
14156 return this;
14157 }
14158
14159 public LineChart WithIsVisible(bool value)
14160 {
14161 this.IsVisible = value;
14162 return this;
14163 }
14164
14165 public LineChart WithSeparator(bool value)
14166 {
14167 this.Separator = value;
14168 return this;
14169 }
14170
14171 public LineChart WithHeight(ElementHeight value)
14172 {
14173 this.Height = value;
14174 return this;
14175 }
14176
14177 public LineChart WithHorizontalAlignment(HorizontalAlignment value)
14178 {
14179 this.HorizontalAlignment = value;
14180 return this;
14181 }
14182
14183 public LineChart WithSpacing(Spacing value)
14184 {
14185 this.Spacing = value;
14186 return this;
14187 }
14188
14189 public LineChart WithTargetWidth(TargetWidth value)
14190 {
14191 this.TargetWidth = value;
14192 return this;
14193 }
14194
14195 public LineChart WithIsSortKey(bool value)
14196 {
14197 this.IsSortKey = value;
14198 return this;
14199 }
14200
14201 public LineChart WithTitle(string value)
14202 {
14203 this.Title = value;
14204 return this;
14205 }
14206
14207 public LineChart WithShowTitle(bool value)
14208 {
14209 this.ShowTitle = value;
14210 return this;
14211 }
14212
14213 public LineChart WithColorSet(ChartColorSet value)
14214 {
14215 this.ColorSet = value;
14216 return this;
14217 }
14218
14219 public LineChart WithMaxWidth(string value)
14220 {
14221 this.MaxWidth = value;
14222 return this;
14223 }
14224
14225 public LineChart WithShowLegend(bool value)
14226 {
14227 this.ShowLegend = value;
14228 return this;
14229 }
14230
14231 public LineChart WithXAxisTitle(string value)
14232 {
14233 this.XAxisTitle = value;
14234 return this;
14235 }
14236
14237 public LineChart WithYAxisTitle(string value)
14238 {
14239 this.YAxisTitle = value;
14240 return this;
14241 }
14242
14243 public LineChart WithColor(ChartColor value)
14244 {
14245 this.Color = value;
14246 return this;
14247 }
14248
14249 public LineChart WithData(params LineChartData[] value)
14250 {
14251 this.Data = new List<LineChartData>(value);
14252 return this;
14253 }
14254
14255 public LineChart WithData(IList<LineChartData> value)
14256 {
14257 this.Data = value;
14258 return this;
14259 }
14260
14261 public LineChart WithYMin(float value)
14262 {
14263 this.YMin = value;
14264 return this;
14265 }
14266
14267 public LineChart WithYMax(float value)
14268 {
14269 this.YMax = value;
14270 return this;
14271 }
14272
14273 public LineChart WithGridArea(string value)
14274 {
14275 this.GridArea = value;
14276 return this;
14277 }
14278
14279 public LineChart WithFallback(IUnion<CardElement, FallbackElement> value)
14280 {
14281 this.Fallback = value;
14282 return this;
14283 }
14284}
14285
14286/// <summary>
14287/// Represents a collection of data points series in a line chart.
14288/// </summary>
14289public class LineChartData : SerializableObject
14290{
14291 /// <summary>
14292 /// Deserializes a JSON string into an object of type LineChartData.
14293 /// </summary>
14294 public static LineChartData? Deserialize(string json)
14295 {
14296 return JsonSerializer.Deserialize<LineChartData>(json);
14297 }
14298
14299 /// <summary>
14300 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
14301 /// </summary>
14302 [JsonPropertyName("key")]
14303 public string? Key { get; set; }
14304
14305 /// <summary>
14306 /// The legend of the chart.
14307 /// </summary>
14308 [JsonPropertyName("legend")]
14309 public string? Legend { get; set; }
14310
14311 /// <summary>
14312 /// The data points in the series.
14313 /// </summary>
14314 [JsonPropertyName("values")]
14315 public IList<LineChartValue>? Values { get; set; }
14316
14317 /// <summary>
14318 /// The color all data points in the series. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
14319 /// </summary>
14320 [JsonPropertyName("color")]
14321 public ChartColor? Color { get; set; }
14322
14323 /// <summary>
14324 /// Serializes this LineChartData into a JSON string.
14325 /// </summary>
14326 public string Serialize()
14327 {
14328 return JsonSerializer.Serialize(
14329 this,
14330 new JsonSerializerOptions
14331 {
14332 WriteIndented = true,
14333 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14334 }
14335 );
14336 }
14337
14338 public LineChartData WithKey(string value)
14339 {
14340 this.Key = value;
14341 return this;
14342 }
14343
14344 public LineChartData WithLegend(string value)
14345 {
14346 this.Legend = value;
14347 return this;
14348 }
14349
14350 public LineChartData WithValues(params LineChartValue[] value)
14351 {
14352 this.Values = new List<LineChartValue>(value);
14353 return this;
14354 }
14355
14356 public LineChartData WithValues(IList<LineChartValue> value)
14357 {
14358 this.Values = value;
14359 return this;
14360 }
14361
14362 public LineChartData WithColor(ChartColor value)
14363 {
14364 this.Color = value;
14365 return this;
14366 }
14367}
14368
14369/// <summary>
14370/// Represents a single data point in a line chart.
14371/// </summary>
14372public class LineChartValue : SerializableObject
14373{
14374 /// <summary>
14375 /// Deserializes a JSON string into an object of type LineChartValue.
14376 /// </summary>
14377 public static LineChartValue? Deserialize(string json)
14378 {
14379 return JsonSerializer.Deserialize<LineChartValue>(json);
14380 }
14381
14382 /// <summary>
14383 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
14384 /// </summary>
14385 [JsonPropertyName("key")]
14386 public string? Key { get; set; }
14387
14388 /// <summary>
14389 /// The x axis value of the data point.
14390 ///
14391 /// 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.
14392 ///
14393 /// 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.
14394 /// </summary>
14395 [JsonPropertyName("x")]
14396 public IUnion<float, string>? X { get; set; }
14397
14398 /// <summary>
14399 /// The y axis value of the data point.
14400 /// </summary>
14401 [JsonPropertyName("y")]
14402 public float? Y { get; set; } = 0;
14403
14404 /// <summary>
14405 /// Serializes this LineChartValue into a JSON string.
14406 /// </summary>
14407 public string Serialize()
14408 {
14409 return JsonSerializer.Serialize(
14410 this,
14411 new JsonSerializerOptions
14412 {
14413 WriteIndented = true,
14414 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14415 }
14416 );
14417 }
14418
14419 public LineChartValue WithKey(string value)
14420 {
14421 this.Key = value;
14422 return this;
14423 }
14424
14425 public LineChartValue WithX(IUnion<float, string> value)
14426 {
14427 this.X = value;
14428 return this;
14429 }
14430
14431 public LineChartValue WithY(float value)
14432 {
14433 this.Y = value;
14434 return this;
14435 }
14436}
14437
14438/// <summary>
14439/// A gauge chart.
14440/// </summary>
14441public class GaugeChart : CardElement
14442{
14443 /// <summary>
14444 /// Deserializes a JSON string into an object of type GaugeChart.
14445 /// </summary>
14446 public static GaugeChart? Deserialize(string json)
14447 {
14448 return JsonSerializer.Deserialize<GaugeChart>(json);
14449 }
14450
14451 /// <summary>
14452 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
14453 /// </summary>
14454 [JsonPropertyName("key")]
14455 public string? Key { get; set; }
14456
14457 /// <summary>
14458 /// Must be **Chart.Gauge**.
14459 /// </summary>
14460 [JsonPropertyName("type")]
14461 public string Type { get; } = "Chart.Gauge";
14462
14463 /// <summary>
14464 /// 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.
14465 /// </summary>
14466 [JsonPropertyName("id")]
14467 public string? Id { get; set; }
14468
14469 /// <summary>
14470 /// 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).
14471 /// </summary>
14472 [JsonPropertyName("requires")]
14473 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
14474
14475 /// <summary>
14476 /// The locale associated with the element.
14477 /// </summary>
14478 [JsonPropertyName("lang")]
14479 public string? Lang { get; set; }
14480
14481 /// <summary>
14482 /// Controls the visibility of the element.
14483 /// </summary>
14484 [JsonPropertyName("isVisible")]
14485 public bool? IsVisible { get; set; } = true;
14486
14487 /// <summary>
14488 /// 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.
14489 /// </summary>
14490 [JsonPropertyName("separator")]
14491 public bool? Separator { get; set; } = false;
14492
14493 /// <summary>
14494 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14495 /// </summary>
14496 [JsonPropertyName("height")]
14497 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
14498
14499 /// <summary>
14500 /// Controls how the element should be horizontally aligned.
14501 /// </summary>
14502 [JsonPropertyName("horizontalAlignment")]
14503 public HorizontalAlignment? HorizontalAlignment { get; set; }
14504
14505 /// <summary>
14506 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
14507 /// </summary>
14508 [JsonPropertyName("spacing")]
14509 public Spacing? Spacing { get; set; } = Spacing.Default;
14510
14511 /// <summary>
14512 /// 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).
14513 /// </summary>
14514 [JsonPropertyName("targetWidth")]
14515 public TargetWidth? TargetWidth { get; set; }
14516
14517 /// <summary>
14518 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14519 /// </summary>
14520 [JsonPropertyName("isSortKey")]
14521 public bool? IsSortKey { get; set; } = false;
14522
14523 /// <summary>
14524 /// The title of the chart.
14525 /// </summary>
14526 [JsonPropertyName("title")]
14527 public string? Title { get; set; }
14528
14529 /// <summary>
14530 /// Controls whether the chart's title should be displayed. Defaults to `false`.
14531 /// </summary>
14532 [JsonPropertyName("showTitle")]
14533 public bool? ShowTitle { get; set; } = false;
14534
14535 /// <summary>
14536 /// 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).
14537 /// </summary>
14538 [JsonPropertyName("colorSet")]
14539 public ChartColorSet? ColorSet { get; set; }
14540
14541 /// <summary>
14542 /// The maximum width, in pixels, of the chart, in the `<number>px` format.
14543 /// </summary>
14544 [JsonPropertyName("maxWidth")]
14545 public string? MaxWidth { get; set; }
14546
14547 /// <summary>
14548 /// Controls whether the chart's legend should be displayed.
14549 /// </summary>
14550 [JsonPropertyName("showLegend")]
14551 public bool? ShowLegend { get; set; } = true;
14552
14553 /// <summary>
14554 /// The minimum value of the gauge.
14555 /// </summary>
14556 [JsonPropertyName("min")]
14557 public float? Min { get; set; } = 0;
14558
14559 /// <summary>
14560 /// The maximum value of the gauge.
14561 /// </summary>
14562 [JsonPropertyName("max")]
14563 public float? Max { get; set; }
14564
14565 /// <summary>
14566 /// The sub-label of the gauge.
14567 /// </summary>
14568 [JsonPropertyName("subLabel")]
14569 public string? SubLabel { get; set; }
14570
14571 /// <summary>
14572 /// Controls whether the min/max values should be displayed.
14573 /// </summary>
14574 [JsonPropertyName("showMinMax")]
14575 public bool? ShowMinMax { get; set; } = true;
14576
14577 /// <summary>
14578 /// Controls whether the gauge's needle is displayed. Default is **true**.
14579 /// </summary>
14580 [JsonPropertyName("showNeedle")]
14581 public bool? ShowNeedle { get; set; } = true;
14582
14583 /// <summary>
14584 /// Controls whether the outlines of the gauge segments are displayed.
14585 /// </summary>
14586 [JsonPropertyName("showOutlines")]
14587 public bool? ShowOutlines { get; set; } = true;
14588
14589 /// <summary>
14590 /// The segments to display in the gauge.
14591 /// </summary>
14592 [JsonPropertyName("segments")]
14593 public IList<GaugeChartLegend>? Segments { get; set; }
14594
14595 /// <summary>
14596 /// The value of the gauge.
14597 /// </summary>
14598 [JsonPropertyName("value")]
14599 public float? Value { get; set; } = 0;
14600
14601 /// <summary>
14602 /// The format used to display the gauge's value.
14603 /// </summary>
14604 [JsonPropertyName("valueFormat")]
14605 public GaugeChartValueFormat? ValueFormat { get; set; } = GaugeChartValueFormat.Percentage;
14606
14607 /// <summary>
14608 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14609 /// </summary>
14610 [JsonPropertyName("grid.area")]
14611 public string? GridArea { get; set; }
14612
14613 /// <summary>
14614 /// 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.
14615 /// </summary>
14616 [JsonPropertyName("fallback")]
14617 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14618
14619 /// <summary>
14620 /// Serializes this GaugeChart into a JSON string.
14621 /// </summary>
14622 public string Serialize()
14623 {
14624 return JsonSerializer.Serialize(
14625 this,
14626 new JsonSerializerOptions
14627 {
14628 WriteIndented = true,
14629 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14630 }
14631 );
14632 }
14633
14634 public GaugeChart WithKey(string value)
14635 {
14636 this.Key = value;
14637 return this;
14638 }
14639
14640 public GaugeChart WithId(string value)
14641 {
14642 this.Id = value;
14643 return this;
14644 }
14645
14646 public GaugeChart WithRequires(HostCapabilities value)
14647 {
14648 this.Requires = value;
14649 return this;
14650 }
14651
14652 public GaugeChart WithLang(string value)
14653 {
14654 this.Lang = value;
14655 return this;
14656 }
14657
14658 public GaugeChart WithIsVisible(bool value)
14659 {
14660 this.IsVisible = value;
14661 return this;
14662 }
14663
14664 public GaugeChart WithSeparator(bool value)
14665 {
14666 this.Separator = value;
14667 return this;
14668 }
14669
14670 public GaugeChart WithHeight(ElementHeight value)
14671 {
14672 this.Height = value;
14673 return this;
14674 }
14675
14676 public GaugeChart WithHorizontalAlignment(HorizontalAlignment value)
14677 {
14678 this.HorizontalAlignment = value;
14679 return this;
14680 }
14681
14682 public GaugeChart WithSpacing(Spacing value)
14683 {
14684 this.Spacing = value;
14685 return this;
14686 }
14687
14688 public GaugeChart WithTargetWidth(TargetWidth value)
14689 {
14690 this.TargetWidth = value;
14691 return this;
14692 }
14693
14694 public GaugeChart WithIsSortKey(bool value)
14695 {
14696 this.IsSortKey = value;
14697 return this;
14698 }
14699
14700 public GaugeChart WithTitle(string value)
14701 {
14702 this.Title = value;
14703 return this;
14704 }
14705
14706 public GaugeChart WithShowTitle(bool value)
14707 {
14708 this.ShowTitle = value;
14709 return this;
14710 }
14711
14712 public GaugeChart WithColorSet(ChartColorSet value)
14713 {
14714 this.ColorSet = value;
14715 return this;
14716 }
14717
14718 public GaugeChart WithMaxWidth(string value)
14719 {
14720 this.MaxWidth = value;
14721 return this;
14722 }
14723
14724 public GaugeChart WithShowLegend(bool value)
14725 {
14726 this.ShowLegend = value;
14727 return this;
14728 }
14729
14730 public GaugeChart WithMin(float value)
14731 {
14732 this.Min = value;
14733 return this;
14734 }
14735
14736 public GaugeChart WithMax(float value)
14737 {
14738 this.Max = value;
14739 return this;
14740 }
14741
14742 public GaugeChart WithSubLabel(string value)
14743 {
14744 this.SubLabel = value;
14745 return this;
14746 }
14747
14748 public GaugeChart WithShowMinMax(bool value)
14749 {
14750 this.ShowMinMax = value;
14751 return this;
14752 }
14753
14754 public GaugeChart WithShowNeedle(bool value)
14755 {
14756 this.ShowNeedle = value;
14757 return this;
14758 }
14759
14760 public GaugeChart WithShowOutlines(bool value)
14761 {
14762 this.ShowOutlines = value;
14763 return this;
14764 }
14765
14766 public GaugeChart WithSegments(params GaugeChartLegend[] value)
14767 {
14768 this.Segments = new List<GaugeChartLegend>(value);
14769 return this;
14770 }
14771
14772 public GaugeChart WithSegments(IList<GaugeChartLegend> value)
14773 {
14774 this.Segments = value;
14775 return this;
14776 }
14777
14778 public GaugeChart WithValue(float value)
14779 {
14780 this.Value = value;
14781 return this;
14782 }
14783
14784 public GaugeChart WithValueFormat(GaugeChartValueFormat value)
14785 {
14786 this.ValueFormat = value;
14787 return this;
14788 }
14789
14790 public GaugeChart WithGridArea(string value)
14791 {
14792 this.GridArea = value;
14793 return this;
14794 }
14795
14796 public GaugeChart WithFallback(IUnion<CardElement, FallbackElement> value)
14797 {
14798 this.Fallback = value;
14799 return this;
14800 }
14801}
14802
14803/// <summary>
14804/// The legend of the chart.
14805/// </summary>
14806public class GaugeChartLegend : SerializableObject
14807{
14808 /// <summary>
14809 /// Deserializes a JSON string into an object of type GaugeChartLegend.
14810 /// </summary>
14811 public static GaugeChartLegend? Deserialize(string json)
14812 {
14813 return JsonSerializer.Deserialize<GaugeChartLegend>(json);
14814 }
14815
14816 /// <summary>
14817 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
14818 /// </summary>
14819 [JsonPropertyName("key")]
14820 public string? Key { get; set; }
14821
14822 /// <summary>
14823 /// The size of the segment.
14824 /// </summary>
14825 [JsonPropertyName("size")]
14826 public float? Size { get; set; } = 0;
14827
14828 /// <summary>
14829 /// The legend text associated with the segment.
14830 /// </summary>
14831 [JsonPropertyName("legend")]
14832 public string? Legend { get; set; }
14833
14834 /// <summary>
14835 /// The color to use for the segment. See [Chart colors reference](https://adaptivecards.microsoft.com/?topic=chart-colors-reference).
14836 /// </summary>
14837 [JsonPropertyName("color")]
14838 public ChartColor? Color { get; set; }
14839
14840 /// <summary>
14841 /// Serializes this GaugeChartLegend into a JSON string.
14842 /// </summary>
14843 public string Serialize()
14844 {
14845 return JsonSerializer.Serialize(
14846 this,
14847 new JsonSerializerOptions
14848 {
14849 WriteIndented = true,
14850 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
14851 }
14852 );
14853 }
14854
14855 public GaugeChartLegend WithKey(string value)
14856 {
14857 this.Key = value;
14858 return this;
14859 }
14860
14861 public GaugeChartLegend WithSize(float value)
14862 {
14863 this.Size = value;
14864 return this;
14865 }
14866
14867 public GaugeChartLegend WithLegend(string value)
14868 {
14869 this.Legend = value;
14870 return this;
14871 }
14872
14873 public GaugeChartLegend WithColor(ChartColor value)
14874 {
14875 this.Color = value;
14876 return this;
14877 }
14878}
14879
14880/// <summary>
14881/// A formatted and syntax-colored code block.
14882/// </summary>
14883public class CodeBlock : CardElement
14884{
14885 /// <summary>
14886 /// Deserializes a JSON string into an object of type CodeBlock.
14887 /// </summary>
14888 public static CodeBlock? Deserialize(string json)
14889 {
14890 return JsonSerializer.Deserialize<CodeBlock>(json);
14891 }
14892
14893 /// <summary>
14894 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
14895 /// </summary>
14896 [JsonPropertyName("key")]
14897 public string? Key { get; set; }
14898
14899 /// <summary>
14900 /// Must be **CodeBlock**.
14901 /// </summary>
14902 [JsonPropertyName("type")]
14903 public string Type { get; } = "CodeBlock";
14904
14905 /// <summary>
14906 /// 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.
14907 /// </summary>
14908 [JsonPropertyName("id")]
14909 public string? Id { get; set; }
14910
14911 /// <summary>
14912 /// 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).
14913 /// </summary>
14914 [JsonPropertyName("requires")]
14915 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
14916
14917 /// <summary>
14918 /// The locale associated with the element.
14919 /// </summary>
14920 [JsonPropertyName("lang")]
14921 public string? Lang { get; set; }
14922
14923 /// <summary>
14924 /// Controls the visibility of the element.
14925 /// </summary>
14926 [JsonPropertyName("isVisible")]
14927 public bool? IsVisible { get; set; } = true;
14928
14929 /// <summary>
14930 /// 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.
14931 /// </summary>
14932 [JsonPropertyName("separator")]
14933 public bool? Separator { get; set; } = false;
14934
14935 /// <summary>
14936 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
14937 /// </summary>
14938 [JsonPropertyName("height")]
14939 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
14940
14941 /// <summary>
14942 /// Controls how the element should be horizontally aligned.
14943 /// </summary>
14944 [JsonPropertyName("horizontalAlignment")]
14945 public HorizontalAlignment? HorizontalAlignment { get; set; }
14946
14947 /// <summary>
14948 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
14949 /// </summary>
14950 [JsonPropertyName("spacing")]
14951 public Spacing? Spacing { get; set; } = Spacing.Default;
14952
14953 /// <summary>
14954 /// 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).
14955 /// </summary>
14956 [JsonPropertyName("targetWidth")]
14957 public TargetWidth? TargetWidth { get; set; }
14958
14959 /// <summary>
14960 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
14961 /// </summary>
14962 [JsonPropertyName("isSortKey")]
14963 public bool? IsSortKey { get; set; } = false;
14964
14965 /// <summary>
14966 /// The code snippet to display.
14967 /// </summary>
14968 [JsonPropertyName("codeSnippet")]
14969 public string? CodeSnippet { get; set; }
14970
14971 /// <summary>
14972 /// The language the code snippet is expressed in.
14973 /// </summary>
14974 [JsonPropertyName("language")]
14975 public CodeLanguage? Language { get; set; } = CodeLanguage.PlainText;
14976
14977 /// <summary>
14978 /// A number that represents the line in the file from where the code snippet was extracted.
14979 /// </summary>
14980 [JsonPropertyName("startLineNumber")]
14981 public float? StartLineNumber { get; set; } = 1;
14982
14983 /// <summary>
14984 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
14985 /// </summary>
14986 [JsonPropertyName("grid.area")]
14987 public string? GridArea { get; set; }
14988
14989 /// <summary>
14990 /// 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.
14991 /// </summary>
14992 [JsonPropertyName("fallback")]
14993 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
14994
14995 /// <summary>
14996 /// Serializes this CodeBlock into a JSON string.
14997 /// </summary>
14998 public string Serialize()
14999 {
15000 return JsonSerializer.Serialize(
15001 this,
15002 new JsonSerializerOptions
15003 {
15004 WriteIndented = true,
15005 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15006 }
15007 );
15008 }
15009
15010 public CodeBlock WithKey(string value)
15011 {
15012 this.Key = value;
15013 return this;
15014 }
15015
15016 public CodeBlock WithId(string value)
15017 {
15018 this.Id = value;
15019 return this;
15020 }
15021
15022 public CodeBlock WithRequires(HostCapabilities value)
15023 {
15024 this.Requires = value;
15025 return this;
15026 }
15027
15028 public CodeBlock WithLang(string value)
15029 {
15030 this.Lang = value;
15031 return this;
15032 }
15033
15034 public CodeBlock WithIsVisible(bool value)
15035 {
15036 this.IsVisible = value;
15037 return this;
15038 }
15039
15040 public CodeBlock WithSeparator(bool value)
15041 {
15042 this.Separator = value;
15043 return this;
15044 }
15045
15046 public CodeBlock WithHeight(ElementHeight value)
15047 {
15048 this.Height = value;
15049 return this;
15050 }
15051
15052 public CodeBlock WithHorizontalAlignment(HorizontalAlignment value)
15053 {
15054 this.HorizontalAlignment = value;
15055 return this;
15056 }
15057
15058 public CodeBlock WithSpacing(Spacing value)
15059 {
15060 this.Spacing = value;
15061 return this;
15062 }
15063
15064 public CodeBlock WithTargetWidth(TargetWidth value)
15065 {
15066 this.TargetWidth = value;
15067 return this;
15068 }
15069
15070 public CodeBlock WithIsSortKey(bool value)
15071 {
15072 this.IsSortKey = value;
15073 return this;
15074 }
15075
15076 public CodeBlock WithCodeSnippet(string value)
15077 {
15078 this.CodeSnippet = value;
15079 return this;
15080 }
15081
15082 public CodeBlock WithLanguage(CodeLanguage value)
15083 {
15084 this.Language = value;
15085 return this;
15086 }
15087
15088 public CodeBlock WithStartLineNumber(float value)
15089 {
15090 this.StartLineNumber = value;
15091 return this;
15092 }
15093
15094 public CodeBlock WithGridArea(string value)
15095 {
15096 this.GridArea = value;
15097 return this;
15098 }
15099
15100 public CodeBlock WithFallback(IUnion<CardElement, FallbackElement> value)
15101 {
15102 this.Fallback = value;
15103 return this;
15104 }
15105}
15106
15107/// <summary>
15108/// Displays a user's information, including their profile picture.
15109/// </summary>
15110public class ComUserMicrosoftGraphComponent : CardElement
15111{
15112 /// <summary>
15113 /// Deserializes a JSON string into an object of type ComUserMicrosoftGraphComponent.
15114 /// </summary>
15115 public static ComUserMicrosoftGraphComponent? Deserialize(string json)
15116 {
15117 return JsonSerializer.Deserialize<ComUserMicrosoftGraphComponent>(json);
15118 }
15119
15120 /// <summary>
15121 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15122 /// </summary>
15123 [JsonPropertyName("key")]
15124 public string? Key { get; set; }
15125
15126 /// <summary>
15127 /// Must be **Component**.
15128 /// </summary>
15129 [JsonPropertyName("type")]
15130 public string Type { get; } = "Component";
15131
15132 /// <summary>
15133 /// 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.
15134 /// </summary>
15135 [JsonPropertyName("id")]
15136 public string? Id { get; set; }
15137
15138 /// <summary>
15139 /// 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).
15140 /// </summary>
15141 [JsonPropertyName("requires")]
15142 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
15143
15144 /// <summary>
15145 /// The locale associated with the element.
15146 /// </summary>
15147 [JsonPropertyName("lang")]
15148 public string? Lang { get; set; }
15149
15150 /// <summary>
15151 /// Controls the visibility of the element.
15152 /// </summary>
15153 [JsonPropertyName("isVisible")]
15154 public bool? IsVisible { get; set; } = true;
15155
15156 /// <summary>
15157 /// 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.
15158 /// </summary>
15159 [JsonPropertyName("separator")]
15160 public bool? Separator { get; set; } = false;
15161
15162 /// <summary>
15163 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
15164 /// </summary>
15165 [JsonPropertyName("height")]
15166 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
15167
15168 /// <summary>
15169 /// Controls how the element should be horizontally aligned.
15170 /// </summary>
15171 [JsonPropertyName("horizontalAlignment")]
15172 public HorizontalAlignment? HorizontalAlignment { get; set; }
15173
15174 /// <summary>
15175 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
15176 /// </summary>
15177 [JsonPropertyName("spacing")]
15178 public Spacing? Spacing { get; set; } = Spacing.Default;
15179
15180 /// <summary>
15181 /// 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).
15182 /// </summary>
15183 [JsonPropertyName("targetWidth")]
15184 public TargetWidth? TargetWidth { get; set; }
15185
15186 /// <summary>
15187 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15188 /// </summary>
15189 [JsonPropertyName("isSortKey")]
15190 public bool? IsSortKey { get; set; } = false;
15191
15192 /// <summary>
15193 /// Must be **graph.microsoft.com/user**.
15194 /// </summary>
15195 [JsonPropertyName("name")]
15196 public string Name { get; } = "graph.microsoft.com/user";
15197
15198 /// <summary>
15199 /// The properties of the Persona component.
15200 /// </summary>
15201 [JsonPropertyName("properties")]
15202 public PersonaProperties? Properties { get; set; }
15203
15204 /// <summary>
15205 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15206 /// </summary>
15207 [JsonPropertyName("grid.area")]
15208 public string? GridArea { get; set; }
15209
15210 /// <summary>
15211 /// 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.
15212 /// </summary>
15213 [JsonPropertyName("fallback")]
15214 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15215
15216 /// <summary>
15217 /// Serializes this ComUserMicrosoftGraphComponent into a JSON string.
15218 /// </summary>
15219 public string Serialize()
15220 {
15221 return JsonSerializer.Serialize(
15222 this,
15223 new JsonSerializerOptions
15224 {
15225 WriteIndented = true,
15226 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15227 }
15228 );
15229 }
15230
15231 public ComUserMicrosoftGraphComponent WithKey(string value)
15232 {
15233 this.Key = value;
15234 return this;
15235 }
15236
15237 public ComUserMicrosoftGraphComponent WithId(string value)
15238 {
15239 this.Id = value;
15240 return this;
15241 }
15242
15243 public ComUserMicrosoftGraphComponent WithRequires(HostCapabilities value)
15244 {
15245 this.Requires = value;
15246 return this;
15247 }
15248
15249 public ComUserMicrosoftGraphComponent WithLang(string value)
15250 {
15251 this.Lang = value;
15252 return this;
15253 }
15254
15255 public ComUserMicrosoftGraphComponent WithIsVisible(bool value)
15256 {
15257 this.IsVisible = value;
15258 return this;
15259 }
15260
15261 public ComUserMicrosoftGraphComponent WithSeparator(bool value)
15262 {
15263 this.Separator = value;
15264 return this;
15265 }
15266
15267 public ComUserMicrosoftGraphComponent WithHeight(ElementHeight value)
15268 {
15269 this.Height = value;
15270 return this;
15271 }
15272
15273 public ComUserMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
15274 {
15275 this.HorizontalAlignment = value;
15276 return this;
15277 }
15278
15279 public ComUserMicrosoftGraphComponent WithSpacing(Spacing value)
15280 {
15281 this.Spacing = value;
15282 return this;
15283 }
15284
15285 public ComUserMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
15286 {
15287 this.TargetWidth = value;
15288 return this;
15289 }
15290
15291 public ComUserMicrosoftGraphComponent WithIsSortKey(bool value)
15292 {
15293 this.IsSortKey = value;
15294 return this;
15295 }
15296
15297 public ComUserMicrosoftGraphComponent WithProperties(PersonaProperties value)
15298 {
15299 this.Properties = value;
15300 return this;
15301 }
15302
15303 public ComUserMicrosoftGraphComponent WithGridArea(string value)
15304 {
15305 this.GridArea = value;
15306 return this;
15307 }
15308
15309 public ComUserMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
15310 {
15311 this.Fallback = value;
15312 return this;
15313 }
15314}
15315
15316/// <summary>
15317/// Represents the properties of a Persona component.
15318/// </summary>
15319public class PersonaProperties : SerializableObject
15320{
15321 /// <summary>
15322 /// Deserializes a JSON string into an object of type PersonaProperties.
15323 /// </summary>
15324 public static PersonaProperties? Deserialize(string json)
15325 {
15326 return JsonSerializer.Deserialize<PersonaProperties>(json);
15327 }
15328
15329 /// <summary>
15330 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15331 /// </summary>
15332 [JsonPropertyName("key")]
15333 public string? Key { get; set; }
15334
15335 /// <summary>
15336 /// The Id of the persona.
15337 /// </summary>
15338 [JsonPropertyName("id")]
15339 public string? Id { get; set; }
15340
15341 /// <summary>
15342 /// The UPN of the persona.
15343 /// </summary>
15344 [JsonPropertyName("userPrincipalName")]
15345 public string? UserPrincipalName { get; set; }
15346
15347 /// <summary>
15348 /// The display name of the persona.
15349 /// </summary>
15350 [JsonPropertyName("displayName")]
15351 public string? DisplayName { get; set; }
15352
15353 /// <summary>
15354 /// Defines the style of the icon for the persona.
15355 /// </summary>
15356 [JsonPropertyName("iconStyle")]
15357 public PersonaIconStyle? IconStyle { get; set; }
15358
15359 /// <summary>
15360 /// Defines how the persona should be displayed.
15361 /// </summary>
15362 [JsonPropertyName("style")]
15363 public PersonaDisplayStyle? Style { get; set; }
15364
15365 /// <summary>
15366 /// Serializes this PersonaProperties into a JSON string.
15367 /// </summary>
15368 public string Serialize()
15369 {
15370 return JsonSerializer.Serialize(
15371 this,
15372 new JsonSerializerOptions
15373 {
15374 WriteIndented = true,
15375 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15376 }
15377 );
15378 }
15379
15380 public PersonaProperties WithKey(string value)
15381 {
15382 this.Key = value;
15383 return this;
15384 }
15385
15386 public PersonaProperties WithId(string value)
15387 {
15388 this.Id = value;
15389 return this;
15390 }
15391
15392 public PersonaProperties WithUserPrincipalName(string value)
15393 {
15394 this.UserPrincipalName = value;
15395 return this;
15396 }
15397
15398 public PersonaProperties WithDisplayName(string value)
15399 {
15400 this.DisplayName = value;
15401 return this;
15402 }
15403
15404 public PersonaProperties WithIconStyle(PersonaIconStyle value)
15405 {
15406 this.IconStyle = value;
15407 return this;
15408 }
15409
15410 public PersonaProperties WithStyle(PersonaDisplayStyle value)
15411 {
15412 this.Style = value;
15413 return this;
15414 }
15415}
15416
15417/// <summary>
15418/// Displays multiple users' information, including their profile pictures.
15419/// </summary>
15420public class ComUsersMicrosoftGraphComponent : CardElement
15421{
15422 /// <summary>
15423 /// Deserializes a JSON string into an object of type ComUsersMicrosoftGraphComponent.
15424 /// </summary>
15425 public static ComUsersMicrosoftGraphComponent? Deserialize(string json)
15426 {
15427 return JsonSerializer.Deserialize<ComUsersMicrosoftGraphComponent>(json);
15428 }
15429
15430 /// <summary>
15431 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15432 /// </summary>
15433 [JsonPropertyName("key")]
15434 public string? Key { get; set; }
15435
15436 /// <summary>
15437 /// Must be **Component**.
15438 /// </summary>
15439 [JsonPropertyName("type")]
15440 public string Type { get; } = "Component";
15441
15442 /// <summary>
15443 /// 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.
15444 /// </summary>
15445 [JsonPropertyName("id")]
15446 public string? Id { get; set; }
15447
15448 /// <summary>
15449 /// 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).
15450 /// </summary>
15451 [JsonPropertyName("requires")]
15452 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
15453
15454 /// <summary>
15455 /// The locale associated with the element.
15456 /// </summary>
15457 [JsonPropertyName("lang")]
15458 public string? Lang { get; set; }
15459
15460 /// <summary>
15461 /// Controls the visibility of the element.
15462 /// </summary>
15463 [JsonPropertyName("isVisible")]
15464 public bool? IsVisible { get; set; } = true;
15465
15466 /// <summary>
15467 /// 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.
15468 /// </summary>
15469 [JsonPropertyName("separator")]
15470 public bool? Separator { get; set; } = false;
15471
15472 /// <summary>
15473 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
15474 /// </summary>
15475 [JsonPropertyName("height")]
15476 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
15477
15478 /// <summary>
15479 /// Controls how the element should be horizontally aligned.
15480 /// </summary>
15481 [JsonPropertyName("horizontalAlignment")]
15482 public HorizontalAlignment? HorizontalAlignment { get; set; }
15483
15484 /// <summary>
15485 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
15486 /// </summary>
15487 [JsonPropertyName("spacing")]
15488 public Spacing? Spacing { get; set; } = Spacing.Default;
15489
15490 /// <summary>
15491 /// 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).
15492 /// </summary>
15493 [JsonPropertyName("targetWidth")]
15494 public TargetWidth? TargetWidth { get; set; }
15495
15496 /// <summary>
15497 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15498 /// </summary>
15499 [JsonPropertyName("isSortKey")]
15500 public bool? IsSortKey { get; set; } = false;
15501
15502 /// <summary>
15503 /// Must be **graph.microsoft.com/users**.
15504 /// </summary>
15505 [JsonPropertyName("name")]
15506 public string Name { get; } = "graph.microsoft.com/users";
15507
15508 /// <summary>
15509 /// The properties of the PersonaSet component.
15510 /// </summary>
15511 [JsonPropertyName("properties")]
15512 public PersonaSetProperties? Properties { get; set; }
15513
15514 /// <summary>
15515 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15516 /// </summary>
15517 [JsonPropertyName("grid.area")]
15518 public string? GridArea { get; set; }
15519
15520 /// <summary>
15521 /// 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.
15522 /// </summary>
15523 [JsonPropertyName("fallback")]
15524 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15525
15526 /// <summary>
15527 /// Serializes this ComUsersMicrosoftGraphComponent into a JSON string.
15528 /// </summary>
15529 public string Serialize()
15530 {
15531 return JsonSerializer.Serialize(
15532 this,
15533 new JsonSerializerOptions
15534 {
15535 WriteIndented = true,
15536 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15537 }
15538 );
15539 }
15540
15541 public ComUsersMicrosoftGraphComponent WithKey(string value)
15542 {
15543 this.Key = value;
15544 return this;
15545 }
15546
15547 public ComUsersMicrosoftGraphComponent WithId(string value)
15548 {
15549 this.Id = value;
15550 return this;
15551 }
15552
15553 public ComUsersMicrosoftGraphComponent WithRequires(HostCapabilities value)
15554 {
15555 this.Requires = value;
15556 return this;
15557 }
15558
15559 public ComUsersMicrosoftGraphComponent WithLang(string value)
15560 {
15561 this.Lang = value;
15562 return this;
15563 }
15564
15565 public ComUsersMicrosoftGraphComponent WithIsVisible(bool value)
15566 {
15567 this.IsVisible = value;
15568 return this;
15569 }
15570
15571 public ComUsersMicrosoftGraphComponent WithSeparator(bool value)
15572 {
15573 this.Separator = value;
15574 return this;
15575 }
15576
15577 public ComUsersMicrosoftGraphComponent WithHeight(ElementHeight value)
15578 {
15579 this.Height = value;
15580 return this;
15581 }
15582
15583 public ComUsersMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
15584 {
15585 this.HorizontalAlignment = value;
15586 return this;
15587 }
15588
15589 public ComUsersMicrosoftGraphComponent WithSpacing(Spacing value)
15590 {
15591 this.Spacing = value;
15592 return this;
15593 }
15594
15595 public ComUsersMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
15596 {
15597 this.TargetWidth = value;
15598 return this;
15599 }
15600
15601 public ComUsersMicrosoftGraphComponent WithIsSortKey(bool value)
15602 {
15603 this.IsSortKey = value;
15604 return this;
15605 }
15606
15607 public ComUsersMicrosoftGraphComponent WithProperties(PersonaSetProperties value)
15608 {
15609 this.Properties = value;
15610 return this;
15611 }
15612
15613 public ComUsersMicrosoftGraphComponent WithGridArea(string value)
15614 {
15615 this.GridArea = value;
15616 return this;
15617 }
15618
15619 public ComUsersMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
15620 {
15621 this.Fallback = value;
15622 return this;
15623 }
15624}
15625
15626/// <summary>
15627/// Represents the properties of a PersonaSet component.
15628/// </summary>
15629public class PersonaSetProperties : SerializableObject
15630{
15631 /// <summary>
15632 /// Deserializes a JSON string into an object of type PersonaSetProperties.
15633 /// </summary>
15634 public static PersonaSetProperties? Deserialize(string json)
15635 {
15636 return JsonSerializer.Deserialize<PersonaSetProperties>(json);
15637 }
15638
15639 /// <summary>
15640 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15641 /// </summary>
15642 [JsonPropertyName("key")]
15643 public string? Key { get; set; }
15644
15645 /// <summary>
15646 /// The users a PersonaSet component should display.
15647 /// </summary>
15648 [JsonPropertyName("users")]
15649 public IList<PersonaProperties>? Users { get; set; }
15650
15651 /// <summary>
15652 /// Defines the style of the icon for the personas in the set.
15653 /// </summary>
15654 [JsonPropertyName("iconStyle")]
15655 public PersonaIconStyle? IconStyle { get; set; }
15656
15657 /// <summary>
15658 /// Defines how each persona in the set should be displayed.
15659 /// </summary>
15660 [JsonPropertyName("style")]
15661 public PersonaDisplayStyle? Style { get; set; }
15662
15663 /// <summary>
15664 /// Serializes this PersonaSetProperties 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 PersonaSetProperties WithKey(string value)
15679 {
15680 this.Key = value;
15681 return this;
15682 }
15683
15684 public PersonaSetProperties WithUsers(params PersonaProperties[] value)
15685 {
15686 this.Users = new List<PersonaProperties>(value);
15687 return this;
15688 }
15689
15690 public PersonaSetProperties WithUsers(IList<PersonaProperties> value)
15691 {
15692 this.Users = value;
15693 return this;
15694 }
15695
15696 public PersonaSetProperties WithIconStyle(PersonaIconStyle value)
15697 {
15698 this.IconStyle = value;
15699 return this;
15700 }
15701
15702 public PersonaSetProperties WithStyle(PersonaDisplayStyle value)
15703 {
15704 this.Style = value;
15705 return this;
15706 }
15707}
15708
15709/// <summary>
15710/// Displays information about a generic graph resource.
15711/// </summary>
15712public class ComResourceMicrosoftGraphComponent : CardElement
15713{
15714 /// <summary>
15715 /// Deserializes a JSON string into an object of type ComResourceMicrosoftGraphComponent.
15716 /// </summary>
15717 public static ComResourceMicrosoftGraphComponent? Deserialize(string json)
15718 {
15719 return JsonSerializer.Deserialize<ComResourceMicrosoftGraphComponent>(json);
15720 }
15721
15722 /// <summary>
15723 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15724 /// </summary>
15725 [JsonPropertyName("key")]
15726 public string? Key { get; set; }
15727
15728 /// <summary>
15729 /// Must be **Component**.
15730 /// </summary>
15731 [JsonPropertyName("type")]
15732 public string Type { get; } = "Component";
15733
15734 /// <summary>
15735 /// 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.
15736 /// </summary>
15737 [JsonPropertyName("id")]
15738 public string? Id { get; set; }
15739
15740 /// <summary>
15741 /// 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).
15742 /// </summary>
15743 [JsonPropertyName("requires")]
15744 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
15745
15746 /// <summary>
15747 /// The locale associated with the element.
15748 /// </summary>
15749 [JsonPropertyName("lang")]
15750 public string? Lang { get; set; }
15751
15752 /// <summary>
15753 /// Controls the visibility of the element.
15754 /// </summary>
15755 [JsonPropertyName("isVisible")]
15756 public bool? IsVisible { get; set; } = true;
15757
15758 /// <summary>
15759 /// 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.
15760 /// </summary>
15761 [JsonPropertyName("separator")]
15762 public bool? Separator { get; set; } = false;
15763
15764 /// <summary>
15765 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
15766 /// </summary>
15767 [JsonPropertyName("height")]
15768 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
15769
15770 /// <summary>
15771 /// Controls how the element should be horizontally aligned.
15772 /// </summary>
15773 [JsonPropertyName("horizontalAlignment")]
15774 public HorizontalAlignment? HorizontalAlignment { get; set; }
15775
15776 /// <summary>
15777 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
15778 /// </summary>
15779 [JsonPropertyName("spacing")]
15780 public Spacing? Spacing { get; set; } = Spacing.Default;
15781
15782 /// <summary>
15783 /// 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).
15784 /// </summary>
15785 [JsonPropertyName("targetWidth")]
15786 public TargetWidth? TargetWidth { get; set; }
15787
15788 /// <summary>
15789 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
15790 /// </summary>
15791 [JsonPropertyName("isSortKey")]
15792 public bool? IsSortKey { get; set; } = false;
15793
15794 /// <summary>
15795 /// Must be **graph.microsoft.com/resource**.
15796 /// </summary>
15797 [JsonPropertyName("name")]
15798 public string Name { get; } = "graph.microsoft.com/resource";
15799
15800 /// <summary>
15801 /// The properties of the resource.
15802 /// </summary>
15803 [JsonPropertyName("properties")]
15804 public ResourceProperties? Properties { get; set; }
15805
15806 /// <summary>
15807 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
15808 /// </summary>
15809 [JsonPropertyName("grid.area")]
15810 public string? GridArea { get; set; }
15811
15812 /// <summary>
15813 /// 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.
15814 /// </summary>
15815 [JsonPropertyName("fallback")]
15816 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
15817
15818 /// <summary>
15819 /// Serializes this ComResourceMicrosoftGraphComponent into a JSON string.
15820 /// </summary>
15821 public string Serialize()
15822 {
15823 return JsonSerializer.Serialize(
15824 this,
15825 new JsonSerializerOptions
15826 {
15827 WriteIndented = true,
15828 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15829 }
15830 );
15831 }
15832
15833 public ComResourceMicrosoftGraphComponent WithKey(string value)
15834 {
15835 this.Key = value;
15836 return this;
15837 }
15838
15839 public ComResourceMicrosoftGraphComponent WithId(string value)
15840 {
15841 this.Id = value;
15842 return this;
15843 }
15844
15845 public ComResourceMicrosoftGraphComponent WithRequires(HostCapabilities value)
15846 {
15847 this.Requires = value;
15848 return this;
15849 }
15850
15851 public ComResourceMicrosoftGraphComponent WithLang(string value)
15852 {
15853 this.Lang = value;
15854 return this;
15855 }
15856
15857 public ComResourceMicrosoftGraphComponent WithIsVisible(bool value)
15858 {
15859 this.IsVisible = value;
15860 return this;
15861 }
15862
15863 public ComResourceMicrosoftGraphComponent WithSeparator(bool value)
15864 {
15865 this.Separator = value;
15866 return this;
15867 }
15868
15869 public ComResourceMicrosoftGraphComponent WithHeight(ElementHeight value)
15870 {
15871 this.Height = value;
15872 return this;
15873 }
15874
15875 public ComResourceMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
15876 {
15877 this.HorizontalAlignment = value;
15878 return this;
15879 }
15880
15881 public ComResourceMicrosoftGraphComponent WithSpacing(Spacing value)
15882 {
15883 this.Spacing = value;
15884 return this;
15885 }
15886
15887 public ComResourceMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
15888 {
15889 this.TargetWidth = value;
15890 return this;
15891 }
15892
15893 public ComResourceMicrosoftGraphComponent WithIsSortKey(bool value)
15894 {
15895 this.IsSortKey = value;
15896 return this;
15897 }
15898
15899 public ComResourceMicrosoftGraphComponent WithProperties(ResourceProperties value)
15900 {
15901 this.Properties = value;
15902 return this;
15903 }
15904
15905 public ComResourceMicrosoftGraphComponent WithGridArea(string value)
15906 {
15907 this.GridArea = value;
15908 return this;
15909 }
15910
15911 public ComResourceMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
15912 {
15913 this.Fallback = value;
15914 return this;
15915 }
15916}
15917
15918/// <summary>
15919/// Represents the properties of a resource component.
15920/// </summary>
15921public class ResourceProperties : SerializableObject
15922{
15923 /// <summary>
15924 /// Deserializes a JSON string into an object of type ResourceProperties.
15925 /// </summary>
15926 public static ResourceProperties? Deserialize(string json)
15927 {
15928 return JsonSerializer.Deserialize<ResourceProperties>(json);
15929 }
15930
15931 /// <summary>
15932 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
15933 /// </summary>
15934 [JsonPropertyName("key")]
15935 public string? Key { get; set; }
15936
15937 /// <summary>
15938 /// The Id of the resource.
15939 /// </summary>
15940 [JsonPropertyName("id")]
15941 public string? Id { get; set; }
15942
15943 /// <summary>
15944 /// The reference to the resource.
15945 /// </summary>
15946 [JsonPropertyName("resourceReference")]
15947 public IDictionary<string, string>? ResourceReference { get; set; }
15948
15949 /// <summary>
15950 /// The visualization of the resource.
15951 /// </summary>
15952 [JsonPropertyName("resourceVisualization")]
15953 public ResourceVisualization? ResourceVisualization { get; set; }
15954
15955 /// <summary>
15956 /// Serializes this ResourceProperties into a JSON string.
15957 /// </summary>
15958 public string Serialize()
15959 {
15960 return JsonSerializer.Serialize(
15961 this,
15962 new JsonSerializerOptions
15963 {
15964 WriteIndented = true,
15965 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
15966 }
15967 );
15968 }
15969
15970 public ResourceProperties WithKey(string value)
15971 {
15972 this.Key = value;
15973 return this;
15974 }
15975
15976 public ResourceProperties WithId(string value)
15977 {
15978 this.Id = value;
15979 return this;
15980 }
15981
15982 public ResourceProperties WithResourceReference(IDictionary<string, string> value)
15983 {
15984 this.ResourceReference = value;
15985 return this;
15986 }
15987
15988 public ResourceProperties WithResourceVisualization(ResourceVisualization value)
15989 {
15990 this.ResourceVisualization = value;
15991 return this;
15992 }
15993}
15994
15995/// <summary>
15996/// Represents a visualization of a resource.
15997/// </summary>
15998public class ResourceVisualization : SerializableObject
15999{
16000 /// <summary>
16001 /// Deserializes a JSON string into an object of type ResourceVisualization.
16002 /// </summary>
16003 public static ResourceVisualization? Deserialize(string json)
16004 {
16005 return JsonSerializer.Deserialize<ResourceVisualization>(json);
16006 }
16007
16008 /// <summary>
16009 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16010 /// </summary>
16011 [JsonPropertyName("key")]
16012 public string? Key { get; set; }
16013
16014 /// <summary>
16015 /// The media associated with the resource.
16016 /// </summary>
16017 [JsonPropertyName("media")]
16018 public string? Media { get; set; }
16019
16020 /// <summary>
16021 /// Serializes this ResourceVisualization into a JSON string.
16022 /// </summary>
16023 public string Serialize()
16024 {
16025 return JsonSerializer.Serialize(
16026 this,
16027 new JsonSerializerOptions
16028 {
16029 WriteIndented = true,
16030 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16031 }
16032 );
16033 }
16034
16035 public ResourceVisualization WithKey(string value)
16036 {
16037 this.Key = value;
16038 return this;
16039 }
16040
16041 public ResourceVisualization WithMedia(string value)
16042 {
16043 this.Media = value;
16044 return this;
16045 }
16046}
16047
16048/// <summary>
16049/// Displays information about a file resource.
16050/// </summary>
16051public class ComFileMicrosoftGraphComponent : CardElement
16052{
16053 /// <summary>
16054 /// Deserializes a JSON string into an object of type ComFileMicrosoftGraphComponent.
16055 /// </summary>
16056 public static ComFileMicrosoftGraphComponent? Deserialize(string json)
16057 {
16058 return JsonSerializer.Deserialize<ComFileMicrosoftGraphComponent>(json);
16059 }
16060
16061 /// <summary>
16062 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16063 /// </summary>
16064 [JsonPropertyName("key")]
16065 public string? Key { get; set; }
16066
16067 /// <summary>
16068 /// Must be **Component**.
16069 /// </summary>
16070 [JsonPropertyName("type")]
16071 public string Type { get; } = "Component";
16072
16073 /// <summary>
16074 /// 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.
16075 /// </summary>
16076 [JsonPropertyName("id")]
16077 public string? Id { get; set; }
16078
16079 /// <summary>
16080 /// 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).
16081 /// </summary>
16082 [JsonPropertyName("requires")]
16083 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
16084
16085 /// <summary>
16086 /// The locale associated with the element.
16087 /// </summary>
16088 [JsonPropertyName("lang")]
16089 public string? Lang { get; set; }
16090
16091 /// <summary>
16092 /// Controls the visibility of the element.
16093 /// </summary>
16094 [JsonPropertyName("isVisible")]
16095 public bool? IsVisible { get; set; } = true;
16096
16097 /// <summary>
16098 /// 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.
16099 /// </summary>
16100 [JsonPropertyName("separator")]
16101 public bool? Separator { get; set; } = false;
16102
16103 /// <summary>
16104 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
16105 /// </summary>
16106 [JsonPropertyName("height")]
16107 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
16108
16109 /// <summary>
16110 /// Controls how the element should be horizontally aligned.
16111 /// </summary>
16112 [JsonPropertyName("horizontalAlignment")]
16113 public HorizontalAlignment? HorizontalAlignment { get; set; }
16114
16115 /// <summary>
16116 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
16117 /// </summary>
16118 [JsonPropertyName("spacing")]
16119 public Spacing? Spacing { get; set; } = Spacing.Default;
16120
16121 /// <summary>
16122 /// 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).
16123 /// </summary>
16124 [JsonPropertyName("targetWidth")]
16125 public TargetWidth? TargetWidth { get; set; }
16126
16127 /// <summary>
16128 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
16129 /// </summary>
16130 [JsonPropertyName("isSortKey")]
16131 public bool? IsSortKey { get; set; } = false;
16132
16133 /// <summary>
16134 /// Must be **graph.microsoft.com/file**.
16135 /// </summary>
16136 [JsonPropertyName("name")]
16137 public string Name { get; } = "graph.microsoft.com/file";
16138
16139 /// <summary>
16140 /// The properties of the file.
16141 /// </summary>
16142 [JsonPropertyName("properties")]
16143 public FileProperties? Properties { get; set; }
16144
16145 /// <summary>
16146 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
16147 /// </summary>
16148 [JsonPropertyName("grid.area")]
16149 public string? GridArea { get; set; }
16150
16151 /// <summary>
16152 /// 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.
16153 /// </summary>
16154 [JsonPropertyName("fallback")]
16155 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
16156
16157 /// <summary>
16158 /// Serializes this ComFileMicrosoftGraphComponent into a JSON string.
16159 /// </summary>
16160 public string Serialize()
16161 {
16162 return JsonSerializer.Serialize(
16163 this,
16164 new JsonSerializerOptions
16165 {
16166 WriteIndented = true,
16167 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16168 }
16169 );
16170 }
16171
16172 public ComFileMicrosoftGraphComponent WithKey(string value)
16173 {
16174 this.Key = value;
16175 return this;
16176 }
16177
16178 public ComFileMicrosoftGraphComponent WithId(string value)
16179 {
16180 this.Id = value;
16181 return this;
16182 }
16183
16184 public ComFileMicrosoftGraphComponent WithRequires(HostCapabilities value)
16185 {
16186 this.Requires = value;
16187 return this;
16188 }
16189
16190 public ComFileMicrosoftGraphComponent WithLang(string value)
16191 {
16192 this.Lang = value;
16193 return this;
16194 }
16195
16196 public ComFileMicrosoftGraphComponent WithIsVisible(bool value)
16197 {
16198 this.IsVisible = value;
16199 return this;
16200 }
16201
16202 public ComFileMicrosoftGraphComponent WithSeparator(bool value)
16203 {
16204 this.Separator = value;
16205 return this;
16206 }
16207
16208 public ComFileMicrosoftGraphComponent WithHeight(ElementHeight value)
16209 {
16210 this.Height = value;
16211 return this;
16212 }
16213
16214 public ComFileMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
16215 {
16216 this.HorizontalAlignment = value;
16217 return this;
16218 }
16219
16220 public ComFileMicrosoftGraphComponent WithSpacing(Spacing value)
16221 {
16222 this.Spacing = value;
16223 return this;
16224 }
16225
16226 public ComFileMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
16227 {
16228 this.TargetWidth = value;
16229 return this;
16230 }
16231
16232 public ComFileMicrosoftGraphComponent WithIsSortKey(bool value)
16233 {
16234 this.IsSortKey = value;
16235 return this;
16236 }
16237
16238 public ComFileMicrosoftGraphComponent WithProperties(FileProperties value)
16239 {
16240 this.Properties = value;
16241 return this;
16242 }
16243
16244 public ComFileMicrosoftGraphComponent WithGridArea(string value)
16245 {
16246 this.GridArea = value;
16247 return this;
16248 }
16249
16250 public ComFileMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
16251 {
16252 this.Fallback = value;
16253 return this;
16254 }
16255}
16256
16257/// <summary>
16258/// Represents the properties of a file component.
16259/// </summary>
16260public class FileProperties : SerializableObject
16261{
16262 /// <summary>
16263 /// Deserializes a JSON string into an object of type FileProperties.
16264 /// </summary>
16265 public static FileProperties? Deserialize(string json)
16266 {
16267 return JsonSerializer.Deserialize<FileProperties>(json);
16268 }
16269
16270 /// <summary>
16271 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16272 /// </summary>
16273 [JsonPropertyName("key")]
16274 public string? Key { get; set; }
16275
16276 /// <summary>
16277 /// The name of the file.
16278 /// </summary>
16279 [JsonPropertyName("name")]
16280 public string? Name { get; set; }
16281
16282 /// <summary>
16283 /// The file extension.
16284 /// </summary>
16285 [JsonPropertyName("extension")]
16286 public string? Extension { get; set; }
16287
16288 /// <summary>
16289 /// The URL of the file.
16290 /// </summary>
16291 [JsonPropertyName("url")]
16292 public string? Url { get; set; }
16293
16294 /// <summary>
16295 /// Serializes this FileProperties into a JSON string.
16296 /// </summary>
16297 public string Serialize()
16298 {
16299 return JsonSerializer.Serialize(
16300 this,
16301 new JsonSerializerOptions
16302 {
16303 WriteIndented = true,
16304 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16305 }
16306 );
16307 }
16308
16309 public FileProperties WithKey(string value)
16310 {
16311 this.Key = value;
16312 return this;
16313 }
16314
16315 public FileProperties WithName(string value)
16316 {
16317 this.Name = value;
16318 return this;
16319 }
16320
16321 public FileProperties WithExtension(string value)
16322 {
16323 this.Extension = value;
16324 return this;
16325 }
16326
16327 public FileProperties WithUrl(string value)
16328 {
16329 this.Url = value;
16330 return this;
16331 }
16332}
16333
16334/// <summary>
16335/// Displays information about a calendar event.
16336/// </summary>
16337public class ComEventMicrosoftGraphComponent : CardElement
16338{
16339 /// <summary>
16340 /// Deserializes a JSON string into an object of type ComEventMicrosoftGraphComponent.
16341 /// </summary>
16342 public static ComEventMicrosoftGraphComponent? Deserialize(string json)
16343 {
16344 return JsonSerializer.Deserialize<ComEventMicrosoftGraphComponent>(json);
16345 }
16346
16347 /// <summary>
16348 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16349 /// </summary>
16350 [JsonPropertyName("key")]
16351 public string? Key { get; set; }
16352
16353 /// <summary>
16354 /// Must be **Component**.
16355 /// </summary>
16356 [JsonPropertyName("type")]
16357 public string Type { get; } = "Component";
16358
16359 /// <summary>
16360 /// 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.
16361 /// </summary>
16362 [JsonPropertyName("id")]
16363 public string? Id { get; set; }
16364
16365 /// <summary>
16366 /// 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).
16367 /// </summary>
16368 [JsonPropertyName("requires")]
16369 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
16370
16371 /// <summary>
16372 /// The locale associated with the element.
16373 /// </summary>
16374 [JsonPropertyName("lang")]
16375 public string? Lang { get; set; }
16376
16377 /// <summary>
16378 /// Controls the visibility of the element.
16379 /// </summary>
16380 [JsonPropertyName("isVisible")]
16381 public bool? IsVisible { get; set; } = true;
16382
16383 /// <summary>
16384 /// 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.
16385 /// </summary>
16386 [JsonPropertyName("separator")]
16387 public bool? Separator { get; set; } = false;
16388
16389 /// <summary>
16390 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
16391 /// </summary>
16392 [JsonPropertyName("height")]
16393 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
16394
16395 /// <summary>
16396 /// Controls how the element should be horizontally aligned.
16397 /// </summary>
16398 [JsonPropertyName("horizontalAlignment")]
16399 public HorizontalAlignment? HorizontalAlignment { get; set; }
16400
16401 /// <summary>
16402 /// Controls the amount of space between this element and the previous one. No space will be added for the first element in a container.
16403 /// </summary>
16404 [JsonPropertyName("spacing")]
16405 public Spacing? Spacing { get; set; } = Spacing.Default;
16406
16407 /// <summary>
16408 /// 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).
16409 /// </summary>
16410 [JsonPropertyName("targetWidth")]
16411 public TargetWidth? TargetWidth { get; set; }
16412
16413 /// <summary>
16414 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
16415 /// </summary>
16416 [JsonPropertyName("isSortKey")]
16417 public bool? IsSortKey { get; set; } = false;
16418
16419 /// <summary>
16420 /// Must be **graph.microsoft.com/event**.
16421 /// </summary>
16422 [JsonPropertyName("name")]
16423 public string Name { get; } = "graph.microsoft.com/event";
16424
16425 /// <summary>
16426 /// The properties of the event.
16427 /// </summary>
16428 [JsonPropertyName("properties")]
16429 public CalendarEventProperties? Properties { get; set; }
16430
16431 /// <summary>
16432 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
16433 /// </summary>
16434 [JsonPropertyName("grid.area")]
16435 public string? GridArea { get; set; }
16436
16437 /// <summary>
16438 /// 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.
16439 /// </summary>
16440 [JsonPropertyName("fallback")]
16441 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
16442
16443 /// <summary>
16444 /// Serializes this ComEventMicrosoftGraphComponent into a JSON string.
16445 /// </summary>
16446 public string Serialize()
16447 {
16448 return JsonSerializer.Serialize(
16449 this,
16450 new JsonSerializerOptions
16451 {
16452 WriteIndented = true,
16453 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16454 }
16455 );
16456 }
16457
16458 public ComEventMicrosoftGraphComponent WithKey(string value)
16459 {
16460 this.Key = value;
16461 return this;
16462 }
16463
16464 public ComEventMicrosoftGraphComponent WithId(string value)
16465 {
16466 this.Id = value;
16467 return this;
16468 }
16469
16470 public ComEventMicrosoftGraphComponent WithRequires(HostCapabilities value)
16471 {
16472 this.Requires = value;
16473 return this;
16474 }
16475
16476 public ComEventMicrosoftGraphComponent WithLang(string value)
16477 {
16478 this.Lang = value;
16479 return this;
16480 }
16481
16482 public ComEventMicrosoftGraphComponent WithIsVisible(bool value)
16483 {
16484 this.IsVisible = value;
16485 return this;
16486 }
16487
16488 public ComEventMicrosoftGraphComponent WithSeparator(bool value)
16489 {
16490 this.Separator = value;
16491 return this;
16492 }
16493
16494 public ComEventMicrosoftGraphComponent WithHeight(ElementHeight value)
16495 {
16496 this.Height = value;
16497 return this;
16498 }
16499
16500 public ComEventMicrosoftGraphComponent WithHorizontalAlignment(HorizontalAlignment value)
16501 {
16502 this.HorizontalAlignment = value;
16503 return this;
16504 }
16505
16506 public ComEventMicrosoftGraphComponent WithSpacing(Spacing value)
16507 {
16508 this.Spacing = value;
16509 return this;
16510 }
16511
16512 public ComEventMicrosoftGraphComponent WithTargetWidth(TargetWidth value)
16513 {
16514 this.TargetWidth = value;
16515 return this;
16516 }
16517
16518 public ComEventMicrosoftGraphComponent WithIsSortKey(bool value)
16519 {
16520 this.IsSortKey = value;
16521 return this;
16522 }
16523
16524 public ComEventMicrosoftGraphComponent WithProperties(CalendarEventProperties value)
16525 {
16526 this.Properties = value;
16527 return this;
16528 }
16529
16530 public ComEventMicrosoftGraphComponent WithGridArea(string value)
16531 {
16532 this.GridArea = value;
16533 return this;
16534 }
16535
16536 public ComEventMicrosoftGraphComponent WithFallback(IUnion<CardElement, FallbackElement> value)
16537 {
16538 this.Fallback = value;
16539 return this;
16540 }
16541}
16542
16543/// <summary>
16544/// The properties of a calendar event.
16545/// </summary>
16546public class CalendarEventProperties : SerializableObject
16547{
16548 /// <summary>
16549 /// Deserializes a JSON string into an object of type CalendarEventProperties.
16550 /// </summary>
16551 public static CalendarEventProperties? Deserialize(string json)
16552 {
16553 return JsonSerializer.Deserialize<CalendarEventProperties>(json);
16554 }
16555
16556 /// <summary>
16557 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16558 /// </summary>
16559 [JsonPropertyName("key")]
16560 public string? Key { get; set; }
16561
16562 /// <summary>
16563 /// The ID of the event.
16564 /// </summary>
16565 [JsonPropertyName("id")]
16566 public string? Id { get; set; }
16567
16568 /// <summary>
16569 /// The title of the event.
16570 /// </summary>
16571 [JsonPropertyName("title")]
16572 public string? Title { get; set; }
16573
16574 /// <summary>
16575 /// The start date and time of the event.
16576 /// </summary>
16577 [JsonPropertyName("start")]
16578 public string? Start { get; set; }
16579
16580 /// <summary>
16581 /// The end date and time of the event.
16582 /// </summary>
16583 [JsonPropertyName("end")]
16584 public string? End { get; set; }
16585
16586 /// <summary>
16587 /// The status of the event.
16588 /// </summary>
16589 [JsonPropertyName("status")]
16590 public string? Status { get; set; }
16591
16592 /// <summary>
16593 /// The locations of the event.
16594 /// </summary>
16595 [JsonPropertyName("locations")]
16596 public IList<string>? Locations { get; set; }
16597
16598 /// <summary>
16599 /// The URL of the online meeting.
16600 /// </summary>
16601 [JsonPropertyName("onlineMeetingUrl")]
16602 public string? OnlineMeetingUrl { get; set; }
16603
16604 /// <summary>
16605 /// Indicates if the event is all day.
16606 /// </summary>
16607 [JsonPropertyName("isAllDay")]
16608 public bool? IsAllDay { get; set; }
16609
16610 /// <summary>
16611 /// The extension of the event.
16612 /// </summary>
16613 [JsonPropertyName("extension")]
16614 public string? Extension { get; set; }
16615
16616 /// <summary>
16617 /// The URL of the event.
16618 /// </summary>
16619 [JsonPropertyName("url")]
16620 public string? Url { get; set; }
16621
16622 /// <summary>
16623 /// The attendees of the event.
16624 /// </summary>
16625 [JsonPropertyName("attendees")]
16626 public IList<CalendarEventAttendee>? Attendees { get; set; }
16627
16628 /// <summary>
16629 /// The organizer of the event.
16630 /// </summary>
16631 [JsonPropertyName("organizer")]
16632 public CalendarEventAttendee? Organizer { get; set; }
16633
16634 /// <summary>
16635 /// Serializes this CalendarEventProperties into a JSON string.
16636 /// </summary>
16637 public string Serialize()
16638 {
16639 return JsonSerializer.Serialize(
16640 this,
16641 new JsonSerializerOptions
16642 {
16643 WriteIndented = true,
16644 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16645 }
16646 );
16647 }
16648
16649 public CalendarEventProperties WithKey(string value)
16650 {
16651 this.Key = value;
16652 return this;
16653 }
16654
16655 public CalendarEventProperties WithId(string value)
16656 {
16657 this.Id = value;
16658 return this;
16659 }
16660
16661 public CalendarEventProperties WithTitle(string value)
16662 {
16663 this.Title = value;
16664 return this;
16665 }
16666
16667 public CalendarEventProperties WithStart(string value)
16668 {
16669 this.Start = value;
16670 return this;
16671 }
16672
16673 public CalendarEventProperties WithEnd(string value)
16674 {
16675 this.End = value;
16676 return this;
16677 }
16678
16679 public CalendarEventProperties WithStatus(string value)
16680 {
16681 this.Status = value;
16682 return this;
16683 }
16684
16685 public CalendarEventProperties WithLocations(params string[] value)
16686 {
16687 this.Locations = new List<string>(value);
16688 return this;
16689 }
16690
16691 public CalendarEventProperties WithLocations(IList<string> value)
16692 {
16693 this.Locations = value;
16694 return this;
16695 }
16696
16697 public CalendarEventProperties WithOnlineMeetingUrl(string value)
16698 {
16699 this.OnlineMeetingUrl = value;
16700 return this;
16701 }
16702
16703 public CalendarEventProperties WithIsAllDay(bool value)
16704 {
16705 this.IsAllDay = value;
16706 return this;
16707 }
16708
16709 public CalendarEventProperties WithExtension(string value)
16710 {
16711 this.Extension = value;
16712 return this;
16713 }
16714
16715 public CalendarEventProperties WithUrl(string value)
16716 {
16717 this.Url = value;
16718 return this;
16719 }
16720
16721 public CalendarEventProperties WithAttendees(params CalendarEventAttendee[] value)
16722 {
16723 this.Attendees = new List<CalendarEventAttendee>(value);
16724 return this;
16725 }
16726
16727 public CalendarEventProperties WithAttendees(IList<CalendarEventAttendee> value)
16728 {
16729 this.Attendees = value;
16730 return this;
16731 }
16732
16733 public CalendarEventProperties WithOrganizer(CalendarEventAttendee value)
16734 {
16735 this.Organizer = value;
16736 return this;
16737 }
16738}
16739
16740/// <summary>
16741/// Represents a calendar event attendee.
16742/// </summary>
16743public class CalendarEventAttendee : SerializableObject
16744{
16745 /// <summary>
16746 /// Deserializes a JSON string into an object of type CalendarEventAttendee.
16747 /// </summary>
16748 public static CalendarEventAttendee? Deserialize(string json)
16749 {
16750 return JsonSerializer.Deserialize<CalendarEventAttendee>(json);
16751 }
16752
16753 /// <summary>
16754 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16755 /// </summary>
16756 [JsonPropertyName("key")]
16757 public string? Key { get; set; }
16758
16759 /// <summary>
16760 /// The name of the attendee.
16761 /// </summary>
16762 [JsonPropertyName("name")]
16763 public string? Name { get; set; }
16764
16765 /// <summary>
16766 /// The email address of the attendee.
16767 /// </summary>
16768 [JsonPropertyName("email")]
16769 public string? Email { get; set; }
16770
16771 /// <summary>
16772 /// The title of the attendee.
16773 /// </summary>
16774 [JsonPropertyName("title")]
16775 public string? Title { get; set; }
16776
16777 /// <summary>
16778 /// The type of the attendee.
16779 /// </summary>
16780 [JsonPropertyName("type")]
16781 public string? Type { get; set; }
16782
16783 /// <summary>
16784 /// The status of the attendee.
16785 /// </summary>
16786 [JsonPropertyName("status")]
16787 public string? Status { get; set; }
16788
16789 /// <summary>
16790 /// Serializes this CalendarEventAttendee into a JSON string.
16791 /// </summary>
16792 public string Serialize()
16793 {
16794 return JsonSerializer.Serialize(
16795 this,
16796 new JsonSerializerOptions
16797 {
16798 WriteIndented = true,
16799 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
16800 }
16801 );
16802 }
16803
16804 public CalendarEventAttendee WithKey(string value)
16805 {
16806 this.Key = value;
16807 return this;
16808 }
16809
16810 public CalendarEventAttendee WithName(string value)
16811 {
16812 this.Name = value;
16813 return this;
16814 }
16815
16816 public CalendarEventAttendee WithEmail(string value)
16817 {
16818 this.Email = value;
16819 return this;
16820 }
16821
16822 public CalendarEventAttendee WithTitle(string value)
16823 {
16824 this.Title = value;
16825 return this;
16826 }
16827
16828 public CalendarEventAttendee WithType(string value)
16829 {
16830 this.Type = value;
16831 return this;
16832 }
16833
16834 public CalendarEventAttendee WithStatus(string value)
16835 {
16836 this.Status = value;
16837 return this;
16838 }
16839}
16840
16841/// <summary>
16842/// A page inside a Carousel element.
16843/// </summary>
16844public class CarouselPage : CardElement
16845{
16846 /// <summary>
16847 /// Deserializes a JSON string into an object of type CarouselPage.
16848 /// </summary>
16849 public static CarouselPage? Deserialize(string json)
16850 {
16851 return JsonSerializer.Deserialize<CarouselPage>(json);
16852 }
16853
16854 /// <summary>
16855 /// Defines an optional key for the object. Keys are seldom needed, but in some scenarios, specifying keys can help maintain visual state in the host application.
16856 /// </summary>
16857 [JsonPropertyName("key")]
16858 public string? Key { get; set; }
16859
16860 /// <summary>
16861 /// Must be **CarouselPage**.
16862 /// </summary>
16863 [JsonPropertyName("type")]
16864 public string Type { get; } = "CarouselPage";
16865
16866 /// <summary>
16867 /// 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.
16868 /// </summary>
16869 [JsonPropertyName("id")]
16870 public string? Id { get; set; }
16871
16872 /// <summary>
16873 /// 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).
16874 /// </summary>
16875 [JsonPropertyName("requires")]
16876 public HostCapabilities? Requires { get; set; } = new HostCapabilities();
16877
16878 /// <summary>
16879 /// The locale associated with the element.
16880 /// </summary>
16881 [JsonPropertyName("lang")]
16882 public string? Lang { get; set; }
16883
16884 /// <summary>
16885 /// Controls the visibility of the element.
16886 /// </summary>
16887 [JsonPropertyName("isVisible")]
16888 public bool? IsVisible { get; set; } = true;
16889
16890 /// <summary>
16891 /// The height of the element. When set to stretch, the element will use the remaining vertical space in its container.
16892 /// </summary>
16893 [JsonPropertyName("height")]
16894 public ElementHeight? Height { get; set; } = ElementHeight.Auto;
16895
16896 /// <summary>
16897 /// 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).
16898 /// </summary>
16899 [JsonPropertyName("targetWidth")]
16900 public TargetWidth? TargetWidth { get; set; }
16901
16902 /// <summary>
16903 /// Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
16904 /// </summary>
16905 [JsonPropertyName("isSortKey")]
16906 public bool? IsSortKey { get; set; } = false;
16907
16908 /// <summary>
16909 /// An Action that will be invoked when the element is tapped or clicked. Action.ShowCard is not supported.
16910 /// </summary>
16911 [JsonPropertyName("selectAction")]
16912 public Action? SelectAction { get; set; }
16913
16914 /// <summary>
16915 /// 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.
16916 /// </summary>
16917 [JsonPropertyName("style")]
16918 public ContainerStyle? Style { get; set; }
16919
16920 /// <summary>
16921 /// Controls if a border should be displayed around the container.
16922 /// </summary>
16923 [JsonPropertyName("showBorder")]
16924 public bool? ShowBorder { get; set; } = false;
16925
16926 /// <summary>
16927 /// Controls if the container should have rounded corners.
16928 /// </summary>
16929 [JsonPropertyName("roundedCorners")]
16930 public bool? RoundedCorners { get; set; } = false;
16931
16932 /// <summary>
16933 /// 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.
16934 /// </summary>
16935 [JsonPropertyName("layouts")]
16936 public IList<ContainerLayout>? Layouts { get; set; }
16937
16938 /// <summary>
16939 /// The minimum height, in pixels, of the container, in the `<number>px` format.
16940 /// </summary>
16941 [JsonPropertyName("minHeight")]
16942 public string? MinHeight { get; set; }
16943
16944 /// <summary>
16945 /// Defines the container's background image.
16946 /// </summary>
16947 [JsonPropertyName("backgroundImage")]
16948 public IUnion<string, BackgroundImage>? BackgroundImage { get; set; }
16949
16950 /// <summary>
16951 /// Controls how the container's content should be vertically aligned.
16952 /// </summary>
16953 [JsonPropertyName("verticalContentAlignment")]
16954 public VerticalAlignment? VerticalContentAlignment { get; set; }
16955
16956 /// <summary>
16957 /// Controls if the content of the card is to be rendered left-to-right or right-to-left.
16958 /// </summary>
16959 [JsonPropertyName("rtl")]
16960 public bool? Rtl { get; set; }
16961
16962 /// <summary>
16963 /// 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.
16964 /// </summary>
16965 [JsonPropertyName("maxHeight")]
16966 public string? MaxHeight { get; set; }
16967
16968 /// <summary>
16969 /// The area of a Layout.AreaGrid layout in which an element should be displayed.
16970 /// </summary>
16971 [JsonPropertyName("grid.area")]
16972 public string? GridArea { get; set; }
16973
16974 /// <summary>
16975 /// 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.
16976 /// </summary>
16977 [JsonPropertyName("fallback")]
16978 public IUnion<CardElement, FallbackElement>? Fallback { get; set; }
16979
16980 /// <summary>
16981 /// The elements in the page.
16982 /// </summary>
16983 [JsonPropertyName("items")]
16984 public IList<CardElement>? Items { get; set; }
16985
16986 public CarouselPage() { }
16987
16988 public CarouselPage(params CardElement[] items)
16989 {
16990 this.Items = new List<CardElement>(items);
16991 }
16992
16993 public CarouselPage(IList<CardElement> items)
16994 {
16995 this.Items = items;
16996 }
16997
16998 /// <summary>
16999 /// Serializes this CarouselPage into a JSON string.
17000 /// </summary>
17001 public string Serialize()
17002 {
17003 return JsonSerializer.Serialize(
17004 this,
17005 new JsonSerializerOptions
17006 {
17007 WriteIndented = true,
17008 DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
17009 }
17010 );
17011 }
17012
17013 public CarouselPage WithKey(string value)
17014 {
17015 this.Key = value;
17016 return this;
17017 }
17018
17019 public CarouselPage WithId(string value)
17020 {
17021 this.Id = value;
17022 return this;
17023 }
17024
17025 public CarouselPage WithRequires(HostCapabilities value)
17026 {
17027 this.Requires = value;
17028 return this;
17029 }
17030
17031 public CarouselPage WithLang(string value)
17032 {
17033 this.Lang = value;
17034 return this;
17035 }
17036
17037 public CarouselPage WithIsVisible(bool value)
17038 {
17039 this.IsVisible = value;
17040 return this;
17041 }
17042
17043 public CarouselPage WithHeight(ElementHeight value)
17044 {
17045 this.Height = value;
17046 return this;
17047 }
17048
17049 public CarouselPage WithTargetWidth(TargetWidth value)
17050 {
17051 this.TargetWidth = value;
17052 return this;
17053 }
17054
17055 public CarouselPage WithIsSortKey(bool value)
17056 {
17057 this.IsSortKey = value;
17058 return this;
17059 }
17060
17061 public CarouselPage WithSelectAction(Action value)
17062 {
17063 this.SelectAction = value;
17064 return this;
17065 }
17066
17067 public CarouselPage WithStyle(ContainerStyle value)
17068 {
17069 this.Style = value;
17070 return this;
17071 }
17072
17073 public CarouselPage WithShowBorder(b