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

use strict;

package Raritan::RPC::peripheral::DeviceManager_5_2_5::UnknownDeviceAttachedEvent;

use constant typeId => "peripheral.DeviceManager_5_2_5.UnknownDeviceAttachedEvent:1.0.0";
use Raritan::RPC::idl::Event;
use Raritan::RPC::peripheral::PosElement_5_0_0;

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

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

Raritan::RPC::Registry::registerCodecClass('peripheral.DeviceManager_5_2_5.UnknownDeviceAttachedEvent', 1, 0, 0, 'Raritan::RPC::peripheral::DeviceManager_5_2_5::UnknownDeviceAttachedEvent');
1;
