// Copyright 2020-2026 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
//
// Generated constructor surface for JetStream API errors.
// Source parity: server/jetstream_errors_generated.go

namespace ZB.MOM.NatsNet.Server;

public static partial class JsApiErrors
{
    public static JsApiError NewJSAccountResourcesExceededError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AccountResourcesExceeded);
    }

    public static JsApiError NewJSAtomicPublishContainsDuplicateMessageError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishContainsDuplicateMessage);
    }

    public static JsApiError NewJSAtomicPublishDisabledError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishDisabled);
    }

    public static JsApiError NewJSAtomicPublishIncompleteBatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishIncompleteBatch);
    }

    public static JsApiError NewJSAtomicPublishInvalidBatchCommitError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishInvalidBatchCommit);
    }

    public static JsApiError NewJSAtomicPublishInvalidBatchIDError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishInvalidBatchID);
    }

    public static JsApiError NewJSAtomicPublishMissingSeqError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(AtomicPublishMissingSeq);
    }

    public static JsApiError NewJSBadRequestError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(BadRequest);
    }

    public static JsApiError NewJSClusterIncompleteError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterIncomplete);
    }

    public static JsApiError NewJSClusterNotActiveError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterNotActive);
    }

    public static JsApiError NewJSClusterNotAssignedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterNotAssigned);
    }

    public static JsApiError NewJSClusterNotAvailError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterNotAvail);
    }

    public static JsApiError NewJSClusterNotLeaderError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterNotLeader);
    }

    public static JsApiError NewJSClusterPeerNotMemberError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterPeerNotMember);
    }

    public static JsApiError NewJSClusterRequiredError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterRequired);
    }

    public static JsApiError NewJSClusterServerMemberChangeInflightError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterServerMemberChangeInflight);
    }

    public static JsApiError NewJSClusterServerNotMemberError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterServerNotMember);
    }

    public static JsApiError NewJSClusterTagsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterTags);
    }

    public static JsApiError NewJSClusterUnSupportFeatureError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ClusterUnSupportFeature);
    }

    public static JsApiError NewJSConsumerAckPolicyInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerAckPolicyInvalid);
    }

    public static JsApiError NewJSConsumerAckWaitNegativeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerAckWaitNegative);
    }

    public static JsApiError NewJSConsumerAlreadyExistsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerAlreadyExists);
    }

    public static JsApiError NewJSConsumerBackOffNegativeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerBackOffNegative);
    }

    public static JsApiError NewJSConsumerBadDurableNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerBadDurableName);
    }

    public static JsApiError NewJSConsumerConfigRequiredError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerConfigRequired);
    }

    public static JsApiError NewJSConsumerCreateDurableAndNameMismatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerCreateDurableAndNameMismatch);
    }

    public static JsApiError NewJSConsumerCreateFilterSubjectMismatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerCreateFilterSubjectMismatch);
    }

    public static JsApiError NewJSConsumerDeliverCycleError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDeliverCycle);
    }

    public static JsApiError NewJSConsumerDeliverToWildcardsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDeliverToWildcards);
    }

    public static JsApiError NewJSConsumerDirectRequiresEphemeralError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDirectRequiresEphemeral);
    }

    public static JsApiError NewJSConsumerDirectRequiresPushError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDirectRequiresPush);
    }

    public static JsApiError NewJSConsumerDoesNotExistError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDoesNotExist);
    }

    public static JsApiError NewJSConsumerDuplicateFilterSubjectsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDuplicateFilterSubjects);
    }

    public static JsApiError NewJSConsumerDurableNameNotInSubjectError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDurableNameNotInSubject);
    }

    public static JsApiError NewJSConsumerDurableNameNotMatchSubjectError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDurableNameNotMatchSubject);
    }

    public static JsApiError NewJSConsumerDurableNameNotSetError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerDurableNameNotSet);
    }

    public static JsApiError NewJSConsumerEmptyFilterError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerEmptyFilter);
    }

    public static JsApiError NewJSConsumerEmptyGroupNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerEmptyGroupName);
    }

    public static JsApiError NewJSConsumerEphemeralWithDurableInSubjectError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerEphemeralWithDurableInSubject);
    }

    public static JsApiError NewJSConsumerEphemeralWithDurableNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerEphemeralWithDurableName);
    }

    public static JsApiError NewJSConsumerExistingActiveError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerExistingActive);
    }

    public static JsApiError NewJSConsumerFCRequiresPushError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerFCRequiresPush);
    }

    public static JsApiError NewJSConsumerFilterNotSubsetError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerFilterNotSubset);
    }

    public static JsApiError NewJSConsumerHBRequiresPushError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerHBRequiresPush);
    }

    public static JsApiError NewJSConsumerInvalidDeliverSubjectError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerInvalidDeliverSubject);
    }

    public static JsApiError NewJSConsumerInvalidGroupNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerInvalidGroupName);
    }

    public static JsApiError NewJSConsumerInvalidPriorityGroupError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerInvalidPriorityGroup);
    }

    public static JsApiError NewJSConsumerMaxDeliverBackoffError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMaxDeliverBackoff);
    }

    public static JsApiError NewJSConsumerMaxPendingAckPolicyRequiredError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMaxPendingAckPolicyRequired);
    }

    public static JsApiError NewJSConsumerMaxRequestBatchNegativeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMaxRequestBatchNegative);
    }

    public static JsApiError NewJSConsumerMaxRequestExpiresTooSmallError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMaxRequestExpiresTooSmall);
    }

    public static JsApiError NewJSConsumerMaxWaitingNegativeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMaxWaitingNegative);
    }

    public static JsApiError NewJSConsumerMultipleFiltersNotAllowedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerMultipleFiltersNotAllowed);
    }

    public static JsApiError NewJSConsumerNameContainsPathSeparatorsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerNameContainsPathSeparators);
    }

    public static JsApiError NewJSConsumerNameExistError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerNameExist);
    }

    public static JsApiError NewJSConsumerNotFoundError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerNotFound);
    }

    public static JsApiError NewJSConsumerOfflineError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerOffline);
    }

    public static JsApiError NewJSConsumerOnMappedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerOnMapped);
    }

    public static JsApiError NewJSConsumerOverlappingSubjectFiltersError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerOverlappingSubjectFilters);
    }

    public static JsApiError NewJSConsumerPinnedTTLWithoutPriorityPolicyNoneError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPinnedTTLWithoutPriorityPolicyNone);
    }

    public static JsApiError NewJSConsumerPriorityGroupWithPolicyNoneError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPriorityGroupWithPolicyNone);
    }

    public static JsApiError NewJSConsumerPriorityPolicyWithoutGroupError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPriorityPolicyWithoutGroup);
    }

    public static JsApiError NewJSConsumerPullNotDurableError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPullNotDurable);
    }

    public static JsApiError NewJSConsumerPullRequiresAckError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPullRequiresAck);
    }

    public static JsApiError NewJSConsumerPullWithRateLimitError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPullWithRateLimit);
    }

    public static JsApiError NewJSConsumerPushMaxWaitingError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPushMaxWaiting);
    }

    public static JsApiError NewJSConsumerPushWithPriorityGroupError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerPushWithPriorityGroup);
    }

    public static JsApiError NewJSConsumerReplacementWithDifferentNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerReplacementWithDifferentName);
    }

    public static JsApiError NewJSConsumerReplayPolicyInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerReplayPolicyInvalid);
    }

    public static JsApiError NewJSConsumerReplicasExceedsStreamError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerReplicasExceedsStream);
    }

    public static JsApiError NewJSConsumerReplicasShouldMatchStreamError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerReplicasShouldMatchStream);
    }

    public static JsApiError NewJSConsumerSmallHeartbeatError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerSmallHeartbeat);
    }

    public static JsApiError NewJSConsumerWQConsumerNotDeliverAllError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerWQConsumerNotDeliverAll);
    }

    public static JsApiError NewJSConsumerWQConsumerNotUniqueError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerWQConsumerNotUnique);
    }

    public static JsApiError NewJSConsumerWQMultipleUnfilteredError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerWQMultipleUnfiltered);
    }

    public static JsApiError NewJSConsumerWQRequiresExplicitAckError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerWQRequiresExplicitAck);
    }

    public static JsApiError NewJSConsumerWithFlowControlNeedsHeartbeatsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ConsumerWithFlowControlNeedsHeartbeats);
    }

    public static JsApiError NewJSInsufficientResourcesError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(InsufficientResources);
    }

    public static JsApiError NewJSMaximumConsumersLimitError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MaximumConsumersLimit);
    }

    public static JsApiError NewJSMaximumStreamsLimitError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MaximumStreamsLimit);
    }

    public static JsApiError NewJSMemoryResourcesExceededError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MemoryResourcesExceeded);
    }

    public static JsApiError NewJSMessageCounterBrokenError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageCounterBroken);
    }

    public static JsApiError NewJSMessageIncrDisabledError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageIncrDisabled);
    }

    public static JsApiError NewJSMessageIncrInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageIncrInvalid);
    }

    public static JsApiError NewJSMessageIncrMissingError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageIncrMissing);
    }

    public static JsApiError NewJSMessageIncrPayloadError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageIncrPayload);
    }

    public static JsApiError NewJSMessageSchedulesDisabledError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesDisabled);
    }

    public static JsApiError NewJSMessageSchedulesPatternInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesPatternInvalid);
    }

    public static JsApiError NewJSMessageSchedulesRollupInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesRollupInvalid);
    }

    public static JsApiError NewJSMessageSchedulesSourceInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesSourceInvalid);
    }

    public static JsApiError NewJSMessageSchedulesTTLInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesTTLInvalid);
    }

    public static JsApiError NewJSMessageSchedulesTargetInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageSchedulesTargetInvalid);
    }

    public static JsApiError NewJSMessageTTLDisabledError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageTTLDisabled);
    }

    public static JsApiError NewJSMessageTTLInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MessageTTLInvalid);
    }

    public static JsApiError NewJSMirrorInvalidStreamNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorInvalidStreamName);
    }

    public static JsApiError NewJSMirrorMaxMessageSizeTooBigError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorMaxMessageSizeTooBig);
    }

    public static JsApiError NewJSMirrorMultipleFiltersNotAllowedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorMultipleFiltersNotAllowed);
    }

    public static JsApiError NewJSMirrorOverlappingSubjectFiltersError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorOverlappingSubjectFilters);
    }

    public static JsApiError NewJSMirrorWithAtomicPublishError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithAtomicPublish);
    }

    public static JsApiError NewJSMirrorWithCountersError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithCounters);
    }

    public static JsApiError NewJSMirrorWithFirstSeqError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithFirstSeq);
    }

    public static JsApiError NewJSMirrorWithMsgSchedulesError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithMsgSchedules);
    }

    public static JsApiError NewJSMirrorWithSourcesError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithSources);
    }

    public static JsApiError NewJSMirrorWithStartSeqAndTimeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithStartSeqAndTime);
    }

    public static JsApiError NewJSMirrorWithSubjectFiltersError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithSubjectFilters);
    }

    public static JsApiError NewJSMirrorWithSubjectsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(MirrorWithSubjects);
    }

    public static JsApiError NewJSNoAccountError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NoAccount);
    }

    public static JsApiError NewJSNoLimitsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NoLimits);
    }

    public static JsApiError NewJSNoMessageFoundError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NoMessageFound);
    }

    public static JsApiError NewJSNotEmptyRequestError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NotEmptyRequest);
    }

    public static JsApiError NewJSNotEnabledError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NotEnabled);
    }

    public static JsApiError NewJSNotEnabledForAccountError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(NotEnabledForAccount);
    }

    public static JsApiError NewJSReplicasCountCannotBeNegativeError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(ReplicasCountCannotBeNegative);
    }

    public static JsApiError NewJSRequiredApiLevelError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(RequiredApiLevel);
    }

    public static JsApiError NewJSSnapshotDeliverSubjectInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SnapshotDeliverSubjectInvalid);
    }

    public static JsApiError NewJSSourceDuplicateDetectedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceDuplicateDetected);
    }

    public static JsApiError NewJSSourceInvalidStreamNameError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceInvalidStreamName);
    }

    public static JsApiError NewJSSourceMaxMessageSizeTooBigError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceMaxMessageSizeTooBig);
    }

    public static JsApiError NewJSSourceMultipleFiltersNotAllowedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceMultipleFiltersNotAllowed);
    }

    public static JsApiError NewJSSourceOverlappingSubjectFiltersError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceOverlappingSubjectFilters);
    }

    public static JsApiError NewJSSourceWithMsgSchedulesError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(SourceWithMsgSchedules);
    }

    public static JsApiError NewJSStorageResourcesExceededError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StorageResourcesExceeded);
    }

    public static JsApiError NewJSStreamDuplicateMessageConflictError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamDuplicateMessageConflict);
    }

    public static JsApiError NewJSStreamExpectedLastSeqPerSubjectInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamExpectedLastSeqPerSubjectInvalid);
    }

    public static JsApiError NewJSStreamExpectedLastSeqPerSubjectNotReadyError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamExpectedLastSeqPerSubjectNotReady);
    }

    public static JsApiError NewJSStreamHeaderExceedsMaximumError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamHeaderExceedsMaximum);
    }

    public static JsApiError NewJSStreamInfoMaxSubjectsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamInfoMaxSubjects);
    }

    public static JsApiError NewJSStreamInvalidError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamInvalid);
    }

    public static JsApiError NewJSStreamMaxBytesRequiredError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMaxBytesRequired);
    }

    public static JsApiError NewJSStreamMaxStreamBytesExceededError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMaxStreamBytesExceeded);
    }

    public static JsApiError NewJSStreamMessageExceedsMaximumError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMessageExceedsMaximum);
    }

    public static JsApiError NewJSStreamMinLastSeqError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMinLastSeq);
    }

    public static JsApiError NewJSStreamMirrorNotUpdatableError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMirrorNotUpdatable);
    }

    public static JsApiError NewJSStreamMismatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMismatch);
    }

    public static JsApiError NewJSStreamMoveAndScaleError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMoveAndScale);
    }

    public static JsApiError NewJSStreamMoveNotInProgressError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamMoveNotInProgress);
    }

    public static JsApiError NewJSStreamNameContainsPathSeparatorsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamNameContainsPathSeparators);
    }

    public static JsApiError NewJSStreamNameExistError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamNameExist);
    }

    public static JsApiError NewJSStreamNameExistRestoreFailedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamNameExistRestoreFailed);
    }

    public static JsApiError NewJSStreamNotFoundError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamNotFound);
    }

    public static JsApiError NewJSStreamNotMatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamNotMatch);
    }

    public static JsApiError NewJSStreamOfflineError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamOffline);
    }

    public static JsApiError NewJSStreamReplicasNotSupportedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamReplicasNotSupported);
    }

    public static JsApiError NewJSStreamReplicasNotUpdatableError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamReplicasNotUpdatable);
    }

    public static JsApiError NewJSStreamSealedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamSealed);
    }

    public static JsApiError NewJSStreamSequenceNotMatchError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamSequenceNotMatch);
    }

    public static JsApiError NewJSStreamSubjectOverlapError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamSubjectOverlap);
    }

    public static JsApiError NewJSStreamTemplateNotFoundError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamTemplateNotFound);
    }

    public static JsApiError NewJSStreamTooManyRequestsError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamTooManyRequests);
    }

    public static JsApiError NewJSStreamWrongLastSequenceConstantError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(StreamWrongLastSequenceConstant);
    }

    public static JsApiError NewJSTempStorageFailedError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(TempStorageFailed);
    }

    public static JsApiError NewJSTemplateNameNotMatchSubjectError(params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return Clone(TemplateNameNotMatchSubject);
    }

    public static JsApiError NewJSAtomicPublishTooLargeBatchError(object? size, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(AtomicPublishTooLargeBatch, "{size}", size);
    }

    public static JsApiError NewJSAtomicPublishUnsupportedHeaderBatchError(object? header, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(AtomicPublishUnsupportedHeaderBatch, "{header}", header);
    }

    public static JsApiError NewJSClusterNoPeersError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ClusterNoPeers, "{err}", err);
    }

    public static JsApiError NewJSConsumerCreateError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerCreateErr, "{err}", err);
    }

    public static JsApiError NewJSConsumerDescriptionTooLongError(object? max, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerDescriptionTooLong, "{max}", max);
    }

    public static JsApiError NewJSConsumerInactiveThresholdExcessError(object? limit, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerInactiveThresholdExcess, "{limit}", limit);
    }

    public static JsApiError NewJSConsumerInvalidPolicyError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerInvalidPolicy, "{err}", err);
    }

    public static JsApiError NewJSConsumerInvalidResetError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerInvalidReset, "{err}", err);
    }

    public static JsApiError NewJSConsumerInvalidSamplingError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerInvalidSampling, "{err}", err);
    }

    public static JsApiError NewJSConsumerMaxPendingAckExcessError(object? limit, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerMaxPendingAckExcess, "{limit}", limit);
    }

    public static JsApiError NewJSConsumerMaxRequestBatchExceededError(object? limit, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerMaxRequestBatchExceeded, "{limit}", limit);
    }

    public static JsApiError NewJSConsumerMetadataLengthError(object? limit, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerMetadataLength, "{limit}", limit);
    }

    public static JsApiError NewJSConsumerNameTooLongError(object? max, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerNameTooLong, "{max}", max);
    }

    public static JsApiError NewJSConsumerOfflineReasonError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerOfflineReason, "{err}", err);
    }

    public static JsApiError NewJSConsumerStoreFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(ConsumerStoreFailed, "{err}", err);
    }

    public static JsApiError NewJSInvalidJSONError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(InvalidJSON, "{err}", err);
    }

    public static JsApiError NewJSMirrorConsumerSetupFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(MirrorConsumerSetupFailed, "{err}", err);
    }

    public static JsApiError NewJSMirrorInvalidSubjectFilterError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(MirrorInvalidSubjectFilter, "{err}", err);
    }

    public static JsApiError NewJSMirrorInvalidTransformDestinationError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(MirrorInvalidTransformDestination, "{err}", err);
    }

    public static JsApiError NewJSPedanticError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(Pedantic, "{err}", err);
    }

    public static JsApiError NewJSRaftGeneralError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(RaftGeneralErr, "{err}", err);
    }

    public static JsApiError NewJSSequenceNotFoundError(ulong seq, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(SequenceNotFound, "{seq}", seq);
    }

    public static JsApiError NewJSSourceConsumerSetupFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(SourceConsumerSetupFailed, "{err}", err);
    }

    public static JsApiError NewJSSourceInvalidSubjectFilterError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(SourceInvalidSubjectFilter, "{err}", err);
    }

    public static JsApiError NewJSSourceInvalidTransformDestinationError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(SourceInvalidTransformDestination, "{err}", err);
    }

    public static JsApiError NewJSStreamAssignmentError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamAssignment, "{err}", err);
    }

    public static JsApiError NewJSStreamCreateError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamCreate, "{err}", err);
    }

    public static JsApiError NewJSStreamDeleteError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamDelete, "{err}", err);
    }

    public static JsApiError NewJSStreamGeneralError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamGeneralError, "{err}", err);
    }

    public static JsApiError NewJSStreamInvalidConfigError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamInvalidConfig, "{err}", err);
    }

    public static JsApiError NewJSStreamInvalidExternalDeliverySubjError(object? prefix, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamInvalidExternalDeliverySubj, "{prefix}", prefix);
    }

    public static JsApiError NewJSStreamLimitsError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamLimits, "{err}", err);
    }

    public static JsApiError NewJSStreamMoveInProgressError(object? msg, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamMoveInProgress, "{msg}", msg);
    }

    public static JsApiError NewJSStreamMsgDeleteFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamMsgDeleteFailed, "{err}", err);
    }

    public static JsApiError NewJSStreamOfflineReasonError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamOfflineReason, "{err}", err);
    }

    public static JsApiError NewJSStreamPurgeFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamPurgeFailed, "{err}", err);
    }

    public static JsApiError NewJSStreamRollupFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamRollupFailed, "{err}", err);
    }

    public static JsApiError NewJSStreamSnapshotError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamSnapshot, "{err}", err);
    }

    public static JsApiError NewJSStreamStoreFailedError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamStoreFailed, "{err}", err);
    }

    public static JsApiError NewJSStreamTemplateCreateError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamTemplateCreate, "{err}", err);
    }

    public static JsApiError NewJSStreamTemplateDeleteError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamTemplateDelete, "{err}", err);
    }

    public static JsApiError NewJSStreamTransformInvalidDestinationError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamTransformInvalidDestination, "{err}", err);
    }

    public static JsApiError NewJSStreamTransformInvalidSourceError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamTransformInvalidSource, "{err}", err);
    }

    public static JsApiError NewJSStreamUpdateError(Exception err, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamUpdate, "{err}", err);
    }

    public static JsApiError NewJSStreamWrongLastMsgIDError(object? id, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamWrongLastMsgID, "{id}", id);
    }

    public static JsApiError NewJSStreamWrongLastSequenceError(ulong seq, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamWrongLastSequence, "{seq}", seq);
    }

    public static JsApiError NewJSStreamExternalApiOverlapError(object? prefix, object? subject, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamExternalApiOverlap, "{prefix}", prefix, "{subject}", subject);
    }

    public static JsApiError NewJSStreamExternalDelPrefixOverlapsError(object? prefix, object? subject, params ErrorOption[] opts)
    {
        if (ParseOpts(opts) is JsApiError overridden)
            return Clone(overridden);

        return NewWithTags(StreamExternalDelPrefixOverlaps, "{prefix}", prefix, "{subject}", subject);
    }

}
