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

use strict;

package Raritan::RPC::peripheral::GatewaySensorManager::Sensor;

use constant typeId => "peripheral.GatewaySensorManager.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.Sensor', 1, 0, 0, 'Raritan::RPC::peripheral::GatewaySensorManager::Sensor');
1;
