/*
 *
 *    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 Thermostat {
namespace Structs {
namespace ScheduleTransitionStruct {
enum class Fields : uint8_t
{
    kDayOfWeek       = 0,
    kTransitionTime  = 1,
    kPresetHandle    = 2,
    kSystemMode      = 3,
    kCoolingSetpoint = 4,
    kHeatingSetpoint = 5,
};

struct Type
{
public:
    chip::BitMask<ScheduleDayOfWeekBitmap> dayOfWeek = static_cast<chip::BitMask<ScheduleDayOfWeekBitmap>>(0);
    uint16_t transitionTime                          = static_cast<uint16_t>(0);
    Optional<chip::ByteSpan> presetHandle;
    Optional<SystemModeEnum> systemMode;
    Optional<int16_t> coolingSetpoint;
    Optional<int16_t> heatingSetpoint;

    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 ScheduleTransitionStruct
namespace ScheduleStruct {
enum class Fields : uint8_t
{
    kScheduleHandle = 0,
    kSystemMode     = 1,
    kName           = 2,
    kPresetHandle   = 3,
    kTransitions    = 4,
    kBuiltIn        = 5,
};

struct Type
{
public:
    DataModel::Nullable<chip::ByteSpan> scheduleHandle;
    SystemModeEnum systemMode = static_cast<SystemModeEnum>(0);
    Optional<chip::CharSpan> name;
    Optional<chip::ByteSpan> presetHandle;
    DataModel::List<const Structs::ScheduleTransitionStruct::Type> transitions;
    DataModel::Nullable<bool> builtIn;

    static constexpr bool kIsFabricScoped = false;

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

struct DecodableType
{
public:
    DataModel::Nullable<chip::ByteSpan> scheduleHandle;
    SystemModeEnum systemMode = static_cast<SystemModeEnum>(0);
    Optional<chip::CharSpan> name;
    Optional<chip::ByteSpan> presetHandle;
    DataModel::DecodableList<Structs::ScheduleTransitionStruct::DecodableType> transitions;
    DataModel::Nullable<bool> builtIn;

    CHIP_ERROR Decode(TLV::TLVReader & reader);

    static constexpr bool kIsFabricScoped = false;
};

} // namespace ScheduleStruct
namespace PresetStruct {
enum class Fields : uint8_t
{
    kPresetHandle    = 0,
    kPresetScenario  = 1,
    kName            = 2,
    kCoolingSetpoint = 3,
    kHeatingSetpoint = 4,
    kBuiltIn         = 5,
};

struct Type
{
public:
    DataModel::Nullable<chip::ByteSpan> presetHandle;
    PresetScenarioEnum presetScenario = static_cast<PresetScenarioEnum>(0);
    Optional<DataModel::Nullable<chip::CharSpan>> name;
    Optional<int16_t> coolingSetpoint;
    Optional<int16_t> heatingSetpoint;
    DataModel::Nullable<bool> builtIn;

    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 PresetStruct
namespace PresetTypeStruct {
enum class Fields : uint8_t
{
    kPresetScenario     = 0,
    kNumberOfPresets    = 1,
    kPresetTypeFeatures = 2,
};

struct Type
{
public:
    PresetScenarioEnum presetScenario                          = static_cast<PresetScenarioEnum>(0);
    uint8_t numberOfPresets                                    = static_cast<uint8_t>(0);
    chip::BitMask<PresetTypeFeaturesBitmap> presetTypeFeatures = static_cast<chip::BitMask<PresetTypeFeaturesBitmap>>(0);

    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 PresetTypeStruct
namespace ScheduleTypeStruct {
enum class Fields : uint8_t
{
    kSystemMode           = 0,
    kNumberOfSchedules    = 1,
    kScheduleTypeFeatures = 2,
};

struct Type
{
public:
    SystemModeEnum systemMode                                      = static_cast<SystemModeEnum>(0);
    uint8_t numberOfSchedules                                      = static_cast<uint8_t>(0);
    chip::BitMask<ScheduleTypeFeaturesBitmap> scheduleTypeFeatures = static_cast<chip::BitMask<ScheduleTypeFeaturesBitmap>>(0);

    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 ScheduleTypeStruct
namespace ThermostatSuggestionStruct {
enum class Fields : uint8_t
{
    kUniqueID       = 0,
    kPresetHandle   = 1,
    kEffectiveTime  = 2,
    kExpirationTime = 3,
};

struct Type
{
public:
    uint8_t uniqueID = static_cast<uint8_t>(0);
    chip::ByteSpan presetHandle;
    uint32_t effectiveTime  = static_cast<uint32_t>(0);
    uint32_t expirationTime = static_cast<uint32_t>(0);

    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 ThermostatSuggestionStruct
namespace WeeklyScheduleTransitionStruct {
enum class Fields : uint8_t
{
    kTransitionTime = 0,
    kHeatSetpoint   = 1,
    kCoolSetpoint   = 2,
};

struct Type
{
public:
    uint16_t transitionTime = static_cast<uint16_t>(0);
    DataModel::Nullable<int16_t> heatSetpoint;
    DataModel::Nullable<int16_t> coolSetpoint;

    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 WeeklyScheduleTransitionStruct
} // namespace Structs
} // namespace Thermostat
} // namespace Clusters
} // namespace app
} // namespace chip
