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

use strict;

package Raritan::RPC::assetmgrmodel::AssetStrip_2_0_3::RackUnitInfo;

use Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::RackUnitSettings;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'rackUnitNumber'} = 1 * $in->{'rackUnitNumber'};
    $encoded->{'rackUnitPosition'} = 1 * $in->{'rackUnitPosition'};
    $encoded->{'type'} = 1 * $in->{'type'};
    $encoded->{'size'} = 1 * $in->{'size'};
    $encoded->{'settings'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::RackUnitSettings::encode($in->{'settings'});
    $encoded->{'assetStripCascadePosition'} = 1 * $in->{'assetStripCascadePosition'};
    $encoded->{'rackUnitRelativePosition'} = 1 * $in->{'rackUnitRelativePosition'};
    $encoded->{'assetStripNumberOfRackUnits'} = 1 * $in->{'assetStripNumberOfRackUnits'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'rackUnitNumber'} = $in->{'rackUnitNumber'};
    $decoded->{'rackUnitPosition'} = $in->{'rackUnitPosition'};
    $decoded->{'type'} = $in->{'type'};
    $decoded->{'size'} = $in->{'size'};
    $decoded->{'settings'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::RackUnitSettings::decode($agent, $in->{'settings'});
    $decoded->{'assetStripCascadePosition'} = $in->{'assetStripCascadePosition'};
    $decoded->{'rackUnitRelativePosition'} = $in->{'rackUnitRelativePosition'};
    $decoded->{'assetStripNumberOfRackUnits'} = $in->{'assetStripNumberOfRackUnits'};
    return $decoded;
}

1;
