# 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::RemoteDevice;

use constant typeId => "peripheral.GatewaySensorManager.RemoteDevice:1.0.0";
sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'deviceId'} = "$in->{'deviceId'}";
    $encoded->{'disabled'} = ($in->{'disabled'}) ? JSON::true : JSON::false;
    $encoded->{'name'} = "$in->{'name'}";
    $encoded->{'timeoutMs'} = 1 * $in->{'timeoutMs'};
    $encoded->{'retry'} = 1 * $in->{'retry'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'deviceId'} = $in->{'deviceId'};
    $decoded->{'disabled'} = ($in->{'disabled'}) ? 1 : 0;
    $decoded->{'name'} = $in->{'name'};
    $decoded->{'timeoutMs'} = $in->{'timeoutMs'};
    $decoded->{'retry'} = $in->{'retry'};
    return $decoded;
}

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