/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; import { Investigation, Investigation$inboundSchema, Investigation$Outbound, Investigation$outboundSchema, } from "./investigation.js"; /** * ListInvestigationStatesResponse */ export type ListInvestigationsResponse = { /** * List of investigations matching request search criteria */ investigations?: Array | undefined; /** * The next pagination token in the Search response; an empty value means no more results */ nextPageToken?: string | undefined; /** * The total number of investigations matching the search criteria. This is the total number of results available across all pages of the query, not the number of investigations returned in the current page. For example, if the search query matches 1,000 investigations but only 50 results are returned per page, `total_size` will be 1,000. */ totalSize?: number | undefined; }; /** @internal */ export const ListInvestigationsResponse$inboundSchema: z.ZodType< ListInvestigationsResponse, z.ZodTypeDef, unknown > = z.object({ investigations: z.array(Investigation$inboundSchema).optional(), next_page_token: z.string().optional(), total_size: z.number().int().optional(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", "total_size": "totalSize", }); }); /** @internal */ export type ListInvestigationsResponse$Outbound = { investigations?: Array | undefined; next_page_token?: string | undefined; total_size?: number | undefined; }; /** @internal */ export const ListInvestigationsResponse$outboundSchema: z.ZodType< ListInvestigationsResponse$Outbound, z.ZodTypeDef, ListInvestigationsResponse > = z.object({ investigations: z.array(Investigation$outboundSchema).optional(), nextPageToken: z.string().optional(), totalSize: z.number().int().optional(), }).transform((v) => { return remap$(v, { nextPageToken: "next_page_token", totalSize: "total_size", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListInvestigationsResponse$ { /** @deprecated use `ListInvestigationsResponse$inboundSchema` instead. */ export const inboundSchema = ListInvestigationsResponse$inboundSchema; /** @deprecated use `ListInvestigationsResponse$outboundSchema` instead. */ export const outboundSchema = ListInvestigationsResponse$outboundSchema; /** @deprecated use `ListInvestigationsResponse$Outbound` instead. */ export type Outbound = ListInvestigationsResponse$Outbound; } export function listInvestigationsResponseToJSON( listInvestigationsResponse: ListInvestigationsResponse, ): string { return JSON.stringify( ListInvestigationsResponse$outboundSchema.parse(listInvestigationsResponse), ); } export function listInvestigationsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListInvestigationsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListInvestigationsResponse' from JSON`, ); }