/* * 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 VaultCreateCallbackStateGlobals = { /** * 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 VaultCreateCallbackStateRequest = { /** * Service ID of the resource to return */ serviceId: string; /** * Unified API */ unifiedApi: string; /** * Callback state data */ createCallbackState: components.CreateCallbackState; }; export type VaultCreateCallbackStateResponse = { httpMeta: components.HTTPMetadata; /** * Callback state created */ createCallbackStateResponse?: | components.CreateCallbackStateResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const VaultCreateCallbackStateGlobals$inboundSchema: z.ZodType< VaultCreateCallbackStateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type VaultCreateCallbackStateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const VaultCreateCallbackStateGlobals$outboundSchema: z.ZodType< VaultCreateCallbackStateGlobals$Outbound, z.ZodTypeDef, VaultCreateCallbackStateGlobals > = 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 VaultCreateCallbackStateGlobals$ { /** @deprecated use `VaultCreateCallbackStateGlobals$inboundSchema` instead. */ export const inboundSchema = VaultCreateCallbackStateGlobals$inboundSchema; /** @deprecated use `VaultCreateCallbackStateGlobals$outboundSchema` instead. */ export const outboundSchema = VaultCreateCallbackStateGlobals$outboundSchema; /** @deprecated use `VaultCreateCallbackStateGlobals$Outbound` instead. */ export type Outbound = VaultCreateCallbackStateGlobals$Outbound; } export function vaultCreateCallbackStateGlobalsToJSON( vaultCreateCallbackStateGlobals: VaultCreateCallbackStateGlobals, ): string { return JSON.stringify( VaultCreateCallbackStateGlobals$outboundSchema.parse( vaultCreateCallbackStateGlobals, ), ); } export function vaultCreateCallbackStateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCreateCallbackStateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCreateCallbackStateGlobals' from JSON`, ); } /** @internal */ export const VaultCreateCallbackStateRequest$inboundSchema: z.ZodType< VaultCreateCallbackStateRequest, z.ZodTypeDef, unknown > = z.object({ service_id: z.string(), unified_api: z.string(), CreateCallbackState: components.CreateCallbackState$inboundSchema, }).transform((v) => { return remap$(v, { "service_id": "serviceId", "unified_api": "unifiedApi", "CreateCallbackState": "createCallbackState", }); }); /** @internal */ export type VaultCreateCallbackStateRequest$Outbound = { service_id: string; unified_api: string; CreateCallbackState: components.CreateCallbackState$Outbound; }; /** @internal */ export const VaultCreateCallbackStateRequest$outboundSchema: z.ZodType< VaultCreateCallbackStateRequest$Outbound, z.ZodTypeDef, VaultCreateCallbackStateRequest > = z.object({ serviceId: z.string(), unifiedApi: z.string(), createCallbackState: components.CreateCallbackState$outboundSchema, }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", createCallbackState: "CreateCallbackState", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace VaultCreateCallbackStateRequest$ { /** @deprecated use `VaultCreateCallbackStateRequest$inboundSchema` instead. */ export const inboundSchema = VaultCreateCallbackStateRequest$inboundSchema; /** @deprecated use `VaultCreateCallbackStateRequest$outboundSchema` instead. */ export const outboundSchema = VaultCreateCallbackStateRequest$outboundSchema; /** @deprecated use `VaultCreateCallbackStateRequest$Outbound` instead. */ export type Outbound = VaultCreateCallbackStateRequest$Outbound; } export function vaultCreateCallbackStateRequestToJSON( vaultCreateCallbackStateRequest: VaultCreateCallbackStateRequest, ): string { return JSON.stringify( VaultCreateCallbackStateRequest$outboundSchema.parse( vaultCreateCallbackStateRequest, ), ); } export function vaultCreateCallbackStateRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCreateCallbackStateRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCreateCallbackStateRequest' from JSON`, ); } /** @internal */ export const VaultCreateCallbackStateResponse$inboundSchema: z.ZodType< VaultCreateCallbackStateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateCallbackStateResponse: components .CreateCallbackStateResponse$inboundSchema.optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateCallbackStateResponse": "createCallbackStateResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type VaultCreateCallbackStateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateCallbackStateResponse?: | components.CreateCallbackStateResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const VaultCreateCallbackStateResponse$outboundSchema: z.ZodType< VaultCreateCallbackStateResponse$Outbound, z.ZodTypeDef, VaultCreateCallbackStateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createCallbackStateResponse: components .CreateCallbackStateResponse$outboundSchema.optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createCallbackStateResponse: "CreateCallbackStateResponse", 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 VaultCreateCallbackStateResponse$ { /** @deprecated use `VaultCreateCallbackStateResponse$inboundSchema` instead. */ export const inboundSchema = VaultCreateCallbackStateResponse$inboundSchema; /** @deprecated use `VaultCreateCallbackStateResponse$outboundSchema` instead. */ export const outboundSchema = VaultCreateCallbackStateResponse$outboundSchema; /** @deprecated use `VaultCreateCallbackStateResponse$Outbound` instead. */ export type Outbound = VaultCreateCallbackStateResponse$Outbound; } export function vaultCreateCallbackStateResponseToJSON( vaultCreateCallbackStateResponse: VaultCreateCallbackStateResponse, ): string { return JSON.stringify( VaultCreateCallbackStateResponse$outboundSchema.parse( vaultCreateCallbackStateResponse, ), ); } export function vaultCreateCallbackStateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCreateCallbackStateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCreateCallbackStateResponse' from JSON`, ); }