/**
 * @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 Groups = Cluster(
  { name: "Groups", id: 4, classification: "endpoint" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 4 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "GN", constraint: "0", default: 1, title: "GroupNames" })
  ),
  Attribute(
    {
      name: "NameSupport",
      id: 0,
      type: "NameSupportBitmap",
      access: "R V",
      conformance: "M",
      constraint: "desc",
      quality: "F"
    },
    Field({ name: "GroupNames", constraint: "7", default: 1 })
  ),
  Command(
    {
      name: "AddGroup",
      id: 0,
      access: "F M",
      conformance: "M",
      direction: "request",
      response: "AddGroupResponse"
    },
    Field({ name: "GroupId", id: 0, type: "group-id", conformance: "M", constraint: "min 1" }),
    Field({ name: "GroupName", id: 1, type: "string", conformance: "M", constraint: "max 16" })
  ),
  Command(
    {
      name: "ViewGroup",
      id: 1,
      access: "F O",
      conformance: "M",
      direction: "request",
      response: "ViewGroupResponse"
    },
    Field({ name: "GroupId", id: 0, type: "group-id", conformance: "M", constraint: "min 1" })
  ),
  Command(
    {
      name: "GetGroupMembership",
      id: 2,
      access: "F O",
      conformance: "M",
      direction: "request",
      response: "GetGroupMembershipResponse"
    },
    Field(
      { name: "GroupList", id: 0, type: "list", conformance: "M", constraint: "all[min 1]" },
      Field({ name: "entry", type: "group-id" })
    )
  ),
  Command(
    {
      name: "RemoveGroup",
      id: 3,
      access: "F M",
      conformance: "M",
      direction: "request",
      response: "RemoveGroupResponse"
    },
    Field({ name: "GroupId", id: 0, type: "group-id", conformance: "M", constraint: "min 1" })
  ),
  Command(
    { name: "RemoveAllGroups", id: 4, access: "F M", conformance: "M", direction: "request", response: "status" }
  ),
  Command(
    {
      name: "AddGroupIfIdentifying",
      id: 5,
      access: "F M",
      conformance: "M",
      direction: "request",
      response: "status"
    },
    Field({ name: "GroupId", id: 0, type: "group-id", conformance: "M", constraint: "min 1" }),
    Field({ name: "GroupName", id: 1, type: "string", conformance: "M", constraint: "max 16" })
  ),
  Command(
    { name: "AddGroupResponse", id: 0, conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "status", conformance: "M", constraint: "desc" }),
    Field({ name: "GroupId", id: 1, type: "group-id", conformance: "M", constraint: "min 1" })
  ),
  Command(
    { name: "ViewGroupResponse", id: 1, conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "status", conformance: "M", constraint: "desc" }),
    Field({ name: "GroupId", id: 1, type: "group-id", conformance: "M", constraint: "min 1" }),
    Field({ name: "GroupName", id: 2, type: "string", conformance: "M", constraint: "max 16" })
  ),
  Command(
    { name: "GetGroupMembershipResponse", id: 2, conformance: "M", direction: "response" },
    Field({ name: "Capacity", id: 0, type: "uint8", conformance: "M", quality: "X" }),
    Field(
      { name: "GroupList", id: 1, type: "list", conformance: "M", constraint: "all[min 1]" },
      Field({ name: "entry", type: "group-id" })
    )
  ),
  Command(
    { name: "RemoveGroupResponse", id: 3, conformance: "M", direction: "response" },
    Field({ name: "Status", id: 0, type: "status", conformance: "M", constraint: "desc" }),
    Field({ name: "GroupId", id: 1, type: "group-id", conformance: "M", constraint: "min 1" })
  ),
  Datatype({ name: "NameSupportBitmap", type: "map8" }, Field({ name: "GroupNames", constraint: "7" }))
);
MatterDefinition.children.push(Groups);
export {
  Groups
};
//# sourceMappingURL=groups.element.js.map
