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

#pragma once

#include <app/EventLoggingTypes.h>
#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/TLV.h>
#include <lib/support/BitMask.h>

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

#include <clusters/Thermostat/ClusterId.h>
#include <clusters/Thermostat/Enums.h>
#include <clusters/Thermostat/EventIds.h>
#include <clusters/Thermostat/Structs.h>

#include <cstdint>

namespace chip {
namespace app {
namespace Clusters {
namespace Thermostat {
namespace Events {
namespace SystemModeChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousSystemMode = 0,
    kCurrentSystemMode  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::SystemModeChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<SystemModeEnum> previousSystemMode;
    SystemModeEnum currentSystemMode = static_cast<SystemModeEnum>(0);

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::SystemModeChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<SystemModeEnum> previousSystemMode;
    SystemModeEnum currentSystemMode = static_cast<SystemModeEnum>(0);

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace SystemModeChange
namespace LocalTemperatureChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kCurrentLocalTemperature = 0,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::LocalTemperatureChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    DataModel::Nullable<int16_t> currentLocalTemperature;

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::LocalTemperatureChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    DataModel::Nullable<int16_t> currentLocalTemperature;

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace LocalTemperatureChange
namespace OccupancyChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousOccupancy = 0,
    kCurrentOccupancy  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::OccupancyChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<chip::BitMask<OccupancyBitmap>> previousOccupancy;
    chip::BitMask<OccupancyBitmap> currentOccupancy = static_cast<chip::BitMask<OccupancyBitmap>>(0);

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::OccupancyChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<chip::BitMask<OccupancyBitmap>> previousOccupancy;
    chip::BitMask<OccupancyBitmap> currentOccupancy = static_cast<chip::BitMask<OccupancyBitmap>>(0);

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace OccupancyChange
namespace SetpointChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kSystemMode       = 0,
    kOccupancy        = 1,
    kPreviousSetpoint = 2,
    kCurrentSetpoint  = 3,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::SetpointChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    SystemModeEnum systemMode = static_cast<SystemModeEnum>(0);
    Optional<chip::BitMask<OccupancyBitmap>> occupancy;
    Optional<int16_t> previousSetpoint;
    int16_t currentSetpoint = static_cast<int16_t>(0);

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::SetpointChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    SystemModeEnum systemMode = static_cast<SystemModeEnum>(0);
    Optional<chip::BitMask<OccupancyBitmap>> occupancy;
    Optional<int16_t> previousSetpoint;
    int16_t currentSetpoint = static_cast<int16_t>(0);

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace SetpointChange
namespace RunningStateChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousRunningState = 0,
    kCurrentRunningState  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::RunningStateChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<chip::BitMask<RelayStateBitmap>> previousRunningState;
    chip::BitMask<RelayStateBitmap> currentRunningState = static_cast<chip::BitMask<RelayStateBitmap>>(0);

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::RunningStateChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<chip::BitMask<RelayStateBitmap>> previousRunningState;
    chip::BitMask<RelayStateBitmap> currentRunningState = static_cast<chip::BitMask<RelayStateBitmap>>(0);

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace RunningStateChange
namespace RunningModeChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousRunningMode = 0,
    kCurrentRunningMode  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::RunningModeChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<ThermostatRunningModeEnum> previousRunningMode;
    ThermostatRunningModeEnum currentRunningMode = static_cast<ThermostatRunningModeEnum>(0);

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::RunningModeChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<ThermostatRunningModeEnum> previousRunningMode;
    ThermostatRunningModeEnum currentRunningMode = static_cast<ThermostatRunningModeEnum>(0);

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace RunningModeChange
namespace ActiveScheduleChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousScheduleHandle = 0,
    kCurrentScheduleHandle  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::ActiveScheduleChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<DataModel::Nullable<chip::ByteSpan>> previousScheduleHandle;
    DataModel::Nullable<chip::ByteSpan> currentScheduleHandle;

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::ActiveScheduleChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<DataModel::Nullable<chip::ByteSpan>> previousScheduleHandle;
    DataModel::Nullable<chip::ByteSpan> currentScheduleHandle;

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace ActiveScheduleChange
namespace ActivePresetChange {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

enum class Fields : uint8_t
{
    kPreviousPresetHandle = 0,
    kCurrentPresetHandle  = 1,
};

struct Type
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::ActivePresetChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }
    static constexpr bool kIsFabricScoped = false;

    Optional<DataModel::Nullable<chip::ByteSpan>> previousPresetHandle;
    DataModel::Nullable<chip::ByteSpan> currentPresetHandle;

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

struct DecodableType
{
public:
    static constexpr PriorityLevel GetPriorityLevel() { return kPriorityLevel; }
    static constexpr EventId GetEventId() { return Events::ActivePresetChange::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; }

    Optional<DataModel::Nullable<chip::ByteSpan>> previousPresetHandle;
    DataModel::Nullable<chip::ByteSpan> currentPresetHandle;

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace ActivePresetChange
} // namespace Events
} // namespace Thermostat
} // namespace Clusters
} // namespace app
} // namespace chip
