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

use strict;

package Raritan::RPC::peripheral::DoorHandleControllerPackage_3_0_3::MechanicallyUnlockedEvent;

use constant typeId => "peripheral.DoorHandleControllerPackage_3_0_3.MechanicallyUnlockedEvent:1.0.0";
use Raritan::RPC::peripheral::PackageInfo_7_0_0;
use Raritan::RPC::idl::Event;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'packageInfo'} = Raritan::RPC::peripheral::PackageInfo_7_0_0::encode($in->{'packageInfo'});
    $encoded->{'channel'} = 1 * $in->{'channel'};
    $encoded->{'doorStateName'} = "$in->{'doorStateName'}";
    $encoded->{'doorHandleName'} = "$in->{'doorHandleName'}";
    $encoded->{'doorLockName'} = "$in->{'doorLockName'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'packageInfo'} = Raritan::RPC::peripheral::PackageInfo_7_0_0::decode($agent, $in->{'packageInfo'});
    $decoded->{'channel'} = $in->{'channel'};
    $decoded->{'doorStateName'} = $in->{'doorStateName'};
    $decoded->{'doorHandleName'} = $in->{'doorHandleName'};
    $decoded->{'doorLockName'} = $in->{'doorLockName'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.DoorHandleControllerPackage_3_0_3.MechanicallyUnlockedEvent', 1, 0, 0, 'Raritan::RPC::peripheral::DoorHandleControllerPackage_3_0_3::MechanicallyUnlockedEvent');
1;
