import { BaseOpenApiV3_1ConverterNode, } from "../../../BaseOpenApiV3_1Converter.node";
import { extendType } from "../../../utils/extendType";
import { X_FERN_HEADER_AUTH } from "../fernExtension.consts";
export class XFernHeaderAuthConverterNode extends BaseOpenApiV3_1ConverterNode {
    headerVariableName;
    headerEnvVar;
    headerPrefix;
    constructor(args) {
        super(args);
        this.safeParse();
    }
    parse() {
        const headerAuth = extendType(this.input)[X_FERN_HEADER_AUTH];
        this.headerVariableName = headerAuth?.name;
        this.headerEnvVar = headerAuth?.env;
        this.headerPrefix = headerAuth?.prefix;
    }
    convert() {
        return {
            name: this.headerVariableName,
            env: this.headerEnvVar,
            prefix: this.headerPrefix,
        };
    }
}
