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

use strict;

package Raritan::RPC::lhxmodel::Parameter_2_0_1::Status;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'switchedOn'} = ($in->{'switchedOn'}) ? JSON::true : JSON::false;
    $encoded->{'active'} = ($in->{'active'}) ? JSON::true : JSON::false;
    $encoded->{'overflow'} = ($in->{'overflow'}) ? JSON::true : JSON::false;
    $encoded->{'underflow'} = ($in->{'underflow'}) ? JSON::true : JSON::false;
    $encoded->{'valid'} = ($in->{'valid'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'switchedOn'} = ($in->{'switchedOn'}) ? 1 : 0;
    $decoded->{'active'} = ($in->{'active'}) ? 1 : 0;
    $decoded->{'overflow'} = ($in->{'overflow'}) ? 1 : 0;
    $decoded->{'underflow'} = ($in->{'underflow'}) ? 1 : 0;
    $decoded->{'valid'} = ($in->{'valid'}) ? 1 : 0;
    return $decoded;
}

1;
