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

namespace HyperBooru.PowerShell;

[Alias("rhbtd")]
[Cmdlet(VerbsCommon.Remove, "HyperBooruTagDefinition")]
public class RemoveTagDefinitionCmdlet : PSCmdlet {
    [Parameter(Mandatory = true)] public required HBSession Session         { get; set; }
    [Parameter(Mandatory = true)] public required Guid      TagDefinitionId { get; set; }

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