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

use strict;

package Raritan::RPC::event::Consumer;

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

use constant typeId => "event.Consumer:1.0.0";

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

use Raritan::RPC::idl::Event;

sub pushEvents($$) {
    my ($self, $events) = @_;
    my $agent = $self->{'agent'};
    my $args = {};
    $args->{'events'} = [];
    for (my $i0 = 0; $i0 <= $#{$events}; $i0++) {
        $args->{'events'}->[$i0] = Raritan::RPC::ValObjCodec::encode($events->[$i0]);
    }
    my $rsp = $agent->json_rpc($self->{'rid'}, 'pushEvents', $args);
}

Raritan::RPC::Registry::registerProxyClass('event.Consumer', 1, 0, 0, 'Raritan::RPC::event::Consumer');
1;
