63 lines
2.5 KiB
C#
63 lines
2.5 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace Heimdall.Application.DTOs;
|
|
|
|
/// <summary>
|
|
/// A global application setting visible to all agents unless overridden.
|
|
/// </summary>
|
|
public sealed record AppSettingDto(
|
|
[property: JsonPropertyName("id")] Guid Id,
|
|
[property: JsonPropertyName("key")] string Key,
|
|
[property: JsonPropertyName("value")] string Value,
|
|
[property: JsonPropertyName("description")] string? Description,
|
|
[property: JsonPropertyName("category")] string Category,
|
|
[property: JsonPropertyName("valueType")] string ValueType,
|
|
[property: JsonPropertyName("allowedValues")] string? AllowedValues,
|
|
[property: JsonPropertyName("updatedAt")] DateTime UpdatedAt,
|
|
[property: JsonPropertyName("agentScoped")] bool AgentScoped = true
|
|
);
|
|
|
|
/// <summary>
|
|
/// Per-agent setting override.
|
|
/// </summary>
|
|
public sealed record AgentSettingDto(
|
|
[property: JsonPropertyName("id")] Guid Id,
|
|
[property: JsonPropertyName("agentId")] Guid AgentId,
|
|
[property: JsonPropertyName("key")] string Key,
|
|
[property: JsonPropertyName("value")] string Value,
|
|
[property: JsonPropertyName("updatedAt")] DateTime UpdatedAt
|
|
);
|
|
|
|
/// <summary>
|
|
/// Request to create a new global setting.
|
|
/// </summary>
|
|
public sealed record CreateAppSettingRequest(
|
|
[property: JsonPropertyName("key")] string Key,
|
|
[property: JsonPropertyName("value")] string Value,
|
|
[property: JsonPropertyName("category")] string Category = "General",
|
|
[property: JsonPropertyName("description")] string? Description = null,
|
|
[property: JsonPropertyName("valueType")] string ValueType = "string",
|
|
[property: JsonPropertyName("allowedValues")] string? AllowedValues = null,
|
|
[property: JsonPropertyName("agentScoped")] bool AgentScoped = true
|
|
);
|
|
|
|
/// <summary>
|
|
/// Request to update an existing global setting value.
|
|
/// </summary>
|
|
public sealed record UpdateAppSettingRequest(
|
|
[property: JsonPropertyName("value")] string Value,
|
|
[property: JsonPropertyName("description")] string? Description = null,
|
|
[property: JsonPropertyName("category")] string? Category = null,
|
|
[property: JsonPropertyName("valueType")] string? ValueType = null,
|
|
[property: JsonPropertyName("allowedValues")] string? AllowedValues = null,
|
|
[property: JsonPropertyName("agentScoped")] bool? AgentScoped = null
|
|
);
|
|
|
|
/// <summary>
|
|
/// Request to set a per-agent setting override.
|
|
/// </summary>
|
|
public sealed record SetAgentSettingRequest(
|
|
[property: JsonPropertyName("key")] string Key,
|
|
[property: JsonPropertyName("value")] string Value
|
|
);
|