/* * 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 InvestigationServiceLinkDocumentsRequest = { /** * The investigation id. */ investigationId: string; linkDocumentsRequestCreate: components.LinkDocumentsRequestCreate; }; export type InvestigationServiceLinkDocumentsResponse = { httpMeta: components.HTTPMetadata; /** * OK */ linkDocumentsResponse?: components.LinkDocumentsResponse | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const InvestigationServiceLinkDocumentsRequest$inboundSchema: z.ZodType< InvestigationServiceLinkDocumentsRequest, z.ZodTypeDef, unknown > = z.object({ investigation_id: z.string(), LinkDocumentsRequestCreate: components.LinkDocumentsRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "investigation_id": "investigationId", "LinkDocumentsRequestCreate": "linkDocumentsRequestCreate", }); }); /** @internal */ export type InvestigationServiceLinkDocumentsRequest$Outbound = { investigation_id: string; LinkDocumentsRequestCreate: components.LinkDocumentsRequestCreate$Outbound; }; /** @internal */ export const InvestigationServiceLinkDocumentsRequest$outboundSchema: z.ZodType< InvestigationServiceLinkDocumentsRequest$Outbound, z.ZodTypeDef, InvestigationServiceLinkDocumentsRequest > = z.object({ investigationId: z.string(), linkDocumentsRequestCreate: components.LinkDocumentsRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { investigationId: "investigation_id", linkDocumentsRequestCreate: "LinkDocumentsRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InvestigationServiceLinkDocumentsRequest$ { /** @deprecated use `InvestigationServiceLinkDocumentsRequest$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceLinkDocumentsRequest$inboundSchema; /** @deprecated use `InvestigationServiceLinkDocumentsRequest$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceLinkDocumentsRequest$outboundSchema; /** @deprecated use `InvestigationServiceLinkDocumentsRequest$Outbound` instead. */ export type Outbound = InvestigationServiceLinkDocumentsRequest$Outbound; } export function investigationServiceLinkDocumentsRequestToJSON( investigationServiceLinkDocumentsRequest: InvestigationServiceLinkDocumentsRequest, ): string { return JSON.stringify( InvestigationServiceLinkDocumentsRequest$outboundSchema.parse( investigationServiceLinkDocumentsRequest, ), ); } export function investigationServiceLinkDocumentsRequestFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceLinkDocumentsRequest, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceLinkDocumentsRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceLinkDocumentsRequest' from JSON`, ); } /** @internal */ export const InvestigationServiceLinkDocumentsResponse$inboundSchema: z.ZodType< InvestigationServiceLinkDocumentsResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, LinkDocumentsResponse: components.LinkDocumentsResponse$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "LinkDocumentsResponse": "linkDocumentsResponse", "Status": "status", }); }); /** @internal */ export type InvestigationServiceLinkDocumentsResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; LinkDocumentsResponse?: components.LinkDocumentsResponse$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const InvestigationServiceLinkDocumentsResponse$outboundSchema: z.ZodType< InvestigationServiceLinkDocumentsResponse$Outbound, z.ZodTypeDef, InvestigationServiceLinkDocumentsResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, linkDocumentsResponse: components.LinkDocumentsResponse$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", linkDocumentsResponse: "LinkDocumentsResponse", 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 InvestigationServiceLinkDocumentsResponse$ { /** @deprecated use `InvestigationServiceLinkDocumentsResponse$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceLinkDocumentsResponse$inboundSchema; /** @deprecated use `InvestigationServiceLinkDocumentsResponse$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceLinkDocumentsResponse$outboundSchema; /** @deprecated use `InvestigationServiceLinkDocumentsResponse$Outbound` instead. */ export type Outbound = InvestigationServiceLinkDocumentsResponse$Outbound; } export function investigationServiceLinkDocumentsResponseToJSON( investigationServiceLinkDocumentsResponse: InvestigationServiceLinkDocumentsResponse, ): string { return JSON.stringify( InvestigationServiceLinkDocumentsResponse$outboundSchema.parse( investigationServiceLinkDocumentsResponse, ), ); } export function investigationServiceLinkDocumentsResponseFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceLinkDocumentsResponse, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceLinkDocumentsResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceLinkDocumentsResponse' from JSON`, ); }