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

use strict;

package Raritan::RPC::servermon::ServerMonitor_2_0_0::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'};
    $encoded->{'resumeCount'} = 1 * $in->{'resumeCount'};
    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'};
    $decoded->{'resumeCount'} = $in->{'resumeCount'};
    return $decoded;
}

1;
