namespace ZB.MOM.WW.MxGateway.Client;

/// <summary>
/// Filters and shape options for <see cref="GalaxyRepositoryClient.DiscoverHierarchyAsync(DiscoverHierarchyOptions, System.Threading.CancellationToken)"/>.
/// </summary>
/// <remarks>
/// Hand-written ergonomic wrapper around the generated
/// <c>DiscoverHierarchyRequest</c>: lets callers express a Galaxy-browse
/// slice with .NET-friendly nullable scalars and collection initializers,
/// without touching the protobuf message's <c>oneof root</c> directly.
/// </remarks>
public sealed class DiscoverHierarchyOptions
{
    /// <summary>Restrict to the subtree rooted at this Galaxy <c>gobject_id</c>.</summary>
    public int? RootGobjectId { get; init; }

    /// <summary>Restrict to the subtree rooted at the object with this tag name.</summary>
    public string? RootTagName { get; init; }

    /// <summary>Restrict to the subtree rooted at this <c>contained_name</c> path.</summary>
    public string? RootContainedPath { get; init; }

    /// <summary>Maximum traversal depth, measured from the chosen root.</summary>
    public int? MaxDepth { get; init; }

    /// <summary>Restrict to objects whose Galaxy category is in this set.</summary>
    public IReadOnlyList<int> CategoryIds { get; init; } = [];

    /// <summary>Restrict to objects whose template chain contains any of these tokens.</summary>
    public IReadOnlyList<string> TemplateChainContains { get; init; } = [];

    /// <summary>Optional glob-style filter on <c>tag_name</c>.</summary>
    public string? TagNameGlob { get; init; }

    /// <summary>Whether to populate each <c>GalaxyObject.Attributes</c>. Null leaves the server default.</summary>
    public bool? IncludeAttributes { get; init; }

    /// <summary>Restrict to objects that bear at least one alarm attribute.</summary>
    public bool AlarmBearingOnly { get; init; }

    /// <summary>Restrict to objects that have at least one historized attribute.</summary>
    public bool HistorizedOnly { get; init; }
}
