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

use strict;

package Raritan::RPC::sensors::Logger_3_1_4::Settings;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'isEnabled'} = ($in->{'isEnabled'}) ? JSON::true : JSON::false;
    $encoded->{'samplesPerRecord'} = 1 * $in->{'samplesPerRecord'};
    $encoded->{'logCapacity'} = 1 * $in->{'logCapacity'};
    $encoded->{'backupEnabled'} = ($in->{'backupEnabled'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'isEnabled'} = ($in->{'isEnabled'}) ? 1 : 0;
    $decoded->{'samplesPerRecord'} = $in->{'samplesPerRecord'};
    $decoded->{'logCapacity'} = $in->{'logCapacity'};
    $decoded->{'backupEnabled'} = ($in->{'backupEnabled'}) ? 1 : 0;
    return $decoded;
}

1;
