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

use strict;

package Raritan::RPC::event::Engine::EventDesc;

use Raritan::RPC::event::Engine::EventDesc;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'eventDescType'} = 1 * $in->{'eventDescType'};
    $encoded->{'eventType'} = 1 * $in->{'eventType'};
    $encoded->{'dynNodeContext'} = "$in->{'dynNodeContext'}";
    $encoded->{'idComp'} = "$in->{'idComp'}";
    $encoded->{'name'} = "$in->{'name'}";
    $encoded->{'entries'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'entries'}}; $i0++) {
        $encoded->{'entries'}->[$i0] = Raritan::RPC::event::Engine::EventDesc::encode($in->{'entries'}->[$i0]);
    }
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'eventDescType'} = $in->{'eventDescType'};
    $decoded->{'eventType'} = $in->{'eventType'};
    $decoded->{'dynNodeContext'} = $in->{'dynNodeContext'};
    $decoded->{'idComp'} = $in->{'idComp'};
    $decoded->{'name'} = $in->{'name'};
    $decoded->{'entries'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'entries'}}; $i0++) {
        $decoded->{'entries'}->[$i0] = Raritan::RPC::event::Engine::EventDesc::decode($agent, $in->{'entries'}->[$i0]);
    }
    return $decoded;
}

1;
