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

use strict;

package Raritan::RPC::datetime::DateTime_3_0_1::Cfg;

use Raritan::RPC::datetime::DateTime_3_0_1::NtpCfg;
use Raritan::RPC::datetime::DateTime_3_0_1::ZoneCfg;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'zoneCfg'} = Raritan::RPC::datetime::DateTime_3_0_1::ZoneCfg::encode($in->{'zoneCfg'});
    $encoded->{'protocol'} = 1 * $in->{'protocol'};
    $encoded->{'deviceTime'} = 1 * $in->{'deviceTime'};
    $encoded->{'ntpCfg'} = Raritan::RPC::datetime::DateTime_3_0_1::NtpCfg::encode($in->{'ntpCfg'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'zoneCfg'} = Raritan::RPC::datetime::DateTime_3_0_1::ZoneCfg::decode($agent, $in->{'zoneCfg'});
    $decoded->{'protocol'} = $in->{'protocol'};
    $decoded->{'deviceTime'} = $in->{'deviceTime'};
    $decoded->{'ntpCfg'} = Raritan::RPC::datetime::DateTime_3_0_1::NtpCfg::decode($agent, $in->{'ntpCfg'});
    return $decoded;
}

1;
