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

use strict;

package Raritan::RPC::lhxmodel::Parameter_2_0_0::MetaData;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'unit'} = 1 * $in->{'unit'};
    $encoded->{'id'} = "$in->{'id'}";
    $encoded->{'defaultValue'} = 1 * $in->{'defaultValue'};
    $encoded->{'min'} = 1 * $in->{'min'};
    $encoded->{'max'} = 1 * $in->{'max'};
    $encoded->{'read_only'} = ($in->{'read_only'}) ? JSON::true : JSON::false;
    $encoded->{'decDigits'} = 1 * $in->{'decDigits'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'unit'} = $in->{'unit'};
    $decoded->{'id'} = $in->{'id'};
    $decoded->{'defaultValue'} = $in->{'defaultValue'};
    $decoded->{'min'} = $in->{'min'};
    $decoded->{'max'} = $in->{'max'};
    $decoded->{'read_only'} = ($in->{'read_only'}) ? 1 : 0;
    $decoded->{'decDigits'} = $in->{'decDigits'};
    return $decoded;
}

1;
