/* * 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 NetworkLogResourceInfo = { /** * Hostname from the URL. */ host?: string | undefined; /** * MD5 hash of the resource content. */ md5?: string | undefined; /** * MIME type of the resource. */ mimeType?: string | undefined; /** * Path from the URL. */ path?: string | undefined; /** * Port from the URL. */ port?: string | undefined; /** * URL scheme (e.g., http, https). */ scheme?: string | undefined; /** * SHA-1 hash of the resource content. */ sha1?: string | undefined; /** * SHA-256 hash of the resource content. */ sha256?: string | undefined; /** * Size of the resource in bytes. */ size?: number | undefined; /** * Full URL of the resource. */ url?: string | undefined; }; /** @internal */ export const NetworkLogResourceInfo$inboundSchema: z.ZodType< NetworkLogResourceInfo, z.ZodTypeDef, unknown > = z.object({ host: z.string().optional(), md5: z.string().optional(), mime_type: z.string().optional(), path: z.string().optional(), port: z.string().optional(), scheme: z.string().optional(), sha1: z.string().optional(), sha256: z.string().optional(), size: z.number().int().optional(), url: z.string().optional(), }).transform((v) => { return remap$(v, { "mime_type": "mimeType", }); }); export function networkLogResourceInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NetworkLogResourceInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NetworkLogResourceInfo' from JSON`, ); }