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

use strict;

package Raritan::RPC::pdumodel::PowerMeterController_1_1_4::PowerMeterCreatedEvent;

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

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

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