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

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

/**
 * Capability for tasks sampling operations.
 */
export type TasksSamplingCapability = {
  createMessage?: { [k: string]: any } | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const TasksSamplingCapability$inboundSchema: z.ZodType<
  TasksSamplingCapability,
  unknown
> = z.object({
  createMessage: z.nullable(z.record(z.string(), z.any())).optional(),
}).catchall(z.any());

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