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

use strict;

package Raritan::RPC::net::EthSettings_4_0_0;

use Raritan::RPC::net::EapAuthSettings_3_0_0;
use Raritan::RPC::net::EthLinkMode;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'linkMode'} = Raritan::RPC::net::EthLinkMode::encode($in->{'linkMode'});
    $encoded->{'mtu'} = 1 * $in->{'mtu'};
    $encoded->{'authType'} = 1 * $in->{'authType'};
    $encoded->{'eap'} = Raritan::RPC::net::EapAuthSettings_3_0_0::encode($in->{'eap'});
    $encoded->{'lldpEnabled'} = ($in->{'lldpEnabled'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'linkMode'} = Raritan::RPC::net::EthLinkMode::decode($agent, $in->{'linkMode'});
    $decoded->{'mtu'} = $in->{'mtu'};
    $decoded->{'authType'} = $in->{'authType'};
    $decoded->{'eap'} = Raritan::RPC::net::EapAuthSettings_3_0_0::decode($agent, $in->{'eap'});
    $decoded->{'lldpEnabled'} = ($in->{'lldpEnabled'}) ? 1 : 0;
    return $decoded;
}

1;
