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

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";
import {
  PaginatedResultChatCompletionEventPreview,
  PaginatedResultChatCompletionEventPreview$inboundSchema,
} from "./paginatedresultchatcompletioneventpreview.js";

export type ListCampaignSelectedEventsResponse = {
  completionEvents: PaginatedResultChatCompletionEventPreview;
};

/** @internal */
export const ListCampaignSelectedEventsResponse$inboundSchema: z.ZodType<
  ListCampaignSelectedEventsResponse,
  unknown
> = z.object({
  completion_events: PaginatedResultChatCompletionEventPreview$inboundSchema,
}).transform((v) => {
  return remap$(v, {
    "completion_events": "completionEvents",
  });
});

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