#!/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 NotifReceiver from db by id. Id is required field.
	------------------------------------
	Available options:
	--NotifReceiverId       | -i id of the NotifReceiver
	--batch                 | -b batch
	--help                  | -h prints this help

};
}

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

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

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

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

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