/* * 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 VaultSessionsCreateGlobals = { /** * 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 VaultSessionsCreateResponse = { httpMeta: components.HTTPMetadata; /** * Session created */ createSessionResponse?: components.CreateSessionResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const VaultSessionsCreateGlobals$inboundSchema: z.ZodType< VaultSessionsCreateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type VaultSessionsCreateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const VaultSessionsCreateGlobals$outboundSchema: z.ZodType< VaultSessionsCreateGlobals$Outbound, z.ZodTypeDef, VaultSessionsCreateGlobals > = 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 VaultSessionsCreateGlobals$ { /** @deprecated use `VaultSessionsCreateGlobals$inboundSchema` instead. */ export const inboundSchema = VaultSessionsCreateGlobals$inboundSchema; /** @deprecated use `VaultSessionsCreateGlobals$outboundSchema` instead. */ export const outboundSchema = VaultSessionsCreateGlobals$outboundSchema; /** @deprecated use `VaultSessionsCreateGlobals$Outbound` instead. */ export type Outbound = VaultSessionsCreateGlobals$Outbound; } export function vaultSessionsCreateGlobalsToJSON( vaultSessionsCreateGlobals: VaultSessionsCreateGlobals, ): string { return JSON.stringify( VaultSessionsCreateGlobals$outboundSchema.parse(vaultSessionsCreateGlobals), ); } export function vaultSessionsCreateGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultSessionsCreateGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultSessionsCreateGlobals' from JSON`, ); } /** @internal */ export const VaultSessionsCreateResponse$inboundSchema: z.ZodType< VaultSessionsCreateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateSessionResponse: components.CreateSessionResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateSessionResponse": "createSessionResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type VaultSessionsCreateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateSessionResponse?: components.CreateSessionResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const VaultSessionsCreateResponse$outboundSchema: z.ZodType< VaultSessionsCreateResponse$Outbound, z.ZodTypeDef, VaultSessionsCreateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createSessionResponse: components.CreateSessionResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createSessionResponse: "CreateSessionResponse", 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 VaultSessionsCreateResponse$ { /** @deprecated use `VaultSessionsCreateResponse$inboundSchema` instead. */ export const inboundSchema = VaultSessionsCreateResponse$inboundSchema; /** @deprecated use `VaultSessionsCreateResponse$outboundSchema` instead. */ export const outboundSchema = VaultSessionsCreateResponse$outboundSchema; /** @deprecated use `VaultSessionsCreateResponse$Outbound` instead. */ export type Outbound = VaultSessionsCreateResponse$Outbound; } export function vaultSessionsCreateResponseToJSON( vaultSessionsCreateResponse: VaultSessionsCreateResponse, ): string { return JSON.stringify( VaultSessionsCreateResponse$outboundSchema.parse( vaultSessionsCreateResponse, ), ); } export function vaultSessionsCreateResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VaultSessionsCreateResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VaultSessionsCreateResponse' from JSON`, ); }