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

use strict;

package Raritan::RPC::pdumodel::PowerMeterController_1_0_1::PowerMeterCreatedEvent;

use constant typeId => "pdumodel.PowerMeterController_1_0_1.PowerMeterCreatedEvent:1.0.0";
use Raritan::RPC::pdumodel::PowerMeter_1_0_1::Config;
use Raritan::RPC::event::UserEvent;
use Raritan::RPC::pdumodel::PowerMeter_1_0_1::Settings;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'powerMeter'} = Raritan::RPC::ObjectCodec::encode($in->{'powerMeter'});
    $encoded->{'config'} = Raritan::RPC::pdumodel::PowerMeter_1_0_1::Config::encode($in->{'config'});
    $encoded->{'settings'} = Raritan::RPC::pdumodel::PowerMeter_1_0_1::Settings::encode($in->{'settings'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::event::UserEvent::decode($agent, $in);
    $decoded->{'powerMeter'} = Raritan::RPC::ObjectCodec::decode($agent, $in->{'powerMeter'}, 'pdumodel.PowerMeter');
    $decoded->{'config'} = Raritan::RPC::pdumodel::PowerMeter_1_0_1::Config::decode($agent, $in->{'config'});
    $decoded->{'settings'} = Raritan::RPC::pdumodel::PowerMeter_1_0_1::Settings::decode($agent, $in->{'settings'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('pdumodel.PowerMeterController_1_0_1.PowerMeterCreatedEvent', 1, 0, 0, 'Raritan::RPC::pdumodel::PowerMeterController_1_0_1::PowerMeterCreatedEvent');
1;
