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

use strict;

package Raritan::RPC::tacplus::ServerSettings;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'server'} = "$in->{'server'}";
    $encoded->{'port'} = 1 * $in->{'port'};
    $encoded->{'timeoutSeconds'} = 1 * $in->{'timeoutSeconds'};
    $encoded->{'retries'} = 1 * $in->{'retries'};
    $encoded->{'sharedSecret'} = "$in->{'sharedSecret'}";
    $encoded->{'authenType'} = 1 * $in->{'authenType'};
    $encoded->{'disableAccounting'} = ($in->{'disableAccounting'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'server'} = $in->{'server'};
    $decoded->{'port'} = $in->{'port'};
    $decoded->{'timeoutSeconds'} = $in->{'timeoutSeconds'};
    $decoded->{'retries'} = $in->{'retries'};
    $decoded->{'sharedSecret'} = $in->{'sharedSecret'};
    $decoded->{'authenType'} = $in->{'authenType'};
    $decoded->{'disableAccounting'} = ($in->{'disableAccounting'}) ? 1 : 0;
    return $decoded;
}

1;
