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

use strict;

package Raritan::RPC::pdumodel::TransferSwitch::PowerQualitySettings;

sub encode {
    my ($in) = @_;
    my $encoded = {};
    $encoded->{'minMarginalVoltage'} = 1 * $in->{'minMarginalVoltage'};
    $encoded->{'minGoodVoltage'} = 1 * $in->{'minGoodVoltage'};
    $encoded->{'maxGoodVoltage'} = 1 * $in->{'maxGoodVoltage'};
    $encoded->{'maxMarginalVoltage'} = 1 * $in->{'maxMarginalVoltage'};
    $encoded->{'voltageHysteresis'} = 1 * $in->{'voltageHysteresis'};
    $encoded->{'voltageDetectTime'} = 1 * $in->{'voltageDetectTime'};
    $encoded->{'minGoodFrequency'} = 1 * $in->{'minGoodFrequency'};
    $encoded->{'maxGoodFrequency'} = 1 * $in->{'maxGoodFrequency'};
    $encoded->{'frequencyHysteresis'} = 1 * $in->{'frequencyHysteresis'};
    return $encoded;
}

sub decode {
    my ($agent, $in) = @_;
    my $decoded = {};
    $decoded->{'minMarginalVoltage'} = $in->{'minMarginalVoltage'};
    $decoded->{'minGoodVoltage'} = $in->{'minGoodVoltage'};
    $decoded->{'maxGoodVoltage'} = $in->{'maxGoodVoltage'};
    $decoded->{'maxMarginalVoltage'} = $in->{'maxMarginalVoltage'};
    $decoded->{'voltageHysteresis'} = $in->{'voltageHysteresis'};
    $decoded->{'voltageDetectTime'} = $in->{'voltageDetectTime'};
    $decoded->{'minGoodFrequency'} = $in->{'minGoodFrequency'};
    $decoded->{'maxGoodFrequency'} = $in->{'maxGoodFrequency'};
    $decoded->{'frequencyHysteresis'} = $in->{'frequencyHysteresis'};
    return $decoded;
}

1;
