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

use strict;

package Raritan::RPC::event::TimerEventManager::TimerEvent;

use Raritan::RPC::event::TimerEventManager::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::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::Schedule::decode($agent, $in->{'executionTime'});
    return $decoded;
}

1;
