/* * 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 VaultCustomFieldsAllGlobals = { /** * 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 VaultCustomFieldsAllRequest = { /** * 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 VaultCustomFieldsAllResponse = { httpMeta: components.HTTPMetadata; /** * Custom mapping */ getCustomFieldsResponse?: components.GetCustomFieldsResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const VaultCustomFieldsAllGlobals$inboundSchema: z.ZodType< VaultCustomFieldsAllGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type VaultCustomFieldsAllGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const VaultCustomFieldsAllGlobals$outboundSchema: z.ZodType< VaultCustomFieldsAllGlobals$Outbound, z.ZodTypeDef, VaultCustomFieldsAllGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultCustomFieldsAllGlobals$ { /** @deprecated use `VaultCustomFieldsAllGlobals$inboundSchema` instead. */ export const inboundSchema = VaultCustomFieldsAllGlobals$inboundSchema; /** @deprecated use `VaultCustomFieldsAllGlobals$outboundSchema` instead. */ export const outboundSchema = VaultCustomFieldsAllGlobals$outboundSchema; /** @deprecated use `VaultCustomFieldsAllGlobals$Outbound` instead. */ export type Outbound = VaultCustomFieldsAllGlobals$Outbound; } export function vaultCustomFieldsAllGlobalsToJSON( vaultCustomFieldsAllGlobals: VaultCustomFieldsAllGlobals, ): string { return JSON.stringify( VaultCustomFieldsAllGlobals$outboundSchema.parse( vaultCustomFieldsAllGlobals, ), ); } export function vaultCustomFieldsAllGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCustomFieldsAllGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCustomFieldsAllGlobals' from JSON`, ); } /** @internal */ export const VaultCustomFieldsAllRequest$inboundSchema: z.ZodType< VaultCustomFieldsAllRequest, z.ZodTypeDef, unknown > = z.object({ unified_api: z.string(), service_id: z.string(), resource: z.string(), resource_id: z.string().optional(), }).transform((v) => { return remap$(v, { "unified_api": "unifiedApi", "service_id": "serviceId", "resource_id": "resourceId", }); }); /** @internal */ export type VaultCustomFieldsAllRequest$Outbound = { unified_api: string; service_id: string; resource: string; resource_id?: string | undefined; }; /** @internal */ export const VaultCustomFieldsAllRequest$outboundSchema: z.ZodType< VaultCustomFieldsAllRequest$Outbound, z.ZodTypeDef, VaultCustomFieldsAllRequest > = z.object({ 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", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultCustomFieldsAllRequest$ { /** @deprecated use `VaultCustomFieldsAllRequest$inboundSchema` instead. */ export const inboundSchema = VaultCustomFieldsAllRequest$inboundSchema; /** @deprecated use `VaultCustomFieldsAllRequest$outboundSchema` instead. */ export const outboundSchema = VaultCustomFieldsAllRequest$outboundSchema; /** @deprecated use `VaultCustomFieldsAllRequest$Outbound` instead. */ export type Outbound = VaultCustomFieldsAllRequest$Outbound; } export function vaultCustomFieldsAllRequestToJSON( vaultCustomFieldsAllRequest: VaultCustomFieldsAllRequest, ): string { return JSON.stringify( VaultCustomFieldsAllRequest$outboundSchema.parse( vaultCustomFieldsAllRequest, ), ); } export function vaultCustomFieldsAllRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCustomFieldsAllRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCustomFieldsAllRequest' from JSON`, ); } /** @internal */ export const VaultCustomFieldsAllResponse$inboundSchema: z.ZodType< VaultCustomFieldsAllResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, GetCustomFieldsResponse: components.GetCustomFieldsResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "GetCustomFieldsResponse": "getCustomFieldsResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type VaultCustomFieldsAllResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; GetCustomFieldsResponse?: | components.GetCustomFieldsResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const VaultCustomFieldsAllResponse$outboundSchema: z.ZodType< VaultCustomFieldsAllResponse$Outbound, z.ZodTypeDef, VaultCustomFieldsAllResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, getCustomFieldsResponse: components.GetCustomFieldsResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", getCustomFieldsResponse: "GetCustomFieldsResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultCustomFieldsAllResponse$ { /** @deprecated use `VaultCustomFieldsAllResponse$inboundSchema` instead. */ export const inboundSchema = VaultCustomFieldsAllResponse$inboundSchema; /** @deprecated use `VaultCustomFieldsAllResponse$outboundSchema` instead. */ export const outboundSchema = VaultCustomFieldsAllResponse$outboundSchema; /** @deprecated use `VaultCustomFieldsAllResponse$Outbound` instead. */ export type Outbound = VaultCustomFieldsAllResponse$Outbound; } export function vaultCustomFieldsAllResponseToJSON( vaultCustomFieldsAllResponse: VaultCustomFieldsAllResponse, ): string { return JSON.stringify( VaultCustomFieldsAllResponse$outboundSchema.parse( vaultCustomFieldsAllResponse, ), ); } export function vaultCustomFieldsAllResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCustomFieldsAllResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCustomFieldsAllResponse' from JSON`, ); }