/* * 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"; /** * An enumerated field indicating what type of data is in the "services.dns.additionals.response" field. For example, "A" signifies that the value in "services.dns.additionals.response" is an IPv4 address for the FQDN in "services.dns.additionals.name". */ export const DnsResourceRecordType = { Unknown: "", A: "a", Txt: "txt", Ns: "ns", } as const; /** * An enumerated field indicating what type of data is in the "services.dns.additionals.response" field. For example, "A" signifies that the value in "services.dns.additionals.response" is an IPv4 address for the FQDN in "services.dns.additionals.name". */ export type DnsResourceRecordType = OpenEnum; export type DnsResourceRecord = { /** * The Fully Qualified Domain Name (FQDN) this RR is for. */ name?: string | undefined; /** * The RDATA field of the RR. */ response?: string | undefined; /** * An enumerated field indicating what type of data is in the "services.dns.additionals.response" field. For example, "A" signifies that the value in "services.dns.additionals.response" is an IPv4 address for the FQDN in "services.dns.additionals.name". */ type?: DnsResourceRecordType | undefined; }; /** @internal */ export const DnsResourceRecordType$inboundSchema: z.ZodType< DnsResourceRecordType, z.ZodTypeDef, unknown > = openEnums.inboundSchema(DnsResourceRecordType); /** @internal */ export const DnsResourceRecord$inboundSchema: z.ZodType< DnsResourceRecord, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), response: z.string().optional(), type: DnsResourceRecordType$inboundSchema.optional(), }); export function dnsResourceRecordFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DnsResourceRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DnsResourceRecord' from JSON`, ); }