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

use strict;

package Raritan::RPC::event::DataPushService_1_0_1::EntryStatus;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'busy'} = ($in->{'busy'}) ? JSON::true : JSON::false;
    $encoded->{'rescheduled'} = ($in->{'rescheduled'}) ? JSON::true : JSON::false;
    $encoded->{'lastAttemptTime'} = 1 * $in->{'lastAttemptTime'};
    $encoded->{'lastSuccessTime'} = 1 * $in->{'lastSuccessTime'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'busy'} = ($in->{'busy'}) ? 1 : 0;
    $decoded->{'rescheduled'} = ($in->{'rescheduled'}) ? 1 : 0;
    $decoded->{'lastAttemptTime'} = $in->{'lastAttemptTime'};
    $decoded->{'lastSuccessTime'} = $in->{'lastSuccessTime'};
    return $decoded;
}

1;
