/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { remap as remap$ } from "../../../lib/primitives.js";

export type Security = {
  apiKeyAuth?: string | undefined;
  bearerAuth?: string | undefined;
};

/** @internal */
export type Security$Outbound = {
  ApiKeyAuth?: string | undefined;
  BearerAuth?: string | undefined;
};

/** @internal */
export const Security$outboundSchema: z.ZodType<
  Security$Outbound,
  z.ZodTypeDef,
  Security
> = z.object({
  apiKeyAuth: z.string().optional(),
  bearerAuth: z.string().optional(),
}).transform((v) => {
  return remap$(v, {
    apiKeyAuth: "ApiKeyAuth",
    bearerAuth: "BearerAuth",
  });
});

export function securityToJSON(security: Security): string {
  return JSON.stringify(Security$outboundSchema.parse(security));
}
