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

use strict;

package Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::StripSettings;

use Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor;
use Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'rackUnitCount'} = 1 * $in->{'rackUnitCount'};
    $encoded->{'name'} = "$in->{'name'}";
    $encoded->{'scanMode'} = 1 * $in->{'scanMode'};
    $encoded->{'defaultColorConnected'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor::encode($in->{'defaultColorConnected'});
    $encoded->{'defaultColorDisconnected'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor::encode($in->{'defaultColorDisconnected'});
    $encoded->{'numberingMode'} = 1 * $in->{'numberingMode'};
    $encoded->{'numberingOffset'} = 1 * $in->{'numberingOffset'};
    $encoded->{'orientation'} = 1 * $in->{'orientation'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'rackUnitCount'} = $in->{'rackUnitCount'};
    $decoded->{'name'} = $in->{'name'};
    $decoded->{'scanMode'} = $in->{'scanMode'};
    $decoded->{'defaultColorConnected'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor::decode($agent, $in->{'defaultColorConnected'});
    $decoded->{'defaultColorDisconnected'} = Raritan::RPC::assetmgrmodel::AssetStripConfig_1_0_1::LEDColor::decode($agent, $in->{'defaultColorDisconnected'});
    $decoded->{'numberingMode'} = $in->{'numberingMode'};
    $decoded->{'numberingOffset'} = $in->{'numberingOffset'};
    $decoded->{'orientation'} = $in->{'orientation'};
    return $decoded;
}

1;
