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

use strict;

package Raritan::RPC::peripheral::GatewaySensorManager_2_0_1::InterpretationRuleInvertable;

use constant typeId => "peripheral.GatewaySensorManager_2_0_1.InterpretationRuleInvertable:1.0.0";
use Raritan::RPC::peripheral::GatewaySensorManager_2_0_1::InterpretationRule;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::peripheral::GatewaySensorManager_2_0_1::InterpretationRule::encode($in);
    $encoded->{'invertCondition'} = ($in->{'invertCondition'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::peripheral::GatewaySensorManager_2_0_1::InterpretationRule::decode($agent, $in);
    $decoded->{'invertCondition'} = ($in->{'invertCondition'}) ? 1 : 0;
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('peripheral.GatewaySensorManager_2_0_1.InterpretationRuleInvertable', 1, 0, 0, 'Raritan::RPC::peripheral::GatewaySensorManager_2_0_1::InterpretationRuleInvertable');
1;
