/* * 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"; /** * Response body for the Identity API GET method. */ export type V3GetIdentityResponse = { /** * If true, the identity is currently active. */ active?: boolean | undefined; /** * The carrier associated with this identity/mobile number. */ carrier?: string | undefined; /** * A client-generated unique ID for a specific customer. This can be used by clients to link calls related to the same customer, across different requests or sessions. The format of this ID is defined by the client - Prove recommends using a GUID, but any format can be accepted. */ clientCustomerId?: string | undefined; /** * The country code associated with the customer/identity. This will be in the ISO 3166-1 A-2 format. */ countryCode?: string | undefined; /** * The time that this identity was created, in seconds since the Unix epoch. */ createdAt?: number | undefined; /** * The time that this identity was created, in ISO 8601 format. */ creationString?: string | undefined; /** * A string that is the unique identifier for the Prove Key on the device. Only applicable if you are leveraging Prove Unify. */ deviceId?: string | undefined; /** * The type of line associated with this identity/mobile number. */ lineType?: string | undefined; /** * The number of the mobile phone. Refer to the Prove Pre-Fill with Mobile Auth and Prove Identity with Mobile Auth documentation for situations * * @remarks * where this field is not required. US and Canada phone numbers can be passed in with or without a leading `+1`. International phone numbers * require a leading `+` followed by the country code. Acceptable characters are: alphanumeric with symbols '+'. */ phoneNumber: string; /** * A unique Prove-generated identifier for the enrolled identity. This is a UUID that can be used to reference the identity in future requests. */ proveId?: string | undefined; }; /** @internal */ export const V3GetIdentityResponse$inboundSchema: z.ZodType< V3GetIdentityResponse, z.ZodTypeDef, unknown > = z.object({ active: z.boolean().optional(), carrier: z.string().optional(), clientCustomerId: z.string().optional(), countryCode: z.string().optional(), createdAt: z.number().int().optional(), creationString: z.string().optional(), deviceId: z.string().optional(), lineType: z.string().optional(), phoneNumber: z.string(), proveId: z.string().optional(), }); /** @internal */ export type V3GetIdentityResponse$Outbound = { active?: boolean | undefined; carrier?: string | undefined; clientCustomerId?: string | undefined; countryCode?: string | undefined; createdAt?: number | undefined; creationString?: string | undefined; deviceId?: string | undefined; lineType?: string | undefined; phoneNumber: string; proveId?: string | undefined; }; /** @internal */ export const V3GetIdentityResponse$outboundSchema: z.ZodType< V3GetIdentityResponse$Outbound, z.ZodTypeDef, V3GetIdentityResponse > = z.object({ active: z.boolean().optional(), carrier: z.string().optional(), clientCustomerId: z.string().optional(), countryCode: z.string().optional(), createdAt: z.number().int().optional(), creationString: z.string().optional(), deviceId: z.string().optional(), lineType: z.string().optional(), phoneNumber: z.string(), proveId: 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 V3GetIdentityResponse$ { /** @deprecated use `V3GetIdentityResponse$inboundSchema` instead. */ export const inboundSchema = V3GetIdentityResponse$inboundSchema; /** @deprecated use `V3GetIdentityResponse$outboundSchema` instead. */ export const outboundSchema = V3GetIdentityResponse$outboundSchema; /** @deprecated use `V3GetIdentityResponse$Outbound` instead. */ export type Outbound = V3GetIdentityResponse$Outbound; } export function v3GetIdentityResponseToJSON( v3GetIdentityResponse: V3GetIdentityResponse, ): string { return JSON.stringify( V3GetIdentityResponse$outboundSchema.parse(v3GetIdentityResponse), ); } export function v3GetIdentityResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GetIdentityResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GetIdentityResponse' from JSON`, ); }