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

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";

export type VoiceAppearance = {
  skinColor?: string | null | undefined;
  hairColor?: string | null | undefined;
  backgroundColor?: string | null | undefined;
  avatarId?: string | null | undefined;
};

/** @internal */
export const VoiceAppearance$inboundSchema: z.ZodType<
  VoiceAppearance,
  unknown
> = z.object({
  skin_color: z.nullable(z.string()).optional(),
  hair_color: z.nullable(z.string()).optional(),
  background_color: z.nullable(z.string()).optional(),
  avatar_id: z.nullable(z.string()).optional(),
}).transform((v) => {
  return remap$(v, {
    "skin_color": "skinColor",
    "hair_color": "hairColor",
    "background_color": "backgroundColor",
    "avatar_id": "avatarId",
  });
});
/** @internal */
export type VoiceAppearance$Outbound = {
  skin_color?: string | null | undefined;
  hair_color?: string | null | undefined;
  background_color?: string | null | undefined;
  avatar_id?: string | null | undefined;
};

/** @internal */
export const VoiceAppearance$outboundSchema: z.ZodType<
  VoiceAppearance$Outbound,
  VoiceAppearance
> = z.object({
  skinColor: z.nullable(z.string()).optional(),
  hairColor: z.nullable(z.string()).optional(),
  backgroundColor: z.nullable(z.string()).optional(),
  avatarId: z.nullable(z.string()).optional(),
}).transform((v) => {
  return remap$(v, {
    skinColor: "skin_color",
    hairColor: "hair_color",
    backgroundColor: "background_color",
    avatarId: "avatar_id",
  });
});

export function voiceAppearanceToJSON(
  voiceAppearance: VoiceAppearance,
): string {
  return JSON.stringify(VoiceAppearance$outboundSchema.parse(voiceAppearance));
}
export function voiceAppearanceFromJSON(
  jsonString: string,
): SafeParseResult<VoiceAppearance, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => VoiceAppearance$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'VoiceAppearance' from JSON`,
  );
}
