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

use strict;

package Raritan::RPC::auth::Policy;


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

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

1;
