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

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

export type CreateCampaignRequest = {
  searchParams: FilterPayload;
  judgeId: string;
  name: string;
  description: string;
  maxNbEvents: number;
};

/** @internal */
export type CreateCampaignRequest$Outbound = {
  search_params: FilterPayload$Outbound;
  judge_id: string;
  name: string;
  description: string;
  max_nb_events: number;
};

/** @internal */
export const CreateCampaignRequest$outboundSchema: z.ZodType<
  CreateCampaignRequest$Outbound,
  CreateCampaignRequest
> = z.object({
  searchParams: FilterPayload$outboundSchema,
  judgeId: z.string(),
  name: z.string(),
  description: z.string(),
  maxNbEvents: z.int(),
}).transform((v) => {
  return remap$(v, {
    searchParams: "search_params",
    judgeId: "judge_id",
    maxNbEvents: "max_nb_events",
  });
});

export function createCampaignRequestToJSON(
  createCampaignRequest: CreateCampaignRequest,
): string {
  return JSON.stringify(
    CreateCampaignRequest$outboundSchema.parse(createCampaignRequest),
  );
}
