/* * 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 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 = { /** * 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; /** * 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 type VaultCreateCallbackStateRequest$Outbound = { consumerId?: string | undefined; appId?: string | undefined; service_id: string; unified_api: string; CreateCallbackState: components.CreateCallbackState$Outbound; }; /** @internal */ export const VaultCreateCallbackStateRequest$outboundSchema: z.ZodType< VaultCreateCallbackStateRequest$Outbound, z.ZodTypeDef, VaultCreateCallbackStateRequest > = /* @__PURE__ */ lazySchema$(() => z.object({ consumerId: z.string().optional(), appId: z.string().optional(), serviceId: z.string(), unifiedApi: z.string(), createCallbackState: components.CreateCallbackState$outboundSchema, }).transform((v) => { return remap$(v, { serviceId: "service_id", unifiedApi: "unified_api", createCallbackState: "CreateCallbackState", }); }) ); export function vaultCreateCallbackStateRequestToJSON( vaultCreateCallbackStateRequest: VaultCreateCallbackStateRequest, ): string { return JSON.stringify( VaultCreateCallbackStateRequest$outboundSchema.parse( vaultCreateCallbackStateRequest, ), ); } /** @internal */ export const VaultCreateCallbackStateResponse$inboundSchema: z.ZodType< VaultCreateCallbackStateResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateCallbackStateResponse: types.optional( components.CreateCallbackStateResponse$inboundSchema, ), UnexpectedErrorResponse: types.optional( components.UnexpectedErrorResponse$inboundSchema, ), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateCallbackStateResponse": "createCallbackStateResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }) ); export function vaultCreateCallbackStateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultCreateCallbackStateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultCreateCallbackStateResponse' from JSON`, ); }