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

use strict;

package Raritan::RPC::pdumodel::TransferSwitch_5_0_2::TransferLogEntry;

use Raritan::RPC::pdumodel::TransferSwitch_5_0_2::Statistics;
use Raritan::RPC::pdumodel::Waveform;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'timestamp'} = 1 * $in->{'timestamp'};
    $encoded->{'oldInlet'} = 1 * $in->{'oldInlet'};
    $encoded->{'newInlet'} = 1 * $in->{'newInlet'};
    $encoded->{'reason'} = 1 * $in->{'reason'};
    $encoded->{'waveform'} = Raritan::RPC::pdumodel::Waveform::encode($in->{'waveform'});
    $encoded->{'statistics'} = Raritan::RPC::pdumodel::TransferSwitch_5_0_2::Statistics::encode($in->{'statistics'});
    $encoded->{'switchFault'} = 1 * $in->{'switchFault'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'timestamp'} = $in->{'timestamp'};
    $decoded->{'oldInlet'} = $in->{'oldInlet'};
    $decoded->{'newInlet'} = $in->{'newInlet'};
    $decoded->{'reason'} = $in->{'reason'};
    $decoded->{'waveform'} = Raritan::RPC::pdumodel::Waveform::decode($agent, $in->{'waveform'});
    $decoded->{'statistics'} = Raritan::RPC::pdumodel::TransferSwitch_5_0_2::Statistics::decode($agent, $in->{'statistics'});
    $decoded->{'switchFault'} = $in->{'switchFault'};
    return $decoded;
}

1;
