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

use strict;

package Raritan::RPC::peripheral::DeviceManager_2_0_0::PackageEvent;

use constant typeId => "peripheral.DeviceManager_2_0_0.PackageEvent:1.0.0";
use Raritan::RPC::idl::Event;
use Raritan::RPC::peripheral::PackageInfo_2_0_0;
use Raritan::RPC::peripheral::PackageInfo_2_0_0;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'packageInfo'} = Raritan::RPC::peripheral::PackageInfo_2_0_0::encode($in->{'packageInfo'});
    $encoded->{'allPackages'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'allPackages'}}; $i0++) {
        $encoded->{'allPackages'}->[$i0] = Raritan::RPC::peripheral::PackageInfo_2_0_0::encode($in->{'allPackages'}->[$i0]);
    }
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'packageInfo'} = Raritan::RPC::peripheral::PackageInfo_2_0_0::decode($agent, $in->{'packageInfo'});
    $decoded->{'allPackages'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'allPackages'}}; $i0++) {
        $decoded->{'allPackages'}->[$i0] = Raritan::RPC::peripheral::PackageInfo_2_0_0::decode($agent, $in->{'allPackages'}->[$i0]);
    }
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.DeviceManager_2_0_0.PackageEvent', 1, 0, 0, 'Raritan::RPC::peripheral::DeviceManager_2_0_0::PackageEvent');
1;
