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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type FieldGroup = {
  name: string;
  label: string;
};

/** @internal */
export const FieldGroup$inboundSchema: z.ZodType<FieldGroup, unknown> = z
  .object({
    name: z.string(),
    label: z.string(),
  });

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