File: BulkRequest_1_0_2.pm

package info (click to toggle)
raritan-json-rpc-sdk 3.6.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 41,748 kB
  • sloc: cs: 162,629; perl: 85,818; python: 24,275; javascript: 5,937; makefile: 21
file content (77 lines) | stat: -rw-r--r-- 2,789 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from BulkRequest.idl.

use strict;

package Raritan::RPC::bulkrpc::BulkRequest_1_0_2;

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

use constant typeId => "bulkrpc.BulkRequest:1.0.2";

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

use Raritan::RPC::bulkrpc::Request;
use Raritan::RPC::bulkrpc::Response;

sub performRequest($$$) {
    my ($self, $requests, $responses) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'requests'} = [];
    for (my $i0 = 0; $i0 <= $#{$requests}; $i0++) {
        $args->{'requests'}->[$i0] = Raritan::RPC::bulkrpc::Request::encode($requests->[$i0]);
    }
    my $rsp = $agent->json_rpc($self->{'rid'}, 'performRequest', $args);
    $$responses = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'responses'}}; $i0++) {
        $$responses->[$i0] = Raritan::RPC::bulkrpc::Response::decode($agent, $rsp->{'responses'}->[$i0]);
    }
}

use Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Response;
use Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Request;

sub performBulk($$$) {
    my ($self, $requests, $responses) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'requests'} = [];
    for (my $i0 = 0; $i0 <= $#{$requests}; $i0++) {
        $args->{'requests'}->[$i0] = Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Request::encode($requests->[$i0]);
    }
    my $rsp = $agent->json_rpc($self->{'rid'}, 'performBulk', $args);
    $$responses = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'responses'}}; $i0++) {
        $$responses->[$i0] = Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Response::decode($agent, $rsp->{'responses'}->[$i0]);
    }
}

use Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Request;
use Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Response;

sub performBulkTimeout($$$$) {
    my ($self, $requests, $responses, $timeoutMs) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'requests'} = [];
    for (my $i0 = 0; $i0 <= $#{$requests}; $i0++) {
        $args->{'requests'}->[$i0] = Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Request::encode($requests->[$i0]);
    }
    $args->{'timeoutMs'} = 1 * $timeoutMs;
    my $rsp = $agent->json_rpc($self->{'rid'}, 'performBulkTimeout', $args);
    $$responses = [];
    for (my $i0 = 0; $i0 <= $#{$rsp->{'responses'}}; $i0++) {
        $$responses->[$i0] = Raritan::RPC::bulkrpc::BulkRequest_1_0_2::Response::decode($agent, $rsp->{'responses'}->[$i0]);
    }
}

Raritan::RPC::Registry::registerProxyClass('bulkrpc.BulkRequest', 1, 0, 2, 'Raritan::RPC::bulkrpc::BulkRequest_1_0_2');
1;