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

use strict;

package Raritan::RPC::tfw::Event;

use Raritan::RPC::tfw::EventType;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'type'} = Raritan::RPC::tfw::EventType::encode($in->{'type'});
    $encoded->{'src'} = Raritan::RPC::ObjectCodec::encode($in->{'src'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'type'} = Raritan::RPC::tfw::EventType::decode($agent, $in->{'type'});
    $decoded->{'src'} = Raritan::RPC::ObjectCodec::decode($agent, $in->{'src'}, 'idl.Object');
    return $decoded;
}

1;
