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

use strict;

package Raritan::RPC::usermgmt::RoleChanged;

use constant typeId => "usermgmt.RoleChanged:1.0.0";
use Raritan::RPC::usermgmt::Role::Info;
use Raritan::RPC::usermgmt::RoleEvent;
use Raritan::RPC::usermgmt::Role::Info;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::usermgmt::RoleEvent::encode($in);
    $encoded->{'oldSettings'} = Raritan::RPC::usermgmt::Role::Info::encode($in->{'oldSettings'});
    $encoded->{'newSettings'} = Raritan::RPC::usermgmt::Role::Info::encode($in->{'newSettings'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::usermgmt::RoleEvent::decode($agent, $in);
    $decoded->{'oldSettings'} = Raritan::RPC::usermgmt::Role::Info::decode($agent, $in->{'oldSettings'});
    $decoded->{'newSettings'} = Raritan::RPC::usermgmt::Role::Info::decode($agent, $in->{'newSettings'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('usermgmt.RoleChanged', 1, 0, 0, 'Raritan::RPC::usermgmt::RoleChanged');
1;
