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

use strict;

package Raritan::RPC::hmi::InternalBeeper_2_0_1::StateChangedEvent;

use constant typeId => "hmi.InternalBeeper_2_0_1.StateChangedEvent:1.0.0";
use Raritan::RPC::idl::Event;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::idl::Event::encode($in);
    $encoded->{'state'} = 1 * $in->{'state'};
    $encoded->{'reason'} = "$in->{'reason'}";
    $encoded->{'mutedTemporarily'} = ($in->{'mutedTemporarily'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::idl::Event::decode($agent, $in);
    $decoded->{'state'} = $in->{'state'};
    $decoded->{'reason'} = $in->{'reason'};
    $decoded->{'mutedTemporarily'} = ($in->{'mutedTemporarily'}) ? 1 : 0;
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('hmi.InternalBeeper_2_0_1.StateChangedEvent', 1, 0, 0, 'Raritan::RPC::hmi::InternalBeeper_2_0_1::StateChangedEvent');
1;
