/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; /** * Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`). * * @remarks * - `event`: Include event summary (id, topic, time, eligible_for_retry, metadata) * - `event.data`: Include full event with payload data * - `response_data`: Include response body and headers * - `destination`: Include the full destination object */ export type GetAttemptInclude = string | Array; export type GetAttemptRequest = { /** * The ID of the attempt. */ attemptId: string; /** * Fields to include in the response. Use bracket notation for multiple values (e.g., `include[0]=event&include[1]=response_data`). * * @remarks * - `event`: Include event summary (id, topic, time, eligible_for_retry, metadata) * - `event.data`: Include full event with payload data * - `response_data`: Include response body and headers * - `destination`: Include the full destination object */ include?: string | Array | undefined; }; /** @internal */ export const GetAttemptInclude$inboundSchema: z.ZodType< GetAttemptInclude, z.ZodTypeDef, unknown > = z.union([z.string(), z.array(z.string())]); /** @internal */ export type GetAttemptInclude$Outbound = string | Array; /** @internal */ export const GetAttemptInclude$outboundSchema: z.ZodType< GetAttemptInclude$Outbound, z.ZodTypeDef, GetAttemptInclude > = z.union([z.string(), z.array(z.string())]); export function getAttemptIncludeToJSON( getAttemptInclude: GetAttemptInclude, ): string { return JSON.stringify( GetAttemptInclude$outboundSchema.parse(getAttemptInclude), ); } export function getAttemptIncludeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAttemptInclude$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAttemptInclude' from JSON`, ); } /** @internal */ export const GetAttemptRequest$inboundSchema: z.ZodType< GetAttemptRequest, z.ZodTypeDef, unknown > = z.object({ attempt_id: z.string(), include: z.union([z.string(), z.array(z.string())]).optional(), }).transform((v) => { return remap$(v, { "attempt_id": "attemptId", }); }); /** @internal */ export type GetAttemptRequest$Outbound = { attempt_id: string; include?: string | Array | undefined; }; /** @internal */ export const GetAttemptRequest$outboundSchema: z.ZodType< GetAttemptRequest$Outbound, z.ZodTypeDef, GetAttemptRequest > = z.object({ attemptId: z.string(), include: z.union([z.string(), z.array(z.string())]).optional(), }).transform((v) => { return remap$(v, { attemptId: "attempt_id", }); }); export function getAttemptRequestToJSON( getAttemptRequest: GetAttemptRequest, ): string { return JSON.stringify( GetAttemptRequest$outboundSchema.parse(getAttemptRequest), ); } export function getAttemptRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetAttemptRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetAttemptRequest' from JSON`, ); }