/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type InvestigationServiceGetInvestigationRequest = { /** * The investigation id. */ investigationId: string; }; export type InvestigationServiceGetInvestigationResponse = { httpMeta: components.HTTPMetadata; /** * OK */ investigation?: components.Investigation | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const InvestigationServiceGetInvestigationRequest$inboundSchema: z.ZodType< InvestigationServiceGetInvestigationRequest, z.ZodTypeDef, unknown > = z.object({ investigation_id: z.string(), }).transform((v) => { return remap$(v, { "investigation_id": "investigationId", }); }); /** @internal */ export type InvestigationServiceGetInvestigationRequest$Outbound = { investigation_id: string; }; /** @internal */ export const InvestigationServiceGetInvestigationRequest$outboundSchema: z.ZodType< InvestigationServiceGetInvestigationRequest$Outbound, z.ZodTypeDef, InvestigationServiceGetInvestigationRequest > = z.object({ investigationId: z.string(), }).transform((v) => { return remap$(v, { investigationId: "investigation_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InvestigationServiceGetInvestigationRequest$ { /** @deprecated use `InvestigationServiceGetInvestigationRequest$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceGetInvestigationRequest$inboundSchema; /** @deprecated use `InvestigationServiceGetInvestigationRequest$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceGetInvestigationRequest$outboundSchema; /** @deprecated use `InvestigationServiceGetInvestigationRequest$Outbound` instead. */ export type Outbound = InvestigationServiceGetInvestigationRequest$Outbound; } export function investigationServiceGetInvestigationRequestToJSON( investigationServiceGetInvestigationRequest: InvestigationServiceGetInvestigationRequest, ): string { return JSON.stringify( InvestigationServiceGetInvestigationRequest$outboundSchema.parse( investigationServiceGetInvestigationRequest, ), ); } export function investigationServiceGetInvestigationRequestFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceGetInvestigationRequest, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceGetInvestigationRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceGetInvestigationRequest' from JSON`, ); } /** @internal */ export const InvestigationServiceGetInvestigationResponse$inboundSchema: z.ZodType< InvestigationServiceGetInvestigationResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Investigation: components.Investigation$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Investigation": "investigation", "Status": "status", }); }); /** @internal */ export type InvestigationServiceGetInvestigationResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Investigation?: components.Investigation$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const InvestigationServiceGetInvestigationResponse$outboundSchema: z.ZodType< InvestigationServiceGetInvestigationResponse$Outbound, z.ZodTypeDef, InvestigationServiceGetInvestigationResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, investigation: components.Investigation$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", investigation: "Investigation", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InvestigationServiceGetInvestigationResponse$ { /** @deprecated use `InvestigationServiceGetInvestigationResponse$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceGetInvestigationResponse$inboundSchema; /** @deprecated use `InvestigationServiceGetInvestigationResponse$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceGetInvestigationResponse$outboundSchema; /** @deprecated use `InvestigationServiceGetInvestigationResponse$Outbound` instead. */ export type Outbound = InvestigationServiceGetInvestigationResponse$Outbound; } export function investigationServiceGetInvestigationResponseToJSON( investigationServiceGetInvestigationResponse: InvestigationServiceGetInvestigationResponse, ): string { return JSON.stringify( InvestigationServiceGetInvestigationResponse$outboundSchema.parse( investigationServiceGetInvestigationResponse, ), ); } export function investigationServiceGetInvestigationResponseFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceGetInvestigationResponse, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceGetInvestigationResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceGetInvestigationResponse' from JSON`, ); }