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

use strict;

package Raritan::RPC::peripheral::GatewaySensorManager::InterpretationRuleModbusSpecificError;

use constant typeId => "peripheral.GatewaySensorManager.InterpretationRuleModbusSpecificError:1.0.0";
use Raritan::RPC::peripheral::GatewaySensorManager::InterpretationRuleInvertable;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::peripheral::GatewaySensorManager::InterpretationRuleInvertable::encode($in);
    $encoded->{'errors'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'errors'}}; $i0++) {
        $encoded->{'errors'}->[$i0] = 1 * $in->{'errors'}->[$i0];
    }
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::peripheral::GatewaySensorManager::InterpretationRuleInvertable::decode($agent, $in);
    $decoded->{'errors'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'errors'}}; $i0++) {
        $decoded->{'errors'}->[$i0] = $in->{'errors'}->[$i0];
    }
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.GatewaySensorManager.InterpretationRuleModbusSpecificError', 1, 0, 0, 'Raritan::RPC::peripheral::GatewaySensorManager::InterpretationRuleModbusSpecificError');
1;
