/*
 *
 *    Copyright (c) 2022 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP
// This file is generated from clusters-Attributes.ipp.zapt

#include <clusters/EnergyEvse/Attributes.h>

#include <app/data-model/Decode.h>
#include <app/data-model/WrappedStructEncoder.h>

namespace chip {
namespace app {
namespace Clusters {
namespace EnergyEvse {
namespace Attributes {
CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader &reader,
                                           const ConcreteAttributePath &path) {
  switch (path.mAttributeId) {
  case Attributes::State::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, state);
  case Attributes::SupplyState::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, supplyState);
  case Attributes::FaultState::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, faultState);
  case Attributes::ChargingEnabledUntil::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, chargingEnabledUntil);
  case Attributes::DischargingEnabledUntil::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, dischargingEnabledUntil);
  case Attributes::CircuitCapacity::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, circuitCapacity);
  case Attributes::MinimumChargeCurrent::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, minimumChargeCurrent);
  case Attributes::MaximumChargeCurrent::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, maximumChargeCurrent);
  case Attributes::MaximumDischargeCurrent::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, maximumDischargeCurrent);
  case Attributes::UserMaximumChargeCurrent::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, userMaximumChargeCurrent);
  case Attributes::RandomizationDelayWindow::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, randomizationDelayWindow);
  case Attributes::NextChargeStartTime::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextChargeStartTime);
  case Attributes::NextChargeTargetTime::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextChargeTargetTime);
  case Attributes::NextChargeRequiredEnergy::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextChargeRequiredEnergy);
  case Attributes::NextChargeTargetSoC::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextChargeTargetSoC);
  case Attributes::ApproximateEVEfficiency::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, approximateEVEfficiency);
  case Attributes::StateOfCharge::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, stateOfCharge);
  case Attributes::BatteryCapacity::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, batteryCapacity);
  case Attributes::VehicleID::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, vehicleID);
  case Attributes::SessionID::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, sessionID);
  case Attributes::SessionDuration::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, sessionDuration);
  case Attributes::SessionEnergyCharged::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, sessionEnergyCharged);
  case Attributes::SessionEnergyDischarged::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, sessionEnergyDischarged);
  case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, generatedCommandList);
  case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, acceptedCommandList);
  case Attributes::AttributeList::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, attributeList);
  case Attributes::FeatureMap::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, featureMap);
  case Attributes::ClusterRevision::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, clusterRevision);
  default:
    return CHIP_NO_ERROR;
  }
}
} // namespace Attributes
} // namespace EnergyEvse
} // namespace Clusters
} // namespace app
} // namespace chip
