// ========================================================================== // Squidex Headless CMS // ========================================================================== // Copyright (c) Squidex UG (haftungsbeschraenkt) // All rights reserved. Licensed under the MIT license. // ========================================================================== using System; using System.ComponentModel.DataAnnotations; using Squidex.Domain.Apps.Core.HandleRules; using Squidex.Domain.Apps.Core.Rules; using Squidex.Infrastructure.Validation; namespace Squidex.Extensions.Actions.Discourse { [RuleAction( Title = "Discourse", IconImage = "", IconColor = "#eB6121", Display = "Post to discourse", Description = "Create a post or topic at discourse.", ReadMore = "https://www.discourse.org/")] public sealed record DiscourseAction : RuleAction { [AbsoluteUrl] [LocalizedRequired] [Display(Name = "Server Url", Description = "The url to the discourse server.")] [DataType(DataType.Url)] public Uri Url { get; set; } [LocalizedRequired] [Display(Name = "Api Key", Description = "The api key to authenticate to your discourse server.")] [DataType(DataType.Text)] public string ApiKey { get; set; } [LocalizedRequired] [Display(Name = "Api User", Description = "The api username to authenticate to your discourse server.")] [DataType(DataType.Text)] public string ApiUsername { get; set; } [LocalizedRequired] [Display(Name = "Text", Description = "The text as markdown.")] [DataType(DataType.MultilineText)] [Formattable] public string Text { get; set; } [Display(Name = "Title", Description = "The optional title when creating new topics.")] [DataType(DataType.Text)] [Formattable] public string Title { get; set; } [Display(Name = "Topic", Description = "The optional topic id.")] [DataType(DataType.Text)] public int? Topic { get; set; } [Display(Name = "Category", Description = "The optional category id.")] [DataType(DataType.Text)] public int? Category { get; set; } } }