// Copyright Epic Games, Inc. All Rights Reserved. using System.Collections.Generic; using System.Text.Json.Serialization; namespace EpicGames.Slack.Elements { /// /// A radio button group that allows a user to choose one item from a list of possible options. /// public class RadioButtonGroupElement : Element { /// /// An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. /// Should be unique among all other action_ids in the containing block. Maximum length for this field is 255 characters. /// [JsonPropertyName("action_id")] public string ActionId { get; set; } /// /// An array of option objects. A maximum of 10 options are allowed. /// [JsonPropertyName("options")] public List Options { get; } = new List(); /// /// An array of option objects that exactly matches one or more of the options within options. These options will be selected when the checkbox group initially loads. /// [JsonPropertyName("initial_option")] public SlackOption? InitialOption { get; set; } /// /// A confirm object that defines an optional confirmation dialog that appears after clicking one of the checkboxes in this element. /// [JsonPropertyName("confirm")] public SlackConfirm? Confirm { get; set; } /// /// Indicates whether the element will be set to auto focus within the view object. Only one element can be set to true. Defaults to false. /// [JsonPropertyName("focus_on_load")] public bool? FocusOnLoad { get; set; } /// /// Construct a new Button action element. /// public RadioButtonGroupElement(string actionId, List options) : base("radio_buttons") { ActionId = actionId; Options.AddRange(options); } } }