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

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

/** @internal */
export const ConnectorLocale$inboundSchema: z.ZodType<
  ConnectorLocale,
  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 connectorLocaleFromJSON(
  jsonString: string,
): SafeParseResult<ConnectorLocale, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ConnectorLocale$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ConnectorLocale' from JSON`,
  );
}
