/* * 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 InvestigationServiceUpdateInvestigationRequest = { /** * The investigation id. */ investigationId: string; /** * The list of fields to update. Updatable Fields: * * @remarks * - identity_verification * - investigation_request_state * - watchlist_matches * - watchlist_id * - watchlist_item_id * - match_state * - exclude_from_screening * - comment */ updateMask?: string | undefined; investigationUpdate: components.InvestigationUpdate; }; export type InvestigationServiceUpdateInvestigationResponse = { httpMeta: components.HTTPMetadata; /** * OK */ investigation?: components.Investigation | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. * * @remarks * FAILED_PRECONDITION: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const InvestigationServiceUpdateInvestigationRequest$inboundSchema: z.ZodType< InvestigationServiceUpdateInvestigationRequest, z.ZodTypeDef, unknown > = z.object({ investigation_id: z.string(), update_mask: z.string().optional(), InvestigationUpdate: components.InvestigationUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "investigation_id": "investigationId", "update_mask": "updateMask", "InvestigationUpdate": "investigationUpdate", }); }); /** @internal */ export type InvestigationServiceUpdateInvestigationRequest$Outbound = { investigation_id: string; update_mask?: string | undefined; InvestigationUpdate: components.InvestigationUpdate$Outbound; }; /** @internal */ export const InvestigationServiceUpdateInvestigationRequest$outboundSchema: z.ZodType< InvestigationServiceUpdateInvestigationRequest$Outbound, z.ZodTypeDef, InvestigationServiceUpdateInvestigationRequest > = z.object({ investigationId: z.string(), updateMask: z.string().optional(), investigationUpdate: components.InvestigationUpdate$outboundSchema, }).transform((v) => { return remap$(v, { investigationId: "investigation_id", updateMask: "update_mask", investigationUpdate: "InvestigationUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace InvestigationServiceUpdateInvestigationRequest$ { /** @deprecated use `InvestigationServiceUpdateInvestigationRequest$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceUpdateInvestigationRequest$inboundSchema; /** @deprecated use `InvestigationServiceUpdateInvestigationRequest$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceUpdateInvestigationRequest$outboundSchema; /** @deprecated use `InvestigationServiceUpdateInvestigationRequest$Outbound` instead. */ export type Outbound = InvestigationServiceUpdateInvestigationRequest$Outbound; } export function investigationServiceUpdateInvestigationRequestToJSON( investigationServiceUpdateInvestigationRequest: InvestigationServiceUpdateInvestigationRequest, ): string { return JSON.stringify( InvestigationServiceUpdateInvestigationRequest$outboundSchema.parse( investigationServiceUpdateInvestigationRequest, ), ); } export function investigationServiceUpdateInvestigationRequestFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceUpdateInvestigationRequest, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceUpdateInvestigationRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceUpdateInvestigationRequest' from JSON`, ); } /** @internal */ export const InvestigationServiceUpdateInvestigationResponse$inboundSchema: z.ZodType< InvestigationServiceUpdateInvestigationResponse, 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 InvestigationServiceUpdateInvestigationResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Investigation?: components.Investigation$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const InvestigationServiceUpdateInvestigationResponse$outboundSchema: z.ZodType< InvestigationServiceUpdateInvestigationResponse$Outbound, z.ZodTypeDef, InvestigationServiceUpdateInvestigationResponse > = 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 InvestigationServiceUpdateInvestigationResponse$ { /** @deprecated use `InvestigationServiceUpdateInvestigationResponse$inboundSchema` instead. */ export const inboundSchema = InvestigationServiceUpdateInvestigationResponse$inboundSchema; /** @deprecated use `InvestigationServiceUpdateInvestigationResponse$outboundSchema` instead. */ export const outboundSchema = InvestigationServiceUpdateInvestigationResponse$outboundSchema; /** @deprecated use `InvestigationServiceUpdateInvestigationResponse$Outbound` instead. */ export type Outbound = InvestigationServiceUpdateInvestigationResponse$Outbound; } export function investigationServiceUpdateInvestigationResponseToJSON( investigationServiceUpdateInvestigationResponse: InvestigationServiceUpdateInvestigationResponse, ): string { return JSON.stringify( InvestigationServiceUpdateInvestigationResponse$outboundSchema.parse( investigationServiceUpdateInvestigationResponse, ), ); } export function investigationServiceUpdateInvestigationResponseFromJSON( jsonString: string, ): SafeParseResult< InvestigationServiceUpdateInvestigationResponse, SDKValidationError > { return safeParse( jsonString, (x) => InvestigationServiceUpdateInvestigationResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'InvestigationServiceUpdateInvestigationResponse' from JSON`, ); }