/* * 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 AuthStartRequestResponse = { httpMeta: components.HTTPMetadata; /** * Result of the operation. */ authStartResponse?: components.AuthStartResponse | undefined; }; /** @internal */ export const AuthStartRequestResponse$inboundSchema: z.ZodType< AuthStartRequestResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AuthStartResponse: components.AuthStartResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AuthStartResponse": "authStartResponse", }); }); /** @internal */ export type AuthStartRequestResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AuthStartResponse?: components.AuthStartResponse$Outbound | undefined; }; /** @internal */ export const AuthStartRequestResponse$outboundSchema: z.ZodType< AuthStartRequestResponse$Outbound, z.ZodTypeDef, AuthStartRequestResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, authStartResponse: components.AuthStartResponse$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", authStartResponse: "AuthStartResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthStartRequestResponse$ { /** @deprecated use `AuthStartRequestResponse$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestResponse$inboundSchema; /** @deprecated use `AuthStartRequestResponse$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestResponse$outboundSchema; /** @deprecated use `AuthStartRequestResponse$Outbound` instead. */ export type Outbound = AuthStartRequestResponse$Outbound; } export function authStartRequestResponseToJSON( authStartRequestResponse: AuthStartRequestResponse, ): string { return JSON.stringify( AuthStartRequestResponse$outboundSchema.parse(authStartRequestResponse), ); } export function authStartRequestResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthStartRequestResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthStartRequestResponse' from JSON`, ); }