/**
 * @license
 * Copyright 2022-2025 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 GroupKeyManagement = Cluster(
  { name: "GroupKeyManagement", id: 63, classification: "node" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 2 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "CS", conformance: "P", constraint: "0", title: "CacheAndSync" })
  ),
  Attribute(
    {
      name: "GroupKeyMap",
      id: 0,
      type: "list",
      access: "RW F VM",
      conformance: "M",
      constraint: "desc",
      default: [],
      quality: "N"
    },
    Field({ name: "entry", type: "GroupKeyMapStruct" })
  ),
  Attribute(
    {
      name: "GroupTable",
      id: 1,
      type: "list",
      access: "R F V",
      conformance: "M",
      constraint: "desc",
      default: []
    },
    Field({ name: "entry", type: "GroupInfoMapStruct" })
  ),
  Attribute({ name: "MaxGroupsPerFabric", id: 2, type: "uint16", access: "R V", conformance: "M", default: 0, quality: "F" }),
  Attribute({
    name: "MaxGroupKeysPerFabric",
    id: 3,
    type: "uint16",
    access: "R V",
    conformance: "M",
    constraint: "1 to 65535",
    default: 1,
    quality: "F"
  }),
  Command(
    { name: "KeySetWrite", id: 0, access: "F A", conformance: "M", direction: "request", response: "status" },
    Field({ name: "GroupKeySet", id: 0, type: "GroupKeySetStruct", conformance: "M" })
  ),
  Command(
    {
      name: "KeySetRead",
      id: 1,
      access: "F A",
      conformance: "M",
      direction: "request",
      response: "KeySetReadResponse"
    },
    Field({ name: "GroupKeySetId", id: 0, type: "uint16", conformance: "M" })
  ),
  Command(
    { name: "KeySetReadResponse", id: 2, conformance: "M", direction: "response" },
    Field({ name: "GroupKeySet", id: 0, type: "GroupKeySetStruct", conformance: "M" })
  ),
  Command(
    { name: "KeySetRemove", id: 3, access: "F A", conformance: "M", direction: "request", response: "status" },
    Field({ name: "GroupKeySetId", id: 0, type: "uint16", conformance: "M" })
  ),
  Command(
    {
      name: "KeySetReadAllIndices",
      id: 4,
      access: "F A",
      conformance: "M",
      direction: "request",
      response: "KeySetReadAllIndicesResponse"
    },
    Field({ name: "DoNotUse", id: 0, conformance: "X" })
  ),
  Command(
    { name: "KeySetReadAllIndicesResponse", id: 5, conformance: "M", direction: "response" },
    Field(
      { name: "GroupKeySetIDs", id: 0, type: "list", conformance: "M" },
      Field({ name: "entry", type: "uint16" })
    )
  ),
  Datatype(
    { name: "GroupKeySecurityPolicyEnum", type: "enum8" },
    Field({ name: "TrustFirst", id: 0, conformance: "M" }),
    Field({ name: "CacheAndSync", id: 1, conformance: "CS" })
  ),
  Datatype(
    { name: "GroupKeyMulticastPolicyEnum", type: "enum8" },
    Field({ name: "PerGroupId", id: 0, conformance: "M" }),
    Field({ name: "AllNodes", id: 1, conformance: "M" })
  ),
  Datatype(
    { name: "GroupKeyMapStruct", type: "struct" },
    Field({ name: "GroupId", id: 1, type: "group-id", access: "F", conformance: "M" }),
    Field({ name: "GroupKeySetId", id: 2, type: "uint16", access: "F", conformance: "M", constraint: "1 to 65535" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  ),
  Datatype(
    { name: "GroupKeySetStruct", type: "struct" },
    Field({ name: "GroupKeySetId", id: 0, type: "uint16", conformance: "M" }),
    Field({ name: "GroupKeySecurityPolicy", id: 1, type: "GroupKeySecurityPolicyEnum", access: "S", conformance: "M" }),
    Field({ name: "EpochKey0", id: 2, type: "octstr", access: "S", conformance: "M", constraint: "16", quality: "X" }),
    Field({ name: "EpochStartTime0", id: 3, type: "epoch-us", access: "S", conformance: "M", quality: "X" }),
    Field({ name: "EpochKey1", id: 4, type: "octstr", access: "S", conformance: "M", constraint: "16", quality: "X" }),
    Field({ name: "EpochStartTime1", id: 5, type: "epoch-us", access: "S", conformance: "M", quality: "X" }),
    Field({ name: "EpochKey2", id: 6, type: "octstr", access: "S", conformance: "M", constraint: "16", quality: "X" }),
    Field({ name: "EpochStartTime2", id: 7, type: "epoch-us", access: "S", conformance: "M", quality: "X" }),
    Field({
      name: "GroupKeyMulticastPolicy",
      id: 8,
      type: "GroupKeyMulticastPolicyEnum",
      access: "S",
      conformance: "O",
      default: 0
    })
  ),
  Datatype(
    { name: "GroupInfoMapStruct", type: "struct" },
    Field({ name: "GroupId", id: 1, type: "group-id", access: "F", conformance: "M" }),
    Field(
      { name: "Endpoints", id: 2, type: "list", access: "F", conformance: "M", constraint: "min 1" },
      Field({ name: "entry", type: "endpoint-no" })
    ),
    Field({ name: "GroupName", id: 3, type: "string", access: "F", conformance: "O", constraint: "max 16" }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  )
);
MatterDefinition.children.push(GroupKeyManagement);
export {
  GroupKeyManagement
};
//# sourceMappingURL=group-key-management.element.js.map
