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

use strict;

package Raritan::RPC::pdumodel::OutletGroup_1_1_9::PowerControlEvent;

use constant typeId => "pdumodel.OutletGroup_1_1_9.PowerControlEvent:1.0.0";
use Raritan::RPC::event::UserEvent;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'state'} = 1 * $in->{'state'};
    $encoded->{'cycle'} = ($in->{'cycle'}) ? JSON::true : JSON::false;
    return $encoded;
}

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

Raritan::RPC::Registry::registerCodecClass('pdumodel.OutletGroup_1_1_9.PowerControlEvent', 1, 0, 0, 'Raritan::RPC::pdumodel::OutletGroup_1_1_9::PowerControlEvent');
1;
