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

use strict;

package Raritan::RPC::pdumodel::Pdu::OutletSequenceState;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'sequenceRunning'} = ($in->{'sequenceRunning'}) ? JSON::true : JSON::false;
    $encoded->{'nextOutletToSwitch'} = 1 * $in->{'nextOutletToSwitch'};
    $encoded->{'timeUntilNextSwitch'} = 1 * $in->{'timeUntilNextSwitch'};
    $encoded->{'outletsRemaining'} = 1 * $in->{'outletsRemaining'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'sequenceRunning'} = ($in->{'sequenceRunning'}) ? 1 : 0;
    $decoded->{'nextOutletToSwitch'} = $in->{'nextOutletToSwitch'};
    $decoded->{'timeUntilNextSwitch'} = $in->{'timeUntilNextSwitch'};
    $decoded->{'outletsRemaining'} = $in->{'outletsRemaining'};
    return $decoded;
}

1;
