# 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_3_0_1::DeviceEvent_2_0_0;

use constant typeId => "peripheral.DeviceManager_3_0_1.DeviceEvent:2.0.0";
use Raritan::RPC::peripheral::Device_3_0_1;
use Raritan::RPC::idl::Event;
use Raritan::RPC::peripheral::Device_3_0_1;

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

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

Raritan::RPC::Registry::registerCodecClass('peripheral.DeviceManager_3_0_1.DeviceEvent', 2, 0, 0, 'Raritan::RPC::peripheral::DeviceManager_3_0_1::DeviceEvent_2_0_0');
1;
