/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MutableCluster } from "../cluster/mutation/MutableCluster.js";
import {
  Attribute,
  OptionalWritableAttribute,
  Event,
  FixedAttribute,
  Command,
  TlvNoResponse,
  WritableAttribute,
  OptionalCommand,
  OptionalAttribute
} from "../cluster/Cluster.js";
import { TlvEnum, TlvUInt32, TlvUInt16, TlvUInt8, TlvBitmap, TlvEpochS } from "../tlv/TlvNumber.js";
import { TlvNullable } from "../tlv/TlvNullable.js";
import { AccessLevel } from "#model";
import { Priority } from "../globals/Priority.js";
import { TlvField, TlvObject, TlvOptionalField } from "../tlv/TlvObject.js";
import { BitFlag, BitField } from "../schema/BitmapSchema.js";
import { TlvString, TlvByteString } from "../tlv/TlvString.js";
import { TlvArray } from "../tlv/TlvArray.js";
import { TlvFabricIndex } from "../datatype/FabricIndex.js";
import { Status } from "../globals/Status.js";
import { TlvBoolean } from "../tlv/TlvBoolean.js";
import { TlvNodeId } from "../datatype/NodeId.js";
import { TlvNoArguments } from "../tlv/TlvNoArguments.js";
import { StatusResponseError } from "../common/StatusResponseError.js";
import { ClusterType } from "../cluster/ClusterType.js";
import { ClusterRegistry } from "../cluster/ClusterRegistry.js";
var DoorLock;
((DoorLock2) => {
  let Feature;
  ((Feature2) => {
    Feature2["PinCredential"] = "PinCredential";
    Feature2["RfidCredential"] = "RfidCredential";
    Feature2["FingerCredentials"] = "FingerCredentials";
    Feature2["WeekDayAccessSchedules"] = "WeekDayAccessSchedules";
    Feature2["DoorPositionSensor"] = "DoorPositionSensor";
    Feature2["FaceCredentials"] = "FaceCredentials";
    Feature2["CredentialOverTheAirAccess"] = "CredentialOverTheAirAccess";
    Feature2["User"] = "User";
    Feature2["YearDayAccessSchedules"] = "YearDayAccessSchedules";
    Feature2["HolidaySchedules"] = "HolidaySchedules";
    Feature2["Unbolting"] = "Unbolting";
    Feature2["AliroProvisioning"] = "AliroProvisioning";
    Feature2["AliroBleuwb"] = "AliroBleuwb";
  })(Feature = DoorLock2.Feature || (DoorLock2.Feature = {}));
  let DoorState;
  ((DoorState2) => {
    DoorState2[DoorState2["DoorOpen"] = 0] = "DoorOpen";
    DoorState2[DoorState2["DoorClosed"] = 1] = "DoorClosed";
    DoorState2[DoorState2["DoorJammed"] = 2] = "DoorJammed";
    DoorState2[DoorState2["DoorForcedOpen"] = 3] = "DoorForcedOpen";
    DoorState2[DoorState2["DoorUnspecifiedError"] = 4] = "DoorUnspecifiedError";
    DoorState2[DoorState2["DoorAjar"] = 5] = "DoorAjar";
  })(DoorState = DoorLock2.DoorState || (DoorLock2.DoorState = {}));
  DoorLock2.TlvDoorStateChangeEvent = TlvObject({
    /**
     * This field shall indicate the new door state for this door event.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.2.1
     */
    doorState: TlvField(0, TlvEnum())
  });
  DoorLock2.CredentialRules = {
    /**
     * Only one credential is required for lock operation
     */
    single: BitFlag(0),
    /**
     * Any two credentials are required for lock operation
     */
    dual: BitFlag(1),
    /**
     * Any three credentials are required for lock operation
     */
    tri: BitFlag(2)
  };
  let DataOperationType;
  ((DataOperationType2) => {
    DataOperationType2[DataOperationType2["Add"] = 0] = "Add";
    DataOperationType2[DataOperationType2["Clear"] = 1] = "Clear";
    DataOperationType2[DataOperationType2["Modify"] = 2] = "Modify";
  })(DataOperationType = DoorLock2.DataOperationType || (DoorLock2.DataOperationType = {}));
  let UserStatus;
  ((UserStatus2) => {
    UserStatus2[UserStatus2["Available"] = 0] = "Available";
    UserStatus2[UserStatus2["OccupiedEnabled"] = 1] = "OccupiedEnabled";
    UserStatus2[UserStatus2["OccupiedDisabled"] = 3] = "OccupiedDisabled";
  })(UserStatus = DoorLock2.UserStatus || (DoorLock2.UserStatus = {}));
  let UserType;
  ((UserType2) => {
    UserType2[UserType2["UnrestrictedUser"] = 0] = "UnrestrictedUser";
    UserType2[UserType2["YearDayScheduleUser"] = 1] = "YearDayScheduleUser";
    UserType2[UserType2["WeekDayScheduleUser"] = 2] = "WeekDayScheduleUser";
    UserType2[UserType2["ProgrammingUser"] = 3] = "ProgrammingUser";
    UserType2[UserType2["NonAccessUser"] = 4] = "NonAccessUser";
    UserType2[UserType2["ForcedUser"] = 5] = "ForcedUser";
    UserType2[UserType2["DisposableUser"] = 6] = "DisposableUser";
    UserType2[UserType2["ExpiringUser"] = 7] = "ExpiringUser";
    UserType2[UserType2["ScheduleRestrictedUser"] = 8] = "ScheduleRestrictedUser";
    UserType2[UserType2["RemoteOnlyUser"] = 9] = "RemoteOnlyUser";
  })(UserType = DoorLock2.UserType || (DoorLock2.UserType = {}));
  let CredentialRule;
  ((CredentialRule2) => {
    CredentialRule2[CredentialRule2["Single"] = 0] = "Single";
    CredentialRule2[CredentialRule2["Dual"] = 1] = "Dual";
    CredentialRule2[CredentialRule2["Tri"] = 2] = "Tri";
  })(CredentialRule = DoorLock2.CredentialRule || (DoorLock2.CredentialRule = {}));
  DoorLock2.TlvSetUserRequest = TlvObject({
    /**
     * This field shall indicate the type of operation.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.1
     */
    operationType: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 })),
    /**
     * This field shall contain a string to use as a human readable identifier for the user.
     *
     * If UserName is null then:
     *
     *   - If the OperationType is Add, the UserName in the resulting user record shall be set to an empty string.
     *
     *   - If the OperationType is Modify, the UserName in the user record shall NOT be changed from the current
     *     value.
     *
     * If UserName is not null, the UserName in the user record shall be set to the provided value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.3
     */
    userName: TlvField(2, TlvNullable(TlvString.bound({ maxLength: 10 }))),
    /**
     * This field shall indicate the fabric assigned number to use for connecting this user to other users on other
     * devices from the fabric’s perspective.
     *
     * If UserUniqueID is null then:
     *
     *   - If the OperationType is Add, the UserUniqueID in the resulting user record shall be set to default value
     *     specified above.
     *
     *   - If the OperationType is Modify, the UserUniqueID in the user record shall NOT be changed from the current
     *     value.
     *
     * If UserUniqueID is not null, the UserUniqueID in the user record shall be set to the provided value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.4
     */
    userUniqueId: TlvField(3, TlvNullable(TlvUInt32)),
    /**
     * This field shall indicate the UserStatus to assign to this user when created or modified.
     *
     * If UserStatus is null then:
     *
     *   - If the OperationType is Add, the UserStatus in the resulting user record shall be set to default value
     *     specified above.
     *
     *   - If the OperationType is Modify, the UserStatus in the user record shall NOT be changed from the current
     *     value.
     *
     * If UserStatus is not null, the UserStatus in the user record shall be set to the provided value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.5
     */
    userStatus: TlvField(4, TlvNullable(TlvEnum())),
    /**
     * This field shall indicate the UserType to assign to this user when created or modified.
     *
     * If UserType is null then:
     *
     *   - If the OperationType is Add, the UserType in the resulting user record shall be set to default value
     *     specified above.
     *
     *   - If the OperationType is Modify, the UserType in the user record shall NOT be changed from the current
     *     value.
     *
     * If UserType is not null, the UserType in the user record shall be set to the provided value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.6
     */
    userType: TlvField(5, TlvNullable(TlvEnum())),
    /**
     * This field shall indicate the CredentialRule to use for this user.
     *
     * The valid CredentialRule enumeration values depends on the bits in the CredentialRulesBitmap map. Each bit in
     * the map identifies a valid CredentialRule that can be used.
     *
     * If CredentialRule is null then:
     *
     *   - If the OperationType is Add, the CredentialRule in the resulting user record shall be set to default
     *     value specified above.
     *
     *   - If the OperationType is Modify, the CredentialRule in the user record shall NOT be changed from the
     *     current value.
     *
     * If CredentialRule is not null, the CredentialRule in the user record shall be set to the provided value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32.7
     */
    credentialRule: TlvField(6, TlvNullable(TlvEnum()))
  });
  DoorLock2.TlvGetUserRequest = TlvObject({ userIndex: TlvField(0, TlvUInt16.bound({ min: 1 })) });
  let CredentialType;
  ((CredentialType2) => {
    CredentialType2[CredentialType2["ProgrammingPin"] = 0] = "ProgrammingPin";
    CredentialType2[CredentialType2["Pin"] = 1] = "Pin";
    CredentialType2[CredentialType2["Rfid"] = 2] = "Rfid";
    CredentialType2[CredentialType2["Fingerprint"] = 3] = "Fingerprint";
    CredentialType2[CredentialType2["FingerVein"] = 4] = "FingerVein";
    CredentialType2[CredentialType2["Face"] = 5] = "Face";
    CredentialType2[CredentialType2["AliroCredentialIssuerKey"] = 6] = "AliroCredentialIssuerKey";
    CredentialType2[CredentialType2["AliroEvictableEndpointKey"] = 7] = "AliroEvictableEndpointKey";
    CredentialType2[CredentialType2["AliroNonEvictableEndpointKey"] = 8] = "AliroNonEvictableEndpointKey";
  })(CredentialType = DoorLock2.CredentialType || (DoorLock2.CredentialType = {}));
  DoorLock2.TlvCredential = TlvObject({
    /**
     * This field shall indicate the credential field used to authorize the lock operation.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.24.1
     */
    credentialType: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the index of the specific credential used to authorize the lock operation in the
     * list of credentials identified by CredentialType (e.g. PIN, RFID, etc.). This field shall be set to 0 if
     * CredentialType is ProgrammingPIN or does not correspond to a list that can be indexed into.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.24.2
     */
    credentialIndex: TlvField(1, TlvUInt16)
  });
  DoorLock2.TlvGetUserResponse = TlvObject({
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.1
     */
    userIndex: TlvField(0, TlvUInt16.bound({ min: 1 })),
    /**
     * This field shall contain a string to use as a human readable identifier for the user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.2
     */
    userName: TlvField(1, TlvNullable(TlvString.bound({ maxLength: 10 }))),
    /**
     * See UserUniqueID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.3
     */
    userUniqueId: TlvField(2, TlvNullable(TlvUInt32)),
    /**
     * This field shall indicate the UserStatus assigned to the user when created or modified.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.4
     */
    userStatus: TlvField(3, TlvNullable(TlvEnum())),
    /**
     * This field shall indicate the UserType assigned to this user when created or modified.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.5
     */
    userType: TlvField(4, TlvNullable(TlvEnum())),
    /**
     * This field shall indicate the CredentialRule set for this user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.6
     */
    credentialRule: TlvField(5, TlvNullable(TlvEnum())),
    /**
     * This field shall contain a list of credentials for this user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.7
     */
    credentials: TlvField(6, TlvNullable(TlvArray(DoorLock2.TlvCredential, { minLength: 0 }))),
    /**
     * This field shall indicate the user’s creator fabric index. CreatorFabricIndex shall be null if UserStatus is
     * set to Available or when the creator fabric cannot be determined (for example, when user was created outside
     * the Interaction Model) and shall NOT be null otherwise. This value shall be set to 0 if the original creator
     * fabric was deleted.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.8
     */
    creatorFabricIndex: TlvField(7, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the user’s last modifier fabric index. LastModifiedFabricIndex shall be null if
     * UserStatus is set to Available or when the modifier fabric cannot be determined (for example, when user was
     * modified outside the Interaction Model) and shall NOT be null otherwise. This value shall be set to 0 if the
     * last modifier fabric was deleted.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.9
     */
    lastModifiedFabricIndex: TlvField(8, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the next occupied UserIndex in the database which is useful for quickly identifying
     * occupied user slots in the database. This shall NOT be null if there is at least one occupied entry after the
     * requested UserIndex in the User database and shall be null if there are no more occupied entries.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.34.10
     */
    nextUserIndex: TlvField(9, TlvNullable(TlvUInt16.bound({ min: 1 })))
  });
  DoorLock2.TlvClearUserRequest = TlvObject({
    /**
     * This field shall specify a valid User index or 0xFFFE to indicate all user slots shall be cleared.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.35.1
     */
    userIndex: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvSetCredentialRequest = TlvObject({
    /**
     * This field shall indicate the set credential operation type requested.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.1
     */
    operationType: TlvField(0, TlvEnum()),
    /**
     * This field shall contain a credential structure that contains the CredentialTypeEnum and the credential index
     * (if applicable or 0 if not) to set.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.2
     */
    credential: TlvField(1, DoorLock2.TlvCredential),
    /**
     * This field shall indicate the credential data to set for the credential being added or modified. The length
     * of the credential data shall conform to the limits of the CredentialType specified in the Credential
     * structure otherwise an INVALID_COMMAND status shall be returned in the SetCredentialResponse command.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.3
     */
    credentialData: TlvField(2, TlvByteString),
    /**
     * This field shall indicate the user index to the user record that corresponds to the credential being added or
     * modified. This shall be null if OperationType is add and a new credential and user is being added at the same
     * time.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.4
     */
    userIndex: TlvField(3, TlvNullable(TlvUInt16.bound({ min: 1 }))),
    /**
     * This field shall indicate the user status to use in the new user record if a new user isbeingcreated. This
     * shall be null if OperationType is Modify. This may be null when adding a new credential and user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.5
     */
    userStatus: TlvField(4, TlvNullable(TlvEnum())),
    /**
     * This field shall indicate the user type to use in the new user record if a new user is beingcreated. This
     * shall be null if OperationType is Modify. This may be null when adding a new credential and user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36.6
     */
    userType: TlvField(5, TlvNullable(TlvEnum()))
  });
  DoorLock2.TlvSetCredentialResponse = TlvObject({
    /**
     * Status comes from the Status Codes table and shall be one of the following values:
     *
     *   - SUCCESS, if setting user credential was successful.
     *
     *   - FAILURE, if some unexpected internal error occurred setting user credential.
     *
     *   - OCCUPIED, if OperationType is Add and CredentialIndex in Credential structure points to an occupied slot.
     *
     *   - OCCUPIED, if OperationType is Modify and CredentialIndex in Credential structure does not match the
     *     CredentialIndex that is already associated with the provided UserIndex.
     *
     *   - DUPLICATE, if CredentialData provided is a duplicate of another credential with the same CredentialType
     *     (e.g. duplicate PIN code).
     *
     *   - RESOURCE_EXHAUSTED, if OperationType is Add and the new credential cannot be added due to resource
     *     constraints such as:
     *
     *     - The user referred to by UserIndex already has NumberOfCredentialsSupportedPerUser credentials
     *       associated.
     *
     *     - The credential is of type AliroEvictableEndpointKey or AliroNonEvictableEndpointKey, and adding it
     *       would cause the total number of credentials of those two types to exceed
     *       NumberOfAliroEndpointKeysSupported.
     *
     *   - INVALID_COMMAND, if one or more fields violate constraints or are invalid.
     *
     *   - INVALID_COMMAND, if the CredentialIndex in the Credential provided exceeds the number of credentials of
     *     the provided CredentialType supported by the lock.
     *
     *   - INVALID_COMMAND, if OperationType is Modify and UserIndex points to an available slot.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.37.1
     */
    status: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the user index that was created with the new credential. If the status being
     * returned is not success then this shall be null. This shall be null if OperationType was Modify; if the
     * OperationType was Add and a new User was created this shall NOT be null and shall provide the UserIndex
     * created. If the OperationType was Add and an existing User was associated with the new credential then this
     * shall be null.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.37.2
     */
    userIndex: TlvField(1, TlvNullable(TlvUInt16.bound({ min: 1 }))),
    /**
     * This field shall indicate the next available index in the database for the credential type set, which is
     * useful for quickly identifying available credential slots in the database. This shall NOT be null if there is
     * at least one available entry after the requested credential index in the corresponding database and shall be
     * null if there are no more available entries. The NextCredentialIndex reported shall NOT exceed the maximum
     * number of credentials for a particular credential type.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.37.3
     */
    nextCredentialIndex: TlvOptionalField(2, TlvNullable(TlvUInt16))
  });
  DoorLock2.TlvGetCredentialStatusRequest = TlvObject({
    /**
     * This field shall contain a credential structure that contains the CredentialTypeEnum and the credential index
     * (if applicable or 0 if not) to retrieve the status for.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.38.1
     */
    credential: TlvField(0, DoorLock2.TlvCredential)
  });
  DoorLock2.TlvGetCredentialStatusResponse = TlvObject({
    /**
     * This field shall indicate if the requested credential type and index exists and is populated for the
     * requested user index.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.1
     */
    credentialExists: TlvField(0, TlvBoolean),
    /**
     * This field shall indicate the credential’s corresponding user index value if the credential exists. If
     * CredentialType requested was ProgrammingPIN then UserIndex shall be null; otherwise, UserIndex shall be null
     * if CredentialExists is set to False and shall NOT be null if CredentialExists is set to True.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.2
     */
    userIndex: TlvField(1, TlvNullable(TlvUInt16.bound({ min: 1 }))),
    /**
     * This field shall indicate the credential’s creator fabric index. CreatorFabricIndex shall be null if
     * CredentialExists is set to False or when the creator fabric cannot be determined (for example, when
     * credential was created outside the Interaction Model) and shall NOT be null otherwise. This value shall be
     * set to 0 if the original creator fabric was deleted.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.3
     */
    creatorFabricIndex: TlvField(2, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the credential’s last modifier fabric index. LastModifiedFabricIndex shall be null
     * if CredentialExists is set to False or when the modifier fabric cannot be determined (for example, when
     * credential was modified outside the Interaction Model) and shall NOT be nullotherwise. This value shall be
     * set to 0 if the last modifier fabric was deleted.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.4
     */
    lastModifiedFabricIndex: TlvField(3, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the next occupied index in the database for the credential type requested, which is
     * useful for quickly identifying occupied credential slots in the database. This shall NOT be null if there is
     * at least one occupied entry after the requested credential index in the corresponding database and shall be
     * null if there are no more occupied entries. The NextCredentialIndex reported shall NOT exceed the maximum
     * number of credentials for a particular credential type.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.5
     */
    nextCredentialIndex: TlvOptionalField(4, TlvNullable(TlvUInt16)),
    /**
     * This field shall indicate the credential data for the requested user index.
     *
     * If the CredentialType in the GetCredentialStatus command was not AliroCredentialIssuerKey,
     * AliroEvictableEndpointKey, or AliroNonEvictableEndpointKey, this field shall NOT be included.
     *
     * Otherwise, if CredentialExists is false this field shall be null.
     *
     * Otherwise, the value of this field shall be the value of the relevant credential, as a 65-byte uncompressed
     * elliptic curve public key as defined in section 2.3.3 of SEC 1.
     *
     * > [!NOTE]
     *
     * > Since the Aliro credentials are public keys, there is no security risk in allowing them to be read.
     *   Possession of the credential octet string does not allow operating the lock.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.39.6
     */
    credentialData: TlvOptionalField(5, TlvNullable(TlvByteString))
  });
  DoorLock2.TlvClearCredentialRequest = TlvObject({
    /**
     * This field shall contain a credential structure that contains the CredentialTypeEnum and the credential index
     * (0xFFFE for all credentials or 0 if not applicable) to clear. This shall be null if clearing all credential
     * types otherwise it shall NOT be null.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.40.1
     */
    credential: TlvField(0, TlvNullable(DoorLock2.TlvCredential))
  });
  let LockDataType;
  ((LockDataType2) => {
    LockDataType2[LockDataType2["Unspecified"] = 0] = "Unspecified";
    LockDataType2[LockDataType2["ProgrammingCode"] = 1] = "ProgrammingCode";
    LockDataType2[LockDataType2["UserIndex"] = 2] = "UserIndex";
    LockDataType2[LockDataType2["WeekDaySchedule"] = 3] = "WeekDaySchedule";
    LockDataType2[LockDataType2["YearDaySchedule"] = 4] = "YearDaySchedule";
    LockDataType2[LockDataType2["HolidaySchedule"] = 5] = "HolidaySchedule";
    LockDataType2[LockDataType2["Pin"] = 6] = "Pin";
    LockDataType2[LockDataType2["Rfid"] = 7] = "Rfid";
    LockDataType2[LockDataType2["Fingerprint"] = 8] = "Fingerprint";
    LockDataType2[LockDataType2["FingerVein"] = 9] = "FingerVein";
    LockDataType2[LockDataType2["Face"] = 10] = "Face";
    LockDataType2[LockDataType2["AliroCredentialIssuerKey"] = 11] = "AliroCredentialIssuerKey";
    LockDataType2[LockDataType2["AliroEvictableEndpointKey"] = 12] = "AliroEvictableEndpointKey";
    LockDataType2[LockDataType2["AliroNonEvictableEndpointKey"] = 13] = "AliroNonEvictableEndpointKey";
  })(LockDataType = DoorLock2.LockDataType || (DoorLock2.LockDataType = {}));
  let OperationSource;
  ((OperationSource2) => {
    OperationSource2[OperationSource2["Unspecified"] = 0] = "Unspecified";
    OperationSource2[OperationSource2["Manual"] = 1] = "Manual";
    OperationSource2[OperationSource2["ProprietaryRemote"] = 2] = "ProprietaryRemote";
    OperationSource2[OperationSource2["Keypad"] = 3] = "Keypad";
    OperationSource2[OperationSource2["Auto"] = 4] = "Auto";
    OperationSource2[OperationSource2["Button"] = 5] = "Button";
    OperationSource2[OperationSource2["Schedule"] = 6] = "Schedule";
    OperationSource2[OperationSource2["Remote"] = 7] = "Remote";
    OperationSource2[OperationSource2["Rfid"] = 8] = "Rfid";
    OperationSource2[OperationSource2["Biometric"] = 9] = "Biometric";
    OperationSource2[OperationSource2["Aliro"] = 10] = "Aliro";
  })(OperationSource = DoorLock2.OperationSource || (DoorLock2.OperationSource = {}));
  DoorLock2.TlvLockUserChangeEvent = TlvObject({
    /**
     * This field shall indicate the lock data type that was changed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.1
     */
    lockDataType: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the data operation performed on the lock data type changed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.2
     */
    dataOperationType: TlvField(1, TlvEnum()),
    /**
     * This field shall indicate the source of the user data change.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.3
     */
    operationSource: TlvField(2, TlvEnum()),
    /**
     * This field shall indicate the lock UserIndex associated with the change (if any). This shall be null if there
     * is no specific user associated with the data operation. This shall be 0xFFFE if all users are affected (e.g.
     * Clear Users).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.4
     */
    userIndex: TlvField(3, TlvNullable(TlvUInt16)),
    /**
     * This field shall indicate the fabric index of the fabric that performed the change (if any). This shall be
     * null if there is no fabric that can be determined to have caused the change. This shall NOT be null if the
     * operation source is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.5
     */
    fabricIndex: TlvField(4, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the Node ID that performed the change (if any). The Node ID of the node that
     * performed the change. This shall be null if there was no Node involved in the change. This shall NOT be null
     * if the operation source is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.6
     */
    sourceNode: TlvField(5, TlvNullable(TlvNodeId)),
    /**
     * This field shall indicate the index of the specific item that was changed (e.g. schedule, PIN, RFID, etc.) in
     * the list of items identified by LockDataType. This shall be null if the LockDataType does not correspond to a
     * list that can be indexed into (e.g. ProgrammingUser). This shall be 0xFFFE if all indices are affected (e.g.
     * ClearPINCode, ClearRFIDCode, ClearWeekDaySchedule, ClearYearDaySchedule, etc.).
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5.7
     */
    dataIndex: TlvField(6, TlvNullable(TlvUInt16))
  });
  DoorLock2.DaysMask = {
    /**
     * Schedule is applied on Sunday
     */
    sunday: BitFlag(0),
    /**
     * Schedule is applied on Monday
     */
    monday: BitFlag(1),
    /**
     * Schedule is applied on Tuesday
     */
    tuesday: BitFlag(2),
    /**
     * Schedule is applied on Wednesday
     */
    wednesday: BitFlag(3),
    /**
     * Schedule is applied on Thursday
     */
    thursday: BitFlag(4),
    /**
     * Schedule is applied on Friday
     */
    friday: BitFlag(5),
    /**
     * Schedule is applied on Saturday
     */
    saturday: BitFlag(6)
  };
  DoorLock2.TlvSetWeekDayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the index of the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.1
     */
    weekDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 })),
    /**
     * This field shall indicate which week days the schedule is active.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.3
     */
    daysMask: TlvField(2, TlvBitmap(TlvUInt8, DoorLock2.DaysMask)),
    /**
     * This field shall indicate the starting hour for the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.4
     */
    startHour: TlvField(3, TlvUInt8.bound({ max: 23 })),
    /**
     * This field shall indicate the starting minute for the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.5
     */
    startMinute: TlvField(4, TlvUInt8.bound({ max: 59 })),
    /**
     * This field shall indicate the ending hour for the Week Day schedule. EndHour shall be equal to or greater
     * than StartHour.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.6
     */
    endHour: TlvField(5, TlvUInt8.bound({ max: 23 })),
    /**
     * This field shall indicate the ending minute for the Week Day schedule. If EndHour is equal to StartHour then
     * EndMinute shall be greater than StartMinute.
     *
     * If the EndHour is equal to 23 and the EndMinute is equal to 59 the Lock shall grant access to the user up
     * until 23:59:59.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12.7
     */
    endMinute: TlvField(6, TlvUInt8.bound({ max: 59 }))
  });
  DoorLock2.TlvGetWeekDayScheduleRequest = TlvObject({
    weekDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 }))
  });
  DoorLock2.TlvGetWeekDayScheduleResponse = TlvObject({
    /**
     * This field shall indicate the index of the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.1
     */
    weekDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 })),
    /**
     * Status shall be one of the following values:
     *
     *   - SUCCESS if both WeekDayIndex and UserIndex are valid and there is a corresponding schedule entry.
     *
     *   - INVALID_COMMAND if either WeekDayIndex and/or UserIndex values are not within valid range
     *
     *   - NOT_FOUND if no corresponding schedule entry found for WeekDayIndex.
     *
     *   - NOT_FOUND if no corresponding user entry found for UserIndex.
     *
     * If this field is SUCCESS, the optional fields for this command shall be present. For other (error) status
     * values, only the fields up to the status field shall be present.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.3
     */
    status: TlvField(2, TlvEnum()),
    daysMask: TlvOptionalField(3, TlvBitmap(TlvUInt8, DoorLock2.DaysMask)),
    /**
     * This field shall indicate the starting hour for the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.4
     */
    startHour: TlvOptionalField(4, TlvUInt8.bound({ max: 23 })),
    /**
     * This field shall indicate the starting minute for the Week Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.5
     */
    startMinute: TlvOptionalField(5, TlvUInt8.bound({ max: 59 })),
    /**
     * This field shall indicate the ending hour for the Week Day schedule. EndHour shall be equal to or greater
     * than StartHour.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.6
     */
    endHour: TlvOptionalField(6, TlvUInt8.bound({ max: 23 })),
    /**
     * This field shall indicate the ending minute for the Week Day schedule. If EndHour is equal to StartHour then
     * EndMinute shall be greater than StartMinute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.14.7
     */
    endMinute: TlvOptionalField(7, TlvUInt8.bound({ max: 59 }))
  });
  DoorLock2.TlvClearWeekDayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the Week Day schedule index to clear or 0xFE to clear all Week Day schedules for
     * the specified user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.15.1
     */
    weekDayIndex: TlvField(0, TlvUInt8),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.15.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 }))
  });
  DoorLock2.TlvSetYearDayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the index of the Year Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.16.1
     */
    yearDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.16.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 })),
    /**
     * This field shall indicate the starting time for the Year Day schedule in Epoch Time in Seconds with local
     * time offset based on the local timezone and DST offset on the day represented by the value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.16.3
     */
    localStartTime: TlvField(2, TlvEpochS),
    /**
     * This field shall indicate the ending time for the Year Day schedule in Epoch Time in Seconds with local time
     * offset based on the local timezone and DST offset on the day represented by the value. LocalEndTime shall be
     * greater than LocalStartTime.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.16.4
     */
    localEndTime: TlvField(3, TlvEpochS)
  });
  DoorLock2.TlvGetYearDayScheduleRequest = TlvObject({
    yearDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 }))
  });
  DoorLock2.TlvGetYearDayScheduleResponse = TlvObject({
    /**
     * This field shall indicate the index of the Year Day schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.18.1
     */
    yearDayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.18.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 })),
    /**
     * Status shall be one of the following values:
     *
     *   - SUCCESS if both YearDayIndex and UserIndex are valid and there is a corresponding schedule entry.
     *
     *   - INVALID_COMMAND if either YearDayIndex and/or UserIndex values are not within valid range
     *
     *   - NOT_FOUND if no corresponding schedule entry found for YearDayIndex.
     *
     *   - NOT_FOUND if no corresponding user entry found for UserIndex.
     *
     * If this field is SUCCESS, the optional fields for this command shall be present. For other (error) status
     * values, only the fields up to the status field shall be present.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.18.3
     */
    status: TlvField(2, TlvEnum()),
    /**
     * This field shall indicate the starting time for the Year Day schedule in Epoch Time in Seconds with local
     * time offset based on the local timezone and DST offset on the day represented by the value. This shall be
     * null if the schedule is not set for the YearDayIndex and UserIndex provided.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.18.4
     */
    localStartTime: TlvOptionalField(3, TlvEpochS),
    /**
     * This field shall indicate the ending time for the Year Day schedule in Epoch Time in Seconds with local time
     * offset based on the local timezone and DST offset on the day represented by the value. LocalEndTime shall be
     * greater than LocalStartTime. This shall be null if the schedule is not set for the YearDayIndex and UserIndex
     * provided.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.18.5
     */
    localEndTime: TlvOptionalField(4, TlvEpochS)
  });
  DoorLock2.TlvClearYearDayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the Year Day schedule index to clear or 0xFE to clear all Year Day schedules for
     * the specified user.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.19.1
     */
    yearDayIndex: TlvField(0, TlvUInt8),
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.19.2
     */
    userIndex: TlvField(1, TlvUInt16.bound({ min: 1 }))
  });
  let OperatingMode;
  ((OperatingMode2) => {
    OperatingMode2[OperatingMode2["Normal"] = 0] = "Normal";
    OperatingMode2[OperatingMode2["Vacation"] = 1] = "Vacation";
    OperatingMode2[OperatingMode2["Privacy"] = 2] = "Privacy";
    OperatingMode2[OperatingMode2["NoRemoteLockUnlock"] = 3] = "NoRemoteLockUnlock";
    OperatingMode2[OperatingMode2["Passage"] = 4] = "Passage";
  })(OperatingMode = DoorLock2.OperatingMode || (DoorLock2.OperatingMode = {}));
  DoorLock2.TlvSetHolidayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the index of the Holiday schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.20.1
     */
    holidayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * This field shall indicate the starting time for the Holiday Day schedule in Epoch Time in Seconds with local
     * time offset based on the local timezone and DST offset on the day represented by the value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.20.2
     */
    localStartTime: TlvField(1, TlvEpochS),
    /**
     * This field shall indicate the ending time for the Holiday Day schedule in Epoch Time in Seconds with local
     * time offset based on the local timezone and DST offset on the day represented by the value. LocalEndTime
     * shall be greater than LocalStartTime.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.20.3
     */
    localEndTime: TlvField(2, TlvEpochS),
    /**
     * This field shall indicate the operating mode to use during this Holiday schedule start/end time.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.20.4
     */
    operatingMode: TlvField(3, TlvEnum())
  });
  DoorLock2.TlvGetHolidayScheduleRequest = TlvObject({ holidayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })) });
  DoorLock2.TlvGetHolidayScheduleResponse = TlvObject({
    /**
     * This field shall indicate the index of the Holiday schedule.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.22.1
     */
    holidayIndex: TlvField(0, TlvUInt8.bound({ min: 1 })),
    /**
     * Status shall be one of the following values:
     *
     *   - FAILURE if the attribute NumberOfHolidaySchedulesSupported is zero.
     *
     *   - SUCCESS if the HolidayIndex is valid and there is a corresponding schedule entry.
     *
     *   - INVALID_COMMAND if the HolidayIndex is not within valid range
     *
     *   - NOT_FOUND if the HolidayIndex is within the valid range, however, there is not corresponding schedule
     *     entry found.
     *
     * If this field is SUCCESS, the optional fields for this command shall be present. For other (error) status
     * values, only the fields up to the status field shall be present.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.22.2
     */
    status: TlvField(1, TlvEnum()),
    /**
     * This field shall indicate the starting time for the Holiday schedule in Epoch Time in Seconds with local time
     * offset based on the local timezone and DST offset on the day represented by the value. This shall be null if
     * the schedule is not set for the HolidayIndex provided.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.22.3
     */
    localStartTime: TlvOptionalField(2, TlvNullable(TlvEpochS)),
    /**
     * This field shall indicate the ending time for the Holiday schedule in Epoch Time in Seconds with local time
     * offset based on the local timezone and DST offset on the day represented by the value. LocalEndTime shall be
     * greater than LocalStartTime. This shall be null if the schedule is not set for the HolidayIndex provided.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.22.4
     */
    localEndTime: TlvOptionalField(3, TlvNullable(TlvEpochS)),
    /**
     * This field shall indicate the operating mode to use during this Holiday schedule start/end time. This shall
     * be null if the schedule is not set for the HolidayIndex provided.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.22.5
     */
    operatingMode: TlvOptionalField(4, TlvNullable(TlvEnum()))
  });
  DoorLock2.TlvClearHolidayScheduleRequest = TlvObject({
    /**
     * This field shall indicate the Holiday schedule index to clear or 0xFE to clear all Holiday schedules.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.23.1
     */
    holidayIndex: TlvField(0, TlvUInt8)
  });
  DoorLock2.TlvSetPinCodeRequest = TlvObject({
    /**
     * This field shall indicate the user ID. The value of the UserID field shall be between 0 and the value of the
     * NumberOfPINUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.4.1
     */
    userId: TlvField(0, TlvUInt16),
    /**
     * This field shall indicate the user status. Only the values 1 (Occupied/Enabled) and 3 (Occupied/Disabled) are
     * allowed for UserStatus.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.4.2
     */
    userStatus: TlvField(1, TlvNullable(TlvEnum())),
    userType: TlvField(2, TlvNullable(TlvEnum())),
    pin: TlvField(3, TlvByteString)
  });
  DoorLock2.TlvGetPinCodeRequest = TlvObject({
    /**
     * This field shall indicate the user ID. The value of the UserID field shall be between 0 and the value of the
     * NumberOfPINUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.5.1
     */
    userId: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvGetPinCodeResponse = TlvObject({
    userId: TlvField(0, TlvUInt16),
    userStatus: TlvField(1, TlvNullable(TlvEnum())),
    userType: TlvField(2, TlvNullable(TlvEnum())),
    pinCode: TlvField(3, TlvNullable(TlvByteString))
  });
  DoorLock2.TlvClearPinCodeRequest = TlvObject({
    /**
     * This field shall specify a valid PIN code slot index or 0xFFFE to indicate all PIN code slots shall be
     * cleared.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.7.1
     */
    pinSlotIndex: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvSetAliroReaderConfigRequest = TlvObject({
    /**
     * This field shall indicate the signing key component of the Reader’s key pair.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.42.1
     */
    signingKey: TlvField(0, TlvByteString.bound({ length: 32 })),
    /**
     * This field shall indicate the verification key component of the Reader’s key pair. This shall be an
     * uncompressed elliptic curve public key as defined in section 2.3.3 of SEC 1.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.42.2
     */
    verificationKey: TlvField(1, TlvByteString.bound({ length: 65 })),
    /**
     * This field shall indicate the reader group identifier for the lock.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.42.3
     */
    groupIdentifier: TlvField(2, TlvByteString.bound({ length: 16 })),
    /**
     * This field shall indicate the group resolving key for the lock.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.42.4
     */
    groupResolvingKey: TlvOptionalField(3, TlvByteString.bound({ length: 16 }))
  });
  DoorLock2.TlvSetUserStatusRequest = TlvObject({
    /**
     * This field shall indicate the user ID. The value of the UserID field shall be between 0 and the value of the
     * NumberOfPINUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.9.1
     */
    userId: TlvField(0, TlvUInt16),
    /**
     * UserStatus value of Available is not allowed. In order to clear a user id, the ClearUser Command shall be
     * used. For user status value please refer to UserStatusEnum.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.9.2
     */
    userStatus: TlvField(1, TlvEnum())
  });
  DoorLock2.TlvGetUserStatusRequest = TlvObject({
    /**
     * This field shall indicate the user ID. The value of the UserID field shall be between 0 and the value of the
     * NumberOfPINUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.10.1
     */
    userId: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvGetUserStatusResponse = TlvObject({
    /**
     * This field shall indicate the user ID provided in the request.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.11.1
     */
    userId: TlvField(0, TlvUInt16),
    /**
     * This field shall indicate the current status of the requested user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.11.2
     */
    userStatus: TlvField(1, TlvEnum())
  });
  DoorLock2.TlvSetUserTypeRequest = TlvObject({
    /**
     * This field shall indicate the user ID.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.24.1
     */
    userId: TlvField(0, TlvUInt16),
    /**
     * This field shall indicate the user type.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.24.2
     */
    userType: TlvField(1, TlvEnum())
  });
  DoorLock2.TlvGetUserTypeRequest = TlvObject({ userId: TlvField(0, TlvUInt16) });
  DoorLock2.TlvGetUserTypeResponse = TlvObject({
    userId: TlvField(0, TlvUInt16),
    userType: TlvField(1, TlvEnum())
  });
  DoorLock2.TlvSetRfidCodeRequest = TlvObject({
    /**
     * This field shall indicate the user ID.
     *
     * The value of the UserID field shall be between 0 and the value of the NumberOfRFIDUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.27.1
     */
    userId: TlvField(0, TlvUInt16),
    /**
     * This field shall indicate what the status is for a specific user ID. The values are according to “Set PIN”
     * while not all are supported.
     *
     * Only the values 1 (Occupied/Enabled) and 3 (Occupied/Disabled) are allowed for UserStatus.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.27.2
     */
    userStatus: TlvField(1, TlvNullable(TlvEnum())),
    /**
     * The values are the same as used for SetPINCode command.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.27.3
     */
    userType: TlvField(2, TlvNullable(TlvEnum())),
    rfidCode: TlvField(3, TlvByteString)
  });
  DoorLock2.TlvGetRfidCodeRequest = TlvObject({
    /**
     * This field shall indicate the user ID.
     *
     * The value of the UserID field shall be between 0 and the value of the NumberOfRFIDUsersSupported attribute.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.28.1
     */
    userId: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvGetRfidCodeResponse = TlvObject({
    userId: TlvField(0, TlvUInt16),
    userStatus: TlvField(1, TlvNullable(TlvEnum())),
    userType: TlvField(2, TlvNullable(TlvEnum())),
    rfidCode: TlvField(3, TlvNullable(TlvByteString))
  });
  DoorLock2.TlvClearRfidCodeRequest = TlvObject({
    /**
     * This field shall indicate a valid RFID code slot index or 0xFFFE to indicate all RFID code slots shall be
     * cleared.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.30.1
     */
    rfidSlotIndex: TlvField(0, TlvUInt16)
  });
  DoorLock2.TlvUnboltDoorRequest = TlvObject({
    /**
     * See Section 5.2.10.1.1, “PINCode Field”.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.41.1
     */
    pinCode: TlvOptionalField(0, TlvByteString)
  });
  let LockState;
  ((LockState2) => {
    LockState2[LockState2["NotFullyLocked"] = 0] = "NotFullyLocked";
    LockState2[LockState2["Locked"] = 1] = "Locked";
    LockState2[LockState2["Unlocked"] = 2] = "Unlocked";
    LockState2[LockState2["Unlatched"] = 3] = "Unlatched";
  })(LockState = DoorLock2.LockState || (DoorLock2.LockState = {}));
  let LockType;
  ((LockType2) => {
    LockType2[LockType2["DeadBolt"] = 0] = "DeadBolt";
    LockType2[LockType2["Magnetic"] = 1] = "Magnetic";
    LockType2[LockType2["Other"] = 2] = "Other";
    LockType2[LockType2["Mortise"] = 3] = "Mortise";
    LockType2[LockType2["Rim"] = 4] = "Rim";
    LockType2[LockType2["LatchBolt"] = 5] = "LatchBolt";
    LockType2[LockType2["CylindricalLock"] = 6] = "CylindricalLock";
    LockType2[LockType2["TubularLock"] = 7] = "TubularLock";
    LockType2[LockType2["InterconnectedLock"] = 8] = "InterconnectedLock";
    LockType2[LockType2["DeadLatch"] = 9] = "DeadLatch";
    LockType2[LockType2["DoorFurniture"] = 10] = "DoorFurniture";
    LockType2[LockType2["Eurocylinder"] = 11] = "Eurocylinder";
  })(LockType = DoorLock2.LockType || (DoorLock2.LockType = {}));
  let LedSetting;
  ((LedSetting2) => {
    LedSetting2[LedSetting2["NoLedSignal"] = 0] = "NoLedSignal";
    LedSetting2[LedSetting2["NoLedSignalAccessAllowed"] = 1] = "NoLedSignalAccessAllowed";
    LedSetting2[LedSetting2["LedSignalAll"] = 2] = "LedSignalAll";
  })(LedSetting = DoorLock2.LedSetting || (DoorLock2.LedSetting = {}));
  let SoundVolume;
  ((SoundVolume2) => {
    SoundVolume2[SoundVolume2["Silent"] = 0] = "Silent";
    SoundVolume2[SoundVolume2["Low"] = 1] = "Low";
    SoundVolume2[SoundVolume2["High"] = 2] = "High";
    SoundVolume2[SoundVolume2["Medium"] = 3] = "Medium";
  })(SoundVolume = DoorLock2.SoundVolume || (DoorLock2.SoundVolume = {}));
  DoorLock2.OperatingModes = {
    /**
     * Normal operation mode is NOT supported
     */
    normal: BitFlag(0),
    /**
     * Vacation operation mode is NOT supported
     */
    vacation: BitFlag(1),
    /**
     * Privacy operation mode is NOT supported
     */
    privacy: BitFlag(2),
    /**
     * No remote lock and unlock operation mode is NOT supported
     */
    noRemoteLockUnlock: BitFlag(3),
    /**
     * Passage operation mode is NOT supported
     */
    passage: BitFlag(4),
    /**
     * This needs always be set because this bitmap is inverse.!
     */
    alwaysSet: BitField(5, 11)
  };
  DoorLock2.ConfigurationRegister = {
    /**
     * The state of local programming functionality
     *
     * This bit shall indicate the state related to local programming:
     *
     *   - 0 = Local programming is disabled
     *
     *   - 1 = Local programming is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.1
     */
    localProgramming: BitFlag(0),
    /**
     * The state of the keypad interface
     *
     * This bit shall indicate the state related to keypad interface:
     *
     *   - 0 = Keypad interface is disabled
     *
     *   - 1 = Keypad interface is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.2
     */
    keypadInterface: BitFlag(1),
    /**
     * The state of the remote interface
     *
     * This bit shall indicate the state related to remote interface:
     *
     *   - 0 = Remote interface is disabled
     *
     *   - 1 = Remote interface is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.3
     */
    remoteInterface: BitFlag(2),
    /**
     * Sound volume is set to Silent value
     *
     * This bit shall indicate the state related to sound volume:
     *
     *   - 0 = Sound volume value is 0 (Silent)
     *
     *   - 1 = Sound volume value is equal to something other than 0
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.4
     */
    soundVolume: BitFlag(5),
    /**
     * Auto relock time it set to 0
     *
     * This bit shall indicate the state related to auto relock time:
     *
     *   - 0 = Auto relock time value is 0
     *
     *   - 1 = Auto relock time value is equal to something other than 0
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.5
     */
    autoRelockTime: BitFlag(6),
    /**
     * LEDs is disabled
     *
     * This bit shall indicate the state related to LED settings:
     *
     *   - 0 = LED settings value is 0 (NoLEDSignal)
     *
     *   - 1 = LED settings value is equal to something other than 0
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.4.6
     */
    ledSettings: BitFlag(7)
  };
  DoorLock2.LocalProgrammingFeatures = {
    /**
     * The state of the ability to add users, credentials or schedules on the device
     *
     * This bit shall indicate whether the door lock is able to add Users/Credentials/Schedules locally:
     *
     *   - 0 = This ability is disabled
     *
     *   - 1 = This ability is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.5.1
     */
    addUsersCredentialsSchedules: BitFlag(0),
    /**
     * The state of the ability to modify users, credentials or schedules on the device
     *
     * This bit shall indicate whether the door lock is able to modify Users/Credentials/Schedules locally:
     *
     *   - 0 = This ability is disabled
     *
     *   - 1 = This ability is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.5.2
     */
    modifyUsersCredentialsSchedules: BitFlag(1),
    /**
     * The state of the ability to clear users, credentials or schedules on the device
     *
     * This bit shall indicate whether the door lock is able to clear Users/Credentials/Schedules locally:
     *
     *   - 0 = This ability is disabled
     *
     *   - 1 = This ability is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.5.3
     */
    clearUsersCredentialsSchedules: BitFlag(2),
    /**
     * The state of the ability to adjust settings on the device
     *
     * This bit shall indicate whether the door lock is able to adjust lock settings locally:
     *
     *   - 0 = This ability is disabled
     *
     *   - 1 = This ability is enabled
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.6.5.4
     */
    adjustSettings: BitFlag(3)
  };
  DoorLock2.TlvLockDoorRequest = TlvObject({
    /**
     * If the RequirePINforRemoteOperation attribute is True then PINCode field shall be provided and the door lock
     * shall NOT grant access if it is not provided.
     *
     * If the PINCode field is provided, the door lock shall verify PINCode before granting access regardless of the
     * value of RequirePINForRemoteOperation attribute.
     *
     * When the PINCode field is provided an invalid PIN will count towards the WrongCodeEntryLimit and the
     * UserCodeTemporaryDisableTime will be triggered if the WrongCodeEntryLimit is exceeded. The lock shall ignore
     * any attempts to lock/unlock the door until the UserCodeTemporaryDisableTime expires.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.1.1
     */
    pinCode: TlvOptionalField(0, TlvByteString)
  });
  DoorLock2.TlvUnlockDoorRequest = TlvObject({
    /**
     * See Section 5.2.10.1.1, “PINCode Field”.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.2.1
     */
    pinCode: TlvOptionalField(0, TlvByteString)
  });
  DoorLock2.TlvUnlockWithTimeoutRequest = TlvObject({
    /**
     * This field shall indicate the timeout in seconds to wait before relocking the door lock. This value is
     * independent of the AutoRelockTime attribute value.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.3.1
     */
    timeout: TlvField(0, TlvUInt16),
    /**
     * See Section 5.2.10.1.1, “PINCode Field”.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.3.2
     */
    pinCode: TlvOptionalField(1, TlvByteString)
  });
  let AlarmCode;
  ((AlarmCode2) => {
    AlarmCode2[AlarmCode2["LockJammed"] = 0] = "LockJammed";
    AlarmCode2[AlarmCode2["LockFactoryReset"] = 1] = "LockFactoryReset";
    AlarmCode2[AlarmCode2["LockRadioPowerCycled"] = 3] = "LockRadioPowerCycled";
    AlarmCode2[AlarmCode2["WrongCodeEntryLimit"] = 4] = "WrongCodeEntryLimit";
    AlarmCode2[AlarmCode2["FrontEsceutcheonRemoved"] = 5] = "FrontEsceutcheonRemoved";
    AlarmCode2[AlarmCode2["DoorForcedOpen"] = 6] = "DoorForcedOpen";
    AlarmCode2[AlarmCode2["DoorAjar"] = 7] = "DoorAjar";
    AlarmCode2[AlarmCode2["ForcedUser"] = 8] = "ForcedUser";
  })(AlarmCode = DoorLock2.AlarmCode || (DoorLock2.AlarmCode = {}));
  DoorLock2.TlvDoorLockAlarmEvent = TlvObject({
    /**
     * This field shall indicate the alarm code of the event that has happened.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.1.1
     */
    alarmCode: TlvField(0, TlvEnum())
  });
  let LockOperationType;
  ((LockOperationType2) => {
    LockOperationType2[LockOperationType2["Lock"] = 0] = "Lock";
    LockOperationType2[LockOperationType2["Unlock"] = 1] = "Unlock";
    LockOperationType2[LockOperationType2["NonAccessUserEvent"] = 2] = "NonAccessUserEvent";
    LockOperationType2[LockOperationType2["ForcedUserEvent"] = 3] = "ForcedUserEvent";
    LockOperationType2[LockOperationType2["Unlatch"] = 4] = "Unlatch";
  })(LockOperationType = DoorLock2.LockOperationType || (DoorLock2.LockOperationType = {}));
  DoorLock2.TlvLockOperationEvent = TlvObject({
    /**
     * This field shall indicate the type of the lock operation that was performed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.1
     */
    lockOperationType: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the source of the lock operation that was performed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.2
     */
    operationSource: TlvField(1, TlvEnum()),
    /**
     * This field shall indicate the UserIndex who performed the lock operation. This shall be null if there is no
     * user index that can be determined for the given operation source. This shall NOT be null if a user index can
     * be determined. In particular, this shall NOT be null if the operation was associated with a valid credential.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.3
     */
    userIndex: TlvField(2, TlvNullable(TlvUInt16)),
    /**
     * This field shall indicate the fabric index of the fabric that performed the lock operation. This shall be
     * null if there is no fabric that can be determined for the given operation source. This shall NOT be null if
     * the operation source is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.4
     */
    fabricIndex: TlvField(3, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the Node ID of the node that performed the lock operation. This shall be null if
     * there is no Node associated with the given operation source. This shall NOT be null if the operation source
     * is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.5
     */
    sourceNode: TlvField(4, TlvNullable(TlvNodeId)),
    /**
     * This field shall indicate the list of credentials used in performing the lock operation. This shall be null
     * if no credentials were involved.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3.6
     */
    credentials: TlvOptionalField(5, TlvNullable(TlvArray(DoorLock2.TlvCredential, { minLength: 1 })))
  });
  let OperationError;
  ((OperationError2) => {
    OperationError2[OperationError2["Unspecified"] = 0] = "Unspecified";
    OperationError2[OperationError2["InvalidCredential"] = 1] = "InvalidCredential";
    OperationError2[OperationError2["DisabledUserDenied"] = 2] = "DisabledUserDenied";
    OperationError2[OperationError2["Restricted"] = 3] = "Restricted";
    OperationError2[OperationError2["InsufficientBattery"] = 4] = "InsufficientBattery";
  })(OperationError = DoorLock2.OperationError || (DoorLock2.OperationError = {}));
  DoorLock2.TlvLockOperationErrorEvent = TlvObject({
    /**
     * This field shall indicate the type of the lock operation that was performed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.1
     */
    lockOperationType: TlvField(0, TlvEnum()),
    /**
     * This field shall indicate the source of the lock operation that was performed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.2
     */
    operationSource: TlvField(1, TlvEnum()),
    /**
     * This field shall indicate the lock operation error triggered when the operation was performed.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.3
     */
    operationError: TlvField(2, TlvEnum()),
    /**
     * This field shall indicate the lock UserIndex who performed the lock operation. This shall be null if there is
     * no user id that can be determined for the given operation source.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.4
     */
    userIndex: TlvField(3, TlvNullable(TlvUInt16)),
    /**
     * This field shall indicate the fabric index of the fabric that performed the lock operation. This shall be
     * null if there is no fabric that can be determined for the given operation source. This shall NOT be null if
     * the operation source is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.5
     */
    fabricIndex: TlvField(4, TlvNullable(TlvFabricIndex)),
    /**
     * This field shall indicate the Node ID of the node that performed the lock operation. This shall be null if
     * there is no Node associated with the given operation source. This shall NOT be null if the operation source
     * is "Remote".
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.6
     */
    sourceNode: TlvField(5, TlvNullable(TlvNodeId)),
    /**
     * This field shall indicate the list of credentials used in performing the lock operation. This shall be null
     * if no credentials were involved.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4.7
     */
    credentials: TlvOptionalField(6, TlvNullable(TlvArray(DoorLock2.TlvCredential, { minLength: 1 })))
  });
  DoorLock2.AlarmMask = {
    /**
     * Locking Mechanism Jammed
     */
    lockJammed: BitFlag(0),
    /**
     * Lock Reset to Factory Defaults
     */
    lockFactoryReset: BitFlag(1),
    /**
     * RF Module Power Cycled
     */
    lockRadioPowerCycled: BitFlag(3),
    /**
     * Tamper Alarm - wrong code entry limit
     */
    wrongCodeEntryLimit: BitFlag(4),
    /**
     * Tamper Alarm - front escutcheon removed from main
     */
    frontEscutcheonRemoved: BitFlag(5),
    /**
     * Forced Door Open under Door Locked Condition
     */
    doorForcedOpen: BitFlag(6)
  };
  let EventType;
  ((EventType2) => {
    EventType2[EventType2["Operation"] = 0] = "Operation";
    EventType2[EventType2["Programming"] = 1] = "Programming";
    EventType2[EventType2["Alarm"] = 2] = "Alarm";
  })(EventType = DoorLock2.EventType || (DoorLock2.EventType = {}));
  let StatusCode;
  ((StatusCode2) => {
    StatusCode2[StatusCode2["Duplicate"] = 2] = "Duplicate";
    StatusCode2[StatusCode2["Occupied"] = 3] = "Occupied";
  })(StatusCode = DoorLock2.StatusCode || (DoorLock2.StatusCode = {}));
  class DuplicateError extends StatusResponseError {
    constructor(message = "Entry would cause a duplicate credential/ID", code = Status.Failure, clusterCode = 2 /* Duplicate */) {
      super(message, code, clusterCode);
    }
  }
  DoorLock2.DuplicateError = DuplicateError;
  class OccupiedError extends StatusResponseError {
    constructor(message = "Entry would replace an occupied slot", code = Status.Failure, clusterCode = 3 /* Occupied */) {
      super(message, code, clusterCode);
    }
  }
  DoorLock2.OccupiedError = OccupiedError;
  DoorLock2.DoorPositionSensorComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the current door state as defined in DoorStateEnum.
       *
       * Null only if an internal error prevents the retrieval of the current door state.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.4
       */
      doorState: Attribute(3, TlvNullable(TlvEnum())),
      /**
       * This attribute shall hold the number of door open events that have occurred since it was last zeroed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.5
       */
      doorOpenEvents: OptionalWritableAttribute(4, TlvUInt32, { writeAcl: AccessLevel.Manage }),
      /**
       * This attribute shall hold the number of door closed events that have occurred since it was last zeroed.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.6
       */
      doorClosedEvents: OptionalWritableAttribute(5, TlvUInt32, { writeAcl: AccessLevel.Manage }),
      /**
       * This attribute shall hold the number of minutes the door has been open since the last time it
       * transitioned from closed to open.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.7
       */
      openPeriod: OptionalWritableAttribute(6, TlvUInt16, { writeAcl: AccessLevel.Manage })
    },
    events: {
      /**
       * The door lock server sends out a DoorStateChange event when the door lock door state changes.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.2
       */
      doorStateChange: Event(1, Priority.Critical, DoorLock2.TlvDoorStateChangeEvent)
    }
  });
  DoorLock2.UserComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of total users supported by the lock.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.8
       */
      numberOfTotalUsersSupported: FixedAttribute(17, TlvUInt16),
      /**
       * This attribute shall contain a bitmap with the bits set for the values of CredentialRuleEnum supported on
       * this device.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.18
       */
      credentialRulesSupport: FixedAttribute(27, TlvBitmap(TlvUInt8, DoorLock2.CredentialRules)),
      /**
       * Indicates the number of credentials that could be assigned for each user.
       *
       * Depending on the value of NumberOfRFIDUsersSupported and NumberOfPINUsersSupported it may not be possible
       * to assign that number of credentials for a user.
       *
       * For example, if the device supports only PIN and RFID credential types,
       * NumberOfCredentialsSupportedPerUser is set to 10, NumberOfPINUsersSupported is set to 5 and
       * NumberOfRFIDUsersSupported is set to 3, it will not be possible to actually assign 10 credentials for a
       * user because maximum number of credentials in the database is 8.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.19
       */
      numberOfCredentialsSupportedPerUser: FixedAttribute(28, TlvUInt8),
      /**
       * Indicates the number of minutes a PIN, RFID, Fingerprint, or other credential associated with a user of
       * type ExpiringUser shall remain valid after its first use before expiring. When the credential expires the
       * UserStatus for the corresponding user record shall be set to OccupiedDisabled.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.36
       */
      expiringUserTimeout: OptionalWritableAttribute(
        53,
        TlvUInt16.bound({ min: 1, max: 2880 }),
        { writeAcl: AccessLevel.Administer }
      )
    },
    commands: {
      /**
       * Set user into the lock.
       *
       * Fields used for different use cases:
       *
       *   - OperationType shall be set to Add.
       *
       *   - UserIndex value shall be set to a user record with UserType set to Available.
       *
       *   - UserName may be null causing new user record to use empty string for UserName otherwise UserName
       *     shall be set to the value provided in the new user record.
       *
       *   - UserUniqueID may be null causing new user record to use 0xFFFFFFFF for UserUniqueID otherwise
       *     UserUniqueID shall be set to the value provided in the new user record.
       *
       *   - UserStatus may be null causing new user record to use OccupiedEnabled for UserStatus otherwise
       *     UserStatus shall be set to the value provided in the new user record.
       *
       *   - UserType may be null causing new user record to use UnrestrictedUser for UserType otherwise UserType
       *     shall be set to the value provided in the new user record.
       *
       *   - CredentialRule may be null causing new user record to use Single for CredentialRule otherwise
       *     CredentialRule shall be set to the value provided in the new user record.
       *
       * CreatorFabricIndex and LastModifiedFabricIndex in the new user record shall be set to the accessing
       * fabric index.
       *
       * A LockUserChange event shall be generated after successfully creating a new user.
       *
       *   - OperationType shall be set to Modify.
       *
       *   - UserIndex value shall be set for a user record with UserType NOT set to Available.
       *
       *   - UserName shall be null if modifying a user record that was not created by the accessing fabric.
       *
       *   - INVALID_COMMAND shall be returned if UserName is not null and the accessing fabric index doesn’t
       *     match the CreatorFabricIndex in the user record otherwise UserName shall be set to the value provided
       *     in the user record.
       *
       *   - UserUniqueID shall be null if modifying the user record that was not created by the accessing fabric.
       *
       *   - INVALID_COMMAND shall be returned if UserUniqueID is not null and the accessing fabric index doesn’t
       *     match the CreatorFabricIndex in the user record otherwise UserUniqueID shall be set to the value
       *     provided in the user record.
       *
       *   - UserStatus may be null causing no change to UserStatus in user record otherwise UserStatus shall be
       *     set to the value provided in the user record.
       *
       *   - UserType may be null causing no change to UserType in user record otherwise UserType shall be set to
       *     the value provided in the user record.
       *
       *   - CredentialRule may be null causing no change to CredentialRule in user record otherwise
       *     CredentialRule shall be set to the value provided in the user record.
       *
       * CreatorFabricIndex shall NOT be changed in the user record. LastModifiedFabricIndex in the new user
       * record shall be set to the accessing fabric index.
       *
       * A LockUserChange event shall be generated after successfully modifying a user.
       *
       * Return status is a global status code or a cluster-specific status code from the Status Codes table and
       * shall be one of the following values:
       *
       *   - SUCCESS, if setting User was successful.
       *
       *   - FAILURE, if some unexpected internal error occurred setting User.
       *
       *   - OCCUPIED, if OperationType is Add and UserIndex points to an occupied slot.
       *
       *   - INVALID_COMMAND, if one or more fields violate constraints or are invalid or if OperationType is
       *     Modify and UserIndex points to an available slot.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.32
       */
      setUser: Command(
        26,
        DoorLock2.TlvSetUserRequest,
        26,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Retrieve user.
       *
       * An InvokeResponse command shall be sent with an appropriate error (e.g. FAILURE, INVALID_COMMAND, etc.)
       * as needed otherwise the GetUserResponse Command shall be sent implying a status of SUCCESS.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.33
       */
      getUser: Command(27, DoorLock2.TlvGetUserRequest, 28, DoorLock2.TlvGetUserResponse, { invokeAcl: AccessLevel.Administer }),
      /**
       * Clears a user or all Users.
       *
       * For each user to clear, all associated credentials (e.g. PIN, RFID, fingerprint, etc.) shall be cleared
       * and the user entry values shall be reset to their default values (e.g. UserStatus shall be Available,
       * UserType shall be UnrestrictedUser) and all associated schedules shall be cleared.
       *
       * A LockUserChange event with the provided UserIndex shall be generated after successfully clearing users.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.35
       */
      clearUser: Command(
        29,
        DoorLock2.TlvClearUserRequest,
        29,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Set a credential (e.g. PIN, RFID, Fingerprint, etc.) into the lock for a new user, existing user, or
       * ProgrammingUser.
       *
       * Fields used for different use cases:
       *
       *   - OperationType shall be set to Add.
       *
       *   - UserIndex shall be set to null and the lock will find a user record with a UserStatus value of
       *     Available and associate its UserIndex with the CredentialIndex in CredentialStruct provided.
       *
       *   - CredentialIndex in CredentialStruct shall be for an unoccupied credential slot.
       *
       *   - UserStatus may be null. If it is null, the new user record shall have UserStatus set to
       *     OccupiedEnabled. Otherwise the new user record shall have UserStatus set to the provided value.
       *
       *   - UserType may be null. If it is null, the new user record shall have UserType set to UnrestrictedUser.
       *     Otherwise the new user record shall have UserType set to the provided value.
       *
       *   - UserType shall NOT be set to ProgrammingUser for this use case.
       *
       * CreatorFabricIndex and LastModifiedFabricIndex in new user and credential records shall be set to the
       * accessing fabric index.
       *
       * A LockUserChange event shall be generated after successfully creating a new credential and anewuser. The
       * UserIndex of this LockUserChange event shall be the UserIndex that was used to createtheuser. The
       * DataIndex of this LockUserChange event shall be the CredentialIndex that was used to create the
       * credential.
       *
       *   - OperationType shall be set to Add.
       *
       *   - UserIndex shall NOT be null and shall NOT already be associated with the CredentialIndex in
       *     CredentialStruct provided otherwise INVALID_COMMAND status response shall be returned.
       *
       *   - INVALID_COMMAND shall be returned if the accessing fabric index doesn’t match the CreatorFabricIndex
       *     in the user record pointed to by UserIndex.
       *
       *   - CredentialIndex in CredentialStruct provided shall be for an available credential slot.
       *
       *   - UserStatus shall be null.
       *
       *   - UserType shall be null.
       *
       * CreatorFabricIndex shall NOT be changed in the user record. LastModifiedFabricIndex in the user record
       * shall be set to the accessing fabric index.
       *
       * CreatorFabricIndex and LastModifiedFabricIndex in the new credential record shall be set to the accessing
       * fabric index.
       *
       * A LockUserChange event shall be generated after successfully adding a new credential.
       *
       *   - OperationType shall be set to Modify.
       *
       *   - UserIndex value shall already be associated with the CredentialIndex in CredentialStruct provided
       *     otherwise INVALID_COMMAND status response shall be returned.
       *
       *   - INVALID_COMMAND shall be returned if the accessing fabric index doesn’t match the CreatorFabricIndex
       *     in the user record pointed to by UserIndex.
       *
       *   - INVALID_COMMAND shall be returned if the accessing fabric index doesn’t match the CreatorFabricIndex
       *     in the credential record pointed to by the CredentialIndex field value of the Credential parameter.
       *
       *   - CredentialIndex in CredentialStruct provided shall be for an occupied credential slot
       *
       *   - UserStatus shall be null.
       *
       *   - UserType shall be null.
       *
       * CreatorFabricIndex shall NOT be changed in user and credential records. LastModifiedFabricIndex in user
       * and credential records shall be set to the accessing fabric index.
       *
       * A LockUserChange event shall be generated after successfully modifying a credential.
       *
       *   - OperationType shall be set to Modify.
       *
       *   - UserIndex shall be null.
       *
       *   - INVALID_COMMAND shall be returned if the accessing fabric index doesn’t match the CreatorFabricIndex
       *     in the credential record pointed to by the CredentialIndex field value of the Credential parameter.
       *
       *   - CredentialType in CredentialStruct shall be set to ProgrammingPIN.
       *
       *   - CredentialIndex in CredentialStruct shall be 0.
       *
       *   - UserStatus shall be null.
       *
       *   - UserType shall be set to ProgrammingUser.
       *
       * CreatorFabricIndex shall NOT be changed in the credential record. LastModifiedFabricIndex in the
       * credential record shall be set to the accessing fabric index.
       *
       * A LockUserChange event shall be generated after successfully modifying a ProgrammingUser PIN code.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.36
       */
      setCredential: Command(
        34,
        DoorLock2.TlvSetCredentialRequest,
        35,
        DoorLock2.TlvSetCredentialResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Retrieve the status of a particular credential (e.g. PIN, RFID, Fingerprint, etc.) by index.
       *
       * An InvokeResponse command shall be sent with an appropriate error (e.g. FAILURE, INVALID_COMMAND, etc.)
       * as needed otherwise the GetCredentialStatusResponse command shall be sent implying a status of SUCCESS.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.38
       */
      getCredentialStatus: Command(
        36,
        DoorLock2.TlvGetCredentialStatusRequest,
        37,
        DoorLock2.TlvGetCredentialStatusResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clear one, one type, or all credentials except ProgrammingPIN credential.
       *
       * Fields used for different use cases:
       *
       *   - CredentialType in Credential structure shall be set to the credential type to be cleared.
       *
       *   - CredentialType in Credential structure shall NOT be set to ProgrammingPIN.
       *
       *   - CredentialIndex in Credential structure shall be set to the credential index to be cleared.
       *
       * A LockUserChange event shall be generated after successfully clearing a credential.
       *
       *   - CredentialType in Credential structure shall be set to the credential type to be cleared.
       *
       *   - CredentialType in Credential structure shall NOT be set to ProgrammingPIN.
       *
       *   - CredentialIndex in Credential structure shall be set to 0xFFFE to indicate all credentials of that
       *     type shall be cleared.
       *
       * A single LockUserChange event shall be generated after successfully clearing credentials. This event
       * shall have DataIndex set to the CredentialIndex in the Credential structure.
       *
       *   - Credential field shall be null.
       *
       * The ProgrammingPIN credential shall NOT be cleared.
       *
       * For each credential type cleared, a LockUserChange event with the corresponding LockDataType shall be
       * generated. This event shall have DataIndex set to 0xFFFE.
       *
       * For each credential cleared whose user doesn’t have another valid credential, the corresponding user
       * record shall be reset back to default values and its UserStatus value shall be set to Available and
       * UserType value shall be set to UnrestrictedUser and all schedules shall be cleared. In this case a
       * LockUserChange event shall be generated for the user being cleared.
       *
       * Return status shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.40
       */
      clearCredential: Command(
        38,
        DoorLock2.TlvClearCredentialRequest,
        38,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      )
    },
    events: {
      /**
       * The door lock server sends out a LockUserChange event when a lock user, schedule, or credential change
       * has occurred.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.5
       */
      lockUserChange: Event(4, Priority.Info, DoorLock2.TlvLockUserChangeEvent)
    }
  });
  DoorLock2.PinCredentialComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of PIN users supported.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.9
       */
      numberOfPinUsersSupported: FixedAttribute(18, TlvUInt16),
      /**
       * Indicates the maximum length in bytes of a PIN Code on this device.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.14
       */
      maxPinCodeLength: FixedAttribute(23, TlvUInt8),
      /**
       * Indicates the minimum length in bytes of a PIN Code on this device.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.15
       */
      minPinCodeLength: FixedAttribute(24, TlvUInt8)
    }
  });
  DoorLock2.RfidCredentialComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of RFID users supported.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.10
       */
      numberOfRfidUsersSupported: FixedAttribute(19, TlvUInt16),
      /**
       * Indicates the maximum length in bytes of a RFID Code on this device. The value depends on the RFID code
       * range specified by the manufacturer, if media anti-collision identifiers (UID) are used as RFID code, a
       * value of 20 (equals 10 Byte ISO 14443A UID) is recommended.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.16
       */
      maxRfidCodeLength: FixedAttribute(25, TlvUInt8),
      /**
       * Indicates the minimum length in bytes of a RFID Code on this device. The value depends on the RFID code
       * range specified by the manufacturer, if media anti-collision identifiers (UID) are used as RFID code, a
       * value of 8 (equals 4 Byte ISO 14443A UID) is recommended.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.17
       */
      minRfidCodeLength: FixedAttribute(26, TlvUInt8)
    }
  });
  DoorLock2.WeekDayAccessSchedulesComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of configurable week day schedule supported per user.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.11
       */
      numberOfWeekDaySchedulesSupportedPerUser: FixedAttribute(20, TlvUInt8.bound({ max: 253 }))
    },
    commands: {
      /**
       * Set a weekly repeating schedule for a specified user.
       *
       * The associated UserType may be changed to ScheduleRestrictedUser by the lock when a Week Day schedule is
       * set.
       *
       * Return status shall be one of the following values:
       *
       * One or more fields violates constraints or is invalid.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.12
       */
      setWeekDaySchedule: Command(
        11,
        DoorLock2.TlvSetWeekDayScheduleRequest,
        11,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Retrieve the specific weekly schedule for the specific user.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.13
       */
      getWeekDaySchedule: Command(
        12,
        DoorLock2.TlvGetWeekDayScheduleRequest,
        12,
        DoorLock2.TlvGetWeekDayScheduleResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clear the specific weekly schedule or all weekly schedules for the specific user.
       *
       * Return status shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.15
       */
      clearWeekDaySchedule: Command(
        13,
        DoorLock2.TlvClearWeekDayScheduleRequest,
        13,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.YearDayAccessSchedulesComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of configurable year day schedule supported per user.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.12
       */
      numberOfYearDaySchedulesSupportedPerUser: FixedAttribute(21, TlvUInt8.bound({ max: 253 }))
    },
    commands: {
      /**
       * Set a time-specific schedule ID for a specified user.
       *
       * The associated UserType may be changed to ScheduleRestrictedUser by the lock when a Year Day schedule is
       * set.
       *
       * Return status shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.16
       */
      setYearDaySchedule: Command(
        14,
        DoorLock2.TlvSetYearDayScheduleRequest,
        14,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Retrieve the specific year day schedule for the specific schedule and user indexes.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.17
       */
      getYearDaySchedule: Command(
        15,
        DoorLock2.TlvGetYearDayScheduleRequest,
        15,
        DoorLock2.TlvGetYearDayScheduleResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clears the specific year day schedule or all year day schedules for the specific user.
       *
       * Return status shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.19
       */
      clearYearDaySchedule: Command(
        16,
        DoorLock2.TlvClearYearDayScheduleRequest,
        16,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.HolidaySchedulesComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of holiday schedules supported for the entire door lock device.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.13
       */
      numberOfHolidaySchedulesSupported: FixedAttribute(22, TlvUInt8.bound({ max: 253 }))
    },
    commands: {
      /**
       * Set the holiday Schedule by specifying local start time and local end time with respect to any Lock
       * Operating Mode.
       *
       * Return status shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.20
       */
      setHolidaySchedule: Command(
        17,
        DoorLock2.TlvSetHolidayScheduleRequest,
        17,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Get the holiday schedule for the specified index.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.21
       */
      getHolidaySchedule: Command(
        18,
        DoorLock2.TlvGetHolidayScheduleRequest,
        18,
        DoorLock2.TlvGetHolidayScheduleResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clears the holiday schedule or all holiday schedules.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.23
       */
      clearHolidaySchedule: Command(
        19,
        DoorLock2.TlvClearHolidayScheduleRequest,
        19,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.PinCredentialOrRfidCredentialComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the number of incorrect Pin codes or RFID presentment attempts a user is allowed to enter
       * before the lock will enter a lockout state. The value of this attribute is compared to all failing forms
       * of credential presentation, including Pin codes used in an Unlock Command when
       * RequirePINforRemoteOperation is set to true. Valid range is 1-255 incorrect attempts. The lockout state
       * will be for the duration of UserCodeTemporaryDisableTime. If the attribute accepts writes and an attempt
       * to write the value 0 is made, the device shall respond with CONSTRAINT_ERROR.
       *
       * The lock may reset the counter used to track incorrect credential presentations as required by internal
       * logic, environmental events, or other reasons. The lock shall reset the counter if a valid credential is
       * presented.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.32
       */
      wrongCodeEntryLimit: WritableAttribute(
        48,
        TlvUInt8.bound({ min: 1 }),
        { writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the number of seconds that the lock shuts down following wrong code entry. Valid range is 1-255
       * seconds. Device can shut down to lock user out for specified amount of time. (Makes it difficult to try
       * and guess a PIN for the device.) If the attribute accepts writes and an attempt to write the attribute to
       * 0 is made, the device shall respond with CONSTRAINT_ERROR.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.33
       */
      userCodeTemporaryDisableTime: WritableAttribute(
        49,
        TlvUInt8.bound({ min: 1 }),
        { writeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.PinCredentialNotUserComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the door locks ability to send PINs over the air. If the attribute is True it is ok for the
       * door lock server to send PINs over the air. This attribute determines the behavior of the server’s TX
       * operation. If it is false, then it is not ok for the device to send PIN in any messages over the air.
       *
       * The PIN field within any door lock cluster message shall keep the first octet unchanged and masks the
       * actual code by replacing with 0xFF. For example (PIN "1234" ): If the attribute value is True, 0x04 0x31
       * 0x32 0x33 0x34 shall be used in the PIN field in any door lock cluster message payload. If the attribute
       * value is False, 0x04 0xFF 0xFF 0xFF 0xFF shall be used.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.34
       */
      sendPinOverTheAir: OptionalWritableAttribute(
        50,
        TlvBoolean,
        { default: true, writeAcl: AccessLevel.Administer }
      )
    },
    commands: {
      /**
       * Set a PIN Code into the lock.
       *
       * Return status is a global status code or a cluster-specific status code from the Status Codes table and
       * shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.4
       */
      setPinCode: Command(
        5,
        DoorLock2.TlvSetPinCodeRequest,
        5,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Retrieve a PIN Code.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.5
       */
      getPinCode: Command(
        6,
        DoorLock2.TlvGetPinCodeRequest,
        6,
        DoorLock2.TlvGetPinCodeResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clear a PIN code or all PIN codes.
       *
       * For each PIN Code cleared whose user doesn’t have a RFID Code or other credential type, then
       * corresponding user record’s UserStatus value shall be set to Available, and UserType value shall be set
       * to UnrestrictedUser and all schedules shall be cleared.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.7
       */
      clearPinCode: Command(
        7,
        DoorLock2.TlvClearPinCodeRequest,
        7,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Clear out all PINs on the lock.
       *
       * > [!NOTE]
       *
       * > On the server, the clear all PIN codes command SHOULD have the same effect as the ClearPINCode command
       *   with respect to the setting of user status, user type and schedules.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.8
       */
      clearAllPinCodes: Command(
        8,
        TlvNoArguments,
        8,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      )
    }
  });
  DoorLock2.CredentialOverTheAirAccessAndPinCredentialComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates if the door lock requires an optional PIN. If this attribute is set to True, the door lock
       * server requires that an optional PINs be included in the payload of remote lock operation events like
       * Lock, Unlock, Unlock with Timeout and Toggle in order to function.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.35
       */
      requirePinForRemoteOperation: WritableAttribute(51, TlvBoolean, { writeAcl: AccessLevel.Administer })
    }
  });
  DoorLock2.AliroProvisioningComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the verification key component of the Reader’s key pair as defined in [Aliro]. The value, if
       * not null, shall be an uncompressed elliptic curve public key as defined in section 2.3.3 of SEC 1.
       *
       * Null if no Reader key pair has been configured on the lock. See Section 5.2.10.42, “SetAliroReaderConfig
       * Command”.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.37
       */
      aliroReaderVerificationKey: Attribute(
        128,
        TlvNullable(TlvByteString.bound({ length: 65 })),
        { readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the reader_group_identifier as defined in [Aliro].
       *
       * Null if no reader_group_identifier has been configured on the lock. See Section 5.2.10.42,
       * “SetAliroReaderConfig Command”.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.38
       */
      aliroReaderGroupIdentifier: Attribute(
        129,
        TlvNullable(TlvByteString.bound({ length: 16 })),
        { readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the reader_group_sub_identifier as defined in [Aliro].
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.39
       */
      aliroReaderGroupSubIdentifier: FixedAttribute(
        130,
        TlvByteString.bound({ length: 16 }),
        { readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the list of protocol versions supported for expedited transactions as defined in [Aliro].
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.40
       */
      aliroExpeditedTransactionSupportedProtocolVersions: FixedAttribute(
        131,
        TlvArray(TlvByteString, { maxLength: 16 }),
        { default: [], readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the maximum number of AliroCredentialIssuerKey credentials that can be stored on the lock.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.44
       */
      numberOfAliroCredentialIssuerKeysSupported: FixedAttribute(135, TlvUInt16),
      /**
       * Indicates the maximum number of endpoint key credentials that can be stored on the lock. This limit
       * applies to the sum of the number of AliroEvictableEndpointKey credentials and the number of
       * AliroNonEvictableEndpointKey credentials.
       *
       * > [!NOTE]
       *
       * > The credential indices used for these two credential types are independent of each other, similar to
       *   all other credential types. As long as NumberOfAliroEndpointKeysSupported is at least 2 a client could
       *   add a credential of type AliroEvictableEndpointKey at any index from 1 to
       *   NumberOfAliroEndpointKeysSupported and also add a credential of type AliroNonEvictableEndpointKey at
       *   the same index, and both credentials would exist on the server.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.45
       */
      numberOfAliroEndpointKeysSupported: FixedAttribute(136, TlvUInt16)
    },
    commands: {
      /**
       * This command allows communicating an Aliro Reader configuration, as defined in [Aliro], to the lock.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.42
       */
      setAliroReaderConfig: Command(
        40,
        DoorLock2.TlvSetAliroReaderConfigRequest,
        40,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * This command allows clearing an existing Aliro Reader configuration for the lock.
       *
       * Administrators shall NOT clear an Aliro Reader configuration without explicit user permission.
       *
       * > [!NOTE]
       *
       * > Using this command will revoke the ability of all existing Aliro user devices that have the old
       *   verification key to interact with the lock. This effect is not restricted to a single fabric or
       *   otherwise scoped in any way.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.43
       */
      clearAliroReaderConfig: Command(
        41,
        TlvNoArguments,
        41,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      )
    }
  });
  DoorLock2.AliroBleuwbComponent = MutableCluster.Component({
    attributes: {
      /**
       * Indicates the Group Resolving Key as defined in [Aliro].
       *
       * Null if no group resolving key has been configured on the lock. See Section 5.2.10.42,
       * “SetAliroReaderConfig Command”.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.41
       */
      aliroGroupResolvingKey: Attribute(
        132,
        TlvNullable(TlvByteString.bound({ length: 16 })),
        { readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the list of protocol versions supported for the Bluetooth LE + UWB Access Control Flow as
       * defined in [Aliro].
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.42
       */
      aliroSupportedBleuwbProtocolVersions: FixedAttribute(
        133,
        TlvArray(TlvByteString, { maxLength: 16 }),
        { default: [], readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      ),
      /**
       * Indicates the version of the Bluetooth LE advertisement as defined in [Aliro].
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.43
       */
      aliroBleAdvertisingVersion: FixedAttribute(
        134,
        TlvUInt8,
        { readAcl: AccessLevel.Administer, writeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent = MutableCluster.Component({
    commands: {
      /**
       * Set the status of a user ID.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.9
       */
      setUserStatus: OptionalCommand(
        9,
        DoorLock2.TlvSetUserStatusRequest,
        9,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Get the status of a user.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.10
       */
      getUserStatus: OptionalCommand(
        10,
        DoorLock2.TlvGetUserStatusRequest,
        10,
        DoorLock2.TlvGetUserStatusResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Set the user type for a specified user.
       *
       * For user type value please refer to User Type Value.
       *
       * Return status shall be one of the following values:
       *
       * One or more fields violates constraints or is invalid. Door lock is unable to switch from restricted to
       * unrestricted user (e.g. need to clear schedules to switch).
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.24
       */
      setUserType: OptionalCommand(
        20,
        DoorLock2.TlvSetUserTypeRequest,
        20,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Retrieve the user type for a specific user.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.25
       */
      getUserType: OptionalCommand(
        21,
        DoorLock2.TlvGetUserTypeRequest,
        21,
        DoorLock2.TlvGetUserTypeResponse,
        { invokeAcl: AccessLevel.Administer }
      )
    }
  });
  DoorLock2.NotUserComponent = MutableCluster.Component({});
  DoorLock2.RfidCredentialNotUserComponent = MutableCluster.Component({
    commands: {
      /**
       * Set an ID for RFID access into the lock.
       *
       * Return status is a global status code or a cluster-specific status code from the Status Codes table and
       * shall be one of the following values:
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.27
       */
      setRfidCode: Command(
        22,
        DoorLock2.TlvSetRfidCodeRequest,
        22,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Retrieve an RFID code.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.28
       */
      getRfidCode: Command(
        23,
        DoorLock2.TlvGetRfidCodeRequest,
        23,
        DoorLock2.TlvGetRfidCodeResponse,
        { invokeAcl: AccessLevel.Administer }
      ),
      /**
       * Clear an RFID code or all RFID codes.
       *
       * For each RFID Code cleared whose user doesn’t have a PIN Code or other credential type, then the
       * corresponding user record’s UserStatus value shall be set to Available, and UserType value shall be set
       * to UnrestrictedUser and all schedules shall be cleared.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.30
       */
      clearRfidCode: Command(
        24,
        DoorLock2.TlvClearRfidCodeRequest,
        24,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      ),
      /**
       * Clear out all RFIDs on the lock. If you clear all RFID codes and this user didn’t have a PIN code, the
       * user status has to be set to "0 Available", the user type has to be set to the default value, and all
       * schedules which are supported have to be set to the default values.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.31
       */
      clearAllRfidCodes: Command(
        25,
        TlvNoArguments,
        25,
        TlvNoResponse,
        { invokeAcl: AccessLevel.Administer, timed: true }
      )
    }
  });
  DoorLock2.UnboltingComponent = MutableCluster.Component({
    commands: {
      /**
       * This command causes the lock device to unlock the door without pulling the latch. This command includes
       * an optional code for the lock. The door lock may require a code depending on the value of the
       * RequirePINForRemoteOperation attribute.
       *
       * > [!NOTE]
       *
       * > If the attribute AutoRelockTime is supported, the lock will transition to the locked state when the
       *   auto relock time has expired.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.41
       */
      unboltDoor: Command(39, DoorLock2.TlvUnboltDoorRequest, 39, TlvNoResponse, { timed: true })
    }
  });
  DoorLock2.Base = MutableCluster.Component({
    id: 257,
    name: "DoorLock",
    revision: 9,
    features: {
      /**
       * If the User Feature is also supported then any PIN Code stored in the lock shall be associated with a
       * User.
       *
       * A lock may support multiple credential types so if the User feature is supported the UserType, UserStatus
       * and Schedules are all associated with a User index and not directly with a PIN index. A User index may
       * have several credentials associated with it.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.1
       */
      pinCredential: BitFlag(0),
      /**
       * If the User Feature is also supported then any RFID credential stored in the lock shall be associated
       * with a User.
       *
       * A lock may support multiple credential types so if the User feature is supported the UserType, UserStatus
       * and Schedules are all associated with a User index and not directly with a RFID index. A User Index may
       * have several credentials associated with it.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.2
       */
      rfidCredential: BitFlag(1),
      /**
       * Currently the cluster only defines the metadata format for notifications when a fingerprint/ finger vein
       * credential is used to access the lock and doesn’t describe how to create fingerprint/finger vein
       * credentials. If the Users feature is also supported then the User that a fingerprint/finger vein is
       * associated with can also have its UserType, UserStatus and Schedule modified.
       *
       * A lock may support multiple credential types so if the User feature is supported the UserType, UserStatus
       * and Schedules are all associated with a User index and not directly with a Finger index. A User Index may
       * have several credentials associated with it.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.3
       */
      fingerCredentials: BitFlag(2),
      /**
       * If the User feature is supported then Week Day Schedules are applied to a User and not a credential.
       *
       * Week Day Schedules are used to restrict access to a specified time window on certain days oftheweek. The
       * schedule is repeated each week.
       *
       * The lock may automatically adjust the UserType when a schedule is created or cleared.
       *
       * Support for WeekDayAccessSchedules requires that the lock has the capability of keeping track of local
       * time.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.4
       */
      weekDayAccessSchedules: BitFlag(4),
      /**
       * If this feature is supported this indicates that the lock has the ability to determine the position of
       * the door which is separate from the state of the lock.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.5
       */
      doorPositionSensor: BitFlag(5),
      /**
       * Currently the cluster only defines the metadata format for notifications when a face recognition, iris,
       * or retina credential is used to access the lock and doesn’t describe how to create face recognition,
       * iris, or retina credentials. If the Users feature is also supported then the User that a face
       * recognition, iris, or retina credential is associated with can also have its UserType, UserStatus and
       * Schedule modified.
       *
       * A lock may support multiple credential types so if the User feature is supported the UserType, UserStatus
       * and Schedules are all associated with a User and not directly with a credential.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.6
       */
      faceCredentials: BitFlag(6),
      /**
       * If this feature is supported then the lock supports the ability to verify a credential provided in a
       * lock/unlock command. Currently the cluster only supports providing the PIN credential to the lock/unlock
       * commands. If this feature is supported then the PIN Credential feature shall also be supported.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.7
       */
      credentialOverTheAirAccess: BitFlag(7),
      /**
       * If the User Feature is supported then a lock employs a User database. A User within the User database is
       * used to associate credentials and schedules to single user record within the lock. This also means the
       * UserType and UserStatus fields are associated with a User and not a credential.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.8
       */
      user: BitFlag(8),
      /**
       * If the User feature is supported then Year Day Schedules are applied to a User and not a credential.
       *
       * Year Day Schedules are used to restrict access to a specified date and time window.
       *
       * The lock may automatically adjust the UserType when a schedule is created or cleared.
       *
       * Support for YearDayAccessSchedules requires that the lock has the capability of keeping track of local
       * time.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.9
       */
      yearDayAccessSchedules: BitFlag(10),
      /**
       * This feature is used to setup Holiday Schedule in the lock device. A Holiday Schedule sets a start and
       * stop end date/time for the lock to use the specified operating mode set by the Holiday Schedule.
       *
       * Support for HolidaySchedules requires that the lock has the capability of keeping track of local time.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.10
       */
      holidaySchedules: BitFlag(11),
      /**
       * Locks that support this feature differentiate between unbolting and unlocking. The Unbolt Door command
       * retracts the bolt without pulling the latch. The Unlock Door command fully unlocks the door by retracting
       * the bolt and briefly pulling the latch. While the latch is pulled, the lock state changes to Unlatched.
       * Locks without unbolting support don’t differentiate between unbolting and unlocking and perform the same
       * operation for both commands.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.11
       */
      unbolting: BitFlag(12),
      /**
       * Locks that support this feature implement the Aliro specification as defined in [Aliro] and support
       * Matter as a method for provisioning Aliro credentials.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.12
       */
      aliroProvisioning: BitFlag(13),
      /**
       * Locks that support this feature implement the Bluetooth LE + UWB Access Control Flow as defined in
       * [Aliro].
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.4.13
       */
      aliroBleuwb: BitFlag(14)
    },
    attributes: {
      /**
       * This attribute may be NULL if the lock hardware does not currently know the status of
       * thelockingmechanism. For example, a lock may not know the LockState status after a power cycle until the
       * first lock actuation is completed.
       *
       * The Not Fully Locked value is used by a lock to indicate that the state of the lock is somewhere between
       * Locked and Unlocked so it is only partially secured. For example, a deadbolt could be partially extended
       * and not in a dead latched state.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.1
       */
      lockState: Attribute(0, TlvNullable(TlvEnum())),
      /**
       * Indicates the type of door lock as defined in LockTypeEnum.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.2
       */
      lockType: Attribute(1, TlvEnum()),
      /**
       * Indicates if the lock is currently able to (Enabled) or not able to (Disabled) process remote Lock,
       * Unlock, or Unlock with Timeout commands.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.3
       */
      actuatorEnabled: Attribute(2, TlvBoolean),
      /**
       * Indicates the language for the on-screen or audible user interface using a 2-byte language code from
       * ISO-639-1.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.20
       */
      language: OptionalWritableAttribute(
        33,
        TlvString.bound({ maxLength: 3 }),
        { writeAcl: AccessLevel.Manage }
      ),
      /**
       * Indicates the settings for the LED support, as defined by LEDSettingEnum.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.21
       */
      ledSettings: OptionalWritableAttribute(
        34,
        TlvEnum(),
        { default: 0 /* NoLedSignal */, writeAcl: AccessLevel.Manage }
      ),
      /**
       * Indicates the number of seconds to wait after unlocking a lock before it automatically locks again.
       * 0=disabled. If set, unlock operations from any source will be timed. For one time unlock with timeout use
       * the specific command.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.22
       */
      autoRelockTime: OptionalWritableAttribute(35, TlvUInt32, { writeAcl: AccessLevel.Manage }),
      /**
       * Indicates the sound volume on a door lock as defined by SoundVolumeEnum.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.23
       */
      soundVolume: OptionalWritableAttribute(
        36,
        TlvEnum(),
        { default: 0 /* Silent */, writeAcl: AccessLevel.Manage }
      ),
      /**
       * Indicates the current operating mode of the lock as defined in OperatingModeEnum.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.24
       */
      operatingMode: WritableAttribute(37, TlvEnum(), { writeAcl: AccessLevel.Manage }),
      /**
       * This attribute shall contain a bitmap with all operating bits of the OperatingMode attribute supported by
       * the lock.
       *
       * A bit position set to zero shall indicate that the mode is supported. A bit position set to one shall
       * indicate that the mode is not supported.
       *
       * Any bit that is not yet defined in OperatingModesBitmap shall be set to 1.
       *
       * The values considered valid to read or write in the OperatingMode attribute shall be the enum values from
       * DoorLockOperatingModeEnum whose equivalent same-named bit from OperatingModesBitmap is set to zero in
       * this attribute. WARNING: This is the opposite of most other semantically similar bitmaps in this
       * specification.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.25
       */
      supportedOperatingModes: FixedAttribute(38, TlvBitmap(TlvUInt16, DoorLock2.OperatingModes)),
      /**
       * Indicates the default configurations as they are physically set on the device (example: hardware dip
       * switch setting, etc…) and represents the default setting for some of the attributes within this cluster
       * (for example: LED, Auto Lock, Sound Volume, and Operating Mode attributes).
       *
       * This is a read-only attribute and is intended to allow clients to determine what changes may need to be
       * made without having to query all the included attributes. It may be beneficial for the clients to know
       * what the device’s original settings were in the event that the device needs to be restored to factory
       * default settings.
       *
       * If the Client device would like to query and modify the door lock server’s operating settings, it SHOULD
       * send read and write attribute requests to the specific attributes.
       *
       * For example, the Sound Volume attribute default value is Silent Mode. However, it is possible that the
       * current Sound Volume is High Volume. Therefore, if the client wants to query/modify the current Sound
       * Volume setting on the server, the client SHOULD read/write to the Sound Volume attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.26
       */
      defaultConfigurationRegister: OptionalAttribute(39, TlvBitmap(TlvUInt16, DoorLock2.ConfigurationRegister)),
      /**
       * This attribute shall enable/disable local programming on the door lock of certain features (see
       * LocalProgrammingFeatures attribute). If this value is set to TRUE then local programming is enabled on
       * the door lock for all features. If it is set to FALSE then local programming is disabled on the door lock
       * for those features whose bit is set to 0 in the LocalProgrammingFeatures attribute. Local programming
       * shall be enabled by default.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.27
       */
      enableLocalProgramming: OptionalWritableAttribute(
        40,
        TlvBoolean,
        { default: true, writeAcl: AccessLevel.Administer }
      ),
      /**
       * This attribute shall enable/disable the ability to lock the door lock with a single touch on the door
       * lock.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.28
       */
      enableOneTouchLocking: OptionalWritableAttribute(
        41,
        TlvBoolean,
        { default: true, writeAcl: AccessLevel.Manage }
      ),
      /**
       * This attribute shall enable/disable an inside LED that allows the user to see at a glance if the door is
       * locked.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.29
       */
      enableInsideStatusLed: OptionalWritableAttribute(
        42,
        TlvBoolean,
        { default: true, writeAcl: AccessLevel.Manage }
      ),
      /**
       * This attribute shall enable/disable a button inside the door that is used to put the lock into privacy
       * mode. When the lock is in privacy mode it cannot be manipulated from the outside.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.30
       */
      enablePrivacyModeButton: OptionalWritableAttribute(
        43,
        TlvBoolean,
        { default: true, writeAcl: AccessLevel.Manage }
      ),
      /**
       * Indicates the local programming features that will be disabled when EnableLocalProgramming attribute is
       * set to False. If a door lock doesn’t support disabling one aspect of local programming it shall return
       * CONSTRAINT_ERROR during a write operation of this attribute. If the EnableLocalProgramming attribute is
       * set to True then all local programming features shall be enabled regardless of the bits set to 0 in this
       * attribute.
       *
       * The features that can be disabled from local programming are defined in LocalProgrammingFeaturesBitmap.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.9.31
       */
      localProgrammingFeatures: OptionalWritableAttribute(
        44,
        TlvBitmap(TlvUInt8, DoorLock2.LocalProgrammingFeatures),
        { writeAcl: AccessLevel.Administer }
      )
    },
    commands: {
      /**
       * This command causes the lock device to lock the door. This command includes an optional code forthelock.
       * The door lock may require a PIN depending on the value of the RequirePINForRemoteOperation attribute.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.1
       */
      lockDoor: Command(0, DoorLock2.TlvLockDoorRequest, 0, TlvNoResponse, { timed: true }),
      /**
       * This command causes the lock device to unlock the door. This command includes an optional code for the
       * lock. The door lock may require a code depending on the value of the RequirePINForRemoteOperation
       * attribute.
       *
       * > [!NOTE]
       *
       * > If the attribute AutoRelockTime is supported the lock will transition to the locked state when the auto
       *   relock time has expired.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.2
       */
      unlockDoor: Command(1, DoorLock2.TlvUnlockDoorRequest, 1, TlvNoResponse, { timed: true }),
      /**
       * This command causes the lock device to unlock the door with a timeout parameter. After the time in
       * seconds specified in the timeout field, the lock device will relock itself automatically. This timeout
       * parameter is only temporary for this message transition and overrides the default relock time as
       * specified in the AutoRelockTime attribute. If the door lock device is not capable of or does not want to
       * support temporary Relock Timeout, it SHOULD NOT support this optional command.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.10.3
       */
      unlockWithTimeout: OptionalCommand(3, DoorLock2.TlvUnlockWithTimeoutRequest, 3, TlvNoResponse, { timed: true })
    },
    events: {
      /**
       * The door lock server provides several alarms which can be sent when there is a critical state on the door
       * lock. The alarms available for the door lock server are listed in AlarmCodeEnum.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.1
       */
      doorLockAlarm: Event(0, Priority.Critical, DoorLock2.TlvDoorLockAlarmEvent),
      /**
       * The door lock server sends out a LockOperation event when the event is triggered by the various lock
       * operation sources.
       *
       *   - If the door lock server supports the Unbolt Door command, it shall generate a LockOperation event
       *     with LockOperationType set to Unlock after an Unbolt Door command succeeds.
       *
       *   - If the door lock server supports the Unbolting feature and an Unlock Door command is performed, it
       *     shall generate a LockOperation event with LockOperationType set to Unlatch when the unlatched state
       *     is reached and a LockOperation event with LockOperationType set to Unlock when the lock successfully
       *     completes the unlock → hold latch → release latch and return to unlock state operation.
       *
       *   - If the command fails during holding or releasing the latch but after passing the unlocked state, the
       *     door lock server shall generate a LockOperationError event with LockOperationType set to Unlatch and
       *     a LockOperation event with LockOperationType set to Unlock.
       *
       *     - If it fails before reaching the unlocked state, the door lock server shall generate only a
       *       LockOperationError event with LockOperationType set to Unlock.
       *
       *   - Upon manual actuation, a door lock server that supports the Unbolting feature:
       *
       *     - shall generate a LockOperation event of LockOperationType Unlatch when it is actuated from the
       *       outside.
       *
       *     - may generate a LockOperation event of LockOperationType Unlatch when it is actuated from the
       *       inside.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.3
       */
      lockOperation: Event(2, Priority.Critical, DoorLock2.TlvLockOperationEvent),
      /**
       * The door lock server sends out a LockOperationError event when a lock operation fails for various
       * reasons.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 5.2.11.4
       */
      lockOperationError: Event(3, Priority.Critical, DoorLock2.TlvLockOperationErrorEvent)
    },
    /**
     * This metadata controls which DoorLockCluster elements matter.js activates for specific feature combinations.
     */
    extensions: MutableCluster.Extensions(
      { flags: { doorPositionSensor: true }, component: DoorLock2.DoorPositionSensorComponent },
      { flags: { user: true }, component: DoorLock2.UserComponent },
      { flags: { pinCredential: true }, component: DoorLock2.PinCredentialComponent },
      { flags: { rfidCredential: true }, component: DoorLock2.RfidCredentialComponent },
      { flags: { weekDayAccessSchedules: true }, component: DoorLock2.WeekDayAccessSchedulesComponent },
      { flags: { yearDayAccessSchedules: true }, component: DoorLock2.YearDayAccessSchedulesComponent },
      { flags: { holidaySchedules: true }, component: DoorLock2.HolidaySchedulesComponent },
      { flags: { pinCredential: true }, component: DoorLock2.PinCredentialOrRfidCredentialComponent },
      { flags: { rfidCredential: true }, component: DoorLock2.PinCredentialOrRfidCredentialComponent },
      { flags: { pinCredential: true, user: false }, component: DoorLock2.PinCredentialNotUserComponent },
      {
        flags: { credentialOverTheAirAccess: true, pinCredential: true },
        component: DoorLock2.CredentialOverTheAirAccessAndPinCredentialComponent
      },
      { flags: { aliroProvisioning: true }, component: DoorLock2.AliroProvisioningComponent },
      { flags: { aliroBleuwb: true }, component: DoorLock2.AliroBleuwbComponent },
      {
        flags: { pinCredential: true, rfidCredential: true, fingerCredentials: true, user: false },
        component: DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent
      },
      { flags: { user: false }, component: DoorLock2.NotUserComponent },
      { flags: { rfidCredential: true, user: false }, component: DoorLock2.RfidCredentialNotUserComponent },
      { flags: { unbolting: true }, component: DoorLock2.UnboltingComponent },
      { flags: { aliroProvisioning: true, user: false }, component: false },
      {
        flags: {
          aliroProvisioning: false,
          user: true,
          pinCredential: true,
          rfidCredential: true,
          fingerCredentials: true,
          faceCredentials: true
        },
        component: false
      },
      { flags: { aliroBleuwb: true, aliroProvisioning: false }, component: false }
    )
  });
  DoorLock2.ClusterInstance = MutableCluster({ ...DoorLock2.Base, base: ClusterType(DoorLock2.Base) }, DoorLock2.NotUserComponent);
  DoorLock2.Cluster = DoorLock2.ClusterInstance;
  const DPS = { doorPositionSensor: true };
  const USR = { user: true };
  const PIN = { pinCredential: true };
  const RID = { rfidCredential: true };
  const WDSCH = { weekDayAccessSchedules: true };
  const YDSCH = { yearDayAccessSchedules: true };
  const HDSCH = { holidaySchedules: true };
  const PIN_NOT_USR = { pinCredential: true, user: false };
  const COTA_PIN = { credentialOverTheAirAccess: true, pinCredential: true };
  const ALIRO = { aliroProvisioning: true };
  const ALBU = { aliroBleuwb: true };
  const PIN_RID_FGP_NOT_USR = { pinCredential: true, rfidCredential: true, fingerCredentials: true, user: false };
  const RID_NOT_USR = { rfidCredential: true, user: false };
  const UBOLT = { unbolting: true };
  DoorLock2.CompleteInstance = MutableCluster({
    id: DoorLock2.Cluster.id,
    name: DoorLock2.Cluster.name,
    revision: DoorLock2.Cluster.revision,
    features: DoorLock2.Cluster.features,
    attributes: {
      ...DoorLock2.Cluster.attributes,
      doorState: MutableCluster.AsConditional(
        DoorLock2.DoorPositionSensorComponent.attributes.doorState,
        { mandatoryIf: [DPS] }
      ),
      doorOpenEvents: MutableCluster.AsConditional(
        DoorLock2.DoorPositionSensorComponent.attributes.doorOpenEvents,
        { optionalIf: [DPS] }
      ),
      doorClosedEvents: MutableCluster.AsConditional(
        DoorLock2.DoorPositionSensorComponent.attributes.doorClosedEvents,
        { optionalIf: [DPS] }
      ),
      openPeriod: MutableCluster.AsConditional(
        DoorLock2.DoorPositionSensorComponent.attributes.openPeriod,
        { optionalIf: [DPS] }
      ),
      numberOfTotalUsersSupported: MutableCluster.AsConditional(
        DoorLock2.UserComponent.attributes.numberOfTotalUsersSupported,
        { mandatoryIf: [USR] }
      ),
      numberOfPinUsersSupported: MutableCluster.AsConditional(
        DoorLock2.PinCredentialComponent.attributes.numberOfPinUsersSupported,
        { mandatoryIf: [PIN] }
      ),
      numberOfRfidUsersSupported: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialComponent.attributes.numberOfRfidUsersSupported,
        { mandatoryIf: [RID] }
      ),
      numberOfWeekDaySchedulesSupportedPerUser: MutableCluster.AsConditional(
        DoorLock2.WeekDayAccessSchedulesComponent.attributes.numberOfWeekDaySchedulesSupportedPerUser,
        { mandatoryIf: [WDSCH] }
      ),
      numberOfYearDaySchedulesSupportedPerUser: MutableCluster.AsConditional(
        DoorLock2.YearDayAccessSchedulesComponent.attributes.numberOfYearDaySchedulesSupportedPerUser,
        { mandatoryIf: [YDSCH] }
      ),
      numberOfHolidaySchedulesSupported: MutableCluster.AsConditional(
        DoorLock2.HolidaySchedulesComponent.attributes.numberOfHolidaySchedulesSupported,
        { mandatoryIf: [HDSCH] }
      ),
      maxPinCodeLength: MutableCluster.AsConditional(
        DoorLock2.PinCredentialComponent.attributes.maxPinCodeLength,
        { mandatoryIf: [PIN] }
      ),
      minPinCodeLength: MutableCluster.AsConditional(
        DoorLock2.PinCredentialComponent.attributes.minPinCodeLength,
        { mandatoryIf: [PIN] }
      ),
      maxRfidCodeLength: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialComponent.attributes.maxRfidCodeLength,
        { mandatoryIf: [RID] }
      ),
      minRfidCodeLength: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialComponent.attributes.minRfidCodeLength,
        { mandatoryIf: [RID] }
      ),
      credentialRulesSupport: MutableCluster.AsConditional(
        DoorLock2.UserComponent.attributes.credentialRulesSupport,
        { mandatoryIf: [USR] }
      ),
      numberOfCredentialsSupportedPerUser: MutableCluster.AsConditional(
        DoorLock2.UserComponent.attributes.numberOfCredentialsSupportedPerUser,
        { mandatoryIf: [USR] }
      ),
      wrongCodeEntryLimit: MutableCluster.AsConditional(
        DoorLock2.PinCredentialOrRfidCredentialComponent.attributes.wrongCodeEntryLimit,
        { mandatoryIf: [PIN, RID] }
      ),
      userCodeTemporaryDisableTime: MutableCluster.AsConditional(
        DoorLock2.PinCredentialOrRfidCredentialComponent.attributes.userCodeTemporaryDisableTime,
        { mandatoryIf: [PIN, RID] }
      ),
      sendPinOverTheAir: MutableCluster.AsConditional(
        DoorLock2.PinCredentialNotUserComponent.attributes.sendPinOverTheAir,
        { optionalIf: [PIN_NOT_USR] }
      ),
      requirePinForRemoteOperation: MutableCluster.AsConditional(
        DoorLock2.CredentialOverTheAirAccessAndPinCredentialComponent.attributes.requirePinForRemoteOperation,
        { mandatoryIf: [COTA_PIN] }
      ),
      expiringUserTimeout: MutableCluster.AsConditional(
        DoorLock2.UserComponent.attributes.expiringUserTimeout,
        { optionalIf: [USR] }
      ),
      aliroReaderVerificationKey: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.aliroReaderVerificationKey,
        { mandatoryIf: [ALIRO] }
      ),
      aliroReaderGroupIdentifier: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.aliroReaderGroupIdentifier,
        { mandatoryIf: [ALIRO] }
      ),
      aliroReaderGroupSubIdentifier: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.aliroReaderGroupSubIdentifier,
        { mandatoryIf: [ALIRO] }
      ),
      aliroExpeditedTransactionSupportedProtocolVersions: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.aliroExpeditedTransactionSupportedProtocolVersions,
        { mandatoryIf: [ALIRO] }
      ),
      aliroGroupResolvingKey: MutableCluster.AsConditional(
        DoorLock2.AliroBleuwbComponent.attributes.aliroGroupResolvingKey,
        { mandatoryIf: [ALBU] }
      ),
      aliroSupportedBleuwbProtocolVersions: MutableCluster.AsConditional(
        DoorLock2.AliroBleuwbComponent.attributes.aliroSupportedBleuwbProtocolVersions,
        { mandatoryIf: [ALBU] }
      ),
      aliroBleAdvertisingVersion: MutableCluster.AsConditional(
        DoorLock2.AliroBleuwbComponent.attributes.aliroBleAdvertisingVersion,
        { mandatoryIf: [ALBU] }
      ),
      numberOfAliroCredentialIssuerKeysSupported: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.numberOfAliroCredentialIssuerKeysSupported,
        { mandatoryIf: [ALIRO] }
      ),
      numberOfAliroEndpointKeysSupported: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.attributes.numberOfAliroEndpointKeysSupported,
        { mandatoryIf: [ALIRO] }
      )
    },
    commands: {
      ...DoorLock2.Cluster.commands,
      setPinCode: MutableCluster.AsConditional(
        DoorLock2.PinCredentialNotUserComponent.commands.setPinCode,
        { mandatoryIf: [PIN_NOT_USR] }
      ),
      getPinCode: MutableCluster.AsConditional(
        DoorLock2.PinCredentialNotUserComponent.commands.getPinCode,
        { mandatoryIf: [PIN_NOT_USR] }
      ),
      clearPinCode: MutableCluster.AsConditional(
        DoorLock2.PinCredentialNotUserComponent.commands.clearPinCode,
        { mandatoryIf: [PIN_NOT_USR] }
      ),
      clearAllPinCodes: MutableCluster.AsConditional(
        DoorLock2.PinCredentialNotUserComponent.commands.clearAllPinCodes,
        { mandatoryIf: [PIN_NOT_USR] }
      ),
      setUserStatus: MutableCluster.AsConditional(
        DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent.commands.setUserStatus,
        { optionalIf: [PIN_RID_FGP_NOT_USR] }
      ),
      getUserStatus: MutableCluster.AsConditional(
        DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent.commands.getUserStatus,
        { optionalIf: [PIN_RID_FGP_NOT_USR] }
      ),
      setWeekDaySchedule: MutableCluster.AsConditional(
        DoorLock2.WeekDayAccessSchedulesComponent.commands.setWeekDaySchedule,
        { mandatoryIf: [WDSCH] }
      ),
      getWeekDaySchedule: MutableCluster.AsConditional(
        DoorLock2.WeekDayAccessSchedulesComponent.commands.getWeekDaySchedule,
        { mandatoryIf: [WDSCH] }
      ),
      clearWeekDaySchedule: MutableCluster.AsConditional(
        DoorLock2.WeekDayAccessSchedulesComponent.commands.clearWeekDaySchedule,
        { mandatoryIf: [WDSCH] }
      ),
      setYearDaySchedule: MutableCluster.AsConditional(
        DoorLock2.YearDayAccessSchedulesComponent.commands.setYearDaySchedule,
        { mandatoryIf: [YDSCH] }
      ),
      getYearDaySchedule: MutableCluster.AsConditional(
        DoorLock2.YearDayAccessSchedulesComponent.commands.getYearDaySchedule,
        { mandatoryIf: [YDSCH] }
      ),
      clearYearDaySchedule: MutableCluster.AsConditional(
        DoorLock2.YearDayAccessSchedulesComponent.commands.clearYearDaySchedule,
        { mandatoryIf: [YDSCH] }
      ),
      setHolidaySchedule: MutableCluster.AsConditional(
        DoorLock2.HolidaySchedulesComponent.commands.setHolidaySchedule,
        { mandatoryIf: [HDSCH] }
      ),
      getHolidaySchedule: MutableCluster.AsConditional(
        DoorLock2.HolidaySchedulesComponent.commands.getHolidaySchedule,
        { mandatoryIf: [HDSCH] }
      ),
      clearHolidaySchedule: MutableCluster.AsConditional(
        DoorLock2.HolidaySchedulesComponent.commands.clearHolidaySchedule,
        { mandatoryIf: [HDSCH] }
      ),
      setUserType: MutableCluster.AsConditional(
        DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent.commands.setUserType,
        { optionalIf: [PIN_RID_FGP_NOT_USR] }
      ),
      getUserType: MutableCluster.AsConditional(
        DoorLock2.PinCredentialAndRfidCredentialAndFingerCredentialsNotUserComponent.commands.getUserType,
        { optionalIf: [PIN_RID_FGP_NOT_USR] }
      ),
      setRfidCode: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialNotUserComponent.commands.setRfidCode,
        { mandatoryIf: [RID_NOT_USR] }
      ),
      getRfidCode: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialNotUserComponent.commands.getRfidCode,
        { mandatoryIf: [RID_NOT_USR] }
      ),
      clearRfidCode: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialNotUserComponent.commands.clearRfidCode,
        { mandatoryIf: [RID_NOT_USR] }
      ),
      clearAllRfidCodes: MutableCluster.AsConditional(
        DoorLock2.RfidCredentialNotUserComponent.commands.clearAllRfidCodes,
        { mandatoryIf: [RID_NOT_USR] }
      ),
      setUser: MutableCluster.AsConditional(DoorLock2.UserComponent.commands.setUser, { mandatoryIf: [USR] }),
      getUser: MutableCluster.AsConditional(DoorLock2.UserComponent.commands.getUser, { mandatoryIf: [USR] }),
      clearUser: MutableCluster.AsConditional(DoorLock2.UserComponent.commands.clearUser, { mandatoryIf: [USR] }),
      setCredential: MutableCluster.AsConditional(DoorLock2.UserComponent.commands.setCredential, { mandatoryIf: [USR] }),
      getCredentialStatus: MutableCluster.AsConditional(
        DoorLock2.UserComponent.commands.getCredentialStatus,
        { mandatoryIf: [USR] }
      ),
      clearCredential: MutableCluster.AsConditional(
        DoorLock2.UserComponent.commands.clearCredential,
        { mandatoryIf: [USR] }
      ),
      unboltDoor: MutableCluster.AsConditional(DoorLock2.UnboltingComponent.commands.unboltDoor, { mandatoryIf: [UBOLT] }),
      setAliroReaderConfig: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.commands.setAliroReaderConfig,
        { mandatoryIf: [ALIRO] }
      ),
      clearAliroReaderConfig: MutableCluster.AsConditional(
        DoorLock2.AliroProvisioningComponent.commands.clearAliroReaderConfig,
        { mandatoryIf: [ALIRO] }
      )
    },
    events: {
      ...DoorLock2.Cluster.events,
      doorStateChange: MutableCluster.AsConditional(
        DoorLock2.DoorPositionSensorComponent.events.doorStateChange,
        { mandatoryIf: [DPS] }
      ),
      lockUserChange: MutableCluster.AsConditional(DoorLock2.UserComponent.events.lockUserChange, { mandatoryIf: [USR] })
    }
  });
  DoorLock2.Complete = DoorLock2.CompleteInstance;
})(DoorLock || (DoorLock = {}));
const DoorLockCluster = DoorLock.Cluster;
ClusterRegistry.register(DoorLock.Complete);
export {
  DoorLock,
  DoorLockCluster
};
//# sourceMappingURL=door-lock.js.map
