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

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 ServerLocale = {
  name?: { [k: string]: string } | null | undefined;
  description?: { [k: string]: string } | null | undefined;
  usageSentence?: { [k: string]: string } | null | undefined;
  workingDescription?: { [k: string]: string } | null | undefined;
  doneDescription?: { [k: string]: string } | null | undefined;
};

/** @internal */
export const ServerLocale$inboundSchema: z.ZodType<ServerLocale, unknown> = z
  .object({
    name: z.nullable(z.record(z.string(), z.string())).optional(),
    description: z.nullable(z.record(z.string(), z.string())).optional(),
    usage_sentence: z.nullable(z.record(z.string(), z.string())).optional(),
    working_description: z.nullable(z.record(z.string(), z.string()))
      .optional(),
    done_description: z.nullable(z.record(z.string(), z.string())).optional(),
  }).transform((v) => {
    return remap$(v, {
      "usage_sentence": "usageSentence",
      "working_description": "workingDescription",
      "done_description": "doneDescription",
    });
  });

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