/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateSessionResponseData = { sessionUri: string; sessionToken: string; }; /** * Session created */ export type CreateSessionResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; data: CreateSessionResponseData; /** * Raw response from the integration when raw=true query param is provided */ raw?: { [k: string]: any } | null | undefined; }; /** @internal */ export const CreateSessionResponseData$inboundSchema: z.ZodType< CreateSessionResponseData, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ session_uri: types.string(), session_token: types.string(), }).transform((v) => { return remap$(v, { "session_uri": "sessionUri", "session_token": "sessionToken", }); }) ); export function createSessionResponseDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateSessionResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSessionResponseData' from JSON`, ); } /** @internal */ export const CreateSessionResponse$inboundSchema: z.ZodType< CreateSessionResponse, z.ZodTypeDef, unknown > = /* @__PURE__ */ lazySchema$(() => z.object({ status_code: types.number(), status: types.string(), data: z.lazy(() => CreateSessionResponseData$inboundSchema), _raw: z.nullable(z.record(z.any())).optional(), }).transform((v) => { return remap$(v, { "status_code": "statusCode", "_raw": "raw", }); }) ); export function createSessionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateSessionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateSessionResponse' from JSON`, ); }