using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Unity.Pipeline.Editor.Commands.ProjectSettings
{
///
///
/// Shared response for the project-settings get/set commands (CLI-202). One type backs every
/// settings group (PlayerSettings, Quality, Graphics, Physics, Time, Input, Tags & Layers,
/// Audio) so agents get a uniform shape across them.
///
///
/// carries the current settings for the group as a flat
/// name → value map — returned by a get, and re-read after a set so the caller can
/// confirm the change without a second round-trip.
///
/// Writes follow the shared confirm/dry_run convention, so
/// / mirror its semantics: a change only mutates when
/// it actually ran (not a preview, not refused). and
/// flag side effects an agent must wait out — e.g. switching the
/// scripting backend or API level triggers a domain reload; some graphics/texture changes trigger
/// an asset reimport. They describe the operation, so a dry_run still reports them.
///
[Serializable]
public class ProjectSettingsResponse
{
[JsonProperty("success")]
public bool Success { get; set; }
/// Settings group this response is for (e.g. "player", "quality", "time").
[JsonProperty("group")]
public string Group { get; set; }
/// True only when a write actually mutated the project (false for get/dry-run/refused/failed).
[JsonProperty("applied")]
public bool Applied { get; set; }
/// True when a write was a preview only (no mutation).
[JsonProperty("dryRun")]
public bool DryRun { get; set; }
/// The operation triggers a domain reload; the agent should wait for the editor to settle.
[JsonProperty("requiresDomainReload")]
public bool RequiresDomainReload { get; set; }
/// The operation triggers an asset reimport; the agent should wait for it to finish.
[JsonProperty("requiresReimport")]
public bool RequiresReimport { get; set; }
/// Current settings for the group as a name → value map.
[JsonProperty("values")]
public Dictionary Values { get; set; }
[JsonProperty("message")]
public string Message { get; set; }
public static ProjectSettingsResponse Fail(string group, string message) => new ProjectSettingsResponse
{
Success = false,
Group = group,
Message = message
};
}
}