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

use strict;

package Raritan::RPC::devsettings::Smtp::Configuration;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'host'} = "$in->{'host'}";
    $encoded->{'port'} = 1 * $in->{'port'};
    $encoded->{'sender'} = "$in->{'sender'}";
    $encoded->{'useAuth'} = ($in->{'useAuth'}) ? JSON::true : JSON::false;
    $encoded->{'username'} = "$in->{'username'}";
    $encoded->{'password'} = "$in->{'password'}";
    $encoded->{'retryCount'} = 1 * $in->{'retryCount'};
    $encoded->{'retryInterval'} = 1 * $in->{'retryInterval'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'host'} = $in->{'host'};
    $decoded->{'port'} = $in->{'port'};
    $decoded->{'sender'} = $in->{'sender'};
    $decoded->{'useAuth'} = ($in->{'useAuth'}) ? 1 : 0;
    $decoded->{'username'} = $in->{'username'};
    $decoded->{'password'} = $in->{'password'};
    $decoded->{'retryCount'} = $in->{'retryCount'};
    $decoded->{'retryInterval'} = $in->{'retryInterval'};
    return $decoded;
}

1;
