/* * 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"; export type AutonomousSystem = { /** * The ASN (autonomous system number) of the host's autonomous system. */ asn?: number | undefined; /** * The autonomous system's CIDR. */ bgpPrefix?: string | undefined; /** * The autonomous system's two-letter ISO 3166-1 alpha-2 country code (US, CN, GB, RU, ...). */ countryCode?: string | undefined; /** * Brief description of the autonomous system. */ description?: string | undefined; /** * The friendly name of the autonomous system. */ name?: string | undefined; /** * The name of the organization managning the autonomous system. */ organization?: string | undefined; }; /** @internal */ export const AutonomousSystem$inboundSchema: z.ZodType< AutonomousSystem, z.ZodTypeDef, unknown > = z.object({ asn: z.number().int().optional(), bgp_prefix: z.string().optional(), country_code: z.string().optional(), description: z.string().optional(), name: z.string().optional(), organization: z.string().optional(), }).transform((v) => { return remap$(v, { "bgp_prefix": "bgpPrefix", "country_code": "countryCode", }); }); export function autonomousSystemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AutonomousSystem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AutonomousSystem' from JSON`, ); }