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

use strict;

package Raritan::RPC::pdumodel::Pdu_6_5_5::PortWithProperties;

use Raritan::RPC::portsmodel::Port_2_0_4::Properties;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'id'} = "$in->{'id'}";
    $encoded->{'port'} = Raritan::RPC::ObjectCodec::encode($in->{'port'});
    $encoded->{'properties'} = Raritan::RPC::portsmodel::Port_2_0_4::Properties::encode($in->{'properties'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'id'} = $in->{'id'};
    $decoded->{'port'} = Raritan::RPC::ObjectCodec::decode($agent, $in->{'port'}, 'portsmodel.Port');
    $decoded->{'properties'} = Raritan::RPC::portsmodel::Port_2_0_4::Properties::decode($agent, $in->{'properties'});
    return $decoded;
}

1;
