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

use strict;

package Raritan::RPC::dsam::DsamPort::SettingsChangedEvent;

use constant typeId => "dsam.DsamPort.SettingsChangedEvent:1.0.0";
use Raritan::RPC::dsam::DsamPort::Settings;
use Raritan::RPC::event::UserEvent;
use Raritan::RPC::dsam::DsamPort::Settings;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'dsamNumber'} = 1 * $in->{'dsamNumber'};
    $encoded->{'portNumber'} = 1 * $in->{'portNumber'};
    $encoded->{'oldSettings'} = Raritan::RPC::dsam::DsamPort::Settings::encode($in->{'oldSettings'});
    $encoded->{'newSettings'} = Raritan::RPC::dsam::DsamPort::Settings::encode($in->{'newSettings'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::event::UserEvent::decode($agent, $in);
    $decoded->{'dsamNumber'} = $in->{'dsamNumber'};
    $decoded->{'portNumber'} = $in->{'portNumber'};
    $decoded->{'oldSettings'} = Raritan::RPC::dsam::DsamPort::Settings::decode($agent, $in->{'oldSettings'});
    $decoded->{'newSettings'} = Raritan::RPC::dsam::DsamPort::Settings::decode($agent, $in->{'newSettings'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('dsam.DsamPort.SettingsChangedEvent', 1, 0, 0, 'Raritan::RPC::dsam::DsamPort::SettingsChangedEvent');
1;
