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

use strict;

package Raritan::RPC::webcam::WebcamSettingsChangedEvent;

use constant typeId => "webcam.WebcamSettingsChangedEvent:1.0.0";
use Raritan::RPC::webcam::Settings_2_0_0;
use Raritan::RPC::webcam::WebcamEvent;
use Raritan::RPC::webcam::Settings_2_0_0;

sub encode {
    my ($in) = @_;
    my $encoded = Raritan::RPC::webcam::WebcamEvent::encode($in);
    $encoded->{'username'} = "$in->{'username'}";
    $encoded->{'oldSettings'} = Raritan::RPC::webcam::Settings_2_0_0::encode($in->{'oldSettings'});
    $encoded->{'newSettings'} = Raritan::RPC::webcam::Settings_2_0_0::encode($in->{'newSettings'});
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = Raritan::RPC::webcam::WebcamEvent::decode($agent, $in);
    $decoded->{'username'} = $in->{'username'};
    $decoded->{'oldSettings'} = Raritan::RPC::webcam::Settings_2_0_0::decode($agent, $in->{'oldSettings'});
    $decoded->{'newSettings'} = Raritan::RPC::webcam::Settings_2_0_0::decode($agent, $in->{'newSettings'});
    return $decoded;
}

Raritan::RPC::Registry::registerCodecClass('webcam.WebcamSettingsChangedEvent', 1, 0, 0, 'Raritan::RPC::webcam::WebcamSettingsChangedEvent');
1;
