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

use strict;

package Raritan::RPC::pdumodel::Nameplate;

use Raritan::RPC::pdumodel::Nameplate::Rating;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'manufacturer'} = "$in->{'manufacturer'}";
    $encoded->{'model'} = "$in->{'model'}";
    $encoded->{'partNumber'} = "$in->{'partNumber'}";
    $encoded->{'serialNumber'} = "$in->{'serialNumber'}";
    $encoded->{'rating'} = Raritan::RPC::pdumodel::Nameplate::Rating::encode($in->{'rating'});
    $encoded->{'imageFileURL'} = "$in->{'imageFileURL'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'manufacturer'} = $in->{'manufacturer'};
    $decoded->{'model'} = $in->{'model'};
    $decoded->{'partNumber'} = $in->{'partNumber'};
    $decoded->{'serialNumber'} = $in->{'serialNumber'};
    $decoded->{'rating'} = Raritan::RPC::pdumodel::Nameplate::Rating::decode($agent, $in->{'rating'});
    $decoded->{'imageFileURL'} = $in->{'imageFileURL'};
    return $decoded;
}

1;
