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

use strict;

package Raritan::RPC::servermon::ServerMonitor::ServerSettings;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'host'} = "$in->{'host'}";
    $encoded->{'enabled'} = ($in->{'enabled'}) ? JSON::true : JSON::false;
    $encoded->{'pingInterval'} = 1 * $in->{'pingInterval'};
    $encoded->{'retryInterval'} = 1 * $in->{'retryInterval'};
    $encoded->{'activationCount'} = 1 * $in->{'activationCount'};
    $encoded->{'failureCount'} = 1 * $in->{'failureCount'};
    $encoded->{'resumeDelay'} = 1 * $in->{'resumeDelay'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'host'} = $in->{'host'};
    $decoded->{'enabled'} = ($in->{'enabled'}) ? 1 : 0;
    $decoded->{'pingInterval'} = $in->{'pingInterval'};
    $decoded->{'retryInterval'} = $in->{'retryInterval'};
    $decoded->{'activationCount'} = $in->{'activationCount'};
    $decoded->{'failureCount'} = $in->{'failureCount'};
    $decoded->{'resumeDelay'} = $in->{'resumeDelay'};
    return $decoded;
}

1;
