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

use strict;

package Raritan::RPC::sensors::NumericSensor_4_0_5::StateChangedEvent;

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

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

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

Raritan::RPC::Registry::registerCodecClass('sensors.NumericSensor_4_0_5.StateChangedEvent', 1, 0, 0, 'Raritan::RPC::sensors::NumericSensor_4_0_5::StateChangedEvent');
1;
