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

use strict;

package Raritan::RPC::cascading::CascadeManager::RoleChangedEvent;

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

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'oldRole'} = $in->{'oldRole'};
    $encoded->{'newRole'} = $in->{'newRole'};
    $encoded->{'master'} = "$in->{'master'}";
    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->{'master'} = $in->{'master'};
    return $decoded;
}

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