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

use strict;

package Raritan::RPC::net::PortForwardingSettings;


sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'enabled'} = ($in->{'enabled'}) ? JSON::true : JSON::false;
    $encoded->{'role'} = 1 * $in->{'role'};
    $encoded->{'masterDownstreamIfName'} = "$in->{'masterDownstreamIfName'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'enabled'} = ($in->{'enabled'}) ? 1 : 0;
    $decoded->{'role'} = $in->{'role'};
    $decoded->{'masterDownstreamIfName'} = $in->{'masterDownstreamIfName'};
    return $decoded;
}

1;
