# 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_2_0_0::Feedback;

use constant typeId => "peripheral.GatewaySensorManager_2_0_0.Feedback:1.0.0";
use Raritan::RPC::peripheral::GatewaySensorManager_2_0_0::FeedbackObject;

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

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

Raritan::RPC::Registry::registerCodecClass('peripheral.GatewaySensorManager_2_0_0.Feedback', 1, 0, 0, 'Raritan::RPC::peripheral::GatewaySensorManager_2_0_0::Feedback');
1;
