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

use strict;

package Raritan::RPC::smartlock::DoorAccessControl_1_1_1::DoorAccessRuleAddedEvent;

use constant typeId => "smartlock.DoorAccessControl_1_1_1.DoorAccessRuleAddedEvent:1.0.0";
use Raritan::RPC::event::UserEvent;
use Raritan::RPC::smartlock::DoorAccessControl_1_1_1::DoorAccessRule;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::event::UserEvent::encode($in);
    $encoded->{'ruleId'} = 1 * $in->{'ruleId'};
    $encoded->{'rule'} = Raritan::RPC::smartlock::DoorAccessControl_1_1_1::DoorAccessRule::encode($in->{'rule'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::event::UserEvent::decode($agent, $in);
    $decoded->{'ruleId'} = $in->{'ruleId'};
    $decoded->{'rule'} = Raritan::RPC::smartlock::DoorAccessControl_1_1_1::DoorAccessRule::decode($agent, $in->{'rule'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('smartlock.DoorAccessControl_1_1_1.DoorAccessRuleAddedEvent', 1, 0, 0, 'Raritan::RPC::smartlock::DoorAccessControl_1_1_1::DoorAccessRuleAddedEvent');
1;
