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

use strict;

package Raritan::RPC::datetime::DateTime_3_0_0::Cfg;

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

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

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

1;
