summaryrefslogtreecommitdiff
path: root/AddImplicitTag.cs
blob: 50f6cfcbb9ce4bf4b28f752d3159929606ae5cd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using HyperBooru.ApiClient;
using System.Management.Automation;

namespace HyperBooru.PowerShell;

[Alias("ahbit")]
[Cmdlet(VerbsCommon.Add, "HyperBooruImplicitTag")]
public class AddImplicitTagCmdlet : PSCmdlet {
    [Parameter(Mandatory = true)] public required HBSession Session         { get; set; }
    [Parameter(Mandatory = true)] public required Guid      TagDefinitionId { get; set; }
    [Parameter(Mandatory = true)] public required Guid[]    ImplicitTagId   { get; set; }

    protected override void ProcessRecord() =>
        Session.Tag.AddImplicitTagsAsync(TagDefinitionId, ImplicitTagId)
            .GetAwaiter()
            .GetResult();
}