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

use strict;

package Raritan::RPC::sensors::Switch_2_0_5::SwitchEvent;

use constant typeId => "sensors.Switch_2_0_5.SwitchEvent:1.0.0";
use Raritan::RPC::event::UserEvent;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'targetState'} = 1 * $in->{'targetState'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::event::UserEvent::decode($agent, $in);
    $decoded->{'targetState'} = $in->{'targetState'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('sensors.Switch_2_0_5.SwitchEvent', 1, 0, 0, 'Raritan::RPC::sensors::Switch_2_0_5::SwitchEvent');
1;
