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

use strict;

package Raritan::RPC::servermon::ServerMonitor_2_0_1::ServerPowerStateEvent;

use constant typeId => "servermon.ServerMonitor_2_0_1.ServerPowerStateEvent:1.0.0";
use Raritan::RPC::idl::Event;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'id'} = 1 * $in->{'id'};
    $encoded->{'host'} = "$in->{'host'}";
    $encoded->{'oldPowerState'} = $in->{'oldPowerState'};
    $encoded->{'newPowerState'} = $in->{'newPowerState'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'id'} = $in->{'id'};
    $decoded->{'host'} = $in->{'host'};
    $decoded->{'oldPowerState'} = $in->{'oldPowerState'};
    $decoded->{'newPowerState'} = $in->{'newPowerState'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('servermon.ServerMonitor_2_0_1.ServerPowerStateEvent', 1, 0, 0, 'Raritan::RPC::servermon::ServerMonitor_2_0_1::ServerPowerStateEvent');
1;
