/* * 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 { lazySchema as lazySchema$, safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type VaultConnectionCustomMappingsAllGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type VaultConnectionCustomMappingsAllRequest = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; /** * Unified API */ unifiedApi: string; /** * Service ID of the resource to return */ serviceId: string; /** * Name of the resource (plural) */ resource: string; /** * This is the id of the resource you want to fetch when listing custom fields. For example, if you want to fetch custom fields for a specific contact, you would use the contact id. */ resourceId?: string | undefined; }; export type VaultConnectionCustomMappingsAllResponse = { httpMeta: components.HTTPMetadata; /** * Custom mapping */ getCustomMappingsResponse?: components.GetCustomMappingsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export type VaultConnectionCustomMappingsAllRequest$Outbound = { consumerId?: string | undefined; appId?: string | undefined; unified_api: string; service_id: string; resource: string; resource_id?: string | undefined; }; /** @internal */ export const VaultConnectionCustomMappingsAllRequest$outboundSchema: z.ZodType< VaultConnectionCustomMappingsAllRequest$Outbound, z.ZodTypeDef, VaultConnectionCustomMappingsAllRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ consumerId: z.string().optional(), appId: z.string().optional(), unifiedApi: z.string(), serviceId: z.string(), resource: z.string(), resourceId: z.string().optional(), }).transform((v) => { return remap$(v, { unifiedApi: "unified_api", serviceId: "service_id", resourceId: "resource_id", }); }) ); export function vaultConnectionCustomMappingsAllRequestToJSON( vaultConnectionCustomMappingsAllRequest: VaultConnectionCustomMappingsAllRequest, ): string { return JSON.stringify( VaultConnectionCustomMappingsAllRequest$outboundSchema.parse( vaultConnectionCustomMappingsAllRequest, ), ); } /** @internal */ export const VaultConnectionCustomMappingsAllResponse$inboundSchema: z.ZodType< VaultConnectionCustomMappingsAllResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetCustomMappingsResponse: types.optional( components.GetCustomMappingsResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetCustomMappingsResponse": "getCustomMappingsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultConnectionCustomMappingsAllResponseFromJSON( jsonString: string, ): SafeParseResult< VaultConnectionCustomMappingsAllResponse, SDKValidationError > { return safeParse( jsonString, (x) => VaultConnectionCustomMappingsAllResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'VaultConnectionCustomMappingsAllResponse' from JSON`, ); }