/*
 *
 *    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 WaterValveData {
namespace Structs {
namespace ValveSessionStruct {
enum class Fields : uint8_t {
  kWeekdays = 0,
  kHour = 1,
  kMinute = 2,
  kVolume = 3,
  kDuration = 4,
};

struct Type {
public:
  uint8_t weekdays = static_cast<uint8_t>(0);
  uint8_t hour = static_cast<uint8_t>(0);
  uint8_t minute = static_cast<uint8_t>(0);
  uint16_t volume = static_cast<uint16_t>(0);
  uint32_t duration = 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 ValveSessionStruct
namespace ValveSessionStateStruct {
enum class Fields : uint8_t {
  kSession = 0,
  kState = 1,
};

struct Type {
public:
  Structs::ValveSessionStruct::Type session;
  ValveSessionStateEnum state = static_cast<ValveSessionStateEnum>(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 ValveSessionStateStruct
namespace ValveFreezeStateStruct {
enum class Fields : uint8_t {
  kFreezed = 0,
  kTimestamp = 1,
};

struct Type {
public:
  bool freezed = static_cast<bool>(0);
  uint64_t timestamp = static_cast<uint64_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 ValveFreezeStateStruct
namespace ValveSessionLogStruct {
enum class Fields : uint8_t {
  kBegin = 0,
  kEnd = 1,
  kVolume = 2,
};

struct Type {
public:
  uint64_t begin = static_cast<uint64_t>(0);
  uint64_t end = static_cast<uint64_t>(0);
  uint16_t volume = static_cast<uint16_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 ValveSessionLogStruct
namespace ValveTemperatureStateStruct {
enum class Fields : uint8_t {
  kTemperature = 0,
  kTimestamp = 1,
};

struct Type {
public:
  uint16_t temperature = static_cast<uint16_t>(0);
  uint64_t timestamp = static_cast<uint64_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 ValveTemperatureStateStruct
namespace WaterUsageStruct {
enum class Fields : uint8_t {
  kHour = 0,
  kToday = 1,
  kYesterday = 2,
  kCurrentWeek = 3,
  kLastWeek = 4,
  kCurrentMonth = 5,
  kLastMonth = 6,
  kCurrentYear = 7,
  kLastYear = 8,
};

struct Type {
public:
  uint32_t hour = static_cast<uint32_t>(0);
  uint32_t today = static_cast<uint32_t>(0);
  uint32_t yesterday = static_cast<uint32_t>(0);
  uint32_t currentWeek = static_cast<uint32_t>(0);
  uint32_t lastWeek = static_cast<uint32_t>(0);
  uint32_t currentMonth = static_cast<uint32_t>(0);
  uint32_t lastMonth = static_cast<uint32_t>(0);
  uint32_t currentYear = static_cast<uint32_t>(0);
  uint32_t lastYear = 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 WaterUsageStruct
} // namespace Structs
} // namespace WaterValveData
} // namespace Clusters
} // namespace app
} // namespace chip
