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

use strict;

package Raritan::RPC::security::FrontPanelPrivilegesChanged;

use constant typeId => "security.FrontPanelPrivilegesChanged:1.0.0";
use Raritan::RPC::event::UserEvent;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'oldPrivileges'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'oldPrivileges'}}; $i0++) {
        $encoded->{'oldPrivileges'}->[$i0] = "$in->{'oldPrivileges'}->[$i0]";
    }
    $encoded->{'newPrivileges'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'newPrivileges'}}; $i0++) {
        $encoded->{'newPrivileges'}->[$i0] = "$in->{'newPrivileges'}->[$i0]";
    }
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::event::UserEvent::decode($agent, $in);
    $decoded->{'oldPrivileges'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'oldPrivileges'}}; $i0++) {
        $decoded->{'oldPrivileges'}->[$i0] = $in->{'oldPrivileges'}->[$i0];
    }
    $decoded->{'newPrivileges'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'newPrivileges'}}; $i0++) {
        $decoded->{'newPrivileges'}->[$i0] = $in->{'newPrivileges'}->[$i0];
    }
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('security.FrontPanelPrivilegesChanged', 1, 0, 0, 'Raritan::RPC::security::FrontPanelPrivilegesChanged');
1;
