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

use strict;

package Raritan::RPC::cascading::CascadeManager_2_0_1::RoleChangedEvent;

use constant typeId => "cascading.CascadeManager_2_0_1.RoleChangedEvent:1.0.0";
use Raritan::RPC::idl::Event;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'oldRole'} = 1 * $in->{'oldRole'};
    $encoded->{'newRole'} = 1 * $in->{'newRole'};
    $encoded->{'primaryUnit'} = "$in->{'primaryUnit'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'oldRole'} = $in->{'oldRole'};
    $decoded->{'newRole'} = $in->{'newRole'};
    $decoded->{'primaryUnit'} = $in->{'primaryUnit'};
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('cascading.CascadeManager_2_0_1.RoleChangedEvent', 1, 0, 0, 'Raritan::RPC::cascading::CascadeManager_2_0_1::RoleChangedEvent');
1;
