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

use strict;

package Raritan::RPC::serial::AnalogModem::CallEndedEvent;

use constant typeId => "serial.AnalogModem.CallEndedEvent:1.0.0";
use Raritan::RPC::serial::AnalogModem::DialInEvent;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::serial::AnalogModem::DialInEvent::encode($in);
    $encoded->{'disconnectedRemotely'} = ($in->{'disconnectedRemotely'}) ? JSON::true : JSON::false;
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::serial::AnalogModem::DialInEvent::decode($agent, $in);
    $decoded->{'disconnectedRemotely'} = ($in->{'disconnectedRemotely'}) ? 1 : 0;
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('serial.AnalogModem.CallEndedEvent', 1, 0, 0, 'Raritan::RPC::serial::AnalogModem::CallEndedEvent');
1;
