# 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_1_2::PowerMeterCreatedEvent;

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

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_1_2::Config::encode($in->{'config'});
    $encoded->{'settings'} = Raritan::RPC::pdumodel::PowerMeter_1_1_2::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_1_2::Config::decode($agent, $in->{'config'});
    $decoded->{'settings'} = Raritan::RPC::pdumodel::PowerMeter_1_1_2::Settings::decode($agent, $in->{'settings'});
    return $decoded;
}

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