// SPDX-License-Identifier: Apache-2.0
import { SoloError } from '../../../core/errors/solo-error.js';
const RFC_1123_POSTFIX = (prefix) => `${prefix} is invalid, must be a valid RFC-1123 DNS label.  \` +
    "A DNS 1123 label must consist of lower case alphanumeric characters, '-' " +
    "or '.', and must start and end with an alphanumeric character.`;
export class NamespaceNameInvalidError extends SoloError {
    static NAMESPACE_NAME_INVALID = (name) => RFC_1123_POSTFIX(`Namespace name '${name}'`);
    /**
     * Instantiates a new error with a message and an optional cause.
     *
     * @param namespaceName - the invalid namespace name.
     * @param cause - optional underlying cause of the error.
     * @param meta - optional metadata to be reported.
     */
    constructor(namespaceName, cause = {}, meta = {}) {
        super(NamespaceNameInvalidError.NAMESPACE_NAME_INVALID(namespaceName), cause, meta);
    }
}
export class ContainerNameInvalidError extends SoloError {
    static CONTAINER_NAME_INVALID = (name) => RFC_1123_POSTFIX(`Container name '${name}'`);
    /**
     * Instantiates a new error with a message and an optional cause.
     *
     * @param containerName - the invalid container name.
     * @param cause - optional underlying cause of the error.
     * @param meta - optional metadata to be reported.
     */
    constructor(containerName, cause = {}, meta = {}) {
        super(ContainerNameInvalidError.CONTAINER_NAME_INVALID(containerName), cause, meta);
    }
}
export class MissingPodReferenceError extends SoloError {
    static MISSING_POD_REF = 'Pod ref is required.';
    /**
     * Instantiates a new error with a message and an optional cause.
     *
     * @param cause - optional underlying cause of the error.
     * @param meta - optional metadata to be reported.
     */
    constructor(cause = {}, meta = {}) {
        super(MissingPodReferenceError.MISSING_POD_REF, cause, meta);
    }
}
export class MissingContainerNameError extends SoloError {
    static MISSING_CONTAINER_NAME = 'Container Name is required.';
    /**
     * Instantiates a new error with a message and an optional cause.
     *
     * @param cause - optional underlying cause of the error.
     * @param meta - optional metadata to be reported.
     */
    constructor(cause = {}, meta = {}) {
        super(MissingContainerNameError.MISSING_CONTAINER_NAME, cause, meta);
    }
}
//# sourceMappingURL=namespace-name-invalid-error.js.map