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

use strict;

package Raritan::RPC::portsmodel::Port::Properties;

use Raritan::RPC::portsmodel::Port::DetectionMode;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'name'} = "$in->{'name'}";
    $encoded->{'label'} = "$in->{'label'}";
    $encoded->{'mode'} = Raritan::RPC::portsmodel::Port::DetectionMode::encode($in->{'mode'});
    $encoded->{'detectedDeviceType'} = "$in->{'detectedDeviceType'}";
    $encoded->{'detectedDeviceName'} = "$in->{'detectedDeviceName'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'name'} = $in->{'name'};
    $decoded->{'label'} = $in->{'label'};
    $decoded->{'mode'} = Raritan::RPC::portsmodel::Port::DetectionMode::decode($agent, $in->{'mode'});
    $decoded->{'detectedDeviceType'} = $in->{'detectedDeviceType'};
    $decoded->{'detectedDeviceName'} = $in->{'detectedDeviceName'};
    return $decoded;
}

1;
