/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AuthStartRequestDeliveryPushNotification = { /** * Body is the body of the push message. */ body: string; /** * ConfirmButton is the text of the push message confirm button. */ confirmBtn?: string | undefined; /** * DenyButton is the text of the push message deny button. */ denyBtn?: string | undefined; /** * OriginatingDevice is the type of device where where the push flow was initiated. */ originatingDevice?: string | undefined; /** * OriginatingIp is the IP address of the web client where the push flow was initiated. */ originatingIp?: string | undefined; /** * Title is the title of the push message. */ title: string; }; /** @internal */ export const AuthStartRequestDeliveryPushNotification$inboundSchema: z.ZodType< AuthStartRequestDeliveryPushNotification, z.ZodTypeDef, unknown > = z.object({ body: z.string(), confirmBtn: z.string().optional(), denyBtn: z.string().optional(), originatingDevice: z.string().optional(), originatingIp: z.string().optional(), title: z.string(), }); /** @internal */ export type AuthStartRequestDeliveryPushNotification$Outbound = { body: string; confirmBtn?: string | undefined; denyBtn?: string | undefined; originatingDevice?: string | undefined; originatingIp?: string | undefined; title: string; }; /** @internal */ export const AuthStartRequestDeliveryPushNotification$outboundSchema: z.ZodType< AuthStartRequestDeliveryPushNotification$Outbound, z.ZodTypeDef, AuthStartRequestDeliveryPushNotification > = z.object({ body: z.string(), confirmBtn: z.string().optional(), denyBtn: z.string().optional(), originatingDevice: z.string().optional(), originatingIp: z.string().optional(), title: z.string(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AuthStartRequestDeliveryPushNotification$ { /** @deprecated use `AuthStartRequestDeliveryPushNotification$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestDeliveryPushNotification$inboundSchema; /** @deprecated use `AuthStartRequestDeliveryPushNotification$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestDeliveryPushNotification$outboundSchema; /** @deprecated use `AuthStartRequestDeliveryPushNotification$Outbound` instead. */ export type Outbound = AuthStartRequestDeliveryPushNotification$Outbound; } export function authStartRequestDeliveryPushNotificationToJSON( authStartRequestDeliveryPushNotification: AuthStartRequestDeliveryPushNotification, ): string { return JSON.stringify( AuthStartRequestDeliveryPushNotification$outboundSchema.parse( authStartRequestDeliveryPushNotification, ), ); } export function authStartRequestDeliveryPushNotificationFromJSON( jsonString: string, ): SafeParseResult< AuthStartRequestDeliveryPushNotification, SDKValidationError > { return safeParse( jsonString, (x) => AuthStartRequestDeliveryPushNotification$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AuthStartRequestDeliveryPushNotification' from JSON`, ); }