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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  CreateVespaSchemaRequest,
  CreateVespaSchemaRequest$Outbound,
  CreateVespaSchemaRequest$outboundSchema,
} from "./createvespaschemarequest.js";

export type CreateVespaSearchIndexInfoRequest = {
  type: "vespa";
  k8sCluster: string;
  k8sNamespace: string;
  vespaInstanceName: string;
  schemas: Array<CreateVespaSchemaRequest>;
};

/** @internal */
export type CreateVespaSearchIndexInfoRequest$Outbound = {
  type: "vespa";
  k8s_cluster: string;
  k8s_namespace: string;
  vespa_instance_name: string;
  schemas: Array<CreateVespaSchemaRequest$Outbound>;
};

/** @internal */
export const CreateVespaSearchIndexInfoRequest$outboundSchema: z.ZodType<
  CreateVespaSearchIndexInfoRequest$Outbound,
  CreateVespaSearchIndexInfoRequest
> = z.object({
  type: z.literal("vespa"),
  k8sCluster: z.string(),
  k8sNamespace: z.string(),
  vespaInstanceName: z.string(),
  schemas: z.array(CreateVespaSchemaRequest$outboundSchema),
}).transform((v) => {
  return remap$(v, {
    k8sCluster: "k8s_cluster",
    k8sNamespace: "k8s_namespace",
    vespaInstanceName: "vespa_instance_name",
  });
});

export function createVespaSearchIndexInfoRequestToJSON(
  createVespaSearchIndexInfoRequest: CreateVespaSearchIndexInfoRequest,
): string {
  return JSON.stringify(
    CreateVespaSearchIndexInfoRequest$outboundSchema.parse(
      createVespaSearchIndexInfoRequest,
    ),
  );
}
