/* * 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 V3GetIdentitiesByPhoneNumberRequest = { /** * The phone number to find identities for. US phone numbers can be passed in with or without a leading +1. Acceptable characters are: alphanumeric with symbols '+'. */ mobileNumber: string; /** * A client-generated unique ID for a specific session. This can be used to identify specific requests. The format of this ID is defined by the client - Prove recommends using a GUID, but any format can be accepted. Do not include Personally Identifiable Information (PII) in this field. */ clientRequestId?: string | undefined; }; export type V3GetIdentitiesByPhoneNumberResponse = { httpMeta: components.HTTPMetadata; /** * V3GetIdentitiesByPhoneNumberResponse */ v3GetIdentitiesByPhoneNumberResponse?: | components.V3GetIdentitiesByPhoneNumberResponse | undefined; }; /** @internal */ export const V3GetIdentitiesByPhoneNumberRequest$inboundSchema: z.ZodType< V3GetIdentitiesByPhoneNumberRequest, z.ZodTypeDef, unknown > = z.object({ mobileNumber: z.string(), clientRequestId: z.string().optional(), }); /** @internal */ export type V3GetIdentitiesByPhoneNumberRequest$Outbound = { mobileNumber: string; clientRequestId?: string | undefined; }; /** @internal */ export const V3GetIdentitiesByPhoneNumberRequest$outboundSchema: z.ZodType< V3GetIdentitiesByPhoneNumberRequest$Outbound, z.ZodTypeDef, V3GetIdentitiesByPhoneNumberRequest > = z.object({ mobileNumber: z.string(), clientRequestId: 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 V3GetIdentitiesByPhoneNumberRequest$ { /** @deprecated use `V3GetIdentitiesByPhoneNumberRequest$inboundSchema` instead. */ export const inboundSchema = V3GetIdentitiesByPhoneNumberRequest$inboundSchema; /** @deprecated use `V3GetIdentitiesByPhoneNumberRequest$outboundSchema` instead. */ export const outboundSchema = V3GetIdentitiesByPhoneNumberRequest$outboundSchema; /** @deprecated use `V3GetIdentitiesByPhoneNumberRequest$Outbound` instead. */ export type Outbound = V3GetIdentitiesByPhoneNumberRequest$Outbound; } export function v3GetIdentitiesByPhoneNumberRequestToJSON( v3GetIdentitiesByPhoneNumberRequest: V3GetIdentitiesByPhoneNumberRequest, ): string { return JSON.stringify( V3GetIdentitiesByPhoneNumberRequest$outboundSchema.parse( v3GetIdentitiesByPhoneNumberRequest, ), ); } export function v3GetIdentitiesByPhoneNumberRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GetIdentitiesByPhoneNumberRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GetIdentitiesByPhoneNumberRequest' from JSON`, ); } /** @internal */ export const V3GetIdentitiesByPhoneNumberResponse$inboundSchema: z.ZodType< V3GetIdentitiesByPhoneNumberResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, V3GetIdentitiesByPhoneNumberResponse: components .V3GetIdentitiesByPhoneNumberResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "V3GetIdentitiesByPhoneNumberResponse": "v3GetIdentitiesByPhoneNumberResponse", }); }); /** @internal */ export type V3GetIdentitiesByPhoneNumberResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; V3GetIdentitiesByPhoneNumberResponse?: | components.V3GetIdentitiesByPhoneNumberResponse$Outbound | undefined; }; /** @internal */ export const V3GetIdentitiesByPhoneNumberResponse$outboundSchema: z.ZodType< V3GetIdentitiesByPhoneNumberResponse$Outbound, z.ZodTypeDef, V3GetIdentitiesByPhoneNumberResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, v3GetIdentitiesByPhoneNumberResponse: components .V3GetIdentitiesByPhoneNumberResponse$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", v3GetIdentitiesByPhoneNumberResponse: "V3GetIdentitiesByPhoneNumberResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3GetIdentitiesByPhoneNumberResponse$ { /** @deprecated use `V3GetIdentitiesByPhoneNumberResponse$inboundSchema` instead. */ export const inboundSchema = V3GetIdentitiesByPhoneNumberResponse$inboundSchema; /** @deprecated use `V3GetIdentitiesByPhoneNumberResponse$outboundSchema` instead. */ export const outboundSchema = V3GetIdentitiesByPhoneNumberResponse$outboundSchema; /** @deprecated use `V3GetIdentitiesByPhoneNumberResponse$Outbound` instead. */ export type Outbound = V3GetIdentitiesByPhoneNumberResponse$Outbound; } export function v3GetIdentitiesByPhoneNumberResponseToJSON( v3GetIdentitiesByPhoneNumberResponse: V3GetIdentitiesByPhoneNumberResponse, ): string { return JSON.stringify( V3GetIdentitiesByPhoneNumberResponse$outboundSchema.parse( v3GetIdentitiesByPhoneNumberResponse, ), ); } export function v3GetIdentitiesByPhoneNumberResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GetIdentitiesByPhoneNumberResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GetIdentitiesByPhoneNumberResponse' from JSON`, ); }