using System.Text.Json.Serialization; namespace BinaryLane.Api.V2.Models; /// /// Base payload for POST /v2/servers/{server_id}/actions. /// /// /// The upstream contract is a discriminated union on type. Its public /// documentation also creates fragment-bearing pseudo-paths for each variant; /// those are not separate HTTP routes. Prefer a concrete derived type for a /// documented action. permits new provider /// action types without waiting for an SDK release. /// public class ServerAction : BinaryLaneRequestModel { /// Creates an empty action for serializers and advanced callers. public ServerAction() { } /// Creates a typed action with the provider discriminator value. protected ServerAction(string type) { Type = type; } [JsonPropertyName(ServerActionJsonNames.Type)] public string Type { get; init; } = string.Empty; } internal static class ServerActionJsonNames { internal const string Type = "type"; } /// An action type not yet represented by a concrete SDK class. public sealed class UnknownServerAction : ServerAction { public UnknownServerAction(string type) : base(type) { } }