# 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_1_1_13::TripStateChangedEvent;

use constant typeId => "pdumodel.OverCurrentProtectorTripSensor_1_1_13.TripStateChangedEvent:1.0.0";
use Raritan::RPC::pdumodel::OverCurrentProtectorTripSensor_1_1_13::TripEventInformation;
use Raritan::RPC::sensors::StateSensor_4_0_7::StateChangedEvent;

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

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

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