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

use strict;

package Raritan::RPC::pdumodel::Panel::CircuitCreatedEvent;

use constant typeId => "pdumodel.Panel.CircuitCreatedEvent:1.0.0";
use Raritan::RPC::pdumodel::Circuit::Config;
use Raritan::RPC::event::UserEvent;
use Raritan::RPC::pdumodel::Circuit::Settings;

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

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

Raritan::RPC::Registry::registerCodecClass('pdumodel.Panel.CircuitCreatedEvent', 1, 0, 0, 'Raritan::RPC::pdumodel::Panel::CircuitCreatedEvent');
1;
