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

import * as z from "zod/v3";
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 TranscriptItemSpeaker = {
  displayName: string;
  /**
   * **Coming soon!**
   *
   * @remarks
   */
  matchedCalendarInviteeEmail?: string | null | undefined;
};

/** @internal */
export const TranscriptItemSpeaker$inboundSchema: z.ZodType<
  TranscriptItemSpeaker,
  z.ZodTypeDef,
  unknown
> = z.object({
  display_name: z.string(),
  matched_calendar_invitee_email: z.nullable(z.string()).optional(),
}).transform((v) => {
  return remap$(v, {
    "display_name": "displayName",
    "matched_calendar_invitee_email": "matchedCalendarInviteeEmail",
  });
});

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