# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2024 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from AlarmManager.idl.

use strict;

package Raritan::RPC::event::AlarmManager::Alert;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'eventCondition'} = "$in->{'eventCondition'}";
    $encoded->{'message'} = "$in->{'message'}";
    $encoded->{'firstAppearance'} = 1 * $in->{'firstAppearance'};
    $encoded->{'lastAppearance'} = 1 * $in->{'lastAppearance'};
    $encoded->{'numberAlerts'} = 1 * $in->{'numberAlerts'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'eventCondition'} = $in->{'eventCondition'};
    $decoded->{'message'} = $in->{'message'};
    $decoded->{'firstAppearance'} = $in->{'firstAppearance'};
    $decoded->{'lastAppearance'} = $in->{'lastAppearance'};
    $decoded->{'numberAlerts'} = $in->{'numberAlerts'};
    return $decoded;
}

1;
