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

use strict;

package Raritan::RPC::pdumodel::OverCurrentProtectorTripSensor::TripStateChangedEvent;

use constant typeId => "pdumodel.OverCurrentProtectorTripSensor.TripStateChangedEvent:1.0.0";
use Raritan::RPC::sensors::StateSensor_4_0_2::StateChangedEvent;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::sensors::StateSensor_4_0_2::StateChangedEvent::encode($in);
    $encoded->{'tripCause'} = Raritan::RPC::ObjectCodec::encode($in->{'tripCause'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::sensors::StateSensor_4_0_2::StateChangedEvent::decode($agent, $in);
    $decoded->{'tripCause'} = Raritan::RPC::ObjectCodec::decode($agent, $in->{'tripCause'}, 'pdumodel.Outlet');
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('pdumodel.OverCurrentProtectorTripSensor.TripStateChangedEvent', 1, 0, 0, 'Raritan::RPC::pdumodel::OverCurrentProtectorTripSensor::TripStateChangedEvent');
1;
