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

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 ConnectorToolLocale = {
  name: { [k: string]: string };
  description: { [k: string]: string };
  usageSentence: { [k: string]: string };
};

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

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