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

use strict;

package Raritan::RPC::bulkcfg::BulkConfiguration_1_0_2::Settings;

use Raritan::RPC::bulkcfg::BulkConfiguration_1_0_2::FilterProfile;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'filterProfiles'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'filterProfiles'}}; $i0++) {
        $encoded->{'filterProfiles'}->[$i0] = Raritan::RPC::bulkcfg::BulkConfiguration_1_0_2::FilterProfile::encode($in->{'filterProfiles'}->[$i0]);
    }
    $encoded->{'defaultProfileName'} = "$in->{'defaultProfileName'}";
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'filterProfiles'} = [];
    for (my $i0 = 0; $i0 <= $#{$in->{'filterProfiles'}}; $i0++) {
        $decoded->{'filterProfiles'}->[$i0] = Raritan::RPC::bulkcfg::BulkConfiguration_1_0_2::FilterProfile::decode($agent, $in->{'filterProfiles'}->[$i0]);
    }
    $decoded->{'defaultProfileName'} = $in->{'defaultProfileName'};
    return $decoded;
}

1;
