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

use strict;

package Raritan::RPC::assetmgrmodel::AssetStrip_2_0_1::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'});
    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'});
    return $decoded;
}

1;
