#!/usr/bin/perl

use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case);
use Perun::Agent;
use Perun::Common qw(printMessage);

sub help {
	return qq{
	Removes NotifTemplateMessage from db by id. Id is required field.
	------------------------------------
	Available options:
	--NotifTemplateMessageId        | -i id of the NotifTemplateMessage
	--batch                         | -b batch
	--help                          | -h prints this help

};
}

our $batch;
my $id;
GetOptions ("help|h"    => sub {
		print help();
		exit 0;
	}, "batch|b"        => \$batch,
	"NotifObjectId|i=i" => \$id) || die help();

# Check options
unless (defined($id)) {die "ERROR: NotifTemplateMessage id is required\n";}

my $agent = Perun::Agent->new();
my $notifAgent = $agent->getNotificationsAgent;

$notifAgent->removePerunNotifTemplateMessage( id => $id );

printMessage("NotifTemplateMessage Id:$id successfully removed.", $batch);
