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

use strict;

package Raritan::RPC::auth::TacPlusManager_1_0_1;

use parent qw(Raritan::RPC::RemoteObject);

use constant typeId => "auth.TacPlusManager:1.0.1";

sub new {
    my ($class, $agent, $rid, $typeId) = @_;
    $typeId = $typeId || Raritan::RPC::auth::TacPlusManager_1_0_1::typeId;
    return $class->SUPER::new($agent, $rid, $typeId);
}

use constant ERR_INVALID_CFG => 1;

use constant ERR_SERVER_UNSPECIFIED => 2;

use constant ERR_INVALID_SHARED_SECRET => 3;

use constant ERR_SERVER_UNREACHABLE => 4;

use constant ERR_AUTHENTICATION_FAILED => 5;

use constant ERR_NO_ROLES => 6;

use constant ERR_NO_KNOWN_ROLES => 7;

use Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings;

sub getTacPlusServers($) {
    my ($self) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    my $rsp = $agent->json_rpc($self->{'rid'}, 'getTacPlusServers', $args);
    my $_ret_;
    $_ret_ = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'_ret_'}}; $i0++) {
        $_ret_->[$i0] = Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings::decode($agent, $rsp->{'_ret_'}->[$i0]);
    }
    return $_ret_;
}

use Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings;

sub setTacPlusServers($$) {
    my ($self, $serverList) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'serverList'} = [];
    for (my $i0 = 0; $i0 <= $#{$serverList}; $i0++) {
        $args->{'serverList'}->[$i0] = Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings::encode($serverList->[$i0]);
    }
    my $rsp = $agent->json_rpc($self->{'rid'}, 'setTacPlusServers', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

use Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings;

sub testTacPlusServer($$$$) {
    my ($self, $username, $password, $settings) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'username'} = "$username";
    $args->{'password'} = "$password";
    $args->{'settings'} = Raritan::RPC::auth::TacPlusManager_1_0_1::ServerSettings::encode($settings);
    my $rsp = $agent->json_rpc($self->{'rid'}, 'testTacPlusServer', $args);
    my $_ret_;
    $_ret_ = $rsp->{'_ret_'};
    return $_ret_;
}

Raritan::RPC::Registry::registerProxyClass('auth.TacPlusManager', 1, 0, 1, 'Raritan::RPC::auth::TacPlusManager_1_0_1');
1;
