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

#pragma once

#include <app/data-model/DecodableList.h>
#include <app/data-model/List.h>
#include <app/data-model/Nullable.h>
#include <lib/core/DataModelTypes.h>
#include <lib/core/Optional.h>
#include <lib/core/TLV.h>
#include <lib/support/BitMask.h>

#include <clusters/shared/Structs.h>

#include <cstdint>

namespace chip {
namespace app {
namespace Clusters {
namespace ElectricalPowerMeasurement {
namespace Structs {
namespace MeasurementAccuracyRangeStruct = Clusters::detail::Structs::MeasurementAccuracyRangeStruct;
namespace MeasurementAccuracyStruct      = Clusters::detail::Structs::MeasurementAccuracyStruct;
namespace HarmonicMeasurementStruct {
enum class Fields : uint8_t
{
    kOrder       = 0,
    kMeasurement = 1,
};

struct Type
{
public:
    uint8_t order = static_cast<uint8_t>(0);
    DataModel::Nullable<int64_t> measurement;

    CHIP_ERROR Decode(TLV::TLVReader & reader);

    static constexpr bool kIsFabricScoped = false;

    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
};

using DecodableType = Type;

} // namespace HarmonicMeasurementStruct
namespace MeasurementRangeStruct {
enum class Fields : uint8_t
{
    kMeasurementType = 0,
    kMin             = 1,
    kMax             = 2,
    kStartTimestamp  = 3,
    kEndTimestamp    = 4,
    kMinTimestamp    = 5,
    kMaxTimestamp    = 6,
    kStartSystime    = 7,
    kEndSystime      = 8,
    kMinSystime      = 9,
    kMaxSystime      = 10,
};

struct Type
{
public:
    MeasurementTypeEnum measurementType = static_cast<MeasurementTypeEnum>(0);
    int64_t min                         = static_cast<int64_t>(0);
    int64_t max                         = static_cast<int64_t>(0);
    Optional<uint32_t> startTimestamp;
    Optional<uint32_t> endTimestamp;
    Optional<uint32_t> minTimestamp;
    Optional<uint32_t> maxTimestamp;
    Optional<uint64_t> startSystime;
    Optional<uint64_t> endSystime;
    Optional<uint64_t> minSystime;
    Optional<uint64_t> maxSystime;

    CHIP_ERROR Decode(TLV::TLVReader & reader);

    static constexpr bool kIsFabricScoped = false;

    CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
};

using DecodableType = Type;

} // namespace MeasurementRangeStruct
} // namespace Structs
} // namespace ElectricalPowerMeasurement
} // namespace Clusters
} // namespace app
} // namespace chip
