// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace EpicGames.Slack.Blocks
{
///
/// A block that is used to hold interactive objects.
///
public class ActionsBlock : Block, ISlackElementContainer
{
///
/// A collection of interactive elements.
///
[JsonPropertyName("elements"), JsonPropertyOrder(1)]
public List Elements { get; } = new List();
///
/// Constructor
///
public ActionsBlock() : base("actions")
{
}
}
///
/// Extension methods for
///
public static class ActionsBlockExtensions
{
///
/// Add an to the list of blocks
///
/// Block container
public static ActionsBlock AddActions(this ISlackBlockContainer container)
{
ActionsBlock block = new ActionsBlock();
container.Blocks.Add(block);
return block;
}
///
/// Add an to the list of blocks
///
/// Block container
/// Configuration function for the block
public static void AddActions(this ISlackBlockContainer container, Action configure)
{
ActionsBlock block = new ActionsBlock();
configure(block);
container.Blocks.Add(block);
}
}
}