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

#pragma once

#include <app/data-model/DecodableList.h>
#include <app/data-model/Encode.h>
#include <app/data-model/List.h>
#include <app/data-model/NullObject.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/Enums.h>
#include <clusters/shared/Structs.h>

#include <clusters/WebRTCTransportProvider/ClusterId.h>
#include <clusters/WebRTCTransportProvider/CommandIds.h>
#include <clusters/WebRTCTransportProvider/Enums.h>
#include <clusters/WebRTCTransportProvider/Structs.h>

#include <cstdint>

namespace chip {
namespace app {
namespace Clusters {
namespace WebRTCTransportProvider {
namespace Commands {
// Forward-declarations so we can reference these later.

namespace SolicitOffer {
struct Type;
struct DecodableType;
} // namespace SolicitOffer

namespace SolicitOfferResponse {
struct Type;
struct DecodableType;
} // namespace SolicitOfferResponse

namespace ProvideOffer {
struct Type;
struct DecodableType;
} // namespace ProvideOffer

namespace ProvideOfferResponse {
struct Type;
struct DecodableType;
} // namespace ProvideOfferResponse

namespace ProvideAnswer {
struct Type;
struct DecodableType;
} // namespace ProvideAnswer

namespace ProvideICECandidates {
struct Type;
struct DecodableType;
} // namespace ProvideICECandidates

namespace EndSession {
struct Type;
struct DecodableType;
} // namespace EndSession

} // namespace Commands

namespace Commands {
namespace SolicitOffer {
enum class Fields : uint8_t {
  kStreamUsage = 0,
  kOriginatingEndpointID = 1,
  kVideoStreamID = 2,
  kAudioStreamID = 3,
  kICEServers = 4,
  kICETransportPolicy = 5,
  kMetadataEnabled = 6,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::SolicitOffer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  Globals::StreamUsageEnum streamUsage =
      static_cast<Globals::StreamUsageEnum>(0);
  chip::EndpointId originatingEndpointID = static_cast<chip::EndpointId>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;
  Optional<DataModel::List<const Globals::Structs::ICEServerStruct::Type>>
      ICEServers;
  Optional<chip::CharSpan> ICETransportPolicy;
  Optional<bool> metadataEnabled;

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

  using ResponseType = Clusters::WebRTCTransportProvider::Commands::
      SolicitOfferResponse::DecodableType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::SolicitOffer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }
  static constexpr bool kIsFabricScoped = true;

  Globals::StreamUsageEnum streamUsage =
      static_cast<Globals::StreamUsageEnum>(0);
  chip::EndpointId originatingEndpointID = static_cast<chip::EndpointId>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;
  Optional<DataModel::DecodableList<
      Globals::Structs::ICEServerStruct::DecodableType>>
      ICEServers;
  Optional<chip::CharSpan> ICETransportPolicy;
  Optional<bool> metadataEnabled;

  CHIP_ERROR Decode(TLV::TLVReader &reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace SolicitOffer
namespace SolicitOfferResponse {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kDeferredOffer = 1,
  kVideoStreamID = 2,
  kAudioStreamID = 3,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::SolicitOfferResponse::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  bool deferredOffer = static_cast<bool>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;

  CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
                    TLV::Tag aTag) const;

  using ResponseType = DataModel::NullObjectType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::SolicitOfferResponse::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  bool deferredOffer = static_cast<bool>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;

  CHIP_ERROR Decode(TLV::TLVReader &reader);
};
}; // namespace SolicitOfferResponse
namespace ProvideOffer {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kSdp = 1,
  kStreamUsage = 2,
  kOriginatingEndpointID = 3,
  kVideoStreamID = 4,
  kAudioStreamID = 5,
  kICEServers = 6,
  kICETransportPolicy = 7,
  kMetadataEnabled = 8,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideOffer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  DataModel::Nullable<uint16_t> webRTCSessionID;
  chip::CharSpan sdp;
  Globals::StreamUsageEnum streamUsage =
      static_cast<Globals::StreamUsageEnum>(0);
  chip::EndpointId originatingEndpointID = static_cast<chip::EndpointId>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;
  Optional<DataModel::List<const Globals::Structs::ICEServerStruct::Type>>
      ICEServers;
  Optional<chip::CharSpan> ICETransportPolicy;
  Optional<bool> metadataEnabled;

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

  using ResponseType = Clusters::WebRTCTransportProvider::Commands::
      ProvideOfferResponse::DecodableType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideOffer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }
  static constexpr bool kIsFabricScoped = true;

  DataModel::Nullable<uint16_t> webRTCSessionID;
  chip::CharSpan sdp;
  Globals::StreamUsageEnum streamUsage =
      static_cast<Globals::StreamUsageEnum>(0);
  chip::EndpointId originatingEndpointID = static_cast<chip::EndpointId>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;
  Optional<DataModel::DecodableList<
      Globals::Structs::ICEServerStruct::DecodableType>>
      ICEServers;
  Optional<chip::CharSpan> ICETransportPolicy;
  Optional<bool> metadataEnabled;

  CHIP_ERROR Decode(TLV::TLVReader &reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace ProvideOffer
namespace ProvideOfferResponse {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kVideoStreamID = 1,
  kAudioStreamID = 2,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideOfferResponse::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;

  CHIP_ERROR Encode(DataModel::FabricAwareTLVWriter &aWriter,
                    TLV::Tag aTag) const;

  using ResponseType = DataModel::NullObjectType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideOfferResponse::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  Optional<DataModel::Nullable<uint16_t>> videoStreamID;
  Optional<DataModel::Nullable<uint16_t>> audioStreamID;

  CHIP_ERROR Decode(TLV::TLVReader &reader);
};
}; // namespace ProvideOfferResponse
namespace ProvideAnswer {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kSdp = 1,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideAnswer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  chip::CharSpan sdp;

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

  using ResponseType = DataModel::NullObjectType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideAnswer::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }
  static constexpr bool kIsFabricScoped = true;

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  chip::CharSpan sdp;

  CHIP_ERROR Decode(TLV::TLVReader &reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace ProvideAnswer
namespace ProvideICECandidates {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kICECandidates = 1,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideICECandidates::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  DataModel::List<const Globals::Structs::ICECandidateStruct::Type>
      ICECandidates;

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

  using ResponseType = DataModel::NullObjectType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() {
    return Commands::ProvideICECandidates::Id;
  }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }
  static constexpr bool kIsFabricScoped = true;

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  DataModel::DecodableList<Globals::Structs::ICECandidateStruct::DecodableType>
      ICECandidates;

  CHIP_ERROR Decode(TLV::TLVReader &reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace ProvideICECandidates
namespace EndSession {
enum class Fields : uint8_t {
  kWebRTCSessionID = 0,
  kReason = 1,
};

struct Type {
public:
  // Use GetCommandId instead of commandId directly to avoid naming conflict
  // with CommandIdentification in ExecutionOfACommand
  static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  Globals::WebRTCEndReasonEnum reason =
      static_cast<Globals::WebRTCEndReasonEnum>(0);

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

  using ResponseType = DataModel::NullObjectType;

  static constexpr bool MustUseTimedInvoke() { return false; }
};

struct DecodableType {
public:
  static constexpr CommandId GetCommandId() { return Commands::EndSession::Id; }
  static constexpr ClusterId GetClusterId() {
    return Clusters::WebRTCTransportProvider::Id;
  }
  static constexpr bool kIsFabricScoped = true;

  uint16_t webRTCSessionID = static_cast<uint16_t>(0);
  Globals::WebRTCEndReasonEnum reason =
      static_cast<Globals::WebRTCEndReasonEnum>(0);

  CHIP_ERROR Decode(TLV::TLVReader &reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace EndSession
} // namespace Commands
} // namespace WebRTCTransportProvider
} // namespace Clusters
} // namespace app
} // namespace chip
