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

use strict;

package Raritan::RPC::smartlock::DoorAccessControl_1_1_1::AbsoluteTimeCondition;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'enabled'} = ($in->{'enabled'}) ? JSON::true : JSON::false;
    $encoded->{'validFrom'} = 1 * $in->{'validFrom'};
    $encoded->{'validTill'} = 1 * $in->{'validTill'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'enabled'} = ($in->{'enabled'}) ? 1 : 0;
    $decoded->{'validFrom'} = $in->{'validFrom'};
    $decoded->{'validTill'} = $in->{'validTill'};
    return $decoded;
}

1;
