/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; import { TestDomainRouteAgentResultDto, TestDomainRouteAgentResultDto$inboundSchema, } from "./testdomainrouteagentresultdto.js"; import { TestDomainRouteWebhookResultDto, TestDomainRouteWebhookResultDto$inboundSchema, } from "./testdomainroutewebhookresultdto.js"; export const DomainStatus = { Pending: "pending", Verified: "verified", } as const; export type DomainStatus = ClosedEnum; export const TestDomainRouteResponseDtoType = { Agent: "agent", Webhook: "webhook", } as const; export type TestDomainRouteResponseDtoType = ClosedEnum< typeof TestDomainRouteResponseDtoType >; export type TestDomainRouteResponseDto = { matched: boolean; dryRun: boolean; domainStatus?: DomainStatus | undefined; mxRecordConfigured?: boolean | undefined; type?: TestDomainRouteResponseDtoType | undefined; /** * Human-readable delivery target summary in dry-run mode. */ wouldDeliverTo?: string | undefined; /** * The outbound payload (dry-run only). */ payload?: { [k: string]: any } | undefined; webhook?: TestDomainRouteWebhookResultDto | undefined; agent?: TestDomainRouteAgentResultDto | undefined; }; /** @internal */ export const DomainStatus$inboundSchema: z.ZodNativeEnum = z.nativeEnum(DomainStatus); /** @internal */ export const TestDomainRouteResponseDtoType$inboundSchema: z.ZodNativeEnum< typeof TestDomainRouteResponseDtoType > = z.nativeEnum(TestDomainRouteResponseDtoType); /** @internal */ export const TestDomainRouteResponseDto$inboundSchema: z.ZodType< TestDomainRouteResponseDto, z.ZodTypeDef, unknown > = z.object({ matched: z.boolean(), dryRun: z.boolean(), domainStatus: DomainStatus$inboundSchema.optional(), mxRecordConfigured: z.boolean().optional(), type: TestDomainRouteResponseDtoType$inboundSchema.optional(), wouldDeliverTo: z.string().optional(), payload: z.record(z.any()).optional(), webhook: TestDomainRouteWebhookResultDto$inboundSchema.optional(), agent: TestDomainRouteAgentResultDto$inboundSchema.optional(), }); export function testDomainRouteResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TestDomainRouteResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TestDomainRouteResponseDto' from JSON`, ); }