/* * 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 AuthStartRequestInstantAuthConsent = { /** * CollectedTimestamp is the date/time when original consent was collected by the client in ISO 8601 format. * * @remarks * Required if status = optedIn. */ collectedTimestamp?: string | undefined; /** * Description of the type of consent (electronic/paper), use case, and reference to the terms and conditions (T&C) * * @remarks * version (if applicable). Required if status = optedIn. * Acceptable characters are: alphanumeric with symbols '-._+=/'. */ description?: string | undefined; /** * Status denotes whether consent has been provided by the mobile subscriber for this transaction. Acceptable values * * @remarks * are: optedIn, optedOut, notCollected, unknown. */ status: string; /** * TransactionID uniquely identifies the consent collected by the client. Required if status = optedIn. * * @remarks * Acceptable characters are: alphanumeric with symbols '-._+=/'. */ transactionId?: string | undefined; }; /** @internal */ export const AuthStartRequestInstantAuthConsent$inboundSchema: z.ZodType< AuthStartRequestInstantAuthConsent, z.ZodTypeDef, unknown > = z.object({ collectedTimestamp: z.string().optional(), description: z.string().optional(), status: z.string(), transactionId: z.string().optional(), }); /** @internal */ export type AuthStartRequestInstantAuthConsent$Outbound = { collectedTimestamp?: string | undefined; description?: string | undefined; status: string; transactionId?: string | undefined; }; /** @internal */ export const AuthStartRequestInstantAuthConsent$outboundSchema: z.ZodType< AuthStartRequestInstantAuthConsent$Outbound, z.ZodTypeDef, AuthStartRequestInstantAuthConsent > = z.object({ collectedTimestamp: z.string().optional(), description: z.string().optional(), status: z.string(), transactionId: 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 AuthStartRequestInstantAuthConsent$ { /** @deprecated use `AuthStartRequestInstantAuthConsent$inboundSchema` instead. */ export const inboundSchema = AuthStartRequestInstantAuthConsent$inboundSchema; /** @deprecated use `AuthStartRequestInstantAuthConsent$outboundSchema` instead. */ export const outboundSchema = AuthStartRequestInstantAuthConsent$outboundSchema; /** @deprecated use `AuthStartRequestInstantAuthConsent$Outbound` instead. */ export type Outbound = AuthStartRequestInstantAuthConsent$Outbound; } export function authStartRequestInstantAuthConsentToJSON( authStartRequestInstantAuthConsent: AuthStartRequestInstantAuthConsent, ): string { return JSON.stringify( AuthStartRequestInstantAuthConsent$outboundSchema.parse( authStartRequestInstantAuthConsent, ), ); } export function authStartRequestInstantAuthConsentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthStartRequestInstantAuthConsent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthStartRequestInstantAuthConsent' from JSON`, ); }