blob: 8e959e07fe7975359ff91baa799b3bb35bfef8ab [file] [log] [blame]
/*
*
* Copyright (c) 2022 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// THIS FILE IS GENERATED BY ZAP
// This file is generated from clusters-Commands.h.zapt
#pragma once
#include <app/data-model/DecodableList.h>
#include <app/data-model/List.h>
#include <app/data-model/NullObject.h>
#include <app/data-model/Nullable.h>
#include <lib/core/DataModelTypes.h>
#include <lib/core/Optional.h>
#include <lib/core/TLV.h>
#include <lib/support/BitMask.h>
#include <clusters/shared/Enums.h>
#include <clusters/shared/Structs.h>
#include <clusters/OperationalCredentials/ClusterId.h>
#include <clusters/OperationalCredentials/CommandIds.h>
#include <clusters/OperationalCredentials/Enums.h>
#include <clusters/OperationalCredentials/Structs.h>
#include <cstdint>
namespace chip {
namespace app {
namespace Clusters {
namespace OperationalCredentials {
namespace Commands {
// Forward-declarations so we can reference these later.
namespace AttestationRequest {
struct Type;
struct DecodableType;
} // namespace AttestationRequest
namespace AttestationResponse {
struct Type;
struct DecodableType;
} // namespace AttestationResponse
namespace CertificateChainRequest {
struct Type;
struct DecodableType;
} // namespace CertificateChainRequest
namespace CertificateChainResponse {
struct Type;
struct DecodableType;
} // namespace CertificateChainResponse
namespace CSRRequest {
struct Type;
struct DecodableType;
} // namespace CSRRequest
namespace CSRResponse {
struct Type;
struct DecodableType;
} // namespace CSRResponse
namespace AddNOC {
struct Type;
struct DecodableType;
} // namespace AddNOC
namespace UpdateNOC {
struct Type;
struct DecodableType;
} // namespace UpdateNOC
namespace NOCResponse {
struct Type;
struct DecodableType;
} // namespace NOCResponse
namespace UpdateFabricLabel {
struct Type;
struct DecodableType;
} // namespace UpdateFabricLabel
namespace RemoveFabric {
struct Type;
struct DecodableType;
} // namespace RemoveFabric
namespace AddTrustedRootCertificate {
struct Type;
struct DecodableType;
} // namespace AddTrustedRootCertificate
namespace SetVIDVerificationStatement {
struct Type;
struct DecodableType;
} // namespace SetVIDVerificationStatement
namespace SignVIDVerificationRequest {
struct Type;
struct DecodableType;
} // namespace SignVIDVerificationRequest
namespace SignVIDVerificationResponse {
struct Type;
struct DecodableType;
} // namespace SignVIDVerificationResponse
} // namespace Commands
namespace Commands {
namespace AttestationRequest {
enum class Fields : uint8_t
{
kAttestationNonce = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::AttestationRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan attestationNonce;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::AttestationResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::AttestationRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan attestationNonce;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace AttestationRequest
namespace AttestationResponse {
enum class Fields : uint8_t
{
kAttestationElements = 0,
kAttestationSignature = 1,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::AttestationResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan attestationElements;
chip::ByteSpan attestationSignature;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::AttestationResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan attestationElements;
chip::ByteSpan attestationSignature;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace AttestationResponse
namespace CertificateChainRequest {
enum class Fields : uint8_t
{
kCertificateType = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::CertificateChainRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
CertificateChainTypeEnum certificateType = static_cast<CertificateChainTypeEnum>(0);
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::CertificateChainResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::CertificateChainRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
CertificateChainTypeEnum certificateType = static_cast<CertificateChainTypeEnum>(0);
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace CertificateChainRequest
namespace CertificateChainResponse {
enum class Fields : uint8_t
{
kCertificate = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::CertificateChainResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan certificate;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::CertificateChainResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan certificate;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace CertificateChainResponse
namespace CSRRequest {
enum class Fields : uint8_t
{
kCSRNonce = 0,
kIsForUpdateNOC = 1,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::CSRRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan CSRNonce;
Optional<bool> isForUpdateNOC;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::CSRResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::CSRRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan CSRNonce;
Optional<bool> isForUpdateNOC;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace CSRRequest
namespace CSRResponse {
enum class Fields : uint8_t
{
kNOCSRElements = 0,
kAttestationSignature = 1,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::CSRResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan NOCSRElements;
chip::ByteSpan attestationSignature;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::CSRResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan NOCSRElements;
chip::ByteSpan attestationSignature;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace CSRResponse
namespace AddNOC {
enum class Fields : uint8_t
{
kNOCValue = 0,
kICACValue = 1,
kIPKValue = 2,
kCaseAdminSubject = 3,
kAdminVendorId = 4,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::AddNOC::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan NOCValue;
Optional<chip::ByteSpan> ICACValue;
chip::ByteSpan IPKValue;
uint64_t caseAdminSubject = static_cast<uint64_t>(0);
chip::VendorId adminVendorId = static_cast<chip::VendorId>(0);
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::AddNOC::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan NOCValue;
Optional<chip::ByteSpan> ICACValue;
chip::ByteSpan IPKValue;
uint64_t caseAdminSubject = static_cast<uint64_t>(0);
chip::VendorId adminVendorId = static_cast<chip::VendorId>(0);
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace AddNOC
namespace UpdateNOC {
enum class Fields : uint8_t
{
kNOCValue = 0,
kICACValue = 1,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::UpdateNOC::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
chip::ByteSpan NOCValue;
Optional<chip::ByteSpan> ICACValue;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::UpdateNOC::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
chip::ByteSpan NOCValue;
Optional<chip::ByteSpan> ICACValue;
CHIP_ERROR Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace UpdateNOC
namespace NOCResponse {
enum class Fields : uint8_t
{
kStatusCode = 0,
kFabricIndex = 1,
kDebugText = 2,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
NodeOperationalCertStatusEnum statusCode = static_cast<NodeOperationalCertStatusEnum>(0);
Optional<chip::FabricIndex> fabricIndex;
Optional<chip::CharSpan> debugText;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::NOCResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
NodeOperationalCertStatusEnum statusCode = static_cast<NodeOperationalCertStatusEnum>(0);
Optional<chip::FabricIndex> fabricIndex;
Optional<chip::CharSpan> debugText;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace NOCResponse
namespace UpdateFabricLabel {
enum class Fields : uint8_t
{
kLabel = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::UpdateFabricLabel::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
chip::CharSpan label;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::UpdateFabricLabel::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
chip::CharSpan label;
CHIP_ERROR Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace UpdateFabricLabel
namespace RemoveFabric {
enum class Fields : uint8_t
{
kFabricIndex = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::NOCResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::RemoveFabric::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace RemoveFabric
namespace AddTrustedRootCertificate {
enum class Fields : uint8_t
{
kRootCACertificate = 0,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::AddTrustedRootCertificate::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan rootCACertificate;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::AddTrustedRootCertificate::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::ByteSpan rootCACertificate;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace AddTrustedRootCertificate
namespace SetVIDVerificationStatement {
enum class Fields : uint8_t
{
kVendorID = 0,
kVIDVerificationStatement = 1,
kVvsc = 2,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::SetVIDVerificationStatement::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
Optional<chip::VendorId> vendorID;
Optional<chip::ByteSpan> VIDVerificationStatement;
Optional<chip::ByteSpan> vvsc;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::SetVIDVerificationStatement::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = true;
Optional<chip::VendorId> vendorID;
Optional<chip::ByteSpan> VIDVerificationStatement;
Optional<chip::ByteSpan> vvsc;
CHIP_ERROR Decode(TLV::TLVReader & reader, FabricIndex aAccessingFabricIndex);
};
}; // namespace SetVIDVerificationStatement
namespace SignVIDVerificationRequest {
enum class Fields : uint8_t
{
kFabricIndex = 0,
kClientChallenge = 1,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::SignVIDVerificationRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
chip::ByteSpan clientChallenge;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = Clusters::OperationalCredentials::Commands::SignVIDVerificationResponse::DecodableType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::SignVIDVerificationRequest::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
chip::ByteSpan clientChallenge;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace SignVIDVerificationRequest
namespace SignVIDVerificationResponse {
enum class Fields : uint8_t
{
kFabricIndex = 0,
kFabricBindingVersion = 1,
kSignature = 2,
};
struct Type
{
public:
// Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand
static constexpr CommandId GetCommandId() { return Commands::SignVIDVerificationResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
uint8_t fabricBindingVersion = static_cast<uint8_t>(0);
chip::ByteSpan signature;
CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const;
using ResponseType = DataModel::NullObjectType;
static constexpr bool MustUseTimedInvoke() { return false; }
};
struct DecodableType
{
public:
static constexpr CommandId GetCommandId() { return Commands::SignVIDVerificationResponse::Id; }
static constexpr ClusterId GetClusterId() { return Clusters::OperationalCredentials::Id; }
static constexpr bool kIsFabricScoped = false;
chip::FabricIndex fabricIndex = static_cast<chip::FabricIndex>(0);
uint8_t fabricBindingVersion = static_cast<uint8_t>(0);
chip::ByteSpan signature;
CHIP_ERROR Decode(TLV::TLVReader & reader);
};
}; // namespace SignVIDVerificationResponse
} // namespace Commands
} // namespace OperationalCredentials
} // namespace Clusters
} // namespace app
} // namespace chip