/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 368deb1f932a */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { ClosedEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * verified: success condition met. not-yet: keep polling. failed: the poll operation itself reported failure. skipped: the operation has no verification spec, or the write result carries none of the fields verification needs (the caller never opted in for this invocation). */ export const VerifyOperationCheckResponseOutcome = { Verified: "verified", NotYet: "not-yet", Failed: "failed", Skipped: "skipped", } as const; /** * verified: success condition met. not-yet: keep polling. failed: the poll operation itself reported failure. skipped: the operation has no verification spec, or the write result carries none of the fields verification needs (the caller never opted in for this invocation). */ export type VerifyOperationCheckResponseOutcome = ClosedEnum< typeof VerifyOperationCheckResponseOutcome >; /** * The operation's declared retry policy, echoed so the caller's poll loop doesn't need its own copy. */ export type VerifyOperationCheckResponseRetry = { maxAttempts: number; intervalSeconds: number; }; export type VerifyOperationCheckResponse = { /** * verified: success condition met. not-yet: keep polling. failed: the poll operation itself reported failure. skipped: the operation has no verification spec, or the write result carries none of the fields verification needs (the caller never opted in for this invocation). */ outcome: VerifyOperationCheckResponseOutcome; /** * Present for 'failed' and 'skipped'. */ reason?: string | undefined; /** * The operation's declared retry policy, echoed so the caller's poll loop doesn't need its own copy. */ retry?: VerifyOperationCheckResponseRetry | undefined; /** * The operation's declared verification timeout. */ timeoutSeconds?: number | undefined; }; /** @internal */ export const VerifyOperationCheckResponseOutcome$inboundSchema: z.ZodEnum< typeof VerifyOperationCheckResponseOutcome > = z.enum(VerifyOperationCheckResponseOutcome); /** @internal */ export const VerifyOperationCheckResponseRetry$inboundSchema: z.ZodType< VerifyOperationCheckResponseRetry, unknown > = z.object({ maxAttempts: z.int(), intervalSeconds: z.int(), }); export function verifyOperationCheckResponseRetryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VerifyOperationCheckResponseRetry$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VerifyOperationCheckResponseRetry' from JSON`, ); } /** @internal */ export const VerifyOperationCheckResponse$inboundSchema: z.ZodType< VerifyOperationCheckResponse, unknown > = z.object({ outcome: VerifyOperationCheckResponseOutcome$inboundSchema, reason: z.string().optional(), retry: z.lazy(() => VerifyOperationCheckResponseRetry$inboundSchema) .optional(), timeoutSeconds: z.int().optional(), }); export function verifyOperationCheckResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VerifyOperationCheckResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VerifyOperationCheckResponse' from JSON`, ); }