/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const Targets = { Host: "host", Web: "web", Cert: "cert", Unknown: "unknown", } as const; export type Targets = OpenEnum; export type AlternativeQuery = { /** * An alternative query that may be used. */ query: string; /** * The types of Platform data records (host, cert, and web) that can be targeted by the alternative query. */ targets: Array | null; }; /** @internal */ export const Targets$inboundSchema: z.ZodType = openEnums.inboundSchema(Targets); /** @internal */ export const AlternativeQuery$inboundSchema: z.ZodType< AlternativeQuery, z.ZodTypeDef, unknown > = z.object({ query: z.string(), targets: z.nullable(z.array(Targets$inboundSchema)), }); export function alternativeQueryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AlternativeQuery$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AlternativeQuery' from JSON`, ); }