import {z} from 'zod' export type ProvisioningRequestX = {id?: string | undefined, requestDate?: string | undefined, httpStatus?: number | undefined, deviceId?: string | undefined, ipAddress?: string | undefined, userAgent?: string | undefined}; export type DeviceX = {id: string, deviceTypeId: string, accountId: string, partitionId: string, macAddress?: string | undefined, deviceName: string, emergencyNumber?: string | undefined, emergencyNumberReservationId?: string | undefined, faxEnabled: boolean, lineNumber: number, userId: string, sipPassword?: string | undefined, sipUsername?: string | undefined, zipcode?: string | undefined, state?: string | undefined, lineType?: ('Line' | 'AdvancedSharedLine' | 'ReferencedUser' | 'IntercomLine' | 'PresenceBlfUser' | 'SpeedDialUser' | 'SpeedDialTn' | 'CallParkingSpot' | 'SipPaging' | 'Custom') | undefined, referenceId?: string | undefined, provisioningRequest?: ProvisioningRequestX | undefined}; export type CallingPlanX = {id?: string | undefined, referenceId?: string | undefined, referenceType?: ('SIP_TRUNK' | 'END_USER' | 'IVR' | 'ACCOUNT' | 'SPECIALTY_LINE' | 'CONTACT_CENTER') | undefined, callingPlanProductId?: string | undefined, endDate?: string | undefined, startDate?: string | undefined, planMinutes?: number | undefined, secondsRemaining?: number | undefined}; export type CallerIdConfigX = {callerIdNumber?: string | undefined, externalCallerIdVisible: boolean, extensionCallerIdVisible: boolean, callerIdNumberReservationId?: string | undefined, callerIdName?: string | undefined}; export type CallHandlingX = {type?: ('Forward' | 'Voicemail' | 'Busy') | undefined, forwardToNumber?: string | undefined, description?: string | undefined}; export type CallHandlingWithTimeoutX = {type?: ('Forward' | 'Voicemail' | 'Busy' | 'RingForever') | undefined, timeout?: number | undefined, forwardToNumber?: string | undefined, description?: string | undefined}; export type RingPhoneCallHandlingX = {busyCallHandling?: CallHandlingX | undefined, noAnswerCallHandling?: CallHandlingWithTimeoutX | undefined, unregisteredCallHandling?: CallHandlingX | undefined}; export type SimultaneousRingEndpointX = {toNumber?: string | undefined, ringDelay?: number | undefined, ringDuration?: number | undefined, continueOnBusy?: boolean | undefined}; export type SimultaneousRingCallHandlingX = {forwardToNumberList?: Array | undefined, forwardToTimedNumberList?: Array | undefined, noAnswerCallHandling?: CallHandlingWithTimeoutX | undefined, continueOnBusy?: boolean | undefined}; export type FindMeEndpointX = {ringUserDevice?: boolean | undefined, toNumber?: string | undefined, description?: string | undefined, timeout?: number | undefined, toUserId?: string | undefined, continueOnBusy?: boolean | undefined}; export type FindMeFollowMeCallHandlingX = {findMeEndpoints?: Array | undefined, busyCallHandling?: CallHandlingX | undefined, timeoutType?: ('Forward' | 'Voicemail' | 'Busy' | 'RingForever') | undefined}; export type ForwardAlwaysNumberTypeX = 'Extension' | 'PhoneNumber' | 'ShortCode'; export type CallHandlingSettingsX = {callWaitingEnabled?: boolean | undefined, doNotDisturbEnabled?: boolean | undefined, callHandlingOptionType?: ('RingPhone' | 'ForwardAlways' | 'SimultaneousRing' | 'FindMeFollowMe') | undefined, forwardAlwaysToNumber?: string | undefined, forwardAlwaysToNumberDescription?: string | undefined, ringPhoneCallHandling?: RingPhoneCallHandlingX | undefined, simultaneousRingCallHandling?: SimultaneousRingCallHandlingX | undefined, findMeFollowMeCallHandling?: FindMeFollowMeCallHandlingX | undefined, forwardAlwaysToNumberType?: ForwardAlwaysNumberTypeX | undefined}; export type CustomCallScreenX = {telephoneNumber?: string | undefined, blockType?: ('Allow' | 'Block' | 'Voicemail' | 'Forward' | 'VipRing' | 'BlockWithPrompt') | undefined, ringType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined}; export type CallScreeningSettingsX = {anonymousCallScreen?: ('Allow' | 'Block' | 'Voicemail' | 'Forward' | 'VipRing' | 'BlockWithPrompt') | undefined, anonymousRingType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined, tollFreeCallScreen?: ('Allow' | 'Block' | 'Voicemail' | 'Forward' | 'VipRing' | 'BlockWithPrompt') | undefined, tollFreeRingType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined, defaultCallScreen?: ('Allow' | 'Block' | 'Voicemail' | 'Forward' | 'VipRing' | 'BlockWithPrompt') | undefined, defaultRingType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined, customCallScreenList?: Array | undefined, forwardTn?: string | undefined}; export type MediaFriendsX = {enabled?: boolean | undefined, host?: string | undefined, toNumber?: string | undefined}; export type WeeklyScheduleTimeX = {startTime: string, endTime: string}; export type WeeklyScheduleX = {SUN?: WeeklyScheduleTimeX | undefined, MON?: WeeklyScheduleTimeX | undefined, TUE?: WeeklyScheduleTimeX | undefined, WED?: WeeklyScheduleTimeX | undefined, THU?: WeeklyScheduleTimeX | undefined, FRI?: WeeklyScheduleTimeX | undefined, SAT?: WeeklyScheduleTimeX | undefined}; export type CustomScheduleX = {date: string, startTime: string, endTime: string}; export type ScheduleX = {name?: string | undefined, type?: ('CUSTOM' | 'WEEKLY') | undefined, weekly?: {[key: string]: WeeklyScheduleX} | undefined, custom?: Array | undefined}; export type CallHandlingScheduleX = {schedule?: ScheduleX | undefined, callHandling?: CallHandlingSettingsX | undefined}; export type EndUserPrivacySettingsX = {directoryPrivacyEnabled?: boolean | undefined, autoAttendantDialByExtensionPrivacyEnabled?: boolean | undefined, autoAttendantDialByNamePrivacyEnabled?: boolean | undefined, autoAnswerPrivacyEnabled?: boolean | undefined}; export type UserGroupX = {id?: string | undefined, name?: string | undefined, description?: string | undefined}; export type EndUserV2X = {id?: string | undefined, username?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, emailAddress?: string | undefined, mustChangePassword?: boolean | undefined, languageTag?: string | undefined, partitionId?: string | undefined, accountId?: string | undefined, callingPlans?: Array | undefined, devices?: Array | undefined, timeZone: 'US/Samoa' | 'US/Hawaii' | 'US/Alaska' | 'US/Pacific' | 'US/Arizona' | 'US/Mountain' | 'US/Central' | 'US/Eastern' | 'America/St_Thomas' | 'Canada/Pacific' | 'Canada/Mountain' | 'Canada/Central' | 'Canada/Eastern' | 'Canada/Atlantic' | 'Canada/Newfoundland', extension?: string | undefined, callerIdConfig?: CallerIdConfigX | undefined, callHandlingSettings?: CallHandlingSettingsX | undefined, callScreeningSettings?: CallScreeningSettingsX | undefined, newCppId?: string | undefined, mediaFriends?: MediaFriendsX | undefined, callHandlingSchedules?: Array | undefined, voicemailBoxId?: string | undefined, endUserType?: ('ADMIN' | 'ADVANCED_ADMIN' | 'BASIC_ADMIN' | 'STANDARD' | 'STANDARD_ADMIN' | 'SUPER_ADMIN') | undefined, userProductPlan?: ('STANDARD' | 'ADVANCED' | 'PROFESSIONAL') | undefined, softphoneClientType?: ('STRETTO' | 'CYMBUS') | undefined, pinLockedOut?: boolean | undefined, privacySettings?: EndUserPrivacySettingsX | undefined, welcomeEmailSent?: string | undefined, blockEmail?: boolean | undefined, allowPortalAccess?: boolean | undefined, tags?: string | undefined, group?: UserGroupX | undefined}; export type CustomerServiceRecordX = {id?: string | undefined, firstName?: string | undefined, middleInitial?: string | undefined, lastName?: string | undefined, businessName?: string | undefined, streetNumber?: string | undefined, streetNumberSuffix?: string | undefined, preDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, streetName?: string | undefined, streetSuffix?: string | undefined, postDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, city?: string | undefined, state?: string | undefined, country?: string | undefined, postalCode?: string | undefined, secondaryLocationDescription?: ('' | 'APARTMENT' | 'BUILDING' | 'BASEMENT' | 'DEPARTMENT' | 'FLOOR' | 'FRONT' | 'HANGER' | 'KEY' | 'LOBBY' | 'LOT' | 'LOWER' | 'OFFICE' | 'PENTHOUSE' | 'PIER' | 'REAR' | 'ROOM' | 'SIDE' | 'SLIP' | 'SPACE' | 'SUITE' | 'STOP' | 'TRAILER' | 'UNIT' | 'UPPER') | undefined, unit?: string | undefined, customerType?: ('BUSINESS' | 'RESIDENTIAL') | undefined, firstNameSecondary?: string | undefined, blockCustomerName?: boolean | undefined, customerName?: string | undefined}; export type E911AddressX = {id?: string | undefined, firstName?: string | undefined, middleInitial?: string | undefined, lastName?: string | undefined, businessName?: string | undefined, streetNumber?: string | undefined, streetNumberSuffix?: string | undefined, preDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, streetName?: string | undefined, streetSuffix?: string | undefined, postDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, city?: string | undefined, state?: string | undefined, country?: string | undefined, postalCode?: string | undefined, secondaryLocationDescription?: ('' | 'APARTMENT' | 'BUILDING' | 'BASEMENT' | 'DEPARTMENT' | 'FLOOR' | 'FRONT' | 'HANGER' | 'KEY' | 'LOBBY' | 'LOT' | 'LOWER' | 'OFFICE' | 'PENTHOUSE' | 'PIER' | 'REAR' | 'ROOM' | 'SIDE' | 'SLIP' | 'SPACE' | 'SUITE' | 'STOP' | 'TRAILER' | 'UNIT' | 'UPPER') | undefined, unit?: string | undefined, customerType?: ('BUSINESS' | 'RESIDENTIAL') | undefined, latitude?: string | undefined, longitude?: string | undefined, language?: string | undefined}; export type AddressX = {id?: string | undefined, firstName?: string | undefined, middleInitial?: string | undefined, lastName?: string | undefined, businessName?: string | undefined, streetNumber?: string | undefined, streetNumberSuffix?: string | undefined, preDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, streetName?: string | undefined, streetSuffix?: string | undefined, postDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, city?: string | undefined, state?: string | undefined, country?: string | undefined, postalCode?: string | undefined, secondaryLocationDescription?: ('' | 'APARTMENT' | 'BUILDING' | 'BASEMENT' | 'DEPARTMENT' | 'FLOOR' | 'FRONT' | 'HANGER' | 'KEY' | 'LOBBY' | 'LOT' | 'LOWER' | 'OFFICE' | 'PENTHOUSE' | 'PIER' | 'REAR' | 'ROOM' | 'SIDE' | 'SLIP' | 'SPACE' | 'SUITE' | 'STOP' | 'TRAILER' | 'UNIT' | 'UPPER') | undefined, unit?: string | undefined}; export type DirectoryListingX = {listed?: boolean | undefined, type?: ('ERROR' | 'LIST_PUBLISH' | 'LIST_NOT_PUBLISH' | 'NOT_LIST_NOT_PUBLISH' | 'PORTED' | 'COMPLEX') | undefined, address?: AddressX | undefined}; export type TelephoneNumberAccountV2X = {phoneNumber?: string | undefined, referenceType?: ('SIP_TRUNK' | 'END_USER' | 'IVR' | 'LINE_APPEARANCE' | 'LINE_HUNTGROUP' | 'TELEPHONE' | 'VFAX' | 'BUSINESS_LINE' | 'BUSINESS_LINE_HUNT_GROUP' | 'CALL_GROUP' | 'CALL_QUEUE' | 'AUTO_ATTENDANT' | 'SPECIALTY_LINE' | 'CONTACT_CENTER') | undefined, referenceId?: string | undefined, functionType?: ('ELS' | 'TollFree' | 'TemporaryNumber' | 'SPTN') | undefined, canAcceptSMS?: boolean | undefined, operationalStatus?: ('ACTIVE' | 'STAGED') | undefined, portId?: string | undefined, servicePackageType?: ('Usage' | 'PrimaryLocalFlatRate' | 'PrimaryLocalAndDomesticLDFlatRate' | 'SecondaryLocalFlatRate' | 'SecondaryLocalAndDomesticLDFlatRate') | undefined, accountId?: string | undefined, partitionId?: string | undefined, customerServiceRecord?: CustomerServiceRecordX | undefined, carrierStatus?: ('ACTIVE' | 'ACTIVATION_ON_HOLD' | 'ACTIVATION_PENDING' | 'PORT_PENDING' | 'CANCEL_PORT' | 'CANCEL_PORT_EXPIDITED' | 'DELETE_PENDING' | 'DELETED' | 'CANCEL_PORT_COMPLETE' | 'PORT_REJECTED' | 'INVENTORY' | 'INVENTORY_CLAIMED' | 'COOLDOWN' | 'RECOVERED') | undefined, orderVersion?: string | undefined, e911Address?: E911AddressX | undefined, temporaryNumber?: string | undefined, directoryListing?: DirectoryListingX | undefined, assignAsCallerId?: boolean | undefined, byotnCarrierId?: string | undefined, ringType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined, carrierId?: string | undefined, tollFree?: boolean | undefined, id?: string | undefined, tags?: Array | undefined}; export type LatLongCustomerServiceRecordX = {id?: string | undefined, firstName?: string | undefined, middleInitial?: string | undefined, lastName?: string | undefined, businessName?: string | undefined, streetNumber?: string | undefined, streetNumberSuffix?: string | undefined, preDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, streetName?: string | undefined, streetSuffix?: string | undefined, postDirectional?: ('' | 'N' | 'NE' | 'E' | 'SE' | 'S' | 'SW' | 'W' | 'NW') | undefined, city?: string | undefined, state?: string | undefined, country?: string | undefined, postalCode?: string | undefined, secondaryLocationDescription?: ('' | 'APARTMENT' | 'BUILDING' | 'BASEMENT' | 'DEPARTMENT' | 'FLOOR' | 'FRONT' | 'HANGER' | 'KEY' | 'LOBBY' | 'LOT' | 'LOWER' | 'OFFICE' | 'PENTHOUSE' | 'PIER' | 'REAR' | 'ROOM' | 'SIDE' | 'SLIP' | 'SPACE' | 'SUITE' | 'STOP' | 'TRAILER' | 'UNIT' | 'UPPER') | undefined, unit?: string | undefined, customerType?: ('BUSINESS' | 'RESIDENTIAL') | undefined, firstNameSecondary?: string | undefined, blockCustomerName?: boolean | undefined, customerName?: string | undefined, latitude?: number | undefined, longitude?: number | undefined}; export type TelephoneNumberAccountBareX = {phoneNumber?: string | undefined, referenceType?: ('SIP_TRUNK' | 'END_USER' | 'IVR' | 'LINE_APPEARANCE' | 'LINE_HUNTGROUP' | 'TELEPHONE' | 'VFAX' | 'BUSINESS_LINE' | 'BUSINESS_LINE_HUNT_GROUP' | 'CALL_GROUP' | 'CALL_QUEUE' | 'AUTO_ATTENDANT' | 'SPECIALTY_LINE' | 'CONTACT_CENTER') | undefined, referenceId?: string | undefined, functionType?: ('ELS' | 'TollFree' | 'TemporaryNumber' | 'SPTN') | undefined, canAcceptSMS?: boolean | undefined, operationalStatus?: ('ACTIVE' | 'STAGED') | undefined, portId?: string | undefined, servicePackageType?: ('Usage' | 'PrimaryLocalFlatRate' | 'PrimaryLocalAndDomesticLDFlatRate' | 'SecondaryLocalFlatRate' | 'SecondaryLocalAndDomesticLDFlatRate') | undefined, tollFree?: boolean | undefined, id?: string | undefined, tags?: Array | undefined}; export type FileDataBase64X = {contentType?: string | undefined, name?: string | undefined, contentBase64?: string | undefined}; export type SmsActionX = 'CHANGE_CAMPAIGN' | 'DISABLE' | 'ENABLE' | 'PORT_COMPLETED'; export type SmsSettingsX = {smsLoaDocumentVersionId?: string | undefined, updatedAt?: string | undefined, campaignId?: string | undefined, smsLoa?: FileDataBase64X | undefined, enableSMS?: boolean | undefined, createdAt?: string | undefined, authorizingPerson?: string | undefined, smsAction?: SmsActionX | undefined, smsCarrierId?: string | undefined, campaignName?: string | undefined, remoteCampaignId?: string | undefined}; export type DynamicTelephoneNumberActivationX = {partitionId?: string | undefined, accountId?: string | undefined, carrierId?: string | undefined, orderId?: string | undefined, tnQuantity?: number | undefined, deviceId?: string | undefined, userId?: string | undefined, customerServiceRecord?: LatLongCustomerServiceRecordX | undefined, directoryListing?: DirectoryListingX | undefined, e911Address?: E911AddressX | undefined, tnSettings?: TelephoneNumberAccountBareX | undefined, ringType?: ('StandardRing' | 'Ring1' | 'Ring2' | 'Ring3' | 'Ring4' | 'Ring5' | 'Ring6' | 'Ring7') | undefined, archived?: boolean | undefined, alianzaOrderId?: string | undefined, smsSettings?: SmsSettingsX | undefined, id?: string | undefined}; export type TnData = {tn?: string | undefined, rateCenter?: string | undefined, wireless?: boolean | undefined}; export type TelecomSettingsX = {notes?: string | undefined, currentCarrier?: string | undefined, currentCarrierName?: string | undefined, localReseller?: string | undefined, loaDate?: string | undefined, disconnectInternetService?: boolean | undefined, disconnectTelevisionService?: boolean | undefined, tnData?: {[key: string]: TnData} | undefined}; export type PortX = {id?: string | undefined, partitionId?: string | undefined, accountId?: string | undefined, telephoneNumbers?: Array | undefined, status?: ('ACTIVE' | 'ACTIVATION_ON_HOLD' | 'ACTIVATION_PENDING' | 'PORT_PENDING' | 'CANCEL_PORT' | 'CANCEL_PORT_EXPIDITED' | 'DELETE_PENDING' | 'DELETED' | 'CANCEL_PORT_COMPLETE' | 'PORT_REJECTED' | 'INVENTORY' | 'INVENTORY_CLAIMED' | 'COOLDOWN' | 'RECOVERED') | undefined, sendLoa?: boolean | undefined, loaSaved?: boolean | undefined, carrierId?: string | undefined, carrierType?: ('LEVEL_3' | 'NO_API' | 'E911' | 'TELUS' | 'TELUS_API' | 'TELUS_ONEVOICE' | 'PROVTEL' | 'VERIZON_CARIANZA' | 'ONVOY_CARIANZA' | 'LEVEL3_CARIANZA' | 'BANDWIDTH' | 'LUMEN_IMS' | 'LUMEN_VOICE_LI_ELS' | 'SINCH' | 'SERVICE_PROVIDER_CARRIER') | undefined, customerServiceRecord?: CustomerServiceRecordX | undefined, crdDate?: string | undefined, billingTelephoneNumber?: string | undefined, portingWireType?: ('Wireless' | 'Wireline') | undefined, portingAuthorizedName?: string | undefined, wirelessAccountNumber?: string | undefined, wirelessPin?: string | undefined, focDate?: string | undefined, focDateTimeZone?: ('US/Samoa' | 'US/Hawaii' | 'US/Alaska' | 'US/Pacific' | 'US/Arizona' | 'US/Mountain' | 'US/Central' | 'US/Eastern' | 'America/St_Thomas' | 'Canada/Pacific' | 'Canada/Mountain' | 'Canada/Central' | 'Canada/Eastern' | 'Canada/Atlantic' | 'Canada/Newfoundland') | undefined, createdDate?: string | undefined, completedDate?: string | undefined, cancelType?: ('NORMAL' | 'EXPIDITED' | 'BY_CARRIER') | undefined, telecomSettings?: TelecomSettingsX | undefined, hotCutPortId?: string | undefined, portNow?: boolean | undefined, canAcceptSMS?: boolean | undefined, smsCallbackUrl?: string | undefined, smsSettings?: SmsSettingsX | undefined, tags?: Array | undefined}; export type Account = {id: string, partitionId: string, accountNumber: string, accountName: string, billingCycleDay: number, customField?: string | undefined, status: 'ACTIVE' | 'DISABLED' | 'DELETED' | 'DELETE_PENDING' | 'SUSPENDED' | 'PENDING', timeZone: 'US/Samoa' | 'US/Hawaii' | 'US/Alaska' | 'US/Pacific' | 'US/Arizona' | 'US/Mountain' | 'US/Central' | 'US/Eastern' | 'America/St_Thomas' | 'Canada/Pacific' | 'Canada/Mountain' | 'Canada/Central' | 'Canada/Eastern' | 'Canada/Atlantic' | 'Canada/Newfoundland', languageTag?: string | undefined, deletionDate?: string | undefined, accountType: 'SIMPLE' | 'ADVANCED', platformType?: ('V2_0' | 'V2_1' | 'CPE1' | 'CPE2') | undefined, platformChangeDate?: string | undefined, inboundRatePlanProductId?: string | undefined, extensionLength: number, dialingBehaviorType: 'SEVEN_DIGIT' | 'TEN_DIGIT' | 'OPEN_DIAL_PLAN' | 'DIAL_NINE_SEVEN_DIGIT' | 'DIAL_NINE_TEN_DIGIT' | 'OPEN_DIAL_PLAN_TEN_DIGIT', routePlanId?: string | undefined, callScreeningSettings?: CallScreeningSettingsX | undefined, holdMusicMediaId?: string | undefined, holdTimeoutSeconds?: number | undefined, allowDangerousExtensions?: boolean | undefined, domain?: string | undefined, sendWelcomeEmail?: boolean | undefined, regulatoryType: 'RESIDENTIAL' | 'COMMERCIAL' | 'GOVERNMENT', endUserCount?: number | undefined, customHoldMusicMediaId?: string | undefined, callingPlans?: Array | undefined}; export type AccountActivationV2X = {device?: DeviceX | undefined, user?: EndUserV2X | undefined, telephoneNumberAccount?: TelephoneNumberAccountV2X | undefined, dynamicTelephoneNumberActivation?: DynamicTelephoneNumberActivationX | undefined, port?: PortX | undefined, holdActivation?: boolean | undefined, account?: Account | undefined}; export type CreateApiV2PartitionPartitionIdAccountActivationArgs = {partitionId: string, body: AccountActivationV2X}; export type CreateApiV2PartitionPartitionIdAccountActivationOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; export const provisioningRequestX = z.object({id: z.string().optional(), requestDate: z.string().optional(), httpStatus: z.number().int().optional(), deviceId: z.string().optional(), ipAddress: z.string().optional(), userAgent: z.string().optional()}); export const deviceX = z.object({id: z.string(), deviceTypeId: z.string(), accountId: z.string(), partitionId: z.string(), macAddress: z.string().optional(), deviceName: z.string(), emergencyNumber: z.string().optional(), emergencyNumberReservationId: z.string().optional(), faxEnabled: z.boolean(), lineNumber: z.number().int(), userId: z.string(), sipPassword: z.string().optional(), sipUsername: z.string().optional(), zipcode: z.string().optional(), state: z.string().optional(), lineType: z.enum(["Line", "AdvancedSharedLine", "ReferencedUser", "IntercomLine", "PresenceBlfUser", "SpeedDialUser", "SpeedDialTn", "CallParkingSpot", "SipPaging", "Custom"]).optional(), referenceId: z.string().optional(), provisioningRequest: provisioningRequestX.optional()}); export const callingPlanX = z.object({id: z.string().optional(), referenceId: z.string().optional(), referenceType: z.enum(["SIP_TRUNK", "END_USER", "IVR", "ACCOUNT", "SPECIALTY_LINE", "CONTACT_CENTER"]).optional(), callingPlanProductId: z.string().optional(), endDate: z.string().optional(), startDate: z.string().optional(), planMinutes: z.number().int().optional(), secondsRemaining: z.number().int().optional()}); export const callerIdConfigX = z.object({callerIdNumber: z.string().optional(), externalCallerIdVisible: z.boolean(), extensionCallerIdVisible: z.boolean(), callerIdNumberReservationId: z.string().optional(), callerIdName: z.string().optional()}); export const callHandlingX = z.object({type: z.enum(["Forward", "Voicemail", "Busy"]).optional(), forwardToNumber: z.string().optional(), description: z.string().optional()}); export const callHandlingWithTimeoutX = z.object({type: z.enum(["Forward", "Voicemail", "Busy", "RingForever"]).optional(), timeout: z.number().int().gte(1).optional(), forwardToNumber: z.string().optional(), description: z.string().optional()}); export const ringPhoneCallHandlingX = z.object({busyCallHandling: callHandlingX.optional(), noAnswerCallHandling: callHandlingWithTimeoutX.optional(), unregisteredCallHandling: callHandlingX.optional()}); export const simultaneousRingEndpointX = z.object({toNumber: z.string().optional(), ringDelay: z.number().int().gte(0).optional(), ringDuration: z.number().int().gte(1).optional(), continueOnBusy: z.boolean().optional()}); export const simultaneousRingCallHandlingX = z.object({forwardToNumberList: z.array(z.string()).optional(), forwardToTimedNumberList: z.array(simultaneousRingEndpointX).optional(), noAnswerCallHandling: callHandlingWithTimeoutX.optional(), continueOnBusy: z.boolean().optional()}); export const findMeEndpointX = z.object({ringUserDevice: z.boolean().optional(), toNumber: z.string().optional(), description: z.string().optional(), timeout: z.number().int().gte(1).lte(240).optional(), toUserId: z.string().optional(), continueOnBusy: z.boolean().optional()}); export const findMeFollowMeCallHandlingX = z.object({findMeEndpoints: z.array(findMeEndpointX).optional(), busyCallHandling: callHandlingX.optional(), timeoutType: z.enum(["Forward", "Voicemail", "Busy", "RingForever"]).optional()}); export const forwardAlwaysNumberTypeX = z.enum(["Extension", "PhoneNumber", "ShortCode"]); export const callHandlingSettingsX = z.object({callWaitingEnabled: z.boolean().optional(), doNotDisturbEnabled: z.boolean().optional(), callHandlingOptionType: z.enum(["RingPhone", "ForwardAlways", "SimultaneousRing", "FindMeFollowMe"]).optional(), forwardAlwaysToNumber: z.string().optional(), forwardAlwaysToNumberDescription: z.string().optional(), ringPhoneCallHandling: ringPhoneCallHandlingX.optional(), simultaneousRingCallHandling: simultaneousRingCallHandlingX.optional(), findMeFollowMeCallHandling: findMeFollowMeCallHandlingX.optional(), forwardAlwaysToNumberType: forwardAlwaysNumberTypeX.optional()}); export const customCallScreenX = z.object({telephoneNumber: z.string().optional(), blockType: z.enum(["Allow", "Block", "Voicemail", "Forward", "VipRing", "BlockWithPrompt"]).optional(), ringType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional()}); export const callScreeningSettingsX = z.object({anonymousCallScreen: z.enum(["Allow", "Block", "Voicemail", "Forward", "VipRing", "BlockWithPrompt"]).optional(), anonymousRingType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional(), tollFreeCallScreen: z.enum(["Allow", "Block", "Voicemail", "Forward", "VipRing", "BlockWithPrompt"]).optional(), tollFreeRingType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional(), defaultCallScreen: z.enum(["Allow", "Block", "Voicemail", "Forward", "VipRing", "BlockWithPrompt"]).optional(), defaultRingType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional(), customCallScreenList: z.array(customCallScreenX).optional(), forwardTn: z.string().optional()}); export const mediaFriendsX = z.object({enabled: z.boolean().optional(), host: z.string().optional(), toNumber: z.string().optional()}); export const weeklyScheduleTimeX = z.object({startTime: z.string(), endTime: z.string()}); export const weeklyScheduleX = z.object({SUN: weeklyScheduleTimeX.optional(), MON: weeklyScheduleTimeX.optional(), TUE: weeklyScheduleTimeX.optional(), WED: weeklyScheduleTimeX.optional(), THU: weeklyScheduleTimeX.optional(), FRI: weeklyScheduleTimeX.optional(), SAT: weeklyScheduleTimeX.optional()}); export const customScheduleX = z.object({date: z.string(), startTime: z.string(), endTime: z.string()}); export const scheduleX = z.object({name: z.string().optional(), type: z.enum(["CUSTOM", "WEEKLY"]).optional(), weekly: z.record(z.string(), weeklyScheduleX).optional(), custom: z.array(customScheduleX).optional()}); export const callHandlingScheduleX = z.object({schedule: scheduleX.optional(), callHandling: callHandlingSettingsX.optional()}); export const endUserPrivacySettingsX = z.object({directoryPrivacyEnabled: z.boolean().optional(), autoAttendantDialByExtensionPrivacyEnabled: z.boolean().optional(), autoAttendantDialByNamePrivacyEnabled: z.boolean().optional(), autoAnswerPrivacyEnabled: z.boolean().optional()}); export const userGroupX = z.object({id: z.string().optional(), name: z.string().optional(), description: z.string().optional()}); export const endUserV2X = z.object({id: z.string().optional(), username: z.string().min(3).max(256).optional(), firstName: z.string().min(3).max(256).optional(), lastName: z.string().min(3).max(256).optional(), emailAddress: z.string().min(3).max(256).optional(), mustChangePassword: z.boolean().optional(), languageTag: z.string().optional(), partitionId: z.string().optional(), accountId: z.string().optional(), callingPlans: z.array(callingPlanX).optional(), devices: z.array(deviceX).optional(), timeZone: z.enum(["US/Samoa", "US/Hawaii", "US/Alaska", "US/Pacific", "US/Arizona", "US/Mountain", "US/Central", "US/Eastern", "America/St_Thomas", "Canada/Pacific", "Canada/Mountain", "Canada/Central", "Canada/Eastern", "Canada/Atlantic", "Canada/Newfoundland"]), extension: z.string().optional(), callerIdConfig: callerIdConfigX.optional(), callHandlingSettings: callHandlingSettingsX.optional(), callScreeningSettings: callScreeningSettingsX.optional(), newCppId: z.string().optional(), mediaFriends: mediaFriendsX.optional(), callHandlingSchedules: z.array(callHandlingScheduleX).optional(), voicemailBoxId: z.string().optional(), endUserType: z.enum(["ADMIN", "ADVANCED_ADMIN", "BASIC_ADMIN", "STANDARD", "STANDARD_ADMIN", "SUPER_ADMIN"]).optional(), userProductPlan: z.enum(["STANDARD", "ADVANCED", "PROFESSIONAL"]).optional(), softphoneClientType: z.enum(["STRETTO", "CYMBUS"]).optional(), pinLockedOut: z.boolean().optional(), privacySettings: endUserPrivacySettingsX.optional(), welcomeEmailSent: z.string().optional(), blockEmail: z.boolean().optional(), allowPortalAccess: z.boolean().optional(), tags: z.string().optional(), group: userGroupX.optional()}); export const customerServiceRecordX = z.object({id: z.string().optional(), firstName: z.string().min(1).max(256).optional(), middleInitial: z.string().max(256).optional(), lastName: z.string().max(256).optional(), businessName: z.string().max(256).optional(), streetNumber: z.string().optional(), streetNumberSuffix: z.string().optional(), preDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), streetName: z.string().max(256).optional(), streetSuffix: z.string().optional(), postDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), city: z.string().max(256).optional(), state: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), secondaryLocationDescription: z.enum(["", "APARTMENT", "BUILDING", "BASEMENT", "DEPARTMENT", "FLOOR", "FRONT", "HANGER", "KEY", "LOBBY", "LOT", "LOWER", "OFFICE", "PENTHOUSE", "PIER", "REAR", "ROOM", "SIDE", "SLIP", "SPACE", "SUITE", "STOP", "TRAILER", "UNIT", "UPPER"]).optional(), unit: z.string().max(10).optional(), customerType: z.enum(["BUSINESS", "RESIDENTIAL"]).optional(), firstNameSecondary: z.string().optional(), blockCustomerName: z.boolean().optional(), customerName: z.string().optional()}); export const e911AddressX = z.object({id: z.string().optional(), firstName: z.string().optional(), middleInitial: z.string().optional(), lastName: z.string().optional(), businessName: z.string().optional(), streetNumber: z.string().optional(), streetNumberSuffix: z.string().optional(), preDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), streetName: z.string().optional(), streetSuffix: z.string().optional(), postDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), city: z.string().optional(), state: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), secondaryLocationDescription: z.enum(["", "APARTMENT", "BUILDING", "BASEMENT", "DEPARTMENT", "FLOOR", "FRONT", "HANGER", "KEY", "LOBBY", "LOT", "LOWER", "OFFICE", "PENTHOUSE", "PIER", "REAR", "ROOM", "SIDE", "SLIP", "SPACE", "SUITE", "STOP", "TRAILER", "UNIT", "UPPER"]).optional(), unit: z.string().optional(), customerType: z.enum(["BUSINESS", "RESIDENTIAL"]).optional(), latitude: z.string().optional(), longitude: z.string().optional(), language: z.string().optional()}); export const addressX = z.object({id: z.string().optional(), firstName: z.string().min(1).max(256).optional(), middleInitial: z.string().max(256).optional(), lastName: z.string().max(256).optional(), businessName: z.string().max(256).optional(), streetNumber: z.string().optional(), streetNumberSuffix: z.string().optional(), preDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), streetName: z.string().max(256).optional(), streetSuffix: z.string().optional(), postDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), city: z.string().max(256).optional(), state: z.string().optional(), country: z.string().optional(), postalCode: z.string().optional(), secondaryLocationDescription: z.enum(["", "APARTMENT", "BUILDING", "BASEMENT", "DEPARTMENT", "FLOOR", "FRONT", "HANGER", "KEY", "LOBBY", "LOT", "LOWER", "OFFICE", "PENTHOUSE", "PIER", "REAR", "ROOM", "SIDE", "SLIP", "SPACE", "SUITE", "STOP", "TRAILER", "UNIT", "UPPER"]).optional(), unit: z.string().max(10).optional()}); export const directoryListingX = z.object({listed: z.boolean().optional(), type: z.enum(["ERROR", "LIST_PUBLISH", "LIST_NOT_PUBLISH", "NOT_LIST_NOT_PUBLISH", "PORTED", "COMPLEX"]).optional(), address: addressX.optional()}); export const telephoneNumberAccountV2X = z.object({phoneNumber: z.string().optional(), referenceType: z.enum(["SIP_TRUNK", "END_USER", "IVR", "LINE_APPEARANCE", "LINE_HUNTGROUP", "TELEPHONE", "VFAX", "BUSINESS_LINE", "BUSINESS_LINE_HUNT_GROUP", "CALL_GROUP", "CALL_QUEUE", "AUTO_ATTENDANT", "SPECIALTY_LINE", "CONTACT_CENTER"]).optional(), referenceId: z.string().optional(), functionType: z.enum(["ELS", "TollFree", "TemporaryNumber", "SPTN"]).optional(), canAcceptSMS: z.boolean().optional(), operationalStatus: z.enum(["ACTIVE", "STAGED"]).optional(), portId: z.string().optional(), servicePackageType: z.enum(["Usage", "PrimaryLocalFlatRate", "PrimaryLocalAndDomesticLDFlatRate", "SecondaryLocalFlatRate", "SecondaryLocalAndDomesticLDFlatRate"]).optional(), accountId: z.string().optional(), partitionId: z.string().optional(), customerServiceRecord: customerServiceRecordX.optional(), carrierStatus: z.enum(["ACTIVE", "ACTIVATION_ON_HOLD", "ACTIVATION_PENDING", "PORT_PENDING", "CANCEL_PORT", "CANCEL_PORT_EXPIDITED", "DELETE_PENDING", "DELETED", "CANCEL_PORT_COMPLETE", "PORT_REJECTED", "INVENTORY", "INVENTORY_CLAIMED", "COOLDOWN", "RECOVERED"]).optional(), orderVersion: z.string().optional(), e911Address: e911AddressX.optional(), temporaryNumber: z.string().optional(), directoryListing: directoryListingX.optional(), assignAsCallerId: z.boolean().optional(), byotnCarrierId: z.string().optional(), ringType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional(), carrierId: z.string().optional(), tollFree: z.boolean().optional(), id: z.string().optional(), tags: z.array(z.string()).optional()}); export const latLongCustomerServiceRecordX = z.object({id: z.string().optional(), firstName: z.string().min(3).max(256).optional(), middleInitial: z.string().min(3).max(256).optional(), lastName: z.string().min(3).max(256).optional(), businessName: z.string().min(3).max(256).optional(), streetNumber: z.string().min(3).max(256).optional(), streetNumberSuffix: z.string().min(3).max(256).optional(), preDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), streetName: z.string().min(3).max(256).optional(), streetSuffix: z.string().min(3).max(256).optional(), postDirectional: z.enum(["", "N", "NE", "E", "SE", "S", "SW", "W", "NW"]).optional(), city: z.string().min(3).max(256).optional(), state: z.string().min(3).max(256).optional(), country: z.string().min(3).max(256).optional(), postalCode: z.string().min(3).max(256).optional(), secondaryLocationDescription: z.enum(["", "APARTMENT", "BUILDING", "BASEMENT", "DEPARTMENT", "FLOOR", "FRONT", "HANGER", "KEY", "LOBBY", "LOT", "LOWER", "OFFICE", "PENTHOUSE", "PIER", "REAR", "ROOM", "SIDE", "SLIP", "SPACE", "SUITE", "STOP", "TRAILER", "UNIT", "UPPER"]).optional(), unit: z.string().max(10).optional(), customerType: z.enum(["BUSINESS", "RESIDENTIAL"]).optional(), firstNameSecondary: z.string().min(3).max(256).optional(), blockCustomerName: z.boolean().optional(), customerName: z.string().min(3).max(256).optional(), latitude: z.number().optional(), longitude: z.number().optional()}); export const telephoneNumberAccountBareX = z.object({phoneNumber: z.string().optional(), referenceType: z.enum(["SIP_TRUNK", "END_USER", "IVR", "LINE_APPEARANCE", "LINE_HUNTGROUP", "TELEPHONE", "VFAX", "BUSINESS_LINE", "BUSINESS_LINE_HUNT_GROUP", "CALL_GROUP", "CALL_QUEUE", "AUTO_ATTENDANT", "SPECIALTY_LINE", "CONTACT_CENTER"]).optional(), referenceId: z.string().optional(), functionType: z.enum(["ELS", "TollFree", "TemporaryNumber", "SPTN"]).optional(), canAcceptSMS: z.boolean().optional(), operationalStatus: z.enum(["ACTIVE", "STAGED"]).optional(), portId: z.string().optional(), servicePackageType: z.enum(["Usage", "PrimaryLocalFlatRate", "PrimaryLocalAndDomesticLDFlatRate", "SecondaryLocalFlatRate", "SecondaryLocalAndDomesticLDFlatRate"]).optional(), tollFree: z.boolean().optional(), id: z.string().optional(), tags: z.array(z.string()).optional()}); export const fileDataBase64X = z.object({contentType: z.string().optional(), name: z.string().optional(), contentBase64: z.string().optional()}); export const smsActionX = z.enum(["CHANGE_CAMPAIGN", "DISABLE", "ENABLE", "PORT_COMPLETED"]); export const smsSettingsX = z.object({smsLoaDocumentVersionId: z.string().optional(), updatedAt: z.string().optional(), campaignId: z.string().optional(), smsLoa: fileDataBase64X.optional(), enableSMS: z.boolean().optional(), createdAt: z.string().optional(), authorizingPerson: z.string().optional(), smsAction: smsActionX.optional(), smsCarrierId: z.string().optional(), campaignName: z.string().optional(), remoteCampaignId: z.string().optional()}); export const dynamicTelephoneNumberActivationX = z.object({partitionId: z.string().optional(), accountId: z.string().optional(), carrierId: z.string().optional(), orderId: z.string().optional(), tnQuantity: z.number().int().optional(), deviceId: z.string().optional(), userId: z.string().optional(), customerServiceRecord: latLongCustomerServiceRecordX.optional(), directoryListing: directoryListingX.optional(), e911Address: e911AddressX.optional(), tnSettings: telephoneNumberAccountBareX.optional(), ringType: z.enum(["StandardRing", "Ring1", "Ring2", "Ring3", "Ring4", "Ring5", "Ring6", "Ring7"]).optional(), archived: z.boolean().optional(), alianzaOrderId: z.string().optional(), smsSettings: smsSettingsX.optional(), id: z.string().optional()}); export const tnData = z.object({tn: z.string().optional(), rateCenter: z.string().optional(), wireless: z.boolean().optional()}); export const telecomSettingsX = z.object({notes: z.string().optional(), currentCarrier: z.string().optional(), currentCarrierName: z.string().optional(), localReseller: z.string().optional(), loaDate: z.string().optional(), disconnectInternetService: z.boolean().optional(), disconnectTelevisionService: z.boolean().optional(), tnData: z.record(z.string(), tnData).optional()}); export const portX = z.object({id: z.string().optional(), partitionId: z.string().optional(), accountId: z.string().optional(), telephoneNumbers: z.array(z.string()).optional(), status: z.enum(["ACTIVE", "ACTIVATION_ON_HOLD", "ACTIVATION_PENDING", "PORT_PENDING", "CANCEL_PORT", "CANCEL_PORT_EXPIDITED", "DELETE_PENDING", "DELETED", "CANCEL_PORT_COMPLETE", "PORT_REJECTED", "INVENTORY", "INVENTORY_CLAIMED", "COOLDOWN", "RECOVERED"]).optional(), sendLoa: z.boolean().optional(), loaSaved: z.boolean().optional(), carrierId: z.string().optional(), carrierType: z.enum(["LEVEL_3", "NO_API", "E911", "TELUS", "TELUS_API", "TELUS_ONEVOICE", "PROVTEL", "VERIZON_CARIANZA", "ONVOY_CARIANZA", "LEVEL3_CARIANZA", "BANDWIDTH", "LUMEN_IMS", "LUMEN_VOICE_LI_ELS", "SINCH", "SERVICE_PROVIDER_CARRIER"]).optional(), customerServiceRecord: customerServiceRecordX.optional(), crdDate: z.string().optional(), billingTelephoneNumber: z.string().optional(), portingWireType: z.enum(["Wireless", "Wireline"]).optional(), portingAuthorizedName: z.string().optional(), wirelessAccountNumber: z.string().optional(), wirelessPin: z.string().max(15).optional(), focDate: z.string().optional(), focDateTimeZone: z.enum(["US/Samoa", "US/Hawaii", "US/Alaska", "US/Pacific", "US/Arizona", "US/Mountain", "US/Central", "US/Eastern", "America/St_Thomas", "Canada/Pacific", "Canada/Mountain", "Canada/Central", "Canada/Eastern", "Canada/Atlantic", "Canada/Newfoundland"]).optional(), createdDate: z.string().optional(), completedDate: z.string().optional(), cancelType: z.enum(["NORMAL", "EXPIDITED", "BY_CARRIER"]).optional(), telecomSettings: telecomSettingsX.optional(), hotCutPortId: z.string().optional(), portNow: z.boolean().optional(), canAcceptSMS: z.boolean().optional(), smsCallbackUrl: z.string().optional(), smsSettings: smsSettingsX.optional(), tags: z.array(z.string()).optional()}); export const account = z.object({id: z.string(), partitionId: z.string(), accountNumber: z.string().min(3).max(256), accountName: z.string().min(3).max(256), billingCycleDay: z.number().int().gte(1).lte(28), customField: z.string().min(3).max(256).optional(), status: z.enum(["ACTIVE", "DISABLED", "DELETED", "DELETE_PENDING", "SUSPENDED", "PENDING"]), timeZone: z.enum(["US/Samoa", "US/Hawaii", "US/Alaska", "US/Pacific", "US/Arizona", "US/Mountain", "US/Central", "US/Eastern", "America/St_Thomas", "Canada/Pacific", "Canada/Mountain", "Canada/Central", "Canada/Eastern", "Canada/Atlantic", "Canada/Newfoundland"]), languageTag: z.string().optional(), deletionDate: z.string().optional(), accountType: z.enum(["SIMPLE", "ADVANCED"]), platformType: z.enum(["V2_0", "V2_1", "CPE1", "CPE2"]).optional(), platformChangeDate: z.string().optional(), inboundRatePlanProductId: z.string().optional(), extensionLength: z.number().int().gte(3).lte(6), dialingBehaviorType: z.enum(["SEVEN_DIGIT", "TEN_DIGIT", "OPEN_DIAL_PLAN", "DIAL_NINE_SEVEN_DIGIT", "DIAL_NINE_TEN_DIGIT", "OPEN_DIAL_PLAN_TEN_DIGIT"]), routePlanId: z.string().optional(), callScreeningSettings: callScreeningSettingsX.optional(), holdMusicMediaId: z.string().optional(), holdTimeoutSeconds: z.number().int().gte(30).lte(600).optional(), allowDangerousExtensions: z.boolean().optional(), domain: z.string().optional(), sendWelcomeEmail: z.boolean().optional(), regulatoryType: z.enum(["RESIDENTIAL", "COMMERCIAL", "GOVERNMENT"]), endUserCount: z.number().int().optional(), customHoldMusicMediaId: z.string().optional(), callingPlans: z.array(callingPlanX).optional()}); export const accountActivationV2X = z.object({device: deviceX.optional(), user: endUserV2X.optional(), telephoneNumberAccount: telephoneNumberAccountV2X.optional(), dynamicTelephoneNumberActivation: dynamicTelephoneNumberActivationX.optional(), port: portX.optional(), holdActivation: z.boolean().optional(), account: account.optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Account activation * * POST /v2/partition/{partitionId}/account/activation */ export const createApiV2PartitionPartitionIdAccountActivation = async (args: CreateApiV2PartitionPartitionIdAccountActivationArgs, options?: CreateApiV2PartitionPartitionIdAccountActivationOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/partition/${encodeURIComponent(String(args.partitionId))}/account/activation${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(accountActivationV2X, await res.json()) };