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

#pragma once

#include <app/ConcreteAttributePath.h>
#include <app/data-model/DecodableList.h>
#include <app/data-model/List.h>
#include <app/data-model/Nullable.h>
#include <app/util/basic-types.h>
#include <lib/core/TLV.h>
#include <lib/support/BitMask.h>

#include <clusters/shared/Attributes.h>
#include <clusters/shared/Enums.h>
#include <clusters/shared/Structs.h>

#include <clusters/CommodityMetering/AttributeIds.h>
#include <clusters/CommodityMetering/ClusterId.h>
#include <clusters/CommodityMetering/Enums.h>
#include <clusters/CommodityMetering/Structs.h>

namespace chip {
namespace app {
namespace Clusters {
namespace CommodityMetering {
namespace Attributes {

namespace MeteredQuantity {
struct TypeInfo {
  using Type = chip::app::DataModel::Nullable<
      chip::app::DataModel::List<const chip::app::Clusters::CommodityMetering::
                                     Structs::MeteredQuantityStruct::Type>>;
  using DecodableType =
      chip::app::DataModel::Nullable<chip::app::DataModel::DecodableList<
          chip::app::Clusters::CommodityMetering::Structs::
              MeteredQuantityStruct::DecodableType>>;
  using DecodableArgType =
      const chip::app::DataModel::Nullable<chip::app::DataModel::DecodableList<
          chip::app::Clusters::CommodityMetering::Structs::
              MeteredQuantityStruct::DecodableType>> &;

  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
  static constexpr AttributeId GetAttributeId() {
    return Attributes::MeteredQuantity::Id;
  }
  static constexpr bool MustUseTimedWrite() { return false; }
};
} // namespace MeteredQuantity
namespace MeteredQuantityTimestamp {
struct TypeInfo {
  using Type = chip::app::DataModel::Nullable<uint32_t>;
  using DecodableType = chip::app::DataModel::Nullable<uint32_t>;
  using DecodableArgType = const chip::app::DataModel::Nullable<uint32_t> &;

  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
  static constexpr AttributeId GetAttributeId() {
    return Attributes::MeteredQuantityTimestamp::Id;
  }
  static constexpr bool MustUseTimedWrite() { return false; }
};
} // namespace MeteredQuantityTimestamp
namespace MeasurementType {
struct TypeInfo {
  using Type = chip::app::DataModel::Nullable<
      chip::app::Clusters::CommodityMetering::MeasurementTypeEnum>;
  using DecodableType = chip::app::DataModel::Nullable<
      chip::app::Clusters::CommodityMetering::MeasurementTypeEnum>;
  using DecodableArgType = const chip::app::DataModel::Nullable<
      chip::app::Clusters::CommodityMetering::MeasurementTypeEnum> &;

  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
  static constexpr AttributeId GetAttributeId() {
    return Attributes::MeasurementType::Id;
  }
  static constexpr bool MustUseTimedWrite() { return false; }
};
} // namespace MeasurementType
namespace GeneratedCommandList {
struct TypeInfo
    : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo {
  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
};
} // namespace GeneratedCommandList
namespace AcceptedCommandList {
struct TypeInfo
    : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo {
  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
};
} // namespace AcceptedCommandList
namespace AttributeList {
struct TypeInfo
    : public Clusters::Globals::Attributes::AttributeList::TypeInfo {
  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
};
} // namespace AttributeList
namespace FeatureMap {
struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo {
  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
};
} // namespace FeatureMap
namespace ClusterRevision {
struct TypeInfo
    : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo {
  static constexpr ClusterId GetClusterId() {
    return Clusters::CommodityMetering::Id;
  }
};
} // namespace ClusterRevision

struct TypeInfo {
  struct DecodableType {
    static constexpr ClusterId GetClusterId() {
      return Clusters::CommodityMetering::Id;
    }

    CHIP_ERROR Decode(TLV::TLVReader &reader,
                      const ConcreteAttributePath &path);

    Attributes::MeteredQuantity::TypeInfo::DecodableType meteredQuantity;
    Attributes::MeteredQuantityTimestamp::TypeInfo::DecodableType
        meteredQuantityTimestamp;
    Attributes::MeasurementType::TypeInfo::DecodableType measurementType;
    Attributes::GeneratedCommandList::TypeInfo::DecodableType
        generatedCommandList;
    Attributes::AcceptedCommandList::TypeInfo::DecodableType
        acceptedCommandList;
    Attributes::AttributeList::TypeInfo::DecodableType attributeList;
    Attributes::FeatureMap::TypeInfo::DecodableType featureMap =
        static_cast<uint32_t>(0);
    Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision =
        static_cast<uint16_t>(0);
  };
};
} // namespace Attributes
} // namespace CommodityMetering
} // namespace Clusters
} // namespace app
} // namespace chip
