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

use strict;

package Raritan::RPC::sensors::NumericSensor_4_0_0::StateChangedEvent;

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

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'oldReading'} = Raritan::RPC::sensors::NumericSensor_4_0_0::Reading::encode($in->{'oldReading'});
    $encoded->{'newReading'} = Raritan::RPC::sensors::NumericSensor_4_0_0::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_0::Reading::decode($agent, $in->{'oldReading'});
    $decoded->{'newReading'} = Raritan::RPC::sensors::NumericSensor_4_0_0::Reading::decode($agent, $in->{'newReading'});
    return $decoded;
}

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