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

use strict;

package Raritan::RPC::cascading::CascadeManager_2_0_2::LinkUnit;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'type'} = 1 * $in->{'type'};
    $encoded->{'host'} = "$in->{'host'}";
    $encoded->{'status'} = 1 * $in->{'status'};
    $encoded->{'fwVersion'} = "$in->{'fwVersion'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'type'} = $in->{'type'};
    $decoded->{'host'} = $in->{'host'};
    $decoded->{'status'} = ($in->{'status'} < 7 ? $in->{'status'} : 0);
    $decoded->{'fwVersion'} = $in->{'fwVersion'};
    return $decoded;
}

1;
