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

use strict;

package Raritan::RPC::devsettings::Snmp_1_0_2::ConfigurationChangedEvent;

use constant typeId => "devsettings.Snmp_1_0_2.ConfigurationChangedEvent:1.0.0";
use Raritan::RPC::idl::Event;
use Raritan::RPC::devsettings::Snmp_1_0_2::Configuration;
use Raritan::RPC::devsettings::Snmp_1_0_2::Configuration;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'userName'} = "$in->{'userName'}";
    $encoded->{'ipAddr'} = "$in->{'ipAddr'}";
    $encoded->{'oldConfig'} = Raritan::RPC::devsettings::Snmp_1_0_2::Configuration::encode($in->{'oldConfig'});
    $encoded->{'newConfig'} = Raritan::RPC::devsettings::Snmp_1_0_2::Configuration::encode($in->{'newConfig'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'userName'} = $in->{'userName'};
    $decoded->{'ipAddr'} = $in->{'ipAddr'};
    $decoded->{'oldConfig'} = Raritan::RPC::devsettings::Snmp_1_0_2::Configuration::decode($agent, $in->{'oldConfig'});
    $decoded->{'newConfig'} = Raritan::RPC::devsettings::Snmp_1_0_2::Configuration::decode($agent, $in->{'newConfig'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('devsettings.Snmp_1_0_2.ConfigurationChangedEvent', 1, 0, 0, 'Raritan::RPC::devsettings::Snmp_1_0_2::ConfigurationChangedEvent');
1;
