/*
 *
 *    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/CommodityTariff/Attributes.h>

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

namespace chip {
namespace app {
namespace Clusters {
namespace CommodityTariff {
namespace Attributes {
CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader &reader,
                                           const ConcreteAttributePath &path) {
  switch (path.mAttributeId) {
  case Attributes::TariffInfo::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, tariffInfo);
  case Attributes::TariffUnit::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, tariffUnit);
  case Attributes::StartDate::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, startDate);
  case Attributes::DayEntries::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, dayEntries);
  case Attributes::DayPatterns::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, dayPatterns);
  case Attributes::CalendarPeriods::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, calendarPeriods);
  case Attributes::IndividualDays::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, individualDays);
  case Attributes::CurrentDay::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, currentDay);
  case Attributes::NextDay::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextDay);
  case Attributes::CurrentDayEntry::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, currentDayEntry);
  case Attributes::CurrentDayEntryDate::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, currentDayEntryDate);
  case Attributes::NextDayEntry::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextDayEntry);
  case Attributes::NextDayEntryDate::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextDayEntryDate);
  case Attributes::TariffComponents::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, tariffComponents);
  case Attributes::TariffPeriods::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, tariffPeriods);
  case Attributes::CurrentTariffComponents::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, currentTariffComponents);
  case Attributes::NextTariffComponents::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, nextTariffComponents);
  case Attributes::DefaultRandomizationOffset::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, defaultRandomizationOffset);
  case Attributes::DefaultRandomizationType::TypeInfo::GetAttributeId():
    return DataModel::Decode(reader, defaultRandomizationType);
  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 CommodityTariff
} // namespace Clusters
} // namespace app
} // namespace chip
