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

use strict;

package Raritan::RPC::lhxmodel::Sensor_4_0_3::StateChangedEvent;

use constant typeId => "lhxmodel.Sensor_4_0_3.StateChangedEvent:1.0.0";
use Raritan::RPC::idl::Event;
use Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading;
use Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'oldReading'} = Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading::encode($in->{'oldReading'});
    $encoded->{'newReading'} = Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading::encode($in->{'newReading'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'oldReading'} = Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading::decode($agent, $in->{'oldReading'});
    $decoded->{'newReading'} = Raritan::RPC::lhxmodel::Sensor_4_0_3::Reading::decode($agent, $in->{'newReading'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('lhxmodel.Sensor_4_0_3.StateChangedEvent', 1, 0, 0, 'Raritan::RPC::lhxmodel::Sensor_4_0_3::StateChangedEvent');
1;
