/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const OperationalCredentials = Cluster(
  { name: "OperationalCredentials", id: 62, classification: "node" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    {
      name: "Nocs",
      id: 0,
      type: "list",
      access: "R F A",
      conformance: "M",
      constraint: "max supportedFabrics",
      quality: "N C"
    },
    Field({ name: "entry", type: "NOCStruct" })
  ),
  Attribute(
    {
      name: "Fabrics",
      id: 1,
      type: "list",
      access: "R F V",
      conformance: "M",
      constraint: "max supportedFabrics",
      quality: "N"
    },
    Field({ name: "entry", type: "FabricDescriptorStruct" })
  ),
  Attribute({
    name: "SupportedFabrics",
    id: 2,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "5 to 254",
    quality: "F"
  }),
  Attribute({
    name: "CommissionedFabrics",
    id: 3,
    type: "uint8",
    access: "R V",
    conformance: "M",
    constraint: "max supportedFabrics",
    quality: "N"
  }),
  Attribute(
    {
      name: "TrustedRootCertificates",
      id: 4,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "max supportedFabrics[max 400]",
      quality: "N C"
    },
    Field({ name: "entry", type: "octstr" })
  ),
  Attribute({ name: "CurrentFabricIndex", id: 5, type: "fabric-idx", access: "R V", conformance: "M", default: 0 }),
  Command(
    {
      name: "AttestationRequest",
      id: 0,
      access: "A",
      conformance: "M",
      direction: "request",
      response: "AttestationResponse"
    },
    Field({ name: "AttestationNonce", id: 0, type: "octstr", conformance: "M", constraint: "32" })
  ),
  Command(
    { name: "AttestationResponse", id: 1, conformance: "M", direction: "response" },
    Field({ name: "AttestationElements", id: 0, type: "octstr", conformance: "M", constraint: "max 900" }),
    Field({ name: "AttestationSignature", id: 1, type: "octstr", conformance: "M", constraint: "64" })
  ),
  Command(
    {
      name: "CertificateChainRequest",
      id: 2,
      access: "A",
      conformance: "M",
      direction: "request",
      response: "CertificateChainResponse"
    },
    Field({ name: "CertificateType", id: 0, type: "CertificateChainTypeEnum", conformance: "M", constraint: "desc" })
  ),
  Command(
    { name: "CertificateChainResponse", id: 3, conformance: "M", direction: "response" },
    Field({ name: "Certificate", id: 0, type: "octstr", conformance: "M", constraint: "max 600" })
  ),
  Command(
    { name: "CsrRequest", id: 4, access: "A", conformance: "M", direction: "request", response: "CsrResponse" },
    Field({ name: "CsrNonce", id: 0, type: "octstr", conformance: "M", constraint: "32" }),
    Field({ name: "IsForUpdateNoc", id: 1, type: "bool", conformance: "O", default: false })
  ),
  Command(
    { name: "CsrResponse", id: 5, conformance: "M", direction: "response" },
    Field({ name: "NocsrElements", id: 0, type: "octstr", conformance: "M", constraint: "max 900" }),
    Field({ name: "AttestationSignature", id: 1, type: "octstr", conformance: "M", constraint: "64" })
  ),
  Command(
    { name: "AddNoc", id: 6, access: "A", conformance: "M", direction: "request", response: "NocResponse" },
    Field({ name: "NocValue", id: 0, type: "octstr", conformance: "M", constraint: "max 400" }),
    Field({ name: "IcacValue", id: 1, type: "octstr", conformance: "O", constraint: "max 400" }),
    Field({ name: "IpkValue", id: 2, type: "octstr", conformance: "M", constraint: "16" }),
    Field({ name: "CaseAdminSubject", id: 3, type: "subject-id", conformance: "M" }),
    Field({ name: "AdminVendorId", id: 4, type: "vendor-id", conformance: "M" })
  ),
  Command(
    { name: "UpdateNoc", id: 7, access: "F A", conformance: "M", direction: "request", response: "NocResponse" },
    Field({ name: "NocValue", id: 0, type: "octstr", access: "F", conformance: "M", constraint: "max 400" }),
    Field({ name: "IcacValue", id: 1, type: "octstr", access: "F", conformance: "O", constraint: "max 400" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  Command(
    { name: "NocResponse", id: 8, conformance: "M", direction: "response" },
    Field({ name: "StatusCode", id: 0, type: "NodeOperationalCertStatusEnum", conformance: "M" }),
    Field({
      name: "FabricIndex",
      id: 1,
      type: "fabric-idx",
      conformance: "StatusCode == Ok, O",
      constraint: "1 to 254"
    }),
    Field({ name: "DebugText", id: 2, type: "string", conformance: "O", constraint: "max 128" })
  ),
  Command(
    {
      name: "UpdateFabricLabel",
      id: 9,
      access: "F A",
      conformance: "M",
      direction: "request",
      response: "NocResponse"
    },
    Field({ name: "Label", id: 0, type: "string", access: "F", conformance: "M", constraint: "max 32" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  Command(
    { name: "RemoveFabric", id: 10, access: "A", conformance: "M", direction: "request", response: "NocResponse" },
    Field({ name: "FabricIndex", id: 0, type: "fabric-idx", conformance: "M", constraint: "1 to 254" })
  ),
  Command(
    {
      name: "AddTrustedRootCertificate",
      id: 11,
      access: "A",
      conformance: "M",
      direction: "request",
      response: "status"
    },
    Field({ name: "RootCaCertificate", id: 0, type: "octstr", conformance: "M", constraint: "max 400" })
  ),
  Command(
    {
      name: "SetVidVerificationStatement",
      id: 12,
      access: "F A",
      conformance: "M",
      direction: "request",
      response: "status"
    },
    Field({ name: "VendorId", id: 0, type: "vendor-id", conformance: "O.a+" }),
    Field({ name: "VidVerificationStatement", id: 1, type: "octstr", conformance: "O.a+", constraint: "max 85" }),
    Field({ name: "Vvsc", id: 2, type: "octstr", conformance: "O.a+", constraint: "max 400" })
  ),
  Command(
    {
      name: "SignVidVerificationRequest",
      id: 13,
      access: "A",
      conformance: "M",
      direction: "request",
      response: "SignVidVerificationResponse"
    },
    Field({ name: "FabricIndex", id: 0, type: "fabric-idx", conformance: "M", constraint: "1 to 254" }),
    Field({ name: "ClientChallenge", id: 1, type: "octstr", conformance: "M", constraint: "32" })
  ),
  Command(
    { name: "SignVidVerificationResponse", id: 14, conformance: "M", direction: "response" },
    Field({ name: "FabricIndex", id: 0, type: "fabric-idx", conformance: "M", constraint: "1 to 254" }),
    Field({ name: "FabricBindingVersion", id: 1, type: "uint8", conformance: "M", constraint: "1 to 255" }),
    Field({ name: "Signature", id: 2, type: "octstr", conformance: "M", constraint: "min 1" })
  ),
  Datatype(
    { name: "CertificateChainTypeEnum", type: "enum8" },
    Field({ name: "DacCertificate", id: 1, conformance: "M" }),
    Field({ name: "PaiCertificate", id: 2, conformance: "M" })
  ),
  Datatype(
    { name: "NodeOperationalCertStatusEnum", type: "enum8" },
    Field({ name: "Ok", id: 0, conformance: "M" }),
    Field({ name: "InvalidPublicKey", id: 1, conformance: "M" }),
    Field({ name: "InvalidNodeOpId", id: 2, conformance: "M" }),
    Field({ name: "InvalidNoc", id: 3, conformance: "M" }),
    Field({ name: "MissingCsr", id: 4, conformance: "M" }),
    Field({ name: "TableFull", id: 5, conformance: "M" }),
    Field({ name: "InvalidAdminSubject", id: 6, conformance: "M" }),
    Field({ name: "FabricConflict", id: 9, conformance: "M" }),
    Field({ name: "LabelConflict", id: 10, conformance: "M" }),
    Field({ name: "InvalidFabricIndex", id: 11, conformance: "M" })
  ),
  Datatype(
    { name: "NOCStruct", type: "struct" },
    Field({ name: "Noc", id: 1, type: "octstr", access: "F", conformance: "M", constraint: "max 400" }),
    Field({ name: "Icac", id: 2, type: "octstr", access: "F", conformance: "M", constraint: "max 400", quality: "X" }),
    Field({ name: "Vvsc", id: 3, type: "octstr", access: "F", conformance: "desc", constraint: "max 400" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  Datatype(
    { name: "FabricDescriptorStruct", type: "struct" },
    Field({ name: "RootPublicKey", id: 1, type: "octstr", access: "F", conformance: "M", constraint: "65" }),
    Field({ name: "VendorId", id: 2, type: "vendor-id", access: "F", conformance: "M", constraint: "desc" }),
    Field({ name: "FabricId", id: 3, type: "fabric-id", access: "F", conformance: "M" }),
    Field({ name: "NodeId", id: 4, type: "node-id", access: "F", conformance: "M" }),
    Field({ name: "Label", id: 5, type: "string", access: "F", conformance: "M", constraint: "max 32" }),
    Field({ name: "VidVerificationStatement", id: 6, type: "octstr", access: "F", conformance: "O", constraint: "85" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  )
);
MatterDefinition.children.push(OperationalCredentials);
export {
  OperationalCredentials
};
//# sourceMappingURL=operational-credentials.element.js.map
