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

use strict;

package Raritan::RPC::peripheral::GatewaySensorManager_2_0_0::Sensor;

use constant typeId => "peripheral.GatewaySensorManager_2_0_0.Sensor:1.0.0";
sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'sensorId'} = "$in->{'sensorId'}";
    $encoded->{'disabled'} = ($in->{'disabled'}) ? JSON::true : JSON::false;
    $encoded->{'deviceId'} = "$in->{'deviceId'}";
    $encoded->{'classId'} = "$in->{'classId'}";
    $encoded->{'encodingId'} = "$in->{'encodingId'}";
    $encoded->{'defaultName'} = "$in->{'defaultName'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'sensorId'} = $in->{'sensorId'};
    $decoded->{'disabled'} = ($in->{'disabled'}) ? 1 : 0;
    $decoded->{'deviceId'} = $in->{'deviceId'};
    $decoded->{'classId'} = $in->{'classId'};
    $decoded->{'encodingId'} = $in->{'encodingId'};
    $decoded->{'defaultName'} = $in->{'defaultName'};
    return $decoded;
}

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