/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 0876ea9e2709
 */

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type ConnectorAuthenticationHeader = {
  name: string;
  isRequired: boolean;
  isSecret: boolean;
};

/** @internal */
export const ConnectorAuthenticationHeader$inboundSchema: z.ZodType<
  ConnectorAuthenticationHeader,
  unknown
> = z.object({
  name: z.string(),
  is_required: z.boolean().default(true),
  is_secret: z.boolean().default(true),
}).transform((v) => {
  return remap$(v, {
    "is_required": "isRequired",
    "is_secret": "isSecret",
  });
});

export function connectorAuthenticationHeaderFromJSON(
  jsonString: string,
): SafeParseResult<ConnectorAuthenticationHeader, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ConnectorAuthenticationHeader$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ConnectorAuthenticationHeader' from JSON`,
  );
}
