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

use strict;

package Raritan::RPC::peripheral::DeviceManager_5_0_0::DeviceFirmwareUpdateStateChangedEvent;

use constant typeId => "peripheral.DeviceManager_5_0_0.DeviceFirmwareUpdateStateChangedEvent:1.0.0";
use Raritan::RPC::idl::Event;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'oldVersion'} = "$in->{'oldVersion'}";
    $encoded->{'newVersion'} = "$in->{'newVersion'}";
    $encoded->{'serial'} = "$in->{'serial'}";
    $encoded->{'state'} = 1 * $in->{'state'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'oldVersion'} = $in->{'oldVersion'};
    $decoded->{'newVersion'} = $in->{'newVersion'};
    $decoded->{'serial'} = $in->{'serial'};
    $decoded->{'state'} = $in->{'state'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.DeviceManager_5_0_0.DeviceFirmwareUpdateStateChangedEvent', 1, 0, 0, 'Raritan::RPC::peripheral::DeviceManager_5_0_0::DeviceFirmwareUpdateStateChangedEvent');
1;
