import {z} from 'zod' 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 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 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 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 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 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 EndUserWithMultipleTnActivationX = {user: EndUserV2X, telephoneNumberAccounts?: Array | undefined, dynamicTelephoneNumberActivations?: Array | undefined, ports?: Array | undefined, holdActivation: boolean}; export type MultipleActivationX = {account: Account, endUsers?: Array | undefined}; export type CreateApiV2PartitionPartitionIdAccountActivationMultipleArgs = {partitionId: string, body: MultipleActivationX}; export type CreateApiV2PartitionPartitionIdAccountActivationMultipleOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; export const createApiV2PartitionPartitionIdAccountActivationMultipleResponse = z.object({success: z.boolean().optional(), message: z.string().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 }; /** * Multiple account activation * * POST /v2/partition/{partitionId}/account/activation/multiple */ export const createApiV2PartitionPartitionIdAccountActivationMultiple = async (args: CreateApiV2PartitionPartitionIdAccountActivationMultipleArgs, options?: CreateApiV2PartitionPartitionIdAccountActivationMultipleOptions) => { 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/multiple${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(createApiV2PartitionPartitionIdAccountActivationMultipleResponse, await res.json()) };