/*
 *
 *    Copyright (c) 2021 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

#pragma once

#include <cstdint>

#include "ModelCommand.h"
#include "gen/CHIPClientCallbacks.h"
#include "gen/CHIPClusters.h"
#include <lib/core/CHIPSafeCasts.h>

static void OnDefaultSuccessResponse(void * context)
{
    ChipLogProgress(chipTool, "Default Success Response");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDefaultFailureResponse(void * context, uint8_t status)
{
    ChipLogProgress(chipTool, "Default Failure Response: 0x%02x", status);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(false);
}

static void OnBooleanAttributeResponse(void * context, bool value)
{
    ChipLogProgress(chipTool, "Boolean attribute Response: %d", value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt8uAttributeResponse(void * context, uint8_t value)
{
    ChipLogProgress(chipTool, "Int8u attribute Response: %" PRIu8, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt16uAttributeResponse(void * context, uint16_t value)
{
    ChipLogProgress(chipTool, "Int16u attribute Response: %" PRIu16, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt32uAttributeResponse(void * context, uint32_t value)
{
    ChipLogProgress(chipTool, "Int32u attribute Response: %" PRIu32, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt64uAttributeResponse(void * context, uint64_t value)
{
    ChipLogProgress(chipTool, "Int64u attribute Response: %" PRIu64, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt8sAttributeResponse(void * context, int8_t value)
{
    ChipLogProgress(chipTool, "Int8s attribute Response: %" PRId8, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt16sAttributeResponse(void * context, int16_t value)
{
    ChipLogProgress(chipTool, "Int16s attribute Response: %" PRId16, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt32sAttributeResponse(void * context, int32_t value)
{
    ChipLogProgress(chipTool, "Int32s attribute Response: %" PRId32, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnInt64sAttributeResponse(void * context, int64_t value)
{
    ChipLogProgress(chipTool, "Int64s attribute Response: %" PRId64, value);

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnStringAttributeResponse(void * context, const chip::ByteSpan value)
{
    char * str = (char *) malloc(value.size() * sizeof(char));
    memmove(str, value.data(), value.size());
    str[value.size()] = '\0';
    free(str);

    ChipLogProgress(chipTool, "String attribute Response: %s (%" PRIu16 ")", str, strlen(str));

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnAccountLoginClusterGetSetupPINResponse(void * context, uint8_t * setupPIN)
{
    ChipLogProgress(chipTool, "AccountLoginClusterGetSetupPINResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnApplicationLauncherClusterLaunchAppResponse(void * context, uint8_t * data)
{
    ChipLogProgress(chipTool, "ApplicationLauncherClusterLaunchAppResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnContentLaunchClusterLaunchContentResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus)
{
    ChipLogProgress(chipTool, "ContentLaunchClusterLaunchContentResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnContentLaunchClusterLaunchURLResponse(void * context, uint8_t * data, uint8_t contentLaunchStatus)
{
    ChipLogProgress(chipTool, "ContentLaunchClusterLaunchURLResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearAllPinsResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearAllPinsResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearAllRfidsResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearAllRfidsResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearHolidayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearPinResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearRfidResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearWeekdayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterClearYeardayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterClearYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetHolidayScheduleResponse(void * context, uint8_t scheduleId, uint32_t localStartTime,
                                                        uint32_t localEndTime, uint8_t operatingModeDuringHoliday)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetLogRecordResponse(void * context, uint16_t logEntryId, uint32_t timestamp, uint8_t eventType,
                                                  uint8_t source, uint8_t eventIdOrAlarmCode, uint16_t userId, uint8_t * pin)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetLogRecordResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetPinResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * pin)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetRfidResponse(void * context, uint16_t userId, uint8_t userStatus, uint8_t userType, uint8_t * rfid)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetUserTypeResponse(void * context, uint16_t userId, uint8_t userType)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetUserTypeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetWeekdayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId, uint8_t daysMask,
                                                        uint8_t startHour, uint8_t startMinute, uint8_t endHour, uint8_t endMinute)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterGetYeardayScheduleResponse(void * context, uint8_t scheduleId, uint16_t userId,
                                                        uint32_t localStartTime, uint32_t localEndTime)
{
    ChipLogProgress(chipTool, "DoorLockClusterGetYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterLockDoorResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterLockDoorResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetHolidayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetHolidayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetPinResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetPinResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetRfidResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetRfidResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetUserTypeResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetUserTypeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetWeekdayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetWeekdayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterSetYeardayScheduleResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterSetYeardayScheduleResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterUnlockDoorResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterUnlockDoorResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDoorLockClusterUnlockWithTimeoutResponse(void * context)
{
    ChipLogProgress(chipTool, "DoorLockClusterUnlockWithTimeoutResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGeneralCommissioningClusterArmFailSafeResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterArmFailSafeResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGeneralCommissioningClusterCommissioningCompleteResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterCommissioningCompleteResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGeneralCommissioningClusterSetRegulatoryConfigResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "GeneralCommissioningClusterSetRegulatoryConfigResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupsClusterAddGroupResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "GroupsClusterAddGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupsClusterGetGroupMembershipResponse(void * context, uint8_t capacity, uint8_t groupCount,
                                                      /* TYPE WARNING: array array defaults to */ uint8_t * groupList)
{
    ChipLogProgress(chipTool, "GroupsClusterGetGroupMembershipResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupsClusterRemoveGroupResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "GroupsClusterRemoveGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupsClusterViewGroupResponse(void * context, uint16_t groupId, uint8_t * groupName)
{
    ChipLogProgress(chipTool, "GroupsClusterViewGroupResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnIdentifyClusterIdentifyQueryResponse(void * context, uint16_t timeout)
{
    ChipLogProgress(chipTool, "IdentifyClusterIdentifyQueryResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnKeypadInputClusterSendKeyResponse(void * context)
{
    ChipLogProgress(chipTool, "KeypadInputClusterSendKeyResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaFastForwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaFastForwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaNextResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaNextResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaPauseResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPauseResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaPlayResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPlayResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaPreviousResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaPreviousResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaRewindResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaRewindResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaSkipBackwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipBackwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaSkipForwardResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipForwardResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaSkipSeekResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaSkipSeekResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaStartOverResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaStartOverResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnMediaPlaybackClusterMediaStopResponse(void * context, uint8_t mediaPlaybackStatus)
{
    ChipLogProgress(chipTool, "MediaPlaybackClusterMediaStopResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterAddThreadNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterAddThreadNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterAddWiFiNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterAddWiFiNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterDisableNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterDisableNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterEnableNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterEnableNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterRemoveNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterRemoveNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void
OnNetworkCommissioningClusterScanNetworksResponse(void * context, uint8_t errorCode, uint8_t * debugText,
                                                  /* TYPE WARNING: array array defaults to */ uint8_t * wifiScanResults,
                                                  /* TYPE WARNING: array array defaults to */ uint8_t * threadScanResults)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterScanNetworksResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterUpdateThreadNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterUpdateThreadNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnNetworkCommissioningClusterUpdateWiFiNetworkResponse(void * context, uint8_t errorCode, uint8_t * debugText)
{
    ChipLogProgress(chipTool, "NetworkCommissioningClusterUpdateWiFiNetworkResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnOperationalCredentialsClusterSetFabricResponse(void * context, chip::FabricId FabricId)
{
    ChipLogProgress(chipTool, "OperationalCredentialsClusterSetFabricResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterAddSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterAddSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterGetSceneMembershipResponse(void * context, uint8_t capacity, uint16_t groupId, uint8_t sceneCount,
                                                      /* TYPE WARNING: array array defaults to */ uint8_t * sceneList)
{
    ChipLogProgress(chipTool, "ScenesClusterGetSceneMembershipResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterRemoveAllScenesResponse(void * context, uint16_t groupId)
{
    ChipLogProgress(chipTool, "ScenesClusterRemoveAllScenesResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterRemoveSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterRemoveSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterStoreSceneResponse(void * context, uint16_t groupId, uint8_t sceneId)
{
    ChipLogProgress(chipTool, "ScenesClusterStoreSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnScenesClusterViewSceneResponse(void * context, uint16_t groupId, uint8_t sceneId, uint16_t transitionTime,
                                             uint8_t * sceneName,
                                             /* TYPE WARNING: array array defaults to */ uint8_t * extensionFieldSets)
{
    ChipLogProgress(chipTool, "ScenesClusterViewSceneResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnTvChannelClusterChangeChannelResponse(void * context,
                                                    /* TYPE WARNING: array array defaults to */ uint8_t * ChannelMatch,
                                                    uint8_t ErrorType)
{
    ChipLogProgress(chipTool, "TvChannelClusterChangeChannelResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnTargetNavigatorClusterNavigateTargetResponse(void * context, uint8_t * data)
{
    ChipLogProgress(chipTool, "TargetNavigatorClusterNavigateTargetResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnTestClusterClusterTestSpecificResponse(void * context, uint8_t returnValue)
{
    ChipLogProgress(chipTool, "TestClusterClusterTestSpecificResponse");

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDescriptorDeviceListListAttributeResponse(void * context, uint16_t count, _DeviceType * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorDeviceListListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "DeviceType[%lu]:", i);
        ChipLogProgress(chipTool, "  type: %" PRIu32 "", entries[i].type);
        ChipLogProgress(chipTool, "  revision: %" PRIu16 "", entries[i].revision);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDescriptorServerListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorServerListListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "CLUSTER_ID[%lu]: %" PRIu16 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDescriptorClientListListAttributeResponse(void * context, uint16_t count, chip::ClusterId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorClientListListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "CLUSTER_ID[%lu]: %" PRIu16 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnDescriptorPartsListListAttributeResponse(void * context, uint16_t count, chip::EndpointId * entries)
{
    ChipLogProgress(chipTool, "OnDescriptorPartsListListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "ENDPOINT_ID[%lu]: %" PRIu8 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupKeyManagementGroupsListAttributeResponse(void * context, uint16_t count, _GroupState * entries)
{
    ChipLogProgress(chipTool, "OnGroupKeyManagementGroupsListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "GroupState[%lu]:", i);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  VendorGroupId: %" PRIu16 "", entries[i].VendorGroupId);
        ChipLogProgress(chipTool, "  GroupKeySetIndex: %" PRIu16 "", entries[i].GroupKeySetIndex);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnGroupKeyManagementGroupKeysListAttributeResponse(void * context, uint16_t count, _GroupKey * entries)
{
    ChipLogProgress(chipTool, "OnGroupKeyManagementGroupKeysListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "GroupKey[%lu]:", i);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  GroupKeyIndex: %" PRIu16 "", entries[i].GroupKeyIndex);
        ChipLogProgress(chipTool, "  GroupKeyRoot: %s", entries[i].GroupKeyRoot);
        ChipLogProgress(chipTool, "  GroupKeyEpochStartTime: %" PRIu64 "", entries[i].GroupKeyEpochStartTime);
        ChipLogProgress(chipTool, "  GroupKeySecurityPolicy: %" PRIu8 "", entries[i].GroupKeySecurityPolicy);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnOperationalCredentialsFabricsListListAttributeResponse(void * context, uint16_t count, _FabricDescriptor * entries)
{
    ChipLogProgress(chipTool, "OnOperationalCredentialsFabricsListListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "FabricDescriptor[%lu]:", i);
        ChipLogProgress(chipTool, "  FabricId: %" PRIu64 "", entries[i].FabricId);
        ChipLogProgress(chipTool, "  VendorId: %" PRIu16 "", entries[i].VendorId);
        ChipLogProgress(chipTool, "  NodeId: %" PRIu64 "", entries[i].NodeId);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

static void OnTestClusterListInt8uListAttributeResponse(void * context, uint16_t count, uint8_t * entries)
{
    ChipLogProgress(chipTool, "OnTestClusterListInt8uListAttributeResponse: %lu entries", count);

    for (uint16_t i = 0; i < count; i++)
    {
        ChipLogProgress(chipTool, "INT8U[%lu]: %" PRIu8 "", i, entries[i]);
    }

    ModelCommand * command = reinterpret_cast<ModelCommand *>(context);
    command->SetCommandExitStatus(true);
}

/*----------------------------------------------------------------------------*\
| Cluster Name                                                        |   ID   |
|---------------------------------------------------------------------+--------|
| AccountLogin                                                        | 0x050E |
| ApplicationBasic                                                    | 0x050D |
| ApplicationLauncher                                                 | 0x050C |
| AudioOutput                                                         | 0x050B |
| BarrierControl                                                      | 0x0103 |
| Basic                                                               | 0x0028 |
| Binding                                                             | 0xF000 |
| ColorControl                                                        | 0x0300 |
| ContentLaunch                                                       | 0x050A |
| Descriptor                                                          | 0x001D |
| DoorLock                                                            | 0x0101 |
| GeneralCommissioning                                                | 0x0030 |
| GroupKeyManagement                                                  | 0xF004 |
| Groups                                                              | 0x0004 |
| Identify                                                            | 0x0003 |
| KeypadInput                                                         | 0x0509 |
| LevelControl                                                        | 0x0008 |
| LowPower                                                            | 0x0508 |
| MediaInput                                                          | 0x0507 |
| MediaPlayback                                                       | 0x0506 |
| NetworkCommissioning                                                | 0x0031 |
| OnOff                                                               | 0x0006 |
| OperationalCredentials                                              | 0x003E |
| PumpConfigurationAndControl                                         | 0x0200 |
| Scenes                                                              | 0x0005 |
| Switch                                                              | 0x003B |
| TvChannel                                                           | 0x0504 |
| TargetNavigator                                                     | 0x0505 |
| TemperatureMeasurement                                              | 0x0402 |
| TestCluster                                                         | 0x050F |
| Thermostat                                                          | 0x0201 |
| WakeOnLan                                                           | 0x0503 |
\*----------------------------------------------------------------------------*/

constexpr chip::ClusterId kAccountLoginClusterId                = 0x050E;
constexpr chip::ClusterId kApplicationBasicClusterId            = 0x050D;
constexpr chip::ClusterId kApplicationLauncherClusterId         = 0x050C;
constexpr chip::ClusterId kAudioOutputClusterId                 = 0x050B;
constexpr chip::ClusterId kBarrierControlClusterId              = 0x0103;
constexpr chip::ClusterId kBasicClusterId                       = 0x0028;
constexpr chip::ClusterId kBindingClusterId                     = 0xF000;
constexpr chip::ClusterId kColorControlClusterId                = 0x0300;
constexpr chip::ClusterId kContentLaunchClusterId               = 0x050A;
constexpr chip::ClusterId kDescriptorClusterId                  = 0x001D;
constexpr chip::ClusterId kDoorLockClusterId                    = 0x0101;
constexpr chip::ClusterId kGeneralCommissioningClusterId        = 0x0030;
constexpr chip::ClusterId kGroupKeyManagementClusterId          = 0xF004;
constexpr chip::ClusterId kGroupsClusterId                      = 0x0004;
constexpr chip::ClusterId kIdentifyClusterId                    = 0x0003;
constexpr chip::ClusterId kKeypadInputClusterId                 = 0x0509;
constexpr chip::ClusterId kLevelControlClusterId                = 0x0008;
constexpr chip::ClusterId kLowPowerClusterId                    = 0x0508;
constexpr chip::ClusterId kMediaInputClusterId                  = 0x0507;
constexpr chip::ClusterId kMediaPlaybackClusterId               = 0x0506;
constexpr chip::ClusterId kNetworkCommissioningClusterId        = 0x0031;
constexpr chip::ClusterId kOnOffClusterId                       = 0x0006;
constexpr chip::ClusterId kOperationalCredentialsClusterId      = 0x003E;
constexpr chip::ClusterId kPumpConfigurationAndControlClusterId = 0x0200;
constexpr chip::ClusterId kScenesClusterId                      = 0x0005;
constexpr chip::ClusterId kSwitchClusterId                      = 0x003B;
constexpr chip::ClusterId kTvChannelClusterId                   = 0x0504;
constexpr chip::ClusterId kTargetNavigatorClusterId             = 0x0505;
constexpr chip::ClusterId kTemperatureMeasurementClusterId      = 0x0402;
constexpr chip::ClusterId kTestClusterClusterId                 = 0x050F;
constexpr chip::ClusterId kThermostatClusterId                  = 0x0201;
constexpr chip::ClusterId kWakeOnLanClusterId                   = 0x0503;

/*----------------------------------------------------------------------------*\
| Cluster AccountLogin                                                | 0x050E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * GetSetupPIN                                                       |   0x00 |
| * Login                                                             |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command GetSetupPIN
 */
class AccountLoginGetSetupPIN : public ModelCommand
{
public:
    AccountLoginGetSetupPIN() : ModelCommand("get-setup-pin")
    {
        AddArgument("tempAccountIdentifier", &mTempAccountIdentifier);
        ModelCommand::AddArguments();
    }
    ~AccountLoginGetSetupPIN()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetSetupPIN(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                   chip::ByteSpan(chip::Uint8::from_char(mTempAccountIdentifier), strlen(mTempAccountIdentifier)));
    }

private:
    chip::Callback::Callback<AccountLoginClusterGetSetupPINResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<AccountLoginClusterGetSetupPINResponseCallback>(OnAccountLoginClusterGetSetupPINResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mTempAccountIdentifier;
};

/*
 * Command Login
 */
class AccountLoginLogin : public ModelCommand
{
public:
    AccountLoginLogin() : ModelCommand("login")
    {
        AddArgument("tempAccountIdentifier", &mTempAccountIdentifier);
        AddArgument("setupPIN", &mSetupPIN);
        ModelCommand::AddArguments();
    }
    ~AccountLoginLogin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Login(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                             chip::ByteSpan(chip::Uint8::from_char(mTempAccountIdentifier), strlen(mTempAccountIdentifier)),
                             chip::ByteSpan(chip::Uint8::from_char(mSetupPIN), strlen(mSetupPIN)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mTempAccountIdentifier;
    char * mSetupPIN;
};

/*
 * Discover Attributes
 */
class DiscoverAccountLoginAttributes : public ModelCommand
{
public:
    DiscoverAccountLoginAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverAccountLoginAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadAccountLoginClusterRevision : public ModelCommand
{
public:
    ReadAccountLoginClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadAccountLoginClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050E) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::AccountLoginCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ApplicationBasic                                            | 0x050D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * VendorName                                                        | 0x0000 |
| * VendorId                                                          | 0x0001 |
| * ApplicationName                                                   | 0x0002 |
| * ProductId                                                         | 0x0003 |
| * ApplicationId                                                     | 0x0005 |
| * CatalogVendorId                                                   | 0x0006 |
| * ApplicationSatus                                                  | 0x0007 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverApplicationBasicAttributes : public ModelCommand
{
public:
    DiscoverApplicationBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverApplicationBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorName
 */
class ReadApplicationBasicVendorName : public ModelCommand
{
public:
    ReadApplicationBasicVendorName() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-name");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicVendorName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorId
 */
class ReadApplicationBasicVendorId : public ModelCommand
{
public:
    ReadApplicationBasicVendorId() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicVendorId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationName
 */
class ReadApplicationBasicApplicationName : public ModelCommand
{
public:
    ReadApplicationBasicApplicationName() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-name");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductId
 */
class ReadApplicationBasicProductId : public ModelCommand
{
public:
    ReadApplicationBasicProductId() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicProductId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationId
 */
class ReadApplicationBasicApplicationId : public ModelCommand
{
public:
    ReadApplicationBasicApplicationId() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CatalogVendorId
 */
class ReadApplicationBasicCatalogVendorId : public ModelCommand
{
public:
    ReadApplicationBasicCatalogVendorId() : ModelCommand("read")
    {
        AddArgument("attr-name", "catalog-vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicCatalogVendorId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCatalogVendorId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationSatus
 */
class ReadApplicationBasicApplicationSatus : public ModelCommand
{
public:
    ReadApplicationBasicApplicationSatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-satus");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicApplicationSatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationSatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadApplicationBasicClusterRevision : public ModelCommand
{
public:
    ReadApplicationBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationBasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ApplicationLauncher                                         | 0x050C |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchApp                                                         |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ApplicationLauncherList                                           | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command LaunchApp
 */
class ApplicationLauncherLaunchApp : public ModelCommand
{
public:
    ApplicationLauncherLaunchApp() : ModelCommand("launch-app")
    {
        AddArgument("data", &mData);
        AddArgument("catalogVendorId", 0, UINT16_MAX, &mCatalogVendorId);
        AddArgument("applicationId", &mApplicationId);
        ModelCommand::AddArguments();
    }
    ~ApplicationLauncherLaunchApp()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchApp(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                 chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)), mCatalogVendorId,
                                 chip::ByteSpan(chip::Uint8::from_char(mApplicationId), strlen(mApplicationId)));
    }

private:
    chip::Callback::Callback<ApplicationLauncherClusterLaunchAppResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ApplicationLauncherClusterLaunchAppResponseCallback>(
            OnApplicationLauncherClusterLaunchAppResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mData;
    uint16_t mCatalogVendorId;
    char * mApplicationId;
};

/*
 * Discover Attributes
 */
class DiscoverApplicationLauncherAttributes : public ModelCommand
{
public:
    DiscoverApplicationLauncherAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverApplicationLauncherAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ApplicationLauncherList
 */
class ReadApplicationLauncherApplicationLauncherList : public ModelCommand
{
public:
    ReadApplicationLauncherApplicationLauncherList() : ModelCommand("read")
    {
        AddArgument("attr-name", "application-launcher-list");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherApplicationLauncherList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeApplicationLauncherList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadApplicationLauncherClusterRevision : public ModelCommand
{
public:
    ReadApplicationLauncherClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadApplicationLauncherClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050C) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ApplicationLauncherCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster AudioOutput                                                 | 0x050B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RenameOutput                                                      |   0x01 |
| * SelectOutput                                                      |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AudioOutputList                                                   | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command RenameOutput
 */
class AudioOutputRenameOutput : public ModelCommand
{
public:
    AudioOutputRenameOutput() : ModelCommand("rename-output")
    {
        AddArgument("index", 0, UINT8_MAX, &mIndex);
        AddArgument("name", &mName);
        ModelCommand::AddArguments();
    }
    ~AudioOutputRenameOutput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RenameOutput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex,
                                    chip::ByteSpan(chip::Uint8::from_char(mName), strlen(mName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
    char * mName;
};

/*
 * Command SelectOutput
 */
class AudioOutputSelectOutput : public ModelCommand
{
public:
    AudioOutputSelectOutput() : ModelCommand("select-output")
    {
        AddArgument("index", 0, UINT8_MAX, &mIndex);
        ModelCommand::AddArguments();
    }
    ~AudioOutputSelectOutput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SelectOutput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
};

/*
 * Discover Attributes
 */
class DiscoverAudioOutputAttributes : public ModelCommand
{
public:
    DiscoverAudioOutputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverAudioOutputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute AudioOutputList
 */
class ReadAudioOutputAudioOutputList : public ModelCommand
{
public:
    ReadAudioOutputAudioOutputList() : ModelCommand("read")
    {
        AddArgument("attr-name", "audio-output-list");
        ModelCommand::AddArguments();
    }

    ~ReadAudioOutputAudioOutputList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeAudioOutputList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadAudioOutputClusterRevision : public ModelCommand
{
public:
    ReadAudioOutputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadAudioOutputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::AudioOutputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster BarrierControl                                              | 0x0103 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * BarrierControlGoToPercent                                         |   0x00 |
| * BarrierControlStop                                                |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * BarrierMovingState                                                | 0x0001 |
| * BarrierSafetyStatus                                               | 0x0002 |
| * BarrierCapabilities                                               | 0x0003 |
| * BarrierPosition                                                   | 0x000A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command BarrierControlGoToPercent
 */
class BarrierControlBarrierControlGoToPercent : public ModelCommand
{
public:
    BarrierControlBarrierControlGoToPercent() : ModelCommand("barrier-control-go-to-percent")
    {
        AddArgument("percentOpen", 0, UINT8_MAX, &mPercentOpen);
        ModelCommand::AddArguments();
    }
    ~BarrierControlBarrierControlGoToPercent()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.BarrierControlGoToPercent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPercentOpen);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mPercentOpen;
};

/*
 * Command BarrierControlStop
 */
class BarrierControlBarrierControlStop : public ModelCommand
{
public:
    BarrierControlBarrierControlStop() : ModelCommand("barrier-control-stop") { ModelCommand::AddArguments(); }
    ~BarrierControlBarrierControlStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.BarrierControlStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverBarrierControlAttributes : public ModelCommand
{
public:
    DiscoverBarrierControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBarrierControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierMovingState
 */
class ReadBarrierControlBarrierMovingState : public ModelCommand
{
public:
    ReadBarrierControlBarrierMovingState() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-moving-state");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierMovingState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierMovingState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierSafetyStatus
 */
class ReadBarrierControlBarrierSafetyStatus : public ModelCommand
{
public:
    ReadBarrierControlBarrierSafetyStatus() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-safety-status");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierSafetyStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierSafetyStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierCapabilities
 */
class ReadBarrierControlBarrierCapabilities : public ModelCommand
{
public:
    ReadBarrierControlBarrierCapabilities() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-capabilities");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierCapabilities()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute BarrierPosition
 */
class ReadBarrierControlBarrierPosition : public ModelCommand
{
public:
    ReadBarrierControlBarrierPosition() : ModelCommand("read")
    {
        AddArgument("attr-name", "barrier-position");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlBarrierPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBarrierPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBarrierControlClusterRevision : public ModelCommand
{
public:
    ReadBarrierControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBarrierControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0103) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BarrierControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Basic                                                       | 0x0028 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MfgSpecificPing                                                   |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * InteractionModelVersion                                           | 0x0000 |
| * VendorName                                                        | 0x0001 |
| * VendorID                                                          | 0x0002 |
| * ProductName                                                       | 0x0003 |
| * ProductID                                                         | 0x0004 |
| * UserLabel                                                         | 0x0005 |
| * Location                                                          | 0x0006 |
| * HardwareVersion                                                   | 0x0007 |
| * HardwareVersionString                                             | 0x0008 |
| * SoftwareVersion                                                   | 0x0009 |
| * SoftwareVersionString                                             | 0x000A |
| * ManufacturingDate                                                 | 0x000B |
| * PartNumber                                                        | 0x000C |
| * ProductURL                                                        | 0x000D |
| * ProductLabel                                                      | 0x000E |
| * SerialNumber                                                      | 0x000F |
| * LocalConfigDisabled                                               | 0x0010 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command MfgSpecificPing
 */
class BasicMfgSpecificPing : public ModelCommand
{
public:
    BasicMfgSpecificPing() : ModelCommand("mfg-specific-ping") { ModelCommand::AddArguments(); }
    ~BasicMfgSpecificPing()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MfgSpecificPing(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverBasicAttributes : public ModelCommand
{
public:
    DiscoverBasicAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBasicAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute InteractionModelVersion
 */
class ReadBasicInteractionModelVersion : public ModelCommand
{
public:
    ReadBasicInteractionModelVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "interaction-model-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicInteractionModelVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInteractionModelVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorName
 */
class ReadBasicVendorName : public ModelCommand
{
public:
    ReadBasicVendorName() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-name");
        ModelCommand::AddArguments();
    }

    ~ReadBasicVendorName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute VendorID
 */
class ReadBasicVendorID : public ModelCommand
{
public:
    ReadBasicVendorID() : ModelCommand("read")
    {
        AddArgument("attr-name", "vendor-id");
        ModelCommand::AddArguments();
    }

    ~ReadBasicVendorID()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeVendorID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductName
 */
class ReadBasicProductName : public ModelCommand
{
public:
    ReadBasicProductName() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-name");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductName()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductName(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductID
 */
class ReadBasicProductID : public ModelCommand
{
public:
    ReadBasicProductID() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-id");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductID()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductID(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute UserLabel
 */
class ReadBasicUserLabel : public ModelCommand
{
public:
    ReadBasicUserLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "user-label");
        ModelCommand::AddArguments();
    }

    ~ReadBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicUserLabel : public ModelCommand
{
public:
    WriteBasicUserLabel() : ModelCommand("write")
    {
        AddArgument("attr-name", "user-label");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicUserLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeUserLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                               chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute Location
 */
class ReadBasicLocation : public ModelCommand
{
public:
    ReadBasicLocation() : ModelCommand("read")
    {
        AddArgument("attr-name", "location");
        ModelCommand::AddArguments();
    }

    ~ReadBasicLocation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicLocation : public ModelCommand
{
public:
    WriteBasicLocation() : ModelCommand("write")
    {
        AddArgument("attr-name", "location");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicLocation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLocation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                              chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute HardwareVersion
 */
class ReadBasicHardwareVersion : public ModelCommand
{
public:
    ReadBasicHardwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicHardwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute HardwareVersionString
 */
class ReadBasicHardwareVersionString : public ModelCommand
{
public:
    ReadBasicHardwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "hardware-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBasicHardwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeHardwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersion
 */
class ReadBasicSoftwareVersion : public ModelCommand
{
public:
    ReadBasicSoftwareVersion() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSoftwareVersion()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersion(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SoftwareVersionString
 */
class ReadBasicSoftwareVersionString : public ModelCommand
{
public:
    ReadBasicSoftwareVersionString() : ModelCommand("read")
    {
        AddArgument("attr-name", "software-version-string");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSoftwareVersionString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSoftwareVersionString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ManufacturingDate
 */
class ReadBasicManufacturingDate : public ModelCommand
{
public:
    ReadBasicManufacturingDate() : ModelCommand("read")
    {
        AddArgument("attr-name", "manufacturing-date");
        ModelCommand::AddArguments();
    }

    ~ReadBasicManufacturingDate()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeManufacturingDate(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartNumber
 */
class ReadBasicPartNumber : public ModelCommand
{
public:
    ReadBasicPartNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "part-number");
        ModelCommand::AddArguments();
    }

    ~ReadBasicPartNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductURL
 */
class ReadBasicProductURL : public ModelCommand
{
public:
    ReadBasicProductURL() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-url");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductURL()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ProductLabel
 */
class ReadBasicProductLabel : public ModelCommand
{
public:
    ReadBasicProductLabel() : ModelCommand("read")
    {
        AddArgument("attr-name", "product-label");
        ModelCommand::AddArguments();
    }

    ~ReadBasicProductLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeProductLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SerialNumber
 */
class ReadBasicSerialNumber : public ModelCommand
{
public:
    ReadBasicSerialNumber() : ModelCommand("read")
    {
        AddArgument("attr-name", "serial-number");
        ModelCommand::AddArguments();
    }

    ~ReadBasicSerialNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSerialNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LocalConfigDisabled
 */
class ReadBasicLocalConfigDisabled : public ModelCommand
{
public:
    ReadBasicLocalConfigDisabled() : ModelCommand("read")
    {
        AddArgument("attr-name", "local-config-disabled");
        ModelCommand::AddArguments();
    }

    ~ReadBasicLocalConfigDisabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocalConfigDisabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteBasicLocalConfigDisabled : public ModelCommand
{
public:
    WriteBasicLocalConfigDisabled() : ModelCommand("write")
    {
        AddArgument("attr-name", "local-config-disabled");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteBasicLocalConfigDisabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeLocalConfigDisabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadBasicClusterRevision : public ModelCommand
{
public:
    ReadBasicClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBasicClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0028) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BasicCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Binding                                                     | 0xF000 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Bind                                                              |   0x00 |
| * Unbind                                                            |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Bind
 */
class BindingBind : public ModelCommand
{
public:
    BindingBind() : ModelCommand("bind")
    {
        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
        AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
        ModelCommand::AddArguments();
    }
    ~BindingBind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Bind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::NodeId mNodeId;
    chip::GroupId mGroupId;
    chip::EndpointId mEndpointId;
    chip::ClusterId mClusterId;
};

/*
 * Command Unbind
 */
class BindingUnbind : public ModelCommand
{
public:
    BindingUnbind() : ModelCommand("unbind")
    {
        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("endpointId", 0, UINT8_MAX, &mEndpointId);
        AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
        ModelCommand::AddArguments();
    }
    ~BindingUnbind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Unbind(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNodeId, mGroupId, mEndpointId, mClusterId);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::NodeId mNodeId;
    chip::GroupId mGroupId;
    chip::EndpointId mEndpointId;
    chip::ClusterId mClusterId;
};

/*
 * Discover Attributes
 */
class DiscoverBindingAttributes : public ModelCommand
{
public:
    DiscoverBindingAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverBindingAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadBindingClusterRevision : public ModelCommand
{
public:
    ReadBindingClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadBindingClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF000) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::BindingCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ColorControl                                                | 0x0300 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MoveColor                                                         |   0x08 |
| * MoveColorTemperature                                              |   0x4B |
| * MoveHue                                                           |   0x01 |
| * MoveSaturation                                                    |   0x04 |
| * MoveToColor                                                       |   0x07 |
| * MoveToColorTemperature                                            |   0x0A |
| * MoveToHue                                                         |   0x00 |
| * MoveToHueAndSaturation                                            |   0x06 |
| * MoveToSaturation                                                  |   0x03 |
| * StepColor                                                         |   0x09 |
| * StepColorTemperature                                              |   0x4C |
| * StepHue                                                           |   0x02 |
| * StepSaturation                                                    |   0x05 |
| * StopMoveStep                                                      |   0x47 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentHue                                                        | 0x0000 |
| * CurrentSaturation                                                 | 0x0001 |
| * RemainingTime                                                     | 0x0002 |
| * CurrentX                                                          | 0x0003 |
| * CurrentY                                                          | 0x0004 |
| * DriftCompensation                                                 | 0x0005 |
| * CompensationText                                                  | 0x0006 |
| * ColorTemperature                                                  | 0x0007 |
| * ColorMode                                                         | 0x0008 |
| * ColorControlOptions                                               | 0x000F |
| * NumberOfPrimaries                                                 | 0x0010 |
| * Primary1X                                                         | 0x0011 |
| * Primary1Y                                                         | 0x0012 |
| * Primary1Intensity                                                 | 0x0013 |
| * Primary2X                                                         | 0x0015 |
| * Primary2Y                                                         | 0x0016 |
| * Primary2Intensity                                                 | 0x0017 |
| * Primary3X                                                         | 0x0019 |
| * Primary3Y                                                         | 0x001A |
| * Primary3Intensity                                                 | 0x001B |
| * Primary4X                                                         | 0x0020 |
| * Primary4Y                                                         | 0x0021 |
| * Primary4Intensity                                                 | 0x0022 |
| * Primary5X                                                         | 0x0024 |
| * Primary5Y                                                         | 0x0025 |
| * Primary5Intensity                                                 | 0x0026 |
| * Primary6X                                                         | 0x0028 |
| * Primary6Y                                                         | 0x0029 |
| * Primary6Intensity                                                 | 0x002A |
| * WhitePointX                                                       | 0x0030 |
| * WhitePointY                                                       | 0x0031 |
| * ColorPointRX                                                      | 0x0032 |
| * ColorPointRY                                                      | 0x0033 |
| * ColorPointRIntensity                                              | 0x0034 |
| * ColorPointGX                                                      | 0x0036 |
| * ColorPointGY                                                      | 0x0037 |
| * ColorPointGIntensity                                              | 0x0038 |
| * ColorPointBX                                                      | 0x003A |
| * ColorPointBY                                                      | 0x003B |
| * ColorPointBIntensity                                              | 0x003C |
| * EnhancedCurrentHue                                                | 0x4000 |
| * EnhancedColorMode                                                 | 0x4001 |
| * ColorLoopActive                                                   | 0x4002 |
| * ColorLoopDirection                                                | 0x4003 |
| * ColorLoopTime                                                     | 0x4004 |
| * ColorCapabilities                                                 | 0x400A |
| * ColorTempPhysicalMin                                              | 0x400B |
| * ColorTempPhysicalMax                                              | 0x400C |
| * CoupleColorTempToLevelMinMireds                                   | 0x400D |
| * StartUpColorTemperatureMireds                                     | 0x4010 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command MoveColor
 */
class ColorControlMoveColor : public ModelCommand
{
public:
    ColorControlMoveColor() : ModelCommand("move-color")
    {
        AddArgument("rateX", INT16_MIN, INT16_MAX, &mRateX);
        AddArgument("rateY", INT16_MIN, INT16_MAX, &mRateY);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x08) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mRateX, mRateY, mOptionsMask,
                                 mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mRateX;
    int16_t mRateY;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveColorTemperature
 */
class ColorControlMoveColorTemperature : public ModelCommand
{
public:
    ColorControlMoveColorTemperature() : ModelCommand("move-color-temperature")
    {
        AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("rate", 0, UINT16_MAX, &mRate);
        AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
        AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4B) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate,
                                            mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint16_t mRate;
    uint16_t mColorTemperatureMinimum;
    uint16_t mColorTemperatureMaximum;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveHue
 */
class ColorControlMoveHue : public ModelCommand
{
public:
    ColorControlMoveHue() : ModelCommand("move-hue")
    {
        AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("rate", 0, UINT8_MAX, &mRate);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
                               mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveSaturation
 */
class ColorControlMoveSaturation : public ModelCommand
{
public:
    ColorControlMoveSaturation() : ModelCommand("move-saturation")
    {
        AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("rate", 0, UINT8_MAX, &mRate);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionsMask,
                                      mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToColor
 */
class ColorControlMoveToColor : public ModelCommand
{
public:
    ColorControlMoveToColor() : ModelCommand("move-to-color")
    {
        AddArgument("colorX", 0, UINT16_MAX, &mColorX);
        AddArgument("colorY", 0, UINT16_MAX, &mColorY);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x07) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorX, mColorY, mTransitionTime,
                                   mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mColorX;
    uint16_t mColorY;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToColorTemperature
 */
class ColorControlMoveToColorTemperature : public ModelCommand
{
public:
    ColorControlMoveToColorTemperature() : ModelCommand("move-to-color-temperature")
    {
        AddArgument("colorTemperature", 0, UINT16_MAX, &mColorTemperature);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x0A) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mColorTemperature,
                                              mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mColorTemperature;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToHue
 */
class ColorControlMoveToHue : public ModelCommand
{
public:
    ColorControlMoveToHue() : ModelCommand("move-to-hue")
    {
        AddArgument("hue", 0, UINT8_MAX, &mHue);
        AddArgument("direction", 0, UINT8_MAX, &mDirection);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mDirection, mTransitionTime,
                                 mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mHue;
    uint8_t mDirection;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToHueAndSaturation
 */
class ColorControlMoveToHueAndSaturation : public ModelCommand
{
public:
    ColorControlMoveToHueAndSaturation() : ModelCommand("move-to-hue-and-saturation")
    {
        AddArgument("hue", 0, UINT8_MAX, &mHue);
        AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToHueAndSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToHueAndSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mHue, mSaturation,
                                              mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mHue;
    uint8_t mSaturation;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command MoveToSaturation
 */
class ColorControlMoveToSaturation : public ModelCommand
{
public:
    ColorControlMoveToSaturation() : ModelCommand("move-to-saturation")
    {
        AddArgument("saturation", 0, UINT8_MAX, &mSaturation);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlMoveToSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mSaturation, mTransitionTime,
                                        mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mSaturation;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepColor
 */
class ColorControlStepColor : public ModelCommand
{
public:
    ColorControlStepColor() : ModelCommand("step-color")
    {
        AddArgument("stepX", INT16_MIN, INT16_MAX, &mStepX);
        AddArgument("stepY", INT16_MIN, INT16_MAX, &mStepY);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepColor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x09) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepColor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepX, mStepY, mTransitionTime,
                                 mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mStepX;
    int16_t mStepY;
    uint16_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepColorTemperature
 */
class ColorControlStepColorTemperature : public ModelCommand
{
public:
    ColorControlStepColorTemperature() : ModelCommand("step-color-temperature")
    {
        AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("stepSize", 0, UINT16_MAX, &mStepSize);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("colorTemperatureMinimum", 0, UINT16_MAX, &mColorTemperatureMinimum);
        AddArgument("colorTemperatureMaximum", 0, UINT16_MAX, &mColorTemperatureMaximum);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x4C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                            mTransitionTime, mColorTemperatureMinimum, mColorTemperatureMaximum, mOptionsMask,
                                            mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint16_t mStepSize;
    uint16_t mTransitionTime;
    uint16_t mColorTemperatureMinimum;
    uint16_t mColorTemperatureMaximum;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepHue
 */
class ColorControlStepHue : public ModelCommand
{
public:
    ColorControlStepHue() : ModelCommand("step-hue")
    {
        AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
                               mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint8_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StepSaturation
 */
class ColorControlStepSaturation : public ModelCommand
{
public:
    ColorControlStepSaturation() : ModelCommand("step-saturation")
    {
        AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("transitionTime", 0, UINT8_MAX, &mTransitionTime);
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStepSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                      mTransitionTime, mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint8_t mTransitionTime;
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Command StopMoveStep
 */
class ColorControlStopMoveStep : public ModelCommand
{
public:
    ColorControlStopMoveStep() : ModelCommand("stop-move-step")
    {
        AddArgument("optionsMask", 0, UINT8_MAX, &mOptionsMask);
        AddArgument("optionsOverride", 0, UINT8_MAX, &mOptionsOverride);
        ModelCommand::AddArguments();
    }
    ~ColorControlStopMoveStep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x47) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StopMoveStep(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionsMask, mOptionsOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mOptionsMask;
    uint8_t mOptionsOverride;
};

/*
 * Discover Attributes
 */
class DiscoverColorControlAttributes : public ModelCommand
{
public:
    DiscoverColorControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverColorControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentHue
 */
class ReadColorControlCurrentHue : public ModelCommand
{
public:
    ReadColorControlCurrentHue() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-hue");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentHue : public ModelCommand
{
public:
    ReportColorControlCurrentHue() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-hue");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentHue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                    mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute CurrentSaturation
 */
class ReadColorControlCurrentSaturation : public ModelCommand
{
public:
    ReadColorControlCurrentSaturation() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-saturation");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentSaturation : public ModelCommand
{
public:
    ReportColorControlCurrentSaturation() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-saturation");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentSaturation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentSaturation(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentSaturation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                           mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute RemainingTime
 */
class ReadColorControlRemainingTime : public ModelCommand
{
public:
    ReadColorControlRemainingTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "remaining-time");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlRemainingTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeRemainingTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentX
 */
class ReadColorControlCurrentX : public ModelCommand
{
public:
    ReadColorControlCurrentX() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentX : public ModelCommand
{
public:
    ReportColorControlCurrentX() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-x");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentX(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute CurrentY
 */
class ReadColorControlCurrentY : public ModelCommand
{
public:
    ReadColorControlCurrentY() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCurrentY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlCurrentY : public ModelCommand
{
public:
    ReportColorControlCurrentY() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-y");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlCurrentY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentY(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute DriftCompensation
 */
class ReadColorControlDriftCompensation : public ModelCommand
{
public:
    ReadColorControlDriftCompensation() : ModelCommand("read")
    {
        AddArgument("attr-name", "drift-compensation");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlDriftCompensation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDriftCompensation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CompensationText
 */
class ReadColorControlCompensationText : public ModelCommand
{
public:
    ReadColorControlCompensationText() : ModelCommand("read")
    {
        AddArgument("attr-name", "compensation-text");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCompensationText()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCompensationText(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTemperature
 */
class ReadColorControlColorTemperature : public ModelCommand
{
public:
    ReadColorControlColorTemperature() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temperature");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportColorControlColorTemperature : public ModelCommand
{
public:
    ReportColorControlColorTemperature() : ModelCommand("report")
    {
        AddArgument("attr-name", "color-temperature");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportColorControlColorTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeColorTemperature(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeColorTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                          mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint16_t mChange;
};

/*
 * Attribute ColorMode
 */
class ReadColorControlColorMode : public ModelCommand
{
public:
    ReadColorControlColorMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-mode");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorControlOptions
 */
class ReadColorControlColorControlOptions : public ModelCommand
{
public:
    ReadColorControlColorControlOptions() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-control-options");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorControlOptions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorControlOptions : public ModelCommand
{
public:
    WriteColorControlColorControlOptions() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-control-options");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorControlOptions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorControlOptions(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute NumberOfPrimaries
 */
class ReadColorControlNumberOfPrimaries : public ModelCommand
{
public:
    ReadColorControlNumberOfPrimaries() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-primaries");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlNumberOfPrimaries()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfPrimaries(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1X
 */
class ReadColorControlPrimary1X : public ModelCommand
{
public:
    ReadColorControlPrimary1X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1Y
 */
class ReadColorControlPrimary1Y : public ModelCommand
{
public:
    ReadColorControlPrimary1Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary1Intensity
 */
class ReadColorControlPrimary1Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary1Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary1intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary1Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary1Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2X
 */
class ReadColorControlPrimary2X : public ModelCommand
{
public:
    ReadColorControlPrimary2X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2Y
 */
class ReadColorControlPrimary2Y : public ModelCommand
{
public:
    ReadColorControlPrimary2Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary2Intensity
 */
class ReadColorControlPrimary2Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary2Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary2intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary2Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary2Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3X
 */
class ReadColorControlPrimary3X : public ModelCommand
{
public:
    ReadColorControlPrimary3X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3Y
 */
class ReadColorControlPrimary3Y : public ModelCommand
{
public:
    ReadColorControlPrimary3Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary3Intensity
 */
class ReadColorControlPrimary3Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary3Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary3intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary3Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary3Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4X
 */
class ReadColorControlPrimary4X : public ModelCommand
{
public:
    ReadColorControlPrimary4X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4Y
 */
class ReadColorControlPrimary4Y : public ModelCommand
{
public:
    ReadColorControlPrimary4Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary4Intensity
 */
class ReadColorControlPrimary4Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary4Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary4intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary4Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary4Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5X
 */
class ReadColorControlPrimary5X : public ModelCommand
{
public:
    ReadColorControlPrimary5X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5Y
 */
class ReadColorControlPrimary5Y : public ModelCommand
{
public:
    ReadColorControlPrimary5Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary5Intensity
 */
class ReadColorControlPrimary5Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary5Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary5intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary5Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary5Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6X
 */
class ReadColorControlPrimary6X : public ModelCommand
{
public:
    ReadColorControlPrimary6X() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6X()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6X(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6Y
 */
class ReadColorControlPrimary6Y : public ModelCommand
{
public:
    ReadColorControlPrimary6Y() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6Y()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6Y(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Primary6Intensity
 */
class ReadColorControlPrimary6Intensity : public ModelCommand
{
public:
    ReadColorControlPrimary6Intensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "primary6intensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlPrimary6Intensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePrimary6Intensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute WhitePointX
 */
class ReadColorControlWhitePointX : public ModelCommand
{
public:
    ReadColorControlWhitePointX() : ModelCommand("read")
    {
        AddArgument("attr-name", "white-point-x");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlWhitePointX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlWhitePointX : public ModelCommand
{
public:
    WriteColorControlWhitePointX() : ModelCommand("write")
    {
        AddArgument("attr-name", "white-point-x");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlWhitePointX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeWhitePointX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute WhitePointY
 */
class ReadColorControlWhitePointY : public ModelCommand
{
public:
    ReadColorControlWhitePointY() : ModelCommand("read")
    {
        AddArgument("attr-name", "white-point-y");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlWhitePointY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlWhitePointY : public ModelCommand
{
public:
    WriteColorControlWhitePointY() : ModelCommand("write")
    {
        AddArgument("attr-name", "white-point-y");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlWhitePointY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeWhitePointY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRX
 */
class ReadColorControlColorPointRX : public ModelCommand
{
public:
    ReadColorControlColorPointRX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-rx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRX : public ModelCommand
{
public:
    WriteColorControlColorPointRX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-rx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRY
 */
class ReadColorControlColorPointRY : public ModelCommand
{
public:
    ReadColorControlColorPointRY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-ry");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRY : public ModelCommand
{
public:
    WriteColorControlColorPointRY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-ry");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointRIntensity
 */
class ReadColorControlColorPointRIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointRIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-rintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointRIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointRIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointRIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-rintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointRIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointRIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ColorPointGX
 */
class ReadColorControlColorPointGX : public ModelCommand
{
public:
    ReadColorControlColorPointGX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGX : public ModelCommand
{
public:
    WriteColorControlColorPointGX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointGY
 */
class ReadColorControlColorPointGY : public ModelCommand
{
public:
    ReadColorControlColorPointGY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gy");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGY : public ModelCommand
{
public:
    WriteColorControlColorPointGY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gy");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointGIntensity
 */
class ReadColorControlColorPointGIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointGIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-gintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointGIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointGIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointGIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-gintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointGIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointGIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ColorPointBX
 */
class ReadColorControlColorPointBX : public ModelCommand
{
public:
    ReadColorControlColorPointBX() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-bx");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBX : public ModelCommand
{
public:
    WriteColorControlColorPointBX() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-bx");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBX()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBX(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointBY
 */
class ReadColorControlColorPointBY : public ModelCommand
{
public:
    ReadColorControlColorPointBY() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-by");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBY : public ModelCommand
{
public:
    WriteColorControlColorPointBY() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-by");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBY()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBY(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ColorPointBIntensity
 */
class ReadColorControlColorPointBIntensity : public ModelCommand
{
public:
    ReadColorControlColorPointBIntensity() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-point-bintensity");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorPointBIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlColorPointBIntensity : public ModelCommand
{
public:
    WriteColorControlColorPointBIntensity() : ModelCommand("write")
    {
        AddArgument("attr-name", "color-point-bintensity");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlColorPointBIntensity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeColorPointBIntensity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute EnhancedCurrentHue
 */
class ReadColorControlEnhancedCurrentHue : public ModelCommand
{
public:
    ReadColorControlEnhancedCurrentHue() : ModelCommand("read")
    {
        AddArgument("attr-name", "enhanced-current-hue");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlEnhancedCurrentHue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnhancedCurrentHue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EnhancedColorMode
 */
class ReadColorControlEnhancedColorMode : public ModelCommand
{
public:
    ReadColorControlEnhancedColorMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "enhanced-color-mode");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlEnhancedColorMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnhancedColorMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopActive
 */
class ReadColorControlColorLoopActive : public ModelCommand
{
public:
    ReadColorControlColorLoopActive() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-active");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopActive()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopActive(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopDirection
 */
class ReadColorControlColorLoopDirection : public ModelCommand
{
public:
    ReadColorControlColorLoopDirection() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-direction");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopDirection()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopDirection(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorLoopTime
 */
class ReadColorControlColorLoopTime : public ModelCommand
{
public:
    ReadColorControlColorLoopTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-loop-time");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorLoopTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorLoopTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorCapabilities
 */
class ReadColorControlColorCapabilities : public ModelCommand
{
public:
    ReadColorControlColorCapabilities() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-capabilities");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorCapabilities()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorCapabilities(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTempPhysicalMin
 */
class ReadColorControlColorTempPhysicalMin : public ModelCommand
{
public:
    ReadColorControlColorTempPhysicalMin() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temp-physical-min");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTempPhysicalMin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTempPhysicalMin(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ColorTempPhysicalMax
 */
class ReadColorControlColorTempPhysicalMax : public ModelCommand
{
public:
    ReadColorControlColorTempPhysicalMax() : ModelCommand("read")
    {
        AddArgument("attr-name", "color-temp-physical-max");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlColorTempPhysicalMax()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeColorTempPhysicalMax(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CoupleColorTempToLevelMinMireds
 */
class ReadColorControlCoupleColorTempToLevelMinMireds : public ModelCommand
{
public:
    ReadColorControlCoupleColorTempToLevelMinMireds() : ModelCommand("read")
    {
        AddArgument("attr-name", "couple-color-temp-to-level-min-mireds");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlCoupleColorTempToLevelMinMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCoupleColorTempToLevelMinMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute StartUpColorTemperatureMireds
 */
class ReadColorControlStartUpColorTemperatureMireds : public ModelCommand
{
public:
    ReadColorControlStartUpColorTemperatureMireds() : ModelCommand("read")
    {
        AddArgument("attr-name", "start-up-color-temperature-mireds");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlStartUpColorTemperatureMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteColorControlStartUpColorTemperatureMireds : public ModelCommand
{
public:
    WriteColorControlStartUpColorTemperatureMireds() : ModelCommand("write")
    {
        AddArgument("attr-name", "start-up-color-temperature-mireds");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteColorControlStartUpColorTemperatureMireds()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeStartUpColorTemperatureMireds(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                                   mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadColorControlClusterRevision : public ModelCommand
{
public:
    ReadColorControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadColorControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0300) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ColorControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster ContentLaunch                                               | 0x050A |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchContent                                                     |   0x00 |
| * LaunchURL                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AcceptsHeaderList                                                 | 0x0000 |
| * SupportedStreamingTypes                                           | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command LaunchContent
 */
class ContentLaunchLaunchContent : public ModelCommand
{
public:
    ContentLaunchLaunchContent() : ModelCommand("launch-content")
    {
        AddArgument("autoPlay", 0, UINT8_MAX, &mAutoPlay);
        AddArgument("data", &mData);
        ModelCommand::AddArguments();
    }
    ~ContentLaunchLaunchContent()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchContent(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mAutoPlay,
                                     chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)));
    }

private:
    chip::Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLaunchClusterLaunchContentResponseCallback>(OnContentLaunchClusterLaunchContentResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mAutoPlay;
    char * mData;
};

/*
 * Command LaunchURL
 */
class ContentLaunchLaunchURL : public ModelCommand
{
public:
    ContentLaunchLaunchURL() : ModelCommand("launch-url")
    {
        AddArgument("contentURL", &mContentURL);
        AddArgument("displayString", &mDisplayString);
        ModelCommand::AddArguments();
    }
    ~ContentLaunchLaunchURL()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LaunchURL(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                 chip::ByteSpan(chip::Uint8::from_char(mContentURL), strlen(mContentURL)),
                                 chip::ByteSpan(chip::Uint8::from_char(mDisplayString), strlen(mDisplayString)));
    }

private:
    chip::Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ContentLaunchClusterLaunchURLResponseCallback>(OnContentLaunchClusterLaunchURLResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mContentURL;
    char * mDisplayString;
};

/*
 * Discover Attributes
 */
class DiscoverContentLaunchAttributes : public ModelCommand
{
public:
    DiscoverContentLaunchAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverContentLaunchAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute AcceptsHeaderList
 */
class ReadContentLaunchAcceptsHeaderList : public ModelCommand
{
public:
    ReadContentLaunchAcceptsHeaderList() : ModelCommand("read")
    {
        AddArgument("attr-name", "accepts-header-list");
        ModelCommand::AddArguments();
    }

    ~ReadContentLaunchAcceptsHeaderList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeAcceptsHeaderList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SupportedStreamingTypes
 */
class ReadContentLaunchSupportedStreamingTypes : public ModelCommand
{
public:
    ReadContentLaunchSupportedStreamingTypes() : ModelCommand("read")
    {
        AddArgument("attr-name", "supported-streaming-types");
        ModelCommand::AddArguments();
    }

    ~ReadContentLaunchSupportedStreamingTypes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSupportedStreamingTypes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadContentLaunchClusterRevision : public ModelCommand
{
public:
    ReadContentLaunchClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadContentLaunchClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050A) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ContentLaunchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Descriptor                                                  | 0x001D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * DeviceList                                                        | 0x0000 |
| * ServerList                                                        | 0x0001 |
| * ClientList                                                        | 0x0002 |
| * PartsList                                                         | 0x0003 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverDescriptorAttributes : public ModelCommand
{
public:
    DiscoverDescriptorAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverDescriptorAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute DeviceList
 */
class ReadDescriptorDeviceList : public ModelCommand
{
public:
    ReadDescriptorDeviceList() : ModelCommand("read")
    {
        AddArgument("attr-name", "device-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorDeviceList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeDeviceList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorDeviceListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorDeviceListListAttributeCallback>(OnDescriptorDeviceListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ServerList
 */
class ReadDescriptorServerList : public ModelCommand
{
public:
    ReadDescriptorServerList() : ModelCommand("read")
    {
        AddArgument("attr-name", "server-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorServerList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeServerList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorServerListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorServerListListAttributeCallback>(OnDescriptorServerListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClientList
 */
class ReadDescriptorClientList : public ModelCommand
{
public:
    ReadDescriptorClientList() : ModelCommand("read")
    {
        AddArgument("attr-name", "client-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorClientList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClientList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorClientListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorClientListListAttributeCallback>(OnDescriptorClientListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute PartsList
 */
class ReadDescriptorPartsList : public ModelCommand
{
public:
    ReadDescriptorPartsList() : ModelCommand("read")
    {
        AddArgument("attr-name", "parts-list");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorPartsList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributePartsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DescriptorPartsListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<DescriptorPartsListListAttributeCallback>(OnDescriptorPartsListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadDescriptorClusterRevision : public ModelCommand
{
public:
    ReadDescriptorClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadDescriptorClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x001D) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DescriptorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster DoorLock                                                    | 0x0101 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearAllPins                                                      |   0x08 |
| * ClearAllRfids                                                     |   0x19 |
| * ClearHolidaySchedule                                              |   0x13 |
| * ClearPin                                                          |   0x07 |
| * ClearRfid                                                         |   0x18 |
| * ClearWeekdaySchedule                                              |   0x0D |
| * ClearYeardaySchedule                                              |   0x10 |
| * GetHolidaySchedule                                                |   0x12 |
| * GetLogRecord                                                      |   0x04 |
| * GetPin                                                            |   0x06 |
| * GetRfid                                                           |   0x17 |
| * GetUserType                                                       |   0x15 |
| * GetWeekdaySchedule                                                |   0x0C |
| * GetYeardaySchedule                                                |   0x0F |
| * LockDoor                                                          |   0x00 |
| * SetHolidaySchedule                                                |   0x11 |
| * SetPin                                                            |   0x05 |
| * SetRfid                                                           |   0x16 |
| * SetUserType                                                       |   0x14 |
| * SetWeekdaySchedule                                                |   0x0B |
| * SetYeardaySchedule                                                |   0x0E |
| * UnlockDoor                                                        |   0x01 |
| * UnlockWithTimeout                                                 |   0x03 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LockState                                                         | 0x0000 |
| * LockType                                                          | 0x0001 |
| * ActuatorEnabled                                                   | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ClearAllPins
 */
class DoorLockClearAllPins : public ModelCommand
{
public:
    DoorLockClearAllPins() : ModelCommand("clear-all-pins") { ModelCommand::AddArguments(); }
    ~DoorLockClearAllPins()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x08) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearAllPins(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearAllPinsResponseCallback>(OnDoorLockClusterClearAllPinsResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command ClearAllRfids
 */
class DoorLockClearAllRfids : public ModelCommand
{
public:
    DoorLockClearAllRfids() : ModelCommand("clear-all-rfids") { ModelCommand::AddArguments(); }
    ~DoorLockClearAllRfids()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x19) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearAllRfids(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearAllRfidsResponseCallback>(OnDoorLockClusterClearAllRfidsResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command ClearHolidaySchedule
 */
class DoorLockClearHolidaySchedule : public ModelCommand
{
public:
    DoorLockClearHolidaySchedule() : ModelCommand("clear-holiday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x13) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearHolidayScheduleResponseCallback>(
            OnDoorLockClusterClearHolidayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
};

/*
 * Command ClearPin
 */
class DoorLockClearPin : public ModelCommand
{
public:
    DoorLockClearPin() : ModelCommand("clear-pin")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x07) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearPinResponseCallback>(OnDoorLockClusterClearPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command ClearRfid
 */
class DoorLockClearRfid : public ModelCommand
{
public:
    DoorLockClearRfid() : ModelCommand("clear-rfid")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x18) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearRfidResponseCallback>(OnDoorLockClusterClearRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command ClearWeekdaySchedule
 */
class DoorLockClearWeekdaySchedule : public ModelCommand
{
public:
    DoorLockClearWeekdaySchedule() : ModelCommand("clear-weekday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0D) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearWeekdayScheduleResponseCallback>(
            OnDoorLockClusterClearWeekdayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command ClearYeardaySchedule
 */
class DoorLockClearYeardaySchedule : public ModelCommand
{
public:
    DoorLockClearYeardaySchedule() : ModelCommand("clear-yearday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockClearYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x10) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterClearYeardayScheduleResponseCallback>(
            OnDoorLockClusterClearYeardayScheduleResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command GetHolidaySchedule
 */
class DoorLockGetHolidaySchedule : public ModelCommand
{
public:
    DoorLockGetHolidaySchedule() : ModelCommand("get-holiday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x12) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetHolidayScheduleResponseCallback>(OnDoorLockClusterGetHolidayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
};

/*
 * Command GetLogRecord
 */
class DoorLockGetLogRecord : public ModelCommand
{
public:
    DoorLockGetLogRecord() : ModelCommand("get-log-record")
    {
        AddArgument("logIndex", 0, UINT16_MAX, &mLogIndex);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetLogRecord()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetLogRecord(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLogIndex);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetLogRecordResponseCallback>(OnDoorLockClusterGetLogRecordResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mLogIndex;
};

/*
 * Command GetPin
 */
class DoorLockGetPin : public ModelCommand
{
public:
    DoorLockGetPin() : ModelCommand("get-pin")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetPinResponseCallback>(OnDoorLockClusterGetPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetRfid
 */
class DoorLockGetRfid : public ModelCommand
{
public:
    DoorLockGetRfid() : ModelCommand("get-rfid")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x17) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetRfidResponseCallback>(OnDoorLockClusterGetRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetUserType
 */
class DoorLockGetUserType : public ModelCommand
{
public:
    DoorLockGetUserType() : ModelCommand("get-user-type")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetUserType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x15) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetUserTypeResponseCallback>(OnDoorLockClusterGetUserTypeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
};

/*
 * Command GetWeekdaySchedule
 */
class DoorLockGetWeekdaySchedule : public ModelCommand
{
public:
    DoorLockGetWeekdaySchedule() : ModelCommand("get-weekday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetWeekdayScheduleResponseCallback>(OnDoorLockClusterGetWeekdayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command GetYeardaySchedule
 */
class DoorLockGetYeardaySchedule : public ModelCommand
{
public:
    DoorLockGetYeardaySchedule() : ModelCommand("get-yearday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        ModelCommand::AddArguments();
    }
    ~DoorLockGetYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0F) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId);
    }

private:
    chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterGetYeardayScheduleResponseCallback>(OnDoorLockClusterGetYeardayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
};

/*
 * Command LockDoor
 */
class DoorLockLockDoor : public ModelCommand
{
public:
    DoorLockLockDoor() : ModelCommand("lock-door")
    {
        AddArgument("pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockLockDoor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.LockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterLockDoorResponseCallback>(OnDoorLockClusterLockDoorResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mPin;
};

/*
 * Command SetHolidaySchedule
 */
class DoorLockSetHolidaySchedule : public ModelCommand
{
public:
    DoorLockSetHolidaySchedule() : ModelCommand("set-holiday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
        AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
        AddArgument("operatingModeDuringHoliday", 0, UINT8_MAX, &mOperatingModeDuringHoliday);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetHolidaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x11) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetHolidaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mLocalStartTime,
                                          mLocalEndTime, mOperatingModeDuringHoliday);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetHolidayScheduleResponseCallback>(OnDoorLockClusterSetHolidayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint32_t mLocalStartTime;
    uint32_t mLocalEndTime;
    uint8_t mOperatingModeDuringHoliday;
};

/*
 * Command SetPin
 */
class DoorLockSetPin : public ModelCommand
{
public:
    DoorLockSetPin() : ModelCommand("set-pin")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
        AddArgument("userType", 0, UINT8_MAX, &mUserType);
        AddArgument("pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetPin()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetPin(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
                              chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterSetPinResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetPinResponseCallback>(OnDoorLockClusterSetPinResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserStatus;
    uint8_t mUserType;
    char * mPin;
};

/*
 * Command SetRfid
 */
class DoorLockSetRfid : public ModelCommand
{
public:
    DoorLockSetRfid() : ModelCommand("set-rfid")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        AddArgument("userStatus", 0, UINT8_MAX, &mUserStatus);
        AddArgument("userType", 0, UINT8_MAX, &mUserType);
        AddArgument("id", &mId);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetRfid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x16) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetRfid(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserStatus, mUserType,
                               chip::ByteSpan(chip::Uint8::from_char(mId), strlen(mId)));
    }

private:
    chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetRfidResponseCallback>(OnDoorLockClusterSetRfidResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserStatus;
    uint8_t mUserType;
    char * mId;
};

/*
 * Command SetUserType
 */
class DoorLockSetUserType : public ModelCommand
{
public:
    DoorLockSetUserType() : ModelCommand("set-user-type")
    {
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        AddArgument("userType", 0, UINT8_MAX, &mUserType);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetUserType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x14) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetUserType(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mUserId, mUserType);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetUserTypeResponseCallback>(OnDoorLockClusterSetUserTypeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mUserId;
    uint8_t mUserType;
};

/*
 * Command SetWeekdaySchedule
 */
class DoorLockSetWeekdaySchedule : public ModelCommand
{
public:
    DoorLockSetWeekdaySchedule() : ModelCommand("set-weekday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        AddArgument("daysMask", 0, UINT8_MAX, &mDaysMask);
        AddArgument("startHour", 0, UINT8_MAX, &mStartHour);
        AddArgument("startMinute", 0, UINT8_MAX, &mStartMinute);
        AddArgument("endHour", 0, UINT8_MAX, &mEndHour);
        AddArgument("endMinute", 0, UINT8_MAX, &mEndMinute);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetWeekdaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0B) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetWeekdaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId, mDaysMask,
                                          mStartHour, mStartMinute, mEndHour, mEndMinute);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetWeekdayScheduleResponseCallback>(OnDoorLockClusterSetWeekdayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
    uint8_t mDaysMask;
    uint8_t mStartHour;
    uint8_t mStartMinute;
    uint8_t mEndHour;
    uint8_t mEndMinute;
};

/*
 * Command SetYeardaySchedule
 */
class DoorLockSetYeardaySchedule : public ModelCommand
{
public:
    DoorLockSetYeardaySchedule() : ModelCommand("set-yearday-schedule")
    {
        AddArgument("scheduleId", 0, UINT8_MAX, &mScheduleId);
        AddArgument("userId", 0, UINT16_MAX, &mUserId);
        AddArgument("localStartTime", 0, UINT32_MAX, &mLocalStartTime);
        AddArgument("localEndTime", 0, UINT32_MAX, &mLocalEndTime);
        ModelCommand::AddArguments();
    }
    ~DoorLockSetYeardaySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x0E) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetYeardaySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mScheduleId, mUserId,
                                          mLocalStartTime, mLocalEndTime);
    }

private:
    chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterSetYeardayScheduleResponseCallback>(OnDoorLockClusterSetYeardayScheduleResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mScheduleId;
    uint16_t mUserId;
    uint32_t mLocalStartTime;
    uint32_t mLocalEndTime;
};

/*
 * Command UnlockDoor
 */
class DoorLockUnlockDoor : public ModelCommand
{
public:
    DoorLockUnlockDoor() : ModelCommand("unlock-door")
    {
        AddArgument("pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockUnlockDoor()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UnlockDoor(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                  chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterUnlockDoorResponseCallback>(OnDoorLockClusterUnlockDoorResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mPin;
};

/*
 * Command UnlockWithTimeout
 */
class DoorLockUnlockWithTimeout : public ModelCommand
{
public:
    DoorLockUnlockWithTimeout() : ModelCommand("unlock-with-timeout")
    {
        AddArgument("timeoutInSeconds", 0, UINT16_MAX, &mTimeoutInSeconds);
        AddArgument("pin", &mPin);
        ModelCommand::AddArguments();
    }
    ~DoorLockUnlockWithTimeout()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UnlockWithTimeout(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutInSeconds,
                                         chip::ByteSpan(chip::Uint8::from_char(mPin), strlen(mPin)));
    }

private:
    chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<DoorLockClusterUnlockWithTimeoutResponseCallback>(OnDoorLockClusterUnlockWithTimeoutResponse,
                                                                                       this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mTimeoutInSeconds;
    char * mPin;
};

/*
 * Discover Attributes
 */
class DiscoverDoorLockAttributes : public ModelCommand
{
public:
    DiscoverDoorLockAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverDoorLockAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LockState
 */
class ReadDoorLockLockState : public ModelCommand
{
public:
    ReadDoorLockLockState() : ModelCommand("read")
    {
        AddArgument("attr-name", "lock-state");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockLockState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportDoorLockLockState : public ModelCommand
{
public:
    ReportDoorLockLockState() : ModelCommand("report")
    {
        AddArgument("attr-name", "lock-state");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportDoorLockLockState()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeLockState(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeLockState(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                   mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute LockType
 */
class ReadDoorLockLockType : public ModelCommand
{
public:
    ReadDoorLockLockType() : ModelCommand("read")
    {
        AddArgument("attr-name", "lock-type");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockLockType()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLockType(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ActuatorEnabled
 */
class ReadDoorLockActuatorEnabled : public ModelCommand
{
public:
    ReadDoorLockActuatorEnabled() : ModelCommand("read")
    {
        AddArgument("attr-name", "actuator-enabled");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockActuatorEnabled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeActuatorEnabled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadDoorLockClusterRevision : public ModelCommand
{
public:
    ReadDoorLockClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadDoorLockClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0101) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::DoorLockCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster GeneralCommissioning                                        | 0x0030 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ArmFailSafe                                                       |   0x00 |
| * CommissioningComplete                                             |   0x04 |
| * SetRegulatoryConfig                                               |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricId                                                          | 0x0000 |
| * Breadcrumb                                                        | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ArmFailSafe
 */
class GeneralCommissioningArmFailSafe : public ModelCommand
{
public:
    GeneralCommissioningArmFailSafe() : ModelCommand("arm-fail-safe")
    {
        AddArgument("expiryLengthSeconds", 0, UINT16_MAX, &mExpiryLengthSeconds);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~GeneralCommissioningArmFailSafe()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ArmFailSafe(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mExpiryLengthSeconds, mBreadcrumb,
                                   mTimeoutMs);
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterArmFailSafeResponseCallback>(
            OnGeneralCommissioningClusterArmFailSafeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mExpiryLengthSeconds;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command CommissioningComplete
 */
class GeneralCommissioningCommissioningComplete : public ModelCommand
{
public:
    GeneralCommissioningCommissioningComplete() : ModelCommand("commissioning-complete") { ModelCommand::AddArguments(); }
    ~GeneralCommissioningCommissioningComplete()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.CommissioningComplete(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterCommissioningCompleteResponseCallback>(
            OnGeneralCommissioningClusterCommissioningCompleteResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command SetRegulatoryConfig
 */
class GeneralCommissioningSetRegulatoryConfig : public ModelCommand
{
public:
    GeneralCommissioningSetRegulatoryConfig() : ModelCommand("set-regulatory-config")
    {
        AddArgument("location", 0, UINT8_MAX, &mLocation);
        AddArgument("countryCode", &mCountryCode);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~GeneralCommissioningSetRegulatoryConfig()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetRegulatoryConfig(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLocation,
                                           chip::ByteSpan(chip::Uint8::from_char(mCountryCode), strlen(mCountryCode)), mBreadcrumb,
                                           mTimeoutMs);
    }

private:
    chip::Callback::Callback<GeneralCommissioningClusterSetRegulatoryConfigResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GeneralCommissioningClusterSetRegulatoryConfigResponseCallback>(
            OnGeneralCommissioningClusterSetRegulatoryConfigResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLocation;
    char * mCountryCode;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Discover Attributes
 */
class DiscoverGeneralCommissioningAttributes : public ModelCommand
{
public:
    DiscoverGeneralCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGeneralCommissioningAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute FabricId
 */
class ReadGeneralCommissioningFabricId : public ModelCommand
{
public:
    ReadGeneralCommissioningFabricId() : ModelCommand("read")
    {
        AddArgument("attr-name", "fabric-id");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningFabricId()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFabricId(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Breadcrumb
 */
class ReadGeneralCommissioningBreadcrumb : public ModelCommand
{
public:
    ReadGeneralCommissioningBreadcrumb() : ModelCommand("read")
    {
        AddArgument("attr-name", "breadcrumb");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningBreadcrumb()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteGeneralCommissioningBreadcrumb : public ModelCommand
{
public:
    WriteGeneralCommissioningBreadcrumb() : ModelCommand("write")
    {
        AddArgument("attr-name", "breadcrumb");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteGeneralCommissioningBreadcrumb()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBreadcrumb(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadGeneralCommissioningClusterRevision : public ModelCommand
{
public:
    ReadGeneralCommissioningClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGeneralCommissioningClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0030) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GeneralCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster GroupKeyManagement                                          | 0xF004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Groups                                                            | 0x0000 |
| * GroupKeys                                                         | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverGroupKeyManagementAttributes : public ModelCommand
{
public:
    DiscoverGroupKeyManagementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGroupKeyManagementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Groups
 */
class ReadGroupKeyManagementGroups : public ModelCommand
{
public:
    ReadGroupKeyManagementGroups() : ModelCommand("read")
    {
        AddArgument("attr-name", "groups");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementGroups()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GroupKeyManagementGroupsListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupKeyManagementGroupsListAttributeCallback>(OnGroupKeyManagementGroupsListAttributeResponse,
                                                                                    this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute GroupKeys
 */
class ReadGroupKeyManagementGroupKeys : public ModelCommand
{
public:
    ReadGroupKeyManagementGroupKeys() : ModelCommand("read")
    {
        AddArgument("attr-name", "group-keys");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementGroupKeys()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeGroupKeys(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<GroupKeyManagementGroupKeysListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupKeyManagementGroupKeysListAttributeCallback>(
            OnGroupKeyManagementGroupKeysListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadGroupKeyManagementClusterRevision : public ModelCommand
{
public:
    ReadGroupKeyManagementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGroupKeyManagementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0xF004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupKeyManagementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Groups                                                      | 0x0004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddGroup                                                          |   0x00 |
| * AddGroupIfIdentifying                                             |   0x05 |
| * GetGroupMembership                                                |   0x02 |
| * RemoveAllGroups                                                   |   0x04 |
| * RemoveGroup                                                       |   0x03 |
| * ViewGroup                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NameSupport                                                       | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddGroup
 */
class GroupsAddGroup : public ModelCommand
{
public:
    GroupsAddGroup() : ModelCommand("add-group")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("groupName", &mGroupName);
        ModelCommand::AddArguments();
    }
    ~GroupsAddGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
                                chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
    }

private:
    chip::Callback::Callback<GroupsClusterAddGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterAddGroupResponseCallback>(OnGroupsClusterAddGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    char * mGroupName;
};

/*
 * Command AddGroupIfIdentifying
 */
class GroupsAddGroupIfIdentifying : public ModelCommand
{
public:
    GroupsAddGroupIfIdentifying() : ModelCommand("add-group-if-identifying")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("groupName", &mGroupName);
        ModelCommand::AddArguments();
    }
    ~GroupsAddGroupIfIdentifying()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddGroupIfIdentifying(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId,
                                             chip::ByteSpan(chip::Uint8::from_char(mGroupName), strlen(mGroupName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    char * mGroupName;
};

/*
 * Command GetGroupMembership
 */
class GroupsGetGroupMembership : public ModelCommand
{
public:
    GroupsGetGroupMembership() : ModelCommand("get-group-membership")
    {
        AddArgument("groupCount", 0, UINT8_MAX, &mGroupCount);
        AddArgument("groupList", 0, UINT16_MAX, &mGroupList);
        ModelCommand::AddArguments();
    }
    ~GroupsGetGroupMembership()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetGroupMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupCount, mGroupList);
    }

private:
    chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterGetGroupMembershipResponseCallback>(OnGroupsClusterGetGroupMembershipResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mGroupCount;
    uint16_t mGroupList;
};

/*
 * Command RemoveAllGroups
 */
class GroupsRemoveAllGroups : public ModelCommand
{
public:
    GroupsRemoveAllGroups() : ModelCommand("remove-all-groups") { ModelCommand::AddArguments(); }
    ~GroupsRemoveAllGroups()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveAllGroups(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command RemoveGroup
 */
class GroupsRemoveGroup : public ModelCommand
{
public:
    GroupsRemoveGroup() : ModelCommand("remove-group")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~GroupsRemoveGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterRemoveGroupResponseCallback>(OnGroupsClusterRemoveGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command ViewGroup
 */
class GroupsViewGroup : public ModelCommand
{
public:
    GroupsViewGroup() : ModelCommand("view-group")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~GroupsViewGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ViewGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<GroupsClusterViewGroupResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<GroupsClusterViewGroupResponseCallback>(OnGroupsClusterViewGroupResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Discover Attributes
 */
class DiscoverGroupsAttributes : public ModelCommand
{
public:
    DiscoverGroupsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverGroupsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NameSupport
 */
class ReadGroupsNameSupport : public ModelCommand
{
public:
    ReadGroupsNameSupport() : ModelCommand("read")
    {
        AddArgument("attr-name", "name-support");
        ModelCommand::AddArguments();
    }

    ~ReadGroupsNameSupport()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadGroupsClusterRevision : public ModelCommand
{
public:
    ReadGroupsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadGroupsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0004) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::GroupsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Identify                                                    | 0x0003 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Identify                                                          |   0x00 |
| * IdentifyQuery                                                     |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * IdentifyTime                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Identify
 */
class IdentifyIdentify : public ModelCommand
{
public:
    IdentifyIdentify() : ModelCommand("identify")
    {
        AddArgument("identifyTime", 0, UINT16_MAX, &mIdentifyTime);
        ModelCommand::AddArguments();
    }
    ~IdentifyIdentify()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Identify(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIdentifyTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mIdentifyTime;
};

/*
 * Command IdentifyQuery
 */
class IdentifyIdentifyQuery : public ModelCommand
{
public:
    IdentifyIdentifyQuery() : ModelCommand("identify-query") { ModelCommand::AddArguments(); }
    ~IdentifyIdentifyQuery()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.IdentifyQuery(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<IdentifyClusterIdentifyQueryResponseCallback>(OnIdentifyClusterIdentifyQueryResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverIdentifyAttributes : public ModelCommand
{
public:
    DiscoverIdentifyAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverIdentifyAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute IdentifyTime
 */
class ReadIdentifyIdentifyTime : public ModelCommand
{
public:
    ReadIdentifyIdentifyTime() : ModelCommand("read")
    {
        AddArgument("attr-name", "identify-time");
        ModelCommand::AddArguments();
    }

    ~ReadIdentifyIdentifyTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteIdentifyIdentifyTime : public ModelCommand
{
public:
    WriteIdentifyIdentifyTime() : ModelCommand("write")
    {
        AddArgument("attr-name", "identify-time");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteIdentifyIdentifyTime()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeIdentifyTime(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadIdentifyClusterRevision : public ModelCommand
{
public:
    ReadIdentifyClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadIdentifyClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0003) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::IdentifyCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster KeypadInput                                                 | 0x0509 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * SendKey                                                           |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command SendKey
 */
class KeypadInputSendKey : public ModelCommand
{
public:
    KeypadInputSendKey() : ModelCommand("send-key")
    {
        AddArgument("keyCode", 0, UINT8_MAX, &mKeyCode);
        ModelCommand::AddArguments();
    }
    ~KeypadInputSendKey()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0509) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SendKey(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mKeyCode);
    }

private:
    chip::Callback::Callback<KeypadInputClusterSendKeyResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<KeypadInputClusterSendKeyResponseCallback>(OnKeypadInputClusterSendKeyResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mKeyCode;
};

/*
 * Discover Attributes
 */
class DiscoverKeypadInputAttributes : public ModelCommand
{
public:
    DiscoverKeypadInputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverKeypadInputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadKeypadInputClusterRevision : public ModelCommand
{
public:
    ReadKeypadInputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadKeypadInputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0509) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::KeypadInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster LevelControl                                                | 0x0008 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Move                                                              |   0x01 |
| * MoveToLevel                                                       |   0x00 |
| * MoveToLevelWithOnOff                                              |   0x04 |
| * MoveWithOnOff                                                     |   0x05 |
| * Step                                                              |   0x02 |
| * StepWithOnOff                                                     |   0x06 |
| * Stop                                                              |   0x03 |
| * StopWithOnOff                                                     |   0x07 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentLevel                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Move
 */
class LevelControlMove : public ModelCommand
{
public:
    LevelControlMove() : ModelCommand("move")
    {
        AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("rate", 0, UINT8_MAX, &mRate);
        AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlMove()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Move(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate, mOptionMask,
                            mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command MoveToLevel
 */
class LevelControlMoveToLevel : public ModelCommand
{
public:
    LevelControlMoveToLevel() : ModelCommand("move-to-level")
    {
        AddArgument("level", 0, UINT8_MAX, &mLevel);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveToLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime, mOptionMask,
                                   mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLevel;
    uint16_t mTransitionTime;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command MoveToLevelWithOnOff
 */
class LevelControlMoveToLevelWithOnOff : public ModelCommand
{
public:
    LevelControlMoveToLevelWithOnOff() : ModelCommand("move-to-level-with-on-off")
    {
        AddArgument("level", 0, UINT8_MAX, &mLevel);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveToLevelWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveToLevelWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mLevel, mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mLevel;
    uint16_t mTransitionTime;
};

/*
 * Command MoveWithOnOff
 */
class LevelControlMoveWithOnOff : public ModelCommand
{
public:
    LevelControlMoveWithOnOff() : ModelCommand("move-with-on-off")
    {
        AddArgument("moveMode", 0, UINT8_MAX, &mMoveMode);
        AddArgument("rate", 0, UINT8_MAX, &mRate);
        ModelCommand::AddArguments();
    }
    ~LevelControlMoveWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MoveWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMoveMode, mRate);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMoveMode;
    uint8_t mRate;
};

/*
 * Command Step
 */
class LevelControlStep : public ModelCommand
{
public:
    LevelControlStep() : ModelCommand("step")
    {
        AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlStep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Step(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize, mTransitionTime,
                            mOptionMask, mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint16_t mTransitionTime;
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command StepWithOnOff
 */
class LevelControlStepWithOnOff : public ModelCommand
{
public:
    LevelControlStepWithOnOff() : ModelCommand("step-with-on-off")
    {
        AddArgument("stepMode", 0, UINT8_MAX, &mStepMode);
        AddArgument("stepSize", 0, UINT8_MAX, &mStepSize);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~LevelControlStepWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StepWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mStepMode, mStepSize,
                                     mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mStepMode;
    uint8_t mStepSize;
    uint16_t mTransitionTime;
};

/*
 * Command Stop
 */
class LevelControlStop : public ModelCommand
{
public:
    LevelControlStop() : ModelCommand("stop")
    {
        AddArgument("optionMask", 0, UINT8_MAX, &mOptionMask);
        AddArgument("optionOverride", 0, UINT8_MAX, &mOptionOverride);
        ModelCommand::AddArguments();
    }
    ~LevelControlStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Stop(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mOptionMask, mOptionOverride);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mOptionMask;
    uint8_t mOptionOverride;
};

/*
 * Command StopWithOnOff
 */
class LevelControlStopWithOnOff : public ModelCommand
{
public:
    LevelControlStopWithOnOff() : ModelCommand("stop-with-on-off") { ModelCommand::AddArguments(); }
    ~LevelControlStopWithOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x07) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StopWithOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverLevelControlAttributes : public ModelCommand
{
public:
    DiscoverLevelControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverLevelControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentLevel
 */
class ReadLevelControlCurrentLevel : public ModelCommand
{
public:
    ReadLevelControlCurrentLevel() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-level");
        ModelCommand::AddArguments();
    }

    ~ReadLevelControlCurrentLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportLevelControlCurrentLevel : public ModelCommand
{
public:
    ReportLevelControlCurrentLevel() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-level");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportLevelControlCurrentLevel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentLevel(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentLevel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                      mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute ClusterRevision
 */
class ReadLevelControlClusterRevision : public ModelCommand
{
public:
    ReadLevelControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadLevelControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0008) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::LevelControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster LowPower                                                    | 0x0508 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Sleep                                                             |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Sleep
 */
class LowPowerSleep : public ModelCommand
{
public:
    LowPowerSleep() : ModelCommand("sleep") { ModelCommand::AddArguments(); }
    ~LowPowerSleep()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Sleep(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverLowPowerAttributes : public ModelCommand
{
public:
    DiscoverLowPowerAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverLowPowerAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadLowPowerClusterRevision : public ModelCommand
{
public:
    ReadLowPowerClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadLowPowerClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0508) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::LowPowerCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster MediaInput                                                  | 0x0507 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * HideInputStatus                                                   |   0x02 |
| * RenameInput                                                       |   0x03 |
| * SelectInput                                                       |   0x00 |
| * ShowInputStatus                                                   |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MediaInputList                                                    | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command HideInputStatus
 */
class MediaInputHideInputStatus : public ModelCommand
{
public:
    MediaInputHideInputStatus() : ModelCommand("hide-input-status") { ModelCommand::AddArguments(); }
    ~MediaInputHideInputStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.HideInputStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command RenameInput
 */
class MediaInputRenameInput : public ModelCommand
{
public:
    MediaInputRenameInput() : ModelCommand("rename-input")
    {
        AddArgument("index", 0, UINT8_MAX, &mIndex);
        AddArgument("name", &mName);
        ModelCommand::AddArguments();
    }
    ~MediaInputRenameInput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RenameInput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex,
                                   chip::ByteSpan(chip::Uint8::from_char(mName), strlen(mName)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
    char * mName;
};

/*
 * Command SelectInput
 */
class MediaInputSelectInput : public ModelCommand
{
public:
    MediaInputSelectInput() : ModelCommand("select-input")
    {
        AddArgument("index", 0, UINT8_MAX, &mIndex);
        ModelCommand::AddArguments();
    }
    ~MediaInputSelectInput()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SelectInput(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mIndex);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mIndex;
};

/*
 * Command ShowInputStatus
 */
class MediaInputShowInputStatus : public ModelCommand
{
public:
    MediaInputShowInputStatus() : ModelCommand("show-input-status") { ModelCommand::AddArguments(); }
    ~MediaInputShowInputStatus()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ShowInputStatus(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverMediaInputAttributes : public ModelCommand
{
public:
    DiscoverMediaInputAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverMediaInputAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MediaInputList
 */
class ReadMediaInputMediaInputList : public ModelCommand
{
public:
    ReadMediaInputMediaInputList() : ModelCommand("read")
    {
        AddArgument("attr-name", "media-input-list");
        ModelCommand::AddArguments();
    }

    ~ReadMediaInputMediaInputList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMediaInputList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadMediaInputClusterRevision : public ModelCommand
{
public:
    ReadMediaInputClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadMediaInputClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0507) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaInputCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster MediaPlayback                                               | 0x0506 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MediaFastForward                                                  |   0x07 |
| * MediaNext                                                         |   0x05 |
| * MediaPause                                                        |   0x01 |
| * MediaPlay                                                         |   0x00 |
| * MediaPrevious                                                     |   0x04 |
| * MediaRewind                                                       |   0x06 |
| * MediaSkipBackward                                                 |   0x09 |
| * MediaSkipForward                                                  |   0x08 |
| * MediaSkipSeek                                                     |   0x0A |
| * MediaStartOver                                                    |   0x03 |
| * MediaStop                                                         |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command MediaFastForward
 */
class MediaPlaybackMediaFastForward : public ModelCommand
{
public:
    MediaPlaybackMediaFastForward() : ModelCommand("media-fast-forward") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaFastForward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x07) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaFastForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaFastForwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaFastForwardResponseCallback>(
            OnMediaPlaybackClusterMediaFastForwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaNext
 */
class MediaPlaybackMediaNext : public ModelCommand
{
public:
    MediaPlaybackMediaNext() : ModelCommand("media-next") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaNext()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaNext(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaNextResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaNextResponseCallback>(OnMediaPlaybackClusterMediaNextResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPause
 */
class MediaPlaybackMediaPause : public ModelCommand
{
public:
    MediaPlaybackMediaPause() : ModelCommand("media-pause") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPause()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPause(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPauseResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPauseResponseCallback>(OnMediaPlaybackClusterMediaPauseResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPlay
 */
class MediaPlaybackMediaPlay : public ModelCommand
{
public:
    MediaPlaybackMediaPlay() : ModelCommand("media-play") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPlay()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPlay(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPlayResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPlayResponseCallback>(OnMediaPlaybackClusterMediaPlayResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaPrevious
 */
class MediaPlaybackMediaPrevious : public ModelCommand
{
public:
    MediaPlaybackMediaPrevious() : ModelCommand("media-previous") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaPrevious()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaPrevious(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaPreviousResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaPreviousResponseCallback>(OnMediaPlaybackClusterMediaPreviousResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaRewind
 */
class MediaPlaybackMediaRewind : public ModelCommand
{
public:
    MediaPlaybackMediaRewind() : ModelCommand("media-rewind") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaRewind()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaRewind(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaRewindResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaRewindResponseCallback>(OnMediaPlaybackClusterMediaRewindResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaSkipBackward
 */
class MediaPlaybackMediaSkipBackward : public ModelCommand
{
public:
    MediaPlaybackMediaSkipBackward() : ModelCommand("media-skip-backward")
    {
        AddArgument("deltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSkipBackward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x09) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSkipBackward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSkipBackwardResponseCallback>(
            OnMediaPlaybackClusterMediaSkipBackwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mDeltaPositionMilliseconds;
};

/*
 * Command MediaSkipForward
 */
class MediaPlaybackMediaSkipForward : public ModelCommand
{
public:
    MediaPlaybackMediaSkipForward() : ModelCommand("media-skip-forward")
    {
        AddArgument("deltaPositionMilliseconds", 0, UINT64_MAX, &mDeltaPositionMilliseconds);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSkipForward()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x08) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSkipForward(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDeltaPositionMilliseconds);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSkipForwardResponseCallback>(
            OnMediaPlaybackClusterMediaSkipForwardResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mDeltaPositionMilliseconds;
};

/*
 * Command MediaSkipSeek
 */
class MediaPlaybackMediaSkipSeek : public ModelCommand
{
public:
    MediaPlaybackMediaSkipSeek() : ModelCommand("media-skip-seek")
    {
        AddArgument("position", 0, UINT64_MAX, &mPosition);
        ModelCommand::AddArguments();
    }
    ~MediaPlaybackMediaSkipSeek()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x0A) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaSkipSeek(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mPosition);
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaSkipSeekResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaSkipSeekResponseCallback>(OnMediaPlaybackClusterMediaSkipSeekResponse,
                                                                                        this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mPosition;
};

/*
 * Command MediaStartOver
 */
class MediaPlaybackMediaStartOver : public ModelCommand
{
public:
    MediaPlaybackMediaStartOver() : ModelCommand("media-start-over") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaStartOver()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaStartOver(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaStartOverResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaStartOverResponseCallback>(
            OnMediaPlaybackClusterMediaStartOverResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command MediaStop
 */
class MediaPlaybackMediaStop : public ModelCommand
{
public:
    MediaPlaybackMediaStop() : ModelCommand("media-stop") { ModelCommand::AddArguments(); }
    ~MediaPlaybackMediaStop()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.MediaStop(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<MediaPlaybackClusterMediaStopResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<MediaPlaybackClusterMediaStopResponseCallback>(OnMediaPlaybackClusterMediaStopResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverMediaPlaybackAttributes : public ModelCommand
{
public:
    DiscoverMediaPlaybackAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverMediaPlaybackAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadMediaPlaybackClusterRevision : public ModelCommand
{
public:
    ReadMediaPlaybackClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadMediaPlaybackClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0506) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::MediaPlaybackCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster NetworkCommissioning                                        | 0x0031 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddThreadNetwork                                                  |   0x06 |
| * AddWiFiNetwork                                                    |   0x02 |
| * DisableNetwork                                                    |   0x0E |
| * EnableNetwork                                                     |   0x0C |
| * GetLastNetworkCommissioningResult                                 |   0x10 |
| * RemoveNetwork                                                     |   0x0A |
| * ScanNetworks                                                      |   0x00 |
| * UpdateThreadNetwork                                               |   0x08 |
| * UpdateWiFiNetwork                                                 |   0x04 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddThreadNetwork
 */
class NetworkCommissioningAddThreadNetwork : public ModelCommand
{
public:
    NetworkCommissioningAddThreadNetwork() : ModelCommand("add-thread-network")
    {
        AddArgument("operationalDataset", &mOperationalDataset);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningAddThreadNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddThreadNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                        chip::ByteSpan(chip::Uint8::from_char(mOperationalDataset), strlen(mOperationalDataset)),
                                        mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterAddThreadNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterAddThreadNetworkResponseCallback>(
            OnNetworkCommissioningClusterAddThreadNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mOperationalDataset;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command AddWiFiNetwork
 */
class NetworkCommissioningAddWiFiNetwork : public ModelCommand
{
public:
    NetworkCommissioningAddWiFiNetwork() : ModelCommand("add-wi-fi-network")
    {
        AddArgument("ssid", &mSsid);
        AddArgument("credentials", &mCredentials);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningAddWiFiNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddWiFiNetwork(
            onSuccessCallback->Cancel(), onFailureCallback->Cancel(), chip::ByteSpan(chip::Uint8::from_char(mSsid), strlen(mSsid)),
            chip::ByteSpan(chip::Uint8::from_char(mCredentials), strlen(mCredentials)), mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterAddWiFiNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterAddWiFiNetworkResponseCallback>(
            OnNetworkCommissioningClusterAddWiFiNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mSsid;
    char * mCredentials;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command DisableNetwork
 */
class NetworkCommissioningDisableNetwork : public ModelCommand
{
public:
    NetworkCommissioningDisableNetwork() : ModelCommand("disable-network")
    {
        AddArgument("networkID", &mNetworkID);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningDisableNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0E) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DisableNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                      chip::ByteSpan(chip::Uint8::from_char(mNetworkID), strlen(mNetworkID)), mBreadcrumb,
                                      mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterDisableNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterDisableNetworkResponseCallback>(
            OnNetworkCommissioningClusterDisableNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command EnableNetwork
 */
class NetworkCommissioningEnableNetwork : public ModelCommand
{
public:
    NetworkCommissioningEnableNetwork() : ModelCommand("enable-network")
    {
        AddArgument("networkID", &mNetworkID);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningEnableNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.EnableNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                     chip::ByteSpan(chip::Uint8::from_char(mNetworkID), strlen(mNetworkID)), mBreadcrumb,
                                     mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterEnableNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterEnableNetworkResponseCallback>(
            OnNetworkCommissioningClusterEnableNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command GetLastNetworkCommissioningResult
 */
class NetworkCommissioningGetLastNetworkCommissioningResult : public ModelCommand
{
public:
    NetworkCommissioningGetLastNetworkCommissioningResult() : ModelCommand("get-last-network-commissioning-result")
    {
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningGetLastNetworkCommissioningResult()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x10) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetLastNetworkCommissioningResult(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTimeoutMs);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mTimeoutMs;
};

/*
 * Command RemoveNetwork
 */
class NetworkCommissioningRemoveNetwork : public ModelCommand
{
public:
    NetworkCommissioningRemoveNetwork() : ModelCommand("remove-network")
    {
        AddArgument("networkID", &mNetworkID);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningRemoveNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x0A) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                     chip::ByteSpan(chip::Uint8::from_char(mNetworkID), strlen(mNetworkID)), mBreadcrumb,
                                     mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterRemoveNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterRemoveNetworkResponseCallback>(
            OnNetworkCommissioningClusterRemoveNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mNetworkID;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command ScanNetworks
 */
class NetworkCommissioningScanNetworks : public ModelCommand
{
public:
    NetworkCommissioningScanNetworks() : ModelCommand("scan-networks")
    {
        AddArgument("ssid", &mSsid);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningScanNetworks()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ScanNetworks(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                    chip::ByteSpan(chip::Uint8::from_char(mSsid), strlen(mSsid)), mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterScanNetworksResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterScanNetworksResponseCallback>(
            OnNetworkCommissioningClusterScanNetworksResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mSsid;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command UpdateThreadNetwork
 */
class NetworkCommissioningUpdateThreadNetwork : public ModelCommand
{
public:
    NetworkCommissioningUpdateThreadNetwork() : ModelCommand("update-thread-network")
    {
        AddArgument("operationalDataset", &mOperationalDataset);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningUpdateThreadNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x08) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateThreadNetwork(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                           chip::ByteSpan(chip::Uint8::from_char(mOperationalDataset), strlen(mOperationalDataset)),
                                           mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterUpdateThreadNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterUpdateThreadNetworkResponseCallback>(
            OnNetworkCommissioningClusterUpdateThreadNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mOperationalDataset;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Command UpdateWiFiNetwork
 */
class NetworkCommissioningUpdateWiFiNetwork : public ModelCommand
{
public:
    NetworkCommissioningUpdateWiFiNetwork() : ModelCommand("update-wi-fi-network")
    {
        AddArgument("ssid", &mSsid);
        AddArgument("credentials", &mCredentials);
        AddArgument("breadcrumb", 0, UINT64_MAX, &mBreadcrumb);
        AddArgument("timeoutMs", 0, UINT32_MAX, &mTimeoutMs);
        ModelCommand::AddArguments();
    }
    ~NetworkCommissioningUpdateWiFiNetwork()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateWiFiNetwork(
            onSuccessCallback->Cancel(), onFailureCallback->Cancel(), chip::ByteSpan(chip::Uint8::from_char(mSsid), strlen(mSsid)),
            chip::ByteSpan(chip::Uint8::from_char(mCredentials), strlen(mCredentials)), mBreadcrumb, mTimeoutMs);
    }

private:
    chip::Callback::Callback<NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<NetworkCommissioningClusterUpdateWiFiNetworkResponseCallback>(
            OnNetworkCommissioningClusterUpdateWiFiNetworkResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mSsid;
    char * mCredentials;
    uint64_t mBreadcrumb;
    uint32_t mTimeoutMs;
};

/*
 * Discover Attributes
 */
class DiscoverNetworkCommissioningAttributes : public ModelCommand
{
public:
    DiscoverNetworkCommissioningAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverNetworkCommissioningAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadNetworkCommissioningClusterRevision : public ModelCommand
{
public:
    ReadNetworkCommissioningClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadNetworkCommissioningClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0031) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::NetworkCommissioningCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OnOff                                                       | 0x0006 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Off                                                               |   0x00 |
| * On                                                                |   0x01 |
| * Toggle                                                            |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * OnOff                                                             | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Off
 */
class OnOffOff : public ModelCommand
{
public:
    OnOffOff() : ModelCommand("off") { ModelCommand::AddArguments(); }
    ~OnOffOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Off(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command On
 */
class OnOffOn : public ModelCommand
{
public:
    OnOffOn() : ModelCommand("on") { ModelCommand::AddArguments(); }
    ~OnOffOn()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.On(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command Toggle
 */
class OnOffToggle : public ModelCommand
{
public:
    OnOffToggle() : ModelCommand("toggle") { ModelCommand::AddArguments(); }
    ~OnOffToggle()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Toggle(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverOnOffAttributes : public ModelCommand
{
public:
    DiscoverOnOffAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOnOffAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute OnOff
 */
class ReadOnOffOnOff : public ModelCommand
{
public:
    ReadOnOffOnOff() : ModelCommand("read")
    {
        AddArgument("attr-name", "on-off");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportOnOffOnOff : public ModelCommand
{
public:
    ReportOnOffOnOff() : ModelCommand("report")
    {
        AddArgument("attr-name", "on-off");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        ModelCommand::AddArguments();
    }

    ~ReportOnOffOnOff()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeOnOff(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeOnOff(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                               mMaxInterval);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<BooleanAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
};

/*
 * Attribute ClusterRevision
 */
class ReadOnOffClusterRevision : public ModelCommand
{
public:
    ReadOnOffClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOnOffClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0006) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OnOffCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster OperationalCredentials                                      | 0x003E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RemoveFabric                                                      |   0x0A |
| * SetFabric                                                         |   0x00 |
| * UpdateFabricLabel                                                 |   0x09 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricsList                                                       | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command RemoveFabric
 */
class OperationalCredentialsRemoveFabric : public ModelCommand
{
public:
    OperationalCredentialsRemoveFabric() : ModelCommand("remove-fabric")
    {
        AddArgument("fabricId", 0, UINT64_MAX, &mFabricId);
        AddArgument("nodeId", 0, UINT64_MAX, &mNodeId);
        AddArgument("vendorId", 0, UINT16_MAX, &mVendorId);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsRemoveFabric()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x0A) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mFabricId, mNodeId, mVendorId);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::FabricId mFabricId;
    chip::NodeId mNodeId;
    uint16_t mVendorId;
};

/*
 * Command SetFabric
 */
class OperationalCredentialsSetFabric : public ModelCommand
{
public:
    OperationalCredentialsSetFabric() : ModelCommand("set-fabric")
    {
        AddArgument("vendorId", 0, UINT16_MAX, &mVendorId);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsSetFabric()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetFabric(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mVendorId);
    }

private:
    chip::Callback::Callback<OperationalCredentialsClusterSetFabricResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsClusterSetFabricResponseCallback>(
            OnOperationalCredentialsClusterSetFabricResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mVendorId;
};

/*
 * Command UpdateFabricLabel
 */
class OperationalCredentialsUpdateFabricLabel : public ModelCommand
{
public:
    OperationalCredentialsUpdateFabricLabel() : ModelCommand("update-fabric-label")
    {
        AddArgument("label", &mLabel);
        ModelCommand::AddArguments();
    }
    ~OperationalCredentialsUpdateFabricLabel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x09) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.UpdateFabricLabel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                         chip::ByteSpan(chip::Uint8::from_char(mLabel), strlen(mLabel)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mLabel;
};

/*
 * Discover Attributes
 */
class DiscoverOperationalCredentialsAttributes : public ModelCommand
{
public:
    DiscoverOperationalCredentialsAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverOperationalCredentialsAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute FabricsList
 */
class ReadOperationalCredentialsFabricsList : public ModelCommand
{
public:
    ReadOperationalCredentialsFabricsList() : ModelCommand("read")
    {
        AddArgument("attr-name", "fabrics-list");
        ModelCommand::AddArguments();
    }

    ~ReadOperationalCredentialsFabricsList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeFabricsList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<OperationalCredentialsFabricsListListAttributeCallback>(
            OnOperationalCredentialsFabricsListListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadOperationalCredentialsClusterRevision : public ModelCommand
{
public:
    ReadOperationalCredentialsClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadOperationalCredentialsClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003E) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::OperationalCredentialsCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster PumpConfigurationAndControl                                 | 0x0200 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MaxPressure                                                       | 0x0000 |
| * MaxSpeed                                                          | 0x0001 |
| * MaxFlow                                                           | 0x0002 |
| * EffectiveOperationMode                                            | 0x0011 |
| * EffectiveControlMode                                              | 0x0012 |
| * Capacity                                                          | 0x0013 |
| * OperationMode                                                     | 0x0020 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverPumpConfigurationAndControlAttributes : public ModelCommand
{
public:
    DiscoverPumpConfigurationAndControlAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverPumpConfigurationAndControlAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxPressure
 */
class ReadPumpConfigurationAndControlMaxPressure : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxPressure() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-pressure");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxPressure()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxPressure(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxSpeed
 */
class ReadPumpConfigurationAndControlMaxSpeed : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxSpeed() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-speed");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxSpeed()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxSpeed(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxFlow
 */
class ReadPumpConfigurationAndControlMaxFlow : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlMaxFlow() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-flow");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlMaxFlow()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxFlow(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EffectiveOperationMode
 */
class ReadPumpConfigurationAndControlEffectiveOperationMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlEffectiveOperationMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "effective-operation-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlEffectiveOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEffectiveOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute EffectiveControlMode
 */
class ReadPumpConfigurationAndControlEffectiveControlMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlEffectiveControlMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "effective-control-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlEffectiveControlMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEffectiveControlMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Capacity
 */
class ReadPumpConfigurationAndControlCapacity : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlCapacity() : ModelCommand("read")
    {
        AddArgument("attr-name", "capacity");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlCapacity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCapacity(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportPumpConfigurationAndControlCapacity : public ModelCommand
{
public:
    ReportPumpConfigurationAndControlCapacity() : ModelCommand("report")
    {
        AddArgument("attr-name", "capacity");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportPumpConfigurationAndControlCapacity()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCapacity(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCapacity(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                  mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute OperationMode
 */
class ReadPumpConfigurationAndControlOperationMode : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlOperationMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "operation-mode");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WritePumpConfigurationAndControlOperationMode : public ModelCommand
{
public:
    WritePumpConfigurationAndControlOperationMode() : ModelCommand("write")
    {
        AddArgument("attr-name", "operation-mode");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WritePumpConfigurationAndControlOperationMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOperationMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadPumpConfigurationAndControlClusterRevision : public ModelCommand
{
public:
    ReadPumpConfigurationAndControlClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadPumpConfigurationAndControlClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0200) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::PumpConfigurationAndControlCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Scenes                                                      | 0x0005 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddScene                                                          |   0x00 |
| * GetSceneMembership                                                |   0x06 |
| * RecallScene                                                       |   0x05 |
| * RemoveAllScenes                                                   |   0x03 |
| * RemoveScene                                                       |   0x02 |
| * StoreScene                                                        |   0x04 |
| * ViewScene                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * SceneCount                                                        | 0x0000 |
| * CurrentScene                                                      | 0x0001 |
| * CurrentGroup                                                      | 0x0002 |
| * SceneValid                                                        | 0x0003 |
| * NameSupport                                                       | 0x0004 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command AddScene
 */
class ScenesAddScene : public ModelCommand
{
public:
    ScenesAddScene() : ModelCommand("add-scene")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        AddArgument("sceneName", &mSceneName);
        AddArgument("clusterId", 0, UINT16_MAX, &mClusterId);
        AddArgument("length", 0, UINT8_MAX, &mLength);
        AddArgument("value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }
    ~ScenesAddScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.AddScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime,
                                chip::ByteSpan(chip::Uint8::from_char(mSceneName), strlen(mSceneName)), mClusterId, mLength,
                                mValue);
    }

private:
    chip::Callback::Callback<ScenesClusterAddSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterAddSceneResponseCallback>(OnScenesClusterAddSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
    uint16_t mTransitionTime;
    char * mSceneName;
    chip::ClusterId mClusterId;
    uint8_t mLength;
    uint8_t mValue;
};

/*
 * Command GetSceneMembership
 */
class ScenesGetSceneMembership : public ModelCommand
{
public:
    ScenesGetSceneMembership() : ModelCommand("get-scene-membership")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~ScenesGetSceneMembership()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetSceneMembership(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterGetSceneMembershipResponseCallback>(OnScenesClusterGetSceneMembershipResponse,
                                                                                      this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command RecallScene
 */
class ScenesRecallScene : public ModelCommand
{
public:
    ScenesRecallScene() : ModelCommand("recall-scene")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
        AddArgument("transitionTime", 0, UINT16_MAX, &mTransitionTime);
        ModelCommand::AddArguments();
    }
    ~ScenesRecallScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x05) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RecallScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId, mTransitionTime);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
    uint16_t mTransitionTime;
};

/*
 * Command RemoveAllScenes
 */
class ScenesRemoveAllScenes : public ModelCommand
{
public:
    ScenesRemoveAllScenes() : ModelCommand("remove-all-scenes")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        ModelCommand::AddArguments();
    }
    ~ScenesRemoveAllScenes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveAllScenes(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId);
    }

private:
    chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterRemoveAllScenesResponseCallback>(OnScenesClusterRemoveAllScenesResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
};

/*
 * Command RemoveScene
 */
class ScenesRemoveScene : public ModelCommand
{
public:
    ScenesRemoveScene() : ModelCommand("remove-scene")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesRemoveScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.RemoveScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterRemoveSceneResponseCallback>(OnScenesClusterRemoveSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Command StoreScene
 */
class ScenesStoreScene : public ModelCommand
{
public:
    ScenesStoreScene() : ModelCommand("store-scene")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesStoreScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.StoreScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterStoreSceneResponseCallback>(OnScenesClusterStoreSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Command ViewScene
 */
class ScenesViewScene : public ModelCommand
{
public:
    ScenesViewScene() : ModelCommand("view-scene")
    {
        AddArgument("groupId", 0, UINT16_MAX, &mGroupId);
        AddArgument("sceneId", 0, UINT8_MAX, &mSceneId);
        ModelCommand::AddArguments();
    }
    ~ScenesViewScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ViewScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mGroupId, mSceneId);
    }

private:
    chip::Callback::Callback<ScenesClusterViewSceneResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<ScenesClusterViewSceneResponseCallback>(OnScenesClusterViewSceneResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mGroupId;
    uint8_t mSceneId;
};

/*
 * Discover Attributes
 */
class DiscoverScenesAttributes : public ModelCommand
{
public:
    DiscoverScenesAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverScenesAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SceneCount
 */
class ReadScenesSceneCount : public ModelCommand
{
public:
    ReadScenesSceneCount() : ModelCommand("read")
    {
        AddArgument("attr-name", "scene-count");
        ModelCommand::AddArguments();
    }

    ~ReadScenesSceneCount()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSceneCount(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentScene
 */
class ReadScenesCurrentScene : public ModelCommand
{
public:
    ReadScenesCurrentScene() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-scene");
        ModelCommand::AddArguments();
    }

    ~ReadScenesCurrentScene()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentScene(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentGroup
 */
class ReadScenesCurrentGroup : public ModelCommand
{
public:
    ReadScenesCurrentGroup() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-group");
        ModelCommand::AddArguments();
    }

    ~ReadScenesCurrentGroup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentGroup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute SceneValid
 */
class ReadScenesSceneValid : public ModelCommand
{
public:
    ReadScenesSceneValid() : ModelCommand("read")
    {
        AddArgument("attr-name", "scene-valid");
        ModelCommand::AddArguments();
    }

    ~ReadScenesSceneValid()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSceneValid(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NameSupport
 */
class ReadScenesNameSupport : public ModelCommand
{
public:
    ReadScenesNameSupport() : ModelCommand("read")
    {
        AddArgument("attr-name", "name-support");
        ModelCommand::AddArguments();
    }

    ~ReadScenesNameSupport()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNameSupport(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadScenesClusterRevision : public ModelCommand
{
public:
    ReadScenesClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadScenesClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0005) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ScenesCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Switch                                                      | 0x003B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NumberOfPositions                                                 | 0x0000 |
| * CurrentPosition                                                   | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverSwitchAttributes : public ModelCommand
{
public:
    DiscoverSwitchAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverSwitchAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute NumberOfPositions
 */
class ReadSwitchNumberOfPositions : public ModelCommand
{
public:
    ReadSwitchNumberOfPositions() : ModelCommand("read")
    {
        AddArgument("attr-name", "number-of-positions");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchNumberOfPositions()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeNumberOfPositions(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentPosition
 */
class ReadSwitchCurrentPosition : public ModelCommand
{
public:
    ReadSwitchCurrentPosition() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-position");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchCurrentPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportSwitchCurrentPosition : public ModelCommand
{
public:
    ReportSwitchCurrentPosition() : ModelCommand("report")
    {
        AddArgument("attr-name", "current-position");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", 0, UINT8_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportSwitchCurrentPosition()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeCurrentPosition(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeCurrentPosition(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                         mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int8uAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    uint8_t mChange;
};

/*
 * Attribute ClusterRevision
 */
class ReadSwitchClusterRevision : public ModelCommand
{
public:
    ReadSwitchClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadSwitchClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x003B) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::SwitchCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TvChannel                                                   | 0x0504 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ChangeChannel                                                     |   0x00 |
| * ChangeChannelByNumber                                             |   0x01 |
| * SkipChannel                                                       |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TvChannelList                                                     | 0x0000 |
| * TvChannelLineup                                                   | 0x0001 |
| * CurrentTvChannel                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ChangeChannel
 */
class TvChannelChangeChannel : public ModelCommand
{
public:
    TvChannelChangeChannel() : ModelCommand("change-channel")
    {
        AddArgument("match", &mMatch);
        ModelCommand::AddArguments();
    }
    ~TvChannelChangeChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ChangeChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                     chip::ByteSpan(chip::Uint8::from_char(mMatch), strlen(mMatch)));
    }

private:
    chip::Callback::Callback<TvChannelClusterChangeChannelResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TvChannelClusterChangeChannelResponseCallback>(OnTvChannelClusterChangeChannelResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mMatch;
};

/*
 * Command ChangeChannelByNumber
 */
class TvChannelChangeChannelByNumber : public ModelCommand
{
public:
    TvChannelChangeChannelByNumber() : ModelCommand("change-channel-by-number")
    {
        AddArgument("majorNumber", 0, UINT16_MAX, &mMajorNumber);
        AddArgument("minorNumber", 0, UINT16_MAX, &mMinorNumber);
        ModelCommand::AddArguments();
    }
    ~TvChannelChangeChannelByNumber()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ChangeChannelByNumber(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMajorNumber, mMinorNumber);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mMajorNumber;
    uint16_t mMinorNumber;
};

/*
 * Command SkipChannel
 */
class TvChannelSkipChannel : public ModelCommand
{
public:
    TvChannelSkipChannel() : ModelCommand("skip-channel")
    {
        AddArgument("count", 0, UINT16_MAX, &mCount);
        ModelCommand::AddArguments();
    }
    ~TvChannelSkipChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SkipChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mCount);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mCount;
};

/*
 * Discover Attributes
 */
class DiscoverTvChannelAttributes : public ModelCommand
{
public:
    DiscoverTvChannelAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTvChannelAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TvChannelList
 */
class ReadTvChannelTvChannelList : public ModelCommand
{
public:
    ReadTvChannelTvChannelList() : ModelCommand("read")
    {
        AddArgument("attr-name", "tv-channel-list");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelTvChannelList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTvChannelList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TvChannelLineup
 */
class ReadTvChannelTvChannelLineup : public ModelCommand
{
public:
    ReadTvChannelTvChannelLineup() : ModelCommand("read")
    {
        AddArgument("attr-name", "tv-channel-lineup");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelTvChannelLineup()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTvChannelLineup(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute CurrentTvChannel
 */
class ReadTvChannelCurrentTvChannel : public ModelCommand
{
public:
    ReadTvChannelCurrentTvChannel() : ModelCommand("read")
    {
        AddArgument("attr-name", "current-tv-channel");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelCurrentTvChannel()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeCurrentTvChannel(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTvChannelClusterRevision : public ModelCommand
{
public:
    ReadTvChannelClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTvChannelClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0504) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TvChannelCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TargetNavigator                                             | 0x0505 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * NavigateTarget                                                    |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TargetNavigatorList                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command NavigateTarget
 */
class TargetNavigatorNavigateTarget : public ModelCommand
{
public:
    TargetNavigatorNavigateTarget() : ModelCommand("navigate-target")
    {
        AddArgument("target", 0, UINT8_MAX, &mTarget);
        AddArgument("data", &mData);
        ModelCommand::AddArguments();
    }
    ~TargetNavigatorNavigateTarget()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.NavigateTarget(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mTarget,
                                      chip::ByteSpan(chip::Uint8::from_char(mData), strlen(mData)));
    }

private:
    chip::Callback::Callback<TargetNavigatorClusterNavigateTargetResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TargetNavigatorClusterNavigateTargetResponseCallback>(
            OnTargetNavigatorClusterNavigateTargetResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mTarget;
    char * mData;
};

/*
 * Discover Attributes
 */
class DiscoverTargetNavigatorAttributes : public ModelCommand
{
public:
    DiscoverTargetNavigatorAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTargetNavigatorAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute TargetNavigatorList
 */
class ReadTargetNavigatorTargetNavigatorList : public ModelCommand
{
public:
    ReadTargetNavigatorTargetNavigatorList() : ModelCommand("read")
    {
        AddArgument("attr-name", "target-navigator-list");
        ModelCommand::AddArguments();
    }

    ~ReadTargetNavigatorTargetNavigatorList()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeTargetNavigatorList(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTargetNavigatorClusterRevision : public ModelCommand
{
public:
    ReadTargetNavigatorClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTargetNavigatorClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0505) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TargetNavigatorCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TemperatureMeasurement                                      | 0x0402 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverTemperatureMeasurementAttributes : public ModelCommand
{
public:
    DiscoverTemperatureMeasurementAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTemperatureMeasurementAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MeasuredValue
 */
class ReadTemperatureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportTemperatureMeasurementMeasuredValue : public ModelCommand
{
public:
    ReportTemperatureMeasurementMeasuredValue() : ModelCommand("report")
    {
        AddArgument("attr-name", "measured-value");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportTemperatureMeasurementMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeMeasuredValue(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                       mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute MinMeasuredValue
 */
class ReadTemperatureMeasurementMinMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMinMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "min-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMinMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMinMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute MaxMeasuredValue
 */
class ReadTemperatureMeasurementMaxMeasuredValue : public ModelCommand
{
public:
    ReadTemperatureMeasurementMaxMeasuredValue() : ModelCommand("read")
    {
        AddArgument("attr-name", "max-measured-value");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementMaxMeasuredValue()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeMaxMeasuredValue(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTemperatureMeasurementClusterRevision : public ModelCommand
{
public:
    ReadTemperatureMeasurementClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTemperatureMeasurementClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0402) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TemperatureMeasurementCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster TestCluster                                                 | 0x050F |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Test                                                              |   0x00 |
| * TestNotHandled                                                    |   0x01 |
| * TestSpecific                                                      |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Boolean                                                           | 0x0000 |
| * Bitmap8                                                           | 0x0001 |
| * Bitmap16                                                          | 0x0002 |
| * Bitmap32                                                          | 0x0003 |
| * Bitmap64                                                          | 0x0004 |
| * Int8u                                                             | 0x0005 |
| * Int16u                                                            | 0x0006 |
| * Int32u                                                            | 0x0008 |
| * Int64u                                                            | 0x000C |
| * Int8s                                                             | 0x000D |
| * Int16s                                                            | 0x000E |
| * Int32s                                                            | 0x0010 |
| * Int64s                                                            | 0x0014 |
| * Enum8                                                             | 0x0015 |
| * Enum16                                                            | 0x0016 |
| * OctetString                                                       | 0x0019 |
| * ListInt8u                                                         | 0x001A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command Test
 */
class TestClusterTest : public ModelCommand
{
public:
    TestClusterTest() : ModelCommand("test") { ModelCommand::AddArguments(); }
    ~TestClusterTest()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.Test(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command TestNotHandled
 */
class TestClusterTestNotHandled : public ModelCommand
{
public:
    TestClusterTestNotHandled() : ModelCommand("test-not-handled") { ModelCommand::AddArguments(); }
    ~TestClusterTestNotHandled()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.TestNotHandled(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command TestSpecific
 */
class TestClusterTestSpecific : public ModelCommand
{
public:
    TestClusterTestSpecific() : ModelCommand("test-specific") { ModelCommand::AddArguments(); }
    ~TestClusterTestSpecific()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.TestSpecific(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterClusterTestSpecificResponseCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterClusterTestSpecificResponseCallback>(OnTestClusterClusterTestSpecificResponse,
                                                                                     this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Discover Attributes
 */
class DiscoverTestClusterAttributes : public ModelCommand
{
public:
    DiscoverTestClusterAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverTestClusterAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute Boolean
 */
class ReadTestClusterBoolean : public ModelCommand
{
public:
    ReadTestClusterBoolean() : ModelCommand("read")
    {
        AddArgument("attr-name", "boolean");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBoolean()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<BooleanAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<BooleanAttributeCallback>(OnBooleanAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBoolean : public ModelCommand
{
public:
    WriteTestClusterBoolean() : ModelCommand("write")
    {
        AddArgument("attr-name", "boolean");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBoolean()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBoolean(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Bitmap8
 */
class ReadTestClusterBitmap8 : public ModelCommand
{
public:
    ReadTestClusterBitmap8() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap8");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap8 : public ModelCommand
{
public:
    WriteTestClusterBitmap8() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap8");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Bitmap16
 */
class ReadTestClusterBitmap16 : public ModelCommand
{
public:
    ReadTestClusterBitmap16() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap16");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap16 : public ModelCommand
{
public:
    WriteTestClusterBitmap16() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap16");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute Bitmap32
 */
class ReadTestClusterBitmap32 : public ModelCommand
{
public:
    ReadTestClusterBitmap32() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap32");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap32()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap32 : public ModelCommand
{
public:
    WriteTestClusterBitmap32() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap32");
        AddArgument("attr-value", 0, UINT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap32()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap32(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mValue;
};

/*
 * Attribute Bitmap64
 */
class ReadTestClusterBitmap64 : public ModelCommand
{
public:
    ReadTestClusterBitmap64() : ModelCommand("read")
    {
        AddArgument("attr-name", "bitmap64");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterBitmap64()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterBitmap64 : public ModelCommand
{
public:
    WriteTestClusterBitmap64() : ModelCommand("write")
    {
        AddArgument("attr-name", "bitmap64");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterBitmap64()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeBitmap64(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute Int8u
 */
class ReadTestClusterInt8u : public ModelCommand
{
public:
    ReadTestClusterInt8u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int8u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt8u : public ModelCommand
{
public:
    WriteTestClusterInt8u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int8u");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Int16u
 */
class ReadTestClusterInt16u : public ModelCommand
{
public:
    ReadTestClusterInt16u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int16u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt16u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt16u : public ModelCommand
{
public:
    WriteTestClusterInt16u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int16u");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt16u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt16u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute Int32u
 */
class ReadTestClusterInt32u : public ModelCommand
{
public:
    ReadTestClusterInt32u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int32u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt32u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32uAttributeCallback>(OnInt32uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt32u : public ModelCommand
{
public:
    WriteTestClusterInt32u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int32u");
        AddArgument("attr-value", 0, UINT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt32u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt32u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint32_t mValue;
};

/*
 * Attribute Int64u
 */
class ReadTestClusterInt64u : public ModelCommand
{
public:
    ReadTestClusterInt64u() : ModelCommand("read")
    {
        AddArgument("attr-name", "int64u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt64u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64uAttributeCallback>(OnInt64uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt64u : public ModelCommand
{
public:
    WriteTestClusterInt64u() : ModelCommand("write")
    {
        AddArgument("attr-name", "int64u");
        AddArgument("attr-value", 0, UINT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt64u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt64u(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint64_t mValue;
};

/*
 * Attribute Int8s
 */
class ReadTestClusterInt8s : public ModelCommand
{
public:
    ReadTestClusterInt8s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int8s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt8s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8sAttributeCallback>(OnInt8sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt8s : public ModelCommand
{
public:
    WriteTestClusterInt8s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int8s");
        AddArgument("attr-value", INT8_MIN, INT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt8s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt8s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int8_t mValue;
};

/*
 * Attribute Int16s
 */
class ReadTestClusterInt16s : public ModelCommand
{
public:
    ReadTestClusterInt16s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int16s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt16s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt16s : public ModelCommand
{
public:
    WriteTestClusterInt16s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int16s");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt16s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt16s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute Int32s
 */
class ReadTestClusterInt32s : public ModelCommand
{
public:
    ReadTestClusterInt32s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int32s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt32s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int32sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int32sAttributeCallback>(OnInt32sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt32s : public ModelCommand
{
public:
    WriteTestClusterInt32s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int32s");
        AddArgument("attr-value", INT32_MIN, INT32_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt32s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt32s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int32_t mValue;
};

/*
 * Attribute Int64s
 */
class ReadTestClusterInt64s : public ModelCommand
{
public:
    ReadTestClusterInt64s() : ModelCommand("read")
    {
        AddArgument("attr-name", "int64s");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterInt64s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int64sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int64sAttributeCallback>(OnInt64sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterInt64s : public ModelCommand
{
public:
    WriteTestClusterInt64s() : ModelCommand("write")
    {
        AddArgument("attr-name", "int64s");
        AddArgument("attr-value", INT64_MIN, INT64_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterInt64s()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeInt64s(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int64_t mValue;
};

/*
 * Attribute Enum8
 */
class ReadTestClusterEnum8 : public ModelCommand
{
public:
    ReadTestClusterEnum8() : ModelCommand("read")
    {
        AddArgument("attr-name", "enum8");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterEnum8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterEnum8 : public ModelCommand
{
public:
    WriteTestClusterEnum8() : ModelCommand("write")
    {
        AddArgument("attr-name", "enum8");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterEnum8()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeEnum8(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute Enum16
 */
class ReadTestClusterEnum16 : public ModelCommand
{
public:
    ReadTestClusterEnum16() : ModelCommand("read")
    {
        AddArgument("attr-name", "enum16");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterEnum16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterEnum16 : public ModelCommand
{
public:
    WriteTestClusterEnum16() : ModelCommand("write")
    {
        AddArgument("attr-name", "enum16");
        AddArgument("attr-value", 0, UINT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterEnum16()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeEnum16(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint16_t mValue;
};

/*
 * Attribute OctetString
 */
class ReadTestClusterOctetString : public ModelCommand
{
public:
    ReadTestClusterOctetString() : ModelCommand("read")
    {
        AddArgument("attr-name", "octet-string");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteTestClusterOctetString : public ModelCommand
{
public:
    WriteTestClusterOctetString() : ModelCommand("write")
    {
        AddArgument("attr-name", "octet-string");
        AddArgument("attr-value", &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteTestClusterOctetString()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOctetString(onSuccessCallback->Cancel(), onFailureCallback->Cancel(),
                                                 chip::ByteSpan(chip::Uint8::from_char(mValue), strlen(mValue)));
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    char * mValue;
};

/*
 * Attribute ListInt8u
 */
class ReadTestClusterListInt8u : public ModelCommand
{
public:
    ReadTestClusterListInt8u() : ModelCommand("read")
    {
        AddArgument("attr-name", "list-int8u");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterListInt8u()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeListInt8u(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<TestClusterListInt8uListAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<TestClusterListInt8uListAttributeCallback>(OnTestClusterListInt8uListAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadTestClusterClusterRevision : public ModelCommand
{
public:
    ReadTestClusterClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadTestClusterClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x050F) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::TestClusterCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster Thermostat                                                  | 0x0201 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearWeeklySchedule                                               |   0x03 |
| * GetRelayStatusLog                                                 |   0x04 |
| * GetWeeklySchedule                                                 |   0x02 |
| * SetWeeklySchedule                                                 |   0x01 |
| * SetpointRaiseLower                                                |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LocalTemperature                                                  | 0x0000 |
| * OccupiedCoolingSetpoint                                           | 0x0011 |
| * OccupiedHeatingSetpoint                                           | 0x0012 |
| * ControlSequenceOfOperation                                        | 0x001B |
| * SystemMode                                                        | 0x001C |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Command ClearWeeklySchedule
 */
class ThermostatClearWeeklySchedule : public ModelCommand
{
public:
    ThermostatClearWeeklySchedule() : ModelCommand("clear-weekly-schedule") { ModelCommand::AddArguments(); }
    ~ThermostatClearWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x03) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ClearWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command GetRelayStatusLog
 */
class ThermostatGetRelayStatusLog : public ModelCommand
{
public:
    ThermostatGetRelayStatusLog() : ModelCommand("get-relay-status-log") { ModelCommand::AddArguments(); }
    ~ThermostatGetRelayStatusLog()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x04) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetRelayStatusLog(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Command GetWeeklySchedule
 */
class ThermostatGetWeeklySchedule : public ModelCommand
{
public:
    ThermostatGetWeeklySchedule() : ModelCommand("get-weekly-schedule")
    {
        AddArgument("daysToReturn", 0, UINT8_MAX, &mDaysToReturn);
        AddArgument("modeToReturn", 0, UINT8_MAX, &mModeToReturn);
        ModelCommand::AddArguments();
    }
    ~ThermostatGetWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x02) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.GetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mDaysToReturn, mModeToReturn);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mDaysToReturn;
    uint8_t mModeToReturn;
};

/*
 * Command SetWeeklySchedule
 */
class ThermostatSetWeeklySchedule : public ModelCommand
{
public:
    ThermostatSetWeeklySchedule() : ModelCommand("set-weekly-schedule")
    {
        AddArgument("numberOfTransitionsForSequence", 0, UINT8_MAX, &mNumberOfTransitionsForSequence);
        AddArgument("dayOfWeekForSequence", 0, UINT8_MAX, &mDayOfWeekForSequence);
        AddArgument("modeForSequence", 0, UINT8_MAX, &mModeForSequence);
        AddArgument("payload", 0, UINT8_MAX, &mPayload);
        ModelCommand::AddArguments();
    }
    ~ThermostatSetWeeklySchedule()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetWeeklySchedule(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mNumberOfTransitionsForSequence,
                                         mDayOfWeekForSequence, mModeForSequence, mPayload);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mNumberOfTransitionsForSequence;
    uint8_t mDayOfWeekForSequence;
    uint8_t mModeForSequence;
    uint8_t mPayload;
};

/*
 * Command SetpointRaiseLower
 */
class ThermostatSetpointRaiseLower : public ModelCommand
{
public:
    ThermostatSetpointRaiseLower() : ModelCommand("setpoint-raise-lower")
    {
        AddArgument("mode", 0, UINT8_MAX, &mMode);
        AddArgument("amount", INT8_MIN, INT8_MAX, &mAmount);
        ModelCommand::AddArguments();
    }
    ~ThermostatSetpointRaiseLower()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.SetpointRaiseLower(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMode, mAmount);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mMode;
    int8_t mAmount;
};

/*
 * Discover Attributes
 */
class DiscoverThermostatAttributes : public ModelCommand
{
public:
    DiscoverThermostatAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverThermostatAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute LocalTemperature
 */
class ReadThermostatLocalTemperature : public ModelCommand
{
public:
    ReadThermostatLocalTemperature() : ModelCommand("read")
    {
        AddArgument("attr-name", "local-temperature");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatLocalTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class ReportThermostatLocalTemperature : public ModelCommand
{
public:
    ReportThermostatLocalTemperature() : ModelCommand("report")
    {
        AddArgument("attr-name", "local-temperature");
        AddArgument("min-interval", 0, UINT16_MAX, &mMinInterval);
        AddArgument("max-interval", 0, UINT16_MAX, &mMaxInterval);
        AddArgument("change", INT16_MIN, INT16_MAX, &mChange);
        ModelCommand::AddArguments();
    }

    ~ReportThermostatLocalTemperature()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
        delete onReportCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x06) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);

        CHIP_ERROR err = cluster.ReportAttributeLocalTemperature(onReportCallback->Cancel());
        if (err != CHIP_NO_ERROR)
        {
            return err;
        }

        return cluster.ConfigureAttributeLocalTemperature(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mMinInterval,
                                                          mMaxInterval, mChange);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    chip::Callback::Callback<Int16sAttributeCallback> * onReportCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    uint16_t mMinInterval;
    uint16_t mMaxInterval;
    int16_t mChange;
};

/*
 * Attribute OccupiedCoolingSetpoint
 */
class ReadThermostatOccupiedCoolingSetpoint : public ModelCommand
{
public:
    ReadThermostatOccupiedCoolingSetpoint() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupied-cooling-setpoint");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatOccupiedCoolingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatOccupiedCoolingSetpoint : public ModelCommand
{
public:
    WriteThermostatOccupiedCoolingSetpoint() : ModelCommand("write")
    {
        AddArgument("attr-name", "occupied-cooling-setpoint");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatOccupiedCoolingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOccupiedCoolingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute OccupiedHeatingSetpoint
 */
class ReadThermostatOccupiedHeatingSetpoint : public ModelCommand
{
public:
    ReadThermostatOccupiedHeatingSetpoint() : ModelCommand("read")
    {
        AddArgument("attr-name", "occupied-heating-setpoint");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatOccupiedHeatingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16sAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16sAttributeCallback>(OnInt16sAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatOccupiedHeatingSetpoint : public ModelCommand
{
public:
    WriteThermostatOccupiedHeatingSetpoint() : ModelCommand("write")
    {
        AddArgument("attr-name", "occupied-heating-setpoint");
        AddArgument("attr-value", INT16_MIN, INT16_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatOccupiedHeatingSetpoint()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeOccupiedHeatingSetpoint(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    int16_t mValue;
};

/*
 * Attribute ControlSequenceOfOperation
 */
class ReadThermostatControlSequenceOfOperation : public ModelCommand
{
public:
    ReadThermostatControlSequenceOfOperation() : ModelCommand("read")
    {
        AddArgument("attr-name", "control-sequence-of-operation");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatControlSequenceOfOperation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatControlSequenceOfOperation : public ModelCommand
{
public:
    WriteThermostatControlSequenceOfOperation() : ModelCommand("write")
    {
        AddArgument("attr-name", "control-sequence-of-operation");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatControlSequenceOfOperation()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeControlSequenceOfOperation(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute SystemMode
 */
class ReadThermostatSystemMode : public ModelCommand
{
public:
    ReadThermostatSystemMode() : ModelCommand("read")
    {
        AddArgument("attr-name", "system-mode");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatSystemMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int8uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int8uAttributeCallback>(OnInt8uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

class WriteThermostatSystemMode : public ModelCommand
{
public:
    WriteThermostatSystemMode() : ModelCommand("write")
    {
        AddArgument("attr-name", "system-mode");
        AddArgument("attr-value", 0, UINT8_MAX, &mValue);
        ModelCommand::AddArguments();
    }

    ~WriteThermostatSystemMode()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x01) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.WriteAttributeSystemMode(onSuccessCallback->Cancel(), onFailureCallback->Cancel(), mValue);
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
    uint8_t mValue;
};

/*
 * Attribute ClusterRevision
 */
class ReadThermostatClusterRevision : public ModelCommand
{
public:
    ReadThermostatClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadThermostatClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0201) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::ThermostatCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Cluster WakeOnLan                                                   | 0x0503 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * WakeOnLanMacAddress                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

/*
 * Discover Attributes
 */
class DiscoverWakeOnLanAttributes : public ModelCommand
{
public:
    DiscoverWakeOnLanAttributes() : ModelCommand("discover") { ModelCommand::AddArguments(); }

    ~DiscoverWakeOnLanAttributes()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0000) command (0x0C) on endpoint %" PRIu16, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.DiscoverAttributes(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<DefaultSuccessCallback> * onSuccessCallback =
        new chip::Callback::Callback<DefaultSuccessCallback>(OnDefaultSuccessResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute WakeOnLanMacAddress
 */
class ReadWakeOnLanWakeOnLanMacAddress : public ModelCommand
{
public:
    ReadWakeOnLanWakeOnLanMacAddress() : ModelCommand("read")
    {
        AddArgument("attr-name", "wake-on-lan-mac-address");
        ModelCommand::AddArguments();
    }

    ~ReadWakeOnLanWakeOnLanMacAddress()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0503) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeWakeOnLanMacAddress(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<StringAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<StringAttributeCallback>(OnStringAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*
 * Attribute ClusterRevision
 */
class ReadWakeOnLanClusterRevision : public ModelCommand
{
public:
    ReadWakeOnLanClusterRevision() : ModelCommand("read")
    {
        AddArgument("attr-name", "cluster-revision");
        ModelCommand::AddArguments();
    }

    ~ReadWakeOnLanClusterRevision()
    {
        delete onSuccessCallback;
        delete onFailureCallback;
    }

    CHIP_ERROR SendCommand(ChipDevice * device, uint8_t endpointId) override
    {
        ChipLogProgress(chipTool, "Sending cluster (0x0503) command (0x00) on endpoint %" PRIu16, endpointId);

        chip::Controller::WakeOnLanCluster cluster;
        cluster.Associate(device, endpointId);
        return cluster.ReadAttributeClusterRevision(onSuccessCallback->Cancel(), onFailureCallback->Cancel());
    }

private:
    chip::Callback::Callback<Int16uAttributeCallback> * onSuccessCallback =
        new chip::Callback::Callback<Int16uAttributeCallback>(OnInt16uAttributeResponse, this);
    chip::Callback::Callback<DefaultFailureCallback> * onFailureCallback =
        new chip::Callback::Callback<DefaultFailureCallback>(OnDefaultFailureResponse, this);
};

/*----------------------------------------------------------------------------*\
| Register all Clusters commands                                               |
\*----------------------------------------------------------------------------*/
void registerClusterAccountLogin(Commands & commands)
{
    const char * clusterName = "AccountLogin";

    commands_list clusterCommands = {
        make_unique<AccountLoginGetSetupPIN>(),
        make_unique<AccountLoginLogin>(),
        make_unique<DiscoverAccountLoginAttributes>(),
        make_unique<ReadAccountLoginClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterApplicationBasic(Commands & commands)
{
    const char * clusterName = "ApplicationBasic";

    commands_list clusterCommands = {
        make_unique<DiscoverApplicationBasicAttributes>(),  make_unique<ReadApplicationBasicVendorName>(),
        make_unique<ReadApplicationBasicVendorId>(),        make_unique<ReadApplicationBasicApplicationName>(),
        make_unique<ReadApplicationBasicProductId>(),       make_unique<ReadApplicationBasicApplicationId>(),
        make_unique<ReadApplicationBasicCatalogVendorId>(), make_unique<ReadApplicationBasicApplicationSatus>(),
        make_unique<ReadApplicationBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterApplicationLauncher(Commands & commands)
{
    const char * clusterName = "ApplicationLauncher";

    commands_list clusterCommands = {
        make_unique<ApplicationLauncherLaunchApp>(),
        make_unique<DiscoverApplicationLauncherAttributes>(),
        make_unique<ReadApplicationLauncherApplicationLauncherList>(),
        make_unique<ReadApplicationLauncherClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterAudioOutput(Commands & commands)
{
    const char * clusterName = "AudioOutput";

    commands_list clusterCommands = {
        make_unique<AudioOutputRenameOutput>(),        make_unique<AudioOutputSelectOutput>(),
        make_unique<DiscoverAudioOutputAttributes>(),  make_unique<ReadAudioOutputAudioOutputList>(),
        make_unique<ReadAudioOutputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBarrierControl(Commands & commands)
{
    const char * clusterName = "BarrierControl";

    commands_list clusterCommands = {
        make_unique<BarrierControlBarrierControlGoToPercent>(), make_unique<BarrierControlBarrierControlStop>(),
        make_unique<DiscoverBarrierControlAttributes>(),        make_unique<ReadBarrierControlBarrierMovingState>(),
        make_unique<ReadBarrierControlBarrierSafetyStatus>(),   make_unique<ReadBarrierControlBarrierCapabilities>(),
        make_unique<ReadBarrierControlBarrierPosition>(),       make_unique<ReadBarrierControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBasic(Commands & commands)
{
    const char * clusterName = "Basic";

    commands_list clusterCommands = {
        make_unique<BasicMfgSpecificPing>(),
        make_unique<DiscoverBasicAttributes>(),
        make_unique<ReadBasicInteractionModelVersion>(),
        make_unique<ReadBasicVendorName>(),
        make_unique<ReadBasicVendorID>(),
        make_unique<ReadBasicProductName>(),
        make_unique<ReadBasicProductID>(),
        make_unique<ReadBasicUserLabel>(),
        make_unique<WriteBasicUserLabel>(),
        make_unique<ReadBasicLocation>(),
        make_unique<WriteBasicLocation>(),
        make_unique<ReadBasicHardwareVersion>(),
        make_unique<ReadBasicHardwareVersionString>(),
        make_unique<ReadBasicSoftwareVersion>(),
        make_unique<ReadBasicSoftwareVersionString>(),
        make_unique<ReadBasicManufacturingDate>(),
        make_unique<ReadBasicPartNumber>(),
        make_unique<ReadBasicProductURL>(),
        make_unique<ReadBasicProductLabel>(),
        make_unique<ReadBasicSerialNumber>(),
        make_unique<ReadBasicLocalConfigDisabled>(),
        make_unique<WriteBasicLocalConfigDisabled>(),
        make_unique<ReadBasicClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterBinding(Commands & commands)
{
    const char * clusterName = "Binding";

    commands_list clusterCommands = {
        make_unique<BindingBind>(),
        make_unique<BindingUnbind>(),
        make_unique<DiscoverBindingAttributes>(),
        make_unique<ReadBindingClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterColorControl(Commands & commands)
{
    const char * clusterName = "ColorControl";

    commands_list clusterCommands = {
        make_unique<ColorControlMoveColor>(),
        make_unique<ColorControlMoveColorTemperature>(),
        make_unique<ColorControlMoveHue>(),
        make_unique<ColorControlMoveSaturation>(),
        make_unique<ColorControlMoveToColor>(),
        make_unique<ColorControlMoveToColorTemperature>(),
        make_unique<ColorControlMoveToHue>(),
        make_unique<ColorControlMoveToHueAndSaturation>(),
        make_unique<ColorControlMoveToSaturation>(),
        make_unique<ColorControlStepColor>(),
        make_unique<ColorControlStepColorTemperature>(),
        make_unique<ColorControlStepHue>(),
        make_unique<ColorControlStepSaturation>(),
        make_unique<ColorControlStopMoveStep>(),
        make_unique<DiscoverColorControlAttributes>(),
        make_unique<ReadColorControlCurrentHue>(),
        make_unique<ReportColorControlCurrentHue>(),
        make_unique<ReadColorControlCurrentSaturation>(),
        make_unique<ReportColorControlCurrentSaturation>(),
        make_unique<ReadColorControlRemainingTime>(),
        make_unique<ReadColorControlCurrentX>(),
        make_unique<ReportColorControlCurrentX>(),
        make_unique<ReadColorControlCurrentY>(),
        make_unique<ReportColorControlCurrentY>(),
        make_unique<ReadColorControlDriftCompensation>(),
        make_unique<ReadColorControlCompensationText>(),
        make_unique<ReadColorControlColorTemperature>(),
        make_unique<ReportColorControlColorTemperature>(),
        make_unique<ReadColorControlColorMode>(),
        make_unique<ReadColorControlColorControlOptions>(),
        make_unique<WriteColorControlColorControlOptions>(),
        make_unique<ReadColorControlNumberOfPrimaries>(),
        make_unique<ReadColorControlPrimary1X>(),
        make_unique<ReadColorControlPrimary1Y>(),
        make_unique<ReadColorControlPrimary1Intensity>(),
        make_unique<ReadColorControlPrimary2X>(),
        make_unique<ReadColorControlPrimary2Y>(),
        make_unique<ReadColorControlPrimary2Intensity>(),
        make_unique<ReadColorControlPrimary3X>(),
        make_unique<ReadColorControlPrimary3Y>(),
        make_unique<ReadColorControlPrimary3Intensity>(),
        make_unique<ReadColorControlPrimary4X>(),
        make_unique<ReadColorControlPrimary4Y>(),
        make_unique<ReadColorControlPrimary4Intensity>(),
        make_unique<ReadColorControlPrimary5X>(),
        make_unique<ReadColorControlPrimary5Y>(),
        make_unique<ReadColorControlPrimary5Intensity>(),
        make_unique<ReadColorControlPrimary6X>(),
        make_unique<ReadColorControlPrimary6Y>(),
        make_unique<ReadColorControlPrimary6Intensity>(),
        make_unique<ReadColorControlWhitePointX>(),
        make_unique<WriteColorControlWhitePointX>(),
        make_unique<ReadColorControlWhitePointY>(),
        make_unique<WriteColorControlWhitePointY>(),
        make_unique<ReadColorControlColorPointRX>(),
        make_unique<WriteColorControlColorPointRX>(),
        make_unique<ReadColorControlColorPointRY>(),
        make_unique<WriteColorControlColorPointRY>(),
        make_unique<ReadColorControlColorPointRIntensity>(),
        make_unique<WriteColorControlColorPointRIntensity>(),
        make_unique<ReadColorControlColorPointGX>(),
        make_unique<WriteColorControlColorPointGX>(),
        make_unique<ReadColorControlColorPointGY>(),
        make_unique<WriteColorControlColorPointGY>(),
        make_unique<ReadColorControlColorPointGIntensity>(),
        make_unique<WriteColorControlColorPointGIntensity>(),
        make_unique<ReadColorControlColorPointBX>(),
        make_unique<WriteColorControlColorPointBX>(),
        make_unique<ReadColorControlColorPointBY>(),
        make_unique<WriteColorControlColorPointBY>(),
        make_unique<ReadColorControlColorPointBIntensity>(),
        make_unique<WriteColorControlColorPointBIntensity>(),
        make_unique<ReadColorControlEnhancedCurrentHue>(),
        make_unique<ReadColorControlEnhancedColorMode>(),
        make_unique<ReadColorControlColorLoopActive>(),
        make_unique<ReadColorControlColorLoopDirection>(),
        make_unique<ReadColorControlColorLoopTime>(),
        make_unique<ReadColorControlColorCapabilities>(),
        make_unique<ReadColorControlColorTempPhysicalMin>(),
        make_unique<ReadColorControlColorTempPhysicalMax>(),
        make_unique<ReadColorControlCoupleColorTempToLevelMinMireds>(),
        make_unique<ReadColorControlStartUpColorTemperatureMireds>(),
        make_unique<WriteColorControlStartUpColorTemperatureMireds>(),
        make_unique<ReadColorControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterContentLaunch(Commands & commands)
{
    const char * clusterName = "ContentLaunch";

    commands_list clusterCommands = {
        make_unique<ContentLaunchLaunchContent>(),
        make_unique<ContentLaunchLaunchURL>(),
        make_unique<DiscoverContentLaunchAttributes>(),
        make_unique<ReadContentLaunchAcceptsHeaderList>(),
        make_unique<ReadContentLaunchSupportedStreamingTypes>(),
        make_unique<ReadContentLaunchClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterDescriptor(Commands & commands)
{
    const char * clusterName = "Descriptor";

    commands_list clusterCommands = {
        make_unique<DiscoverDescriptorAttributes>(), make_unique<ReadDescriptorDeviceList>(),
        make_unique<ReadDescriptorServerList>(),     make_unique<ReadDescriptorClientList>(),
        make_unique<ReadDescriptorPartsList>(),      make_unique<ReadDescriptorClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterDoorLock(Commands & commands)
{
    const char * clusterName = "DoorLock";

    commands_list clusterCommands = {
        make_unique<DoorLockClearAllPins>(),
        make_unique<DoorLockClearAllRfids>(),
        make_unique<DoorLockClearHolidaySchedule>(),
        make_unique<DoorLockClearPin>(),
        make_unique<DoorLockClearRfid>(),
        make_unique<DoorLockClearWeekdaySchedule>(),
        make_unique<DoorLockClearYeardaySchedule>(),
        make_unique<DoorLockGetHolidaySchedule>(),
        make_unique<DoorLockGetLogRecord>(),
        make_unique<DoorLockGetPin>(),
        make_unique<DoorLockGetRfid>(),
        make_unique<DoorLockGetUserType>(),
        make_unique<DoorLockGetWeekdaySchedule>(),
        make_unique<DoorLockGetYeardaySchedule>(),
        make_unique<DoorLockLockDoor>(),
        make_unique<DoorLockSetHolidaySchedule>(),
        make_unique<DoorLockSetPin>(),
        make_unique<DoorLockSetRfid>(),
        make_unique<DoorLockSetUserType>(),
        make_unique<DoorLockSetWeekdaySchedule>(),
        make_unique<DoorLockSetYeardaySchedule>(),
        make_unique<DoorLockUnlockDoor>(),
        make_unique<DoorLockUnlockWithTimeout>(),
        make_unique<DiscoverDoorLockAttributes>(),
        make_unique<ReadDoorLockLockState>(),
        make_unique<ReportDoorLockLockState>(),
        make_unique<ReadDoorLockLockType>(),
        make_unique<ReadDoorLockActuatorEnabled>(),
        make_unique<ReadDoorLockClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGeneralCommissioning(Commands & commands)
{
    const char * clusterName = "GeneralCommissioning";

    commands_list clusterCommands = {
        make_unique<GeneralCommissioningArmFailSafe>(),         make_unique<GeneralCommissioningCommissioningComplete>(),
        make_unique<GeneralCommissioningSetRegulatoryConfig>(), make_unique<DiscoverGeneralCommissioningAttributes>(),
        make_unique<ReadGeneralCommissioningFabricId>(),        make_unique<ReadGeneralCommissioningBreadcrumb>(),
        make_unique<WriteGeneralCommissioningBreadcrumb>(),     make_unique<ReadGeneralCommissioningClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGroupKeyManagement(Commands & commands)
{
    const char * clusterName = "GroupKeyManagement";

    commands_list clusterCommands = {
        make_unique<DiscoverGroupKeyManagementAttributes>(),
        make_unique<ReadGroupKeyManagementGroups>(),
        make_unique<ReadGroupKeyManagementGroupKeys>(),
        make_unique<ReadGroupKeyManagementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterGroups(Commands & commands)
{
    const char * clusterName = "Groups";

    commands_list clusterCommands = {
        make_unique<GroupsAddGroup>(),
        make_unique<GroupsAddGroupIfIdentifying>(),
        make_unique<GroupsGetGroupMembership>(),
        make_unique<GroupsRemoveAllGroups>(),
        make_unique<GroupsRemoveGroup>(),
        make_unique<GroupsViewGroup>(),
        make_unique<DiscoverGroupsAttributes>(),
        make_unique<ReadGroupsNameSupport>(),
        make_unique<ReadGroupsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterIdentify(Commands & commands)
{
    const char * clusterName = "Identify";

    commands_list clusterCommands = {
        make_unique<IdentifyIdentify>(),           make_unique<IdentifyIdentifyQuery>(),
        make_unique<DiscoverIdentifyAttributes>(), make_unique<ReadIdentifyIdentifyTime>(),
        make_unique<WriteIdentifyIdentifyTime>(),  make_unique<ReadIdentifyClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterKeypadInput(Commands & commands)
{
    const char * clusterName = "KeypadInput";

    commands_list clusterCommands = {
        make_unique<KeypadInputSendKey>(),
        make_unique<DiscoverKeypadInputAttributes>(),
        make_unique<ReadKeypadInputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterLevelControl(Commands & commands)
{
    const char * clusterName = "LevelControl";

    commands_list clusterCommands = {
        make_unique<LevelControlMove>(),
        make_unique<LevelControlMoveToLevel>(),
        make_unique<LevelControlMoveToLevelWithOnOff>(),
        make_unique<LevelControlMoveWithOnOff>(),
        make_unique<LevelControlStep>(),
        make_unique<LevelControlStepWithOnOff>(),
        make_unique<LevelControlStop>(),
        make_unique<LevelControlStopWithOnOff>(),
        make_unique<DiscoverLevelControlAttributes>(),
        make_unique<ReadLevelControlCurrentLevel>(),
        make_unique<ReportLevelControlCurrentLevel>(),
        make_unique<ReadLevelControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterLowPower(Commands & commands)
{
    const char * clusterName = "LowPower";

    commands_list clusterCommands = {
        make_unique<LowPowerSleep>(),
        make_unique<DiscoverLowPowerAttributes>(),
        make_unique<ReadLowPowerClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterMediaInput(Commands & commands)
{
    const char * clusterName = "MediaInput";

    commands_list clusterCommands = {
        make_unique<MediaInputHideInputStatus>(),     make_unique<MediaInputRenameInput>(),
        make_unique<MediaInputSelectInput>(),         make_unique<MediaInputShowInputStatus>(),
        make_unique<DiscoverMediaInputAttributes>(),  make_unique<ReadMediaInputMediaInputList>(),
        make_unique<ReadMediaInputClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterMediaPlayback(Commands & commands)
{
    const char * clusterName = "MediaPlayback";

    commands_list clusterCommands = {
        make_unique<MediaPlaybackMediaFastForward>(),    make_unique<MediaPlaybackMediaNext>(),
        make_unique<MediaPlaybackMediaPause>(),          make_unique<MediaPlaybackMediaPlay>(),
        make_unique<MediaPlaybackMediaPrevious>(),       make_unique<MediaPlaybackMediaRewind>(),
        make_unique<MediaPlaybackMediaSkipBackward>(),   make_unique<MediaPlaybackMediaSkipForward>(),
        make_unique<MediaPlaybackMediaSkipSeek>(),       make_unique<MediaPlaybackMediaStartOver>(),
        make_unique<MediaPlaybackMediaStop>(),           make_unique<DiscoverMediaPlaybackAttributes>(),
        make_unique<ReadMediaPlaybackClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterNetworkCommissioning(Commands & commands)
{
    const char * clusterName = "NetworkCommissioning";

    commands_list clusterCommands = {
        make_unique<NetworkCommissioningAddThreadNetwork>(),
        make_unique<NetworkCommissioningAddWiFiNetwork>(),
        make_unique<NetworkCommissioningDisableNetwork>(),
        make_unique<NetworkCommissioningEnableNetwork>(),
        make_unique<NetworkCommissioningGetLastNetworkCommissioningResult>(),
        make_unique<NetworkCommissioningRemoveNetwork>(),
        make_unique<NetworkCommissioningScanNetworks>(),
        make_unique<NetworkCommissioningUpdateThreadNetwork>(),
        make_unique<NetworkCommissioningUpdateWiFiNetwork>(),
        make_unique<DiscoverNetworkCommissioningAttributes>(),
        make_unique<ReadNetworkCommissioningClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOnOff(Commands & commands)
{
    const char * clusterName = "OnOff";

    commands_list clusterCommands = {
        make_unique<OnOffOff>(),
        make_unique<OnOffOn>(),
        make_unique<OnOffToggle>(),
        make_unique<DiscoverOnOffAttributes>(),
        make_unique<ReadOnOffOnOff>(),
        make_unique<ReportOnOffOnOff>(),
        make_unique<ReadOnOffClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterOperationalCredentials(Commands & commands)
{
    const char * clusterName = "OperationalCredentials";

    commands_list clusterCommands = {
        make_unique<OperationalCredentialsRemoveFabric>(),      make_unique<OperationalCredentialsSetFabric>(),
        make_unique<OperationalCredentialsUpdateFabricLabel>(), make_unique<DiscoverOperationalCredentialsAttributes>(),
        make_unique<ReadOperationalCredentialsFabricsList>(),   make_unique<ReadOperationalCredentialsClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterPumpConfigurationAndControl(Commands & commands)
{
    const char * clusterName = "PumpConfigurationAndControl";

    commands_list clusterCommands = {
        make_unique<DiscoverPumpConfigurationAndControlAttributes>(),
        make_unique<ReadPumpConfigurationAndControlMaxPressure>(),
        make_unique<ReadPumpConfigurationAndControlMaxSpeed>(),
        make_unique<ReadPumpConfigurationAndControlMaxFlow>(),
        make_unique<ReadPumpConfigurationAndControlEffectiveOperationMode>(),
        make_unique<ReadPumpConfigurationAndControlEffectiveControlMode>(),
        make_unique<ReadPumpConfigurationAndControlCapacity>(),
        make_unique<ReportPumpConfigurationAndControlCapacity>(),
        make_unique<ReadPumpConfigurationAndControlOperationMode>(),
        make_unique<WritePumpConfigurationAndControlOperationMode>(),
        make_unique<ReadPumpConfigurationAndControlClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterScenes(Commands & commands)
{
    const char * clusterName = "Scenes";

    commands_list clusterCommands = {
        make_unique<ScenesAddScene>(),         make_unique<ScenesGetSceneMembership>(),  make_unique<ScenesRecallScene>(),
        make_unique<ScenesRemoveAllScenes>(),  make_unique<ScenesRemoveScene>(),         make_unique<ScenesStoreScene>(),
        make_unique<ScenesViewScene>(),        make_unique<DiscoverScenesAttributes>(),  make_unique<ReadScenesSceneCount>(),
        make_unique<ReadScenesCurrentScene>(), make_unique<ReadScenesCurrentGroup>(),    make_unique<ReadScenesSceneValid>(),
        make_unique<ReadScenesNameSupport>(),  make_unique<ReadScenesClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterSwitch(Commands & commands)
{
    const char * clusterName = "Switch";

    commands_list clusterCommands = {
        make_unique<DiscoverSwitchAttributes>(),  make_unique<ReadSwitchNumberOfPositions>(),
        make_unique<ReadSwitchCurrentPosition>(), make_unique<ReportSwitchCurrentPosition>(),
        make_unique<ReadSwitchClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTvChannel(Commands & commands)
{
    const char * clusterName = "TvChannel";

    commands_list clusterCommands = {
        make_unique<TvChannelChangeChannel>(),        make_unique<TvChannelChangeChannelByNumber>(),
        make_unique<TvChannelSkipChannel>(),          make_unique<DiscoverTvChannelAttributes>(),
        make_unique<ReadTvChannelTvChannelList>(),    make_unique<ReadTvChannelTvChannelLineup>(),
        make_unique<ReadTvChannelCurrentTvChannel>(), make_unique<ReadTvChannelClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTargetNavigator(Commands & commands)
{
    const char * clusterName = "TargetNavigator";

    commands_list clusterCommands = {
        make_unique<TargetNavigatorNavigateTarget>(),
        make_unique<DiscoverTargetNavigatorAttributes>(),
        make_unique<ReadTargetNavigatorTargetNavigatorList>(),
        make_unique<ReadTargetNavigatorClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTemperatureMeasurement(Commands & commands)
{
    const char * clusterName = "TemperatureMeasurement";

    commands_list clusterCommands = {
        make_unique<DiscoverTemperatureMeasurementAttributes>(),   make_unique<ReadTemperatureMeasurementMeasuredValue>(),
        make_unique<ReportTemperatureMeasurementMeasuredValue>(),  make_unique<ReadTemperatureMeasurementMinMeasuredValue>(),
        make_unique<ReadTemperatureMeasurementMaxMeasuredValue>(), make_unique<ReadTemperatureMeasurementClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterTestCluster(Commands & commands)
{
    const char * clusterName = "TestCluster";

    commands_list clusterCommands = {
        make_unique<TestClusterTest>(),
        make_unique<TestClusterTestNotHandled>(),
        make_unique<TestClusterTestSpecific>(),
        make_unique<DiscoverTestClusterAttributes>(),
        make_unique<ReadTestClusterBoolean>(),
        make_unique<WriteTestClusterBoolean>(),
        make_unique<ReadTestClusterBitmap8>(),
        make_unique<WriteTestClusterBitmap8>(),
        make_unique<ReadTestClusterBitmap16>(),
        make_unique<WriteTestClusterBitmap16>(),
        make_unique<ReadTestClusterBitmap32>(),
        make_unique<WriteTestClusterBitmap32>(),
        make_unique<ReadTestClusterBitmap64>(),
        make_unique<WriteTestClusterBitmap64>(),
        make_unique<ReadTestClusterInt8u>(),
        make_unique<WriteTestClusterInt8u>(),
        make_unique<ReadTestClusterInt16u>(),
        make_unique<WriteTestClusterInt16u>(),
        make_unique<ReadTestClusterInt32u>(),
        make_unique<WriteTestClusterInt32u>(),
        make_unique<ReadTestClusterInt64u>(),
        make_unique<WriteTestClusterInt64u>(),
        make_unique<ReadTestClusterInt8s>(),
        make_unique<WriteTestClusterInt8s>(),
        make_unique<ReadTestClusterInt16s>(),
        make_unique<WriteTestClusterInt16s>(),
        make_unique<ReadTestClusterInt32s>(),
        make_unique<WriteTestClusterInt32s>(),
        make_unique<ReadTestClusterInt64s>(),
        make_unique<WriteTestClusterInt64s>(),
        make_unique<ReadTestClusterEnum8>(),
        make_unique<WriteTestClusterEnum8>(),
        make_unique<ReadTestClusterEnum16>(),
        make_unique<WriteTestClusterEnum16>(),
        make_unique<ReadTestClusterOctetString>(),
        make_unique<WriteTestClusterOctetString>(),
        make_unique<ReadTestClusterListInt8u>(),
        make_unique<ReadTestClusterClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterThermostat(Commands & commands)
{
    const char * clusterName = "Thermostat";

    commands_list clusterCommands = {
        make_unique<ThermostatClearWeeklySchedule>(),
        make_unique<ThermostatGetRelayStatusLog>(),
        make_unique<ThermostatGetWeeklySchedule>(),
        make_unique<ThermostatSetWeeklySchedule>(),
        make_unique<ThermostatSetpointRaiseLower>(),
        make_unique<DiscoverThermostatAttributes>(),
        make_unique<ReadThermostatLocalTemperature>(),
        make_unique<ReportThermostatLocalTemperature>(),
        make_unique<ReadThermostatOccupiedCoolingSetpoint>(),
        make_unique<WriteThermostatOccupiedCoolingSetpoint>(),
        make_unique<ReadThermostatOccupiedHeatingSetpoint>(),
        make_unique<WriteThermostatOccupiedHeatingSetpoint>(),
        make_unique<ReadThermostatControlSequenceOfOperation>(),
        make_unique<WriteThermostatControlSequenceOfOperation>(),
        make_unique<ReadThermostatSystemMode>(),
        make_unique<WriteThermostatSystemMode>(),
        make_unique<ReadThermostatClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}
void registerClusterWakeOnLan(Commands & commands)
{
    const char * clusterName = "WakeOnLan";

    commands_list clusterCommands = {
        make_unique<DiscoverWakeOnLanAttributes>(),
        make_unique<ReadWakeOnLanWakeOnLanMacAddress>(),
        make_unique<ReadWakeOnLanClusterRevision>(),
    };

    commands.Register(clusterName, clusterCommands);
}

void registerClusters(Commands & commands)
{
    registerClusterAccountLogin(commands);
    registerClusterApplicationBasic(commands);
    registerClusterApplicationLauncher(commands);
    registerClusterAudioOutput(commands);
    registerClusterBarrierControl(commands);
    registerClusterBasic(commands);
    registerClusterBinding(commands);
    registerClusterColorControl(commands);
    registerClusterContentLaunch(commands);
    registerClusterDescriptor(commands);
    registerClusterDoorLock(commands);
    registerClusterGeneralCommissioning(commands);
    registerClusterGroupKeyManagement(commands);
    registerClusterGroups(commands);
    registerClusterIdentify(commands);
    registerClusterKeypadInput(commands);
    registerClusterLevelControl(commands);
    registerClusterLowPower(commands);
    registerClusterMediaInput(commands);
    registerClusterMediaPlayback(commands);
    registerClusterNetworkCommissioning(commands);
    registerClusterOnOff(commands);
    registerClusterOperationalCredentials(commands);
    registerClusterPumpConfigurationAndControl(commands);
    registerClusterScenes(commands);
    registerClusterSwitch(commands);
    registerClusterTvChannel(commands);
    registerClusterTargetNavigator(commands);
    registerClusterTemperatureMeasurement(commands);
    registerClusterTestCluster(commands);
    registerClusterThermostat(commands);
    registerClusterWakeOnLan(commands);
}
