/*
 *
 *    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/EnergyEvse/ClusterId.h>
#include <clusters/EnergyEvse/Enums.h>
#include <clusters/EnergyEvse/EventIds.h>
#include <clusters/EnergyEvse/Structs.h>

#include <cstdint>

namespace chip {
namespace app {
namespace Clusters {
namespace EnergyEvse {
namespace Events {
namespace EVConnected {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info;

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

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

    uint32_t sessionID = static_cast<uint32_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::EVConnected::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    uint32_t sessionID = static_cast<uint32_t>(0);

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

enum class Fields : uint8_t
{
    kSessionID               = 0,
    kState                   = 1,
    kSessionDuration         = 2,
    kSessionEnergyCharged    = 3,
    kSessionEnergyDischarged = 4,
};

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

    uint32_t sessionID           = static_cast<uint32_t>(0);
    StateEnum state              = static_cast<StateEnum>(0);
    uint32_t sessionDuration     = static_cast<uint32_t>(0);
    int64_t sessionEnergyCharged = static_cast<int64_t>(0);
    Optional<int64_t> sessionEnergyDischarged;

    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::EVNotDetected::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    uint32_t sessionID           = static_cast<uint32_t>(0);
    StateEnum state              = static_cast<StateEnum>(0);
    uint32_t sessionDuration     = static_cast<uint32_t>(0);
    int64_t sessionEnergyCharged = static_cast<int64_t>(0);
    Optional<int64_t> sessionEnergyDischarged;

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

enum class Fields : uint8_t
{
    kSessionID               = 0,
    kState                   = 1,
    kMaximumCurrent          = 2,
    kMaximumDischargeCurrent = 3,
};

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

    uint32_t sessionID     = static_cast<uint32_t>(0);
    StateEnum state        = static_cast<StateEnum>(0);
    int64_t maximumCurrent = static_cast<int64_t>(0);
    Optional<int64_t> maximumDischargeCurrent;

    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::EnergyTransferStarted::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    uint32_t sessionID     = static_cast<uint32_t>(0);
    StateEnum state        = static_cast<StateEnum>(0);
    int64_t maximumCurrent = static_cast<int64_t>(0);
    Optional<int64_t> maximumDischargeCurrent;

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

enum class Fields : uint8_t
{
    kSessionID         = 0,
    kState             = 1,
    kReason            = 2,
    kEnergyTransferred = 4,
    kEnergyDischarged  = 5,
};

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

    uint32_t sessionID                     = static_cast<uint32_t>(0);
    StateEnum state                        = static_cast<StateEnum>(0);
    EnergyTransferStoppedReasonEnum reason = static_cast<EnergyTransferStoppedReasonEnum>(0);
    int64_t energyTransferred              = static_cast<int64_t>(0);
    Optional<int64_t> energyDischarged;

    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::EnergyTransferStopped::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    uint32_t sessionID                     = static_cast<uint32_t>(0);
    StateEnum state                        = static_cast<StateEnum>(0);
    EnergyTransferStoppedReasonEnum reason = static_cast<EnergyTransferStoppedReasonEnum>(0);
    int64_t energyTransferred              = static_cast<int64_t>(0);
    Optional<int64_t> energyDischarged;

    CHIP_ERROR Decode(TLV::TLVReader & reader);
};
} // namespace EnergyTransferStopped
namespace Fault {
static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Critical;

enum class Fields : uint8_t
{
    kSessionID               = 0,
    kState                   = 1,
    kFaultStatePreviousState = 2,
    kFaultStateCurrentState  = 4,
};

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

    DataModel::Nullable<uint32_t> sessionID;
    StateEnum state                        = static_cast<StateEnum>(0);
    FaultStateEnum faultStatePreviousState = static_cast<FaultStateEnum>(0);
    FaultStateEnum faultStateCurrentState  = static_cast<FaultStateEnum>(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::Fault::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    DataModel::Nullable<uint32_t> sessionID;
    StateEnum state                        = static_cast<StateEnum>(0);
    FaultStateEnum faultStatePreviousState = static_cast<FaultStateEnum>(0);
    FaultStateEnum faultStateCurrentState  = static_cast<FaultStateEnum>(0);

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

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

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

    chip::ByteSpan uid;

    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::Rfid::Id; }
    static constexpr ClusterId GetClusterId() { return Clusters::EnergyEvse::Id; }

    chip::ByteSpan uid;

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