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

use strict;

package Raritan::RPC::event::TimerEventManager_2_0_0::TimerEvent;

use Raritan::RPC::event::TimerEventManager_2_0_0::Schedule;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'eventId'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'eventId'}}; $i0++) {
        $encoded->{'eventId'}->[$i0] = "$in->{'eventId'}->[$i0]";
    }
    $encoded->{'executionTime'} = Raritan::RPC::event::TimerEventManager_2_0_0::Schedule::encode($in->{'executionTime'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'eventId'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'eventId'}}; $i0++) {
        $decoded->{'eventId'}->[$i0] = $in->{'eventId'}->[$i0];
    }
    $decoded->{'executionTime'} = Raritan::RPC::event::TimerEventManager_2_0_0::Schedule::decode($agent, $in->{'executionTime'});
    return $decoded;
}

1;
