import {z} from 'zod' export type ActiveInactiveEnum = unknown; export type LanguageIdEnum = unknown; export type ActorsDbEntity = {ParentActorID?: (number | null) | undefined, ActorID?: (number | null) | undefined, ActorDescription?: (string | null) | undefined, ActorCode?: (number | null) | undefined, ActorAddress?: (string | null) | undefined, ActorContact?: (string | null) | undefined, ActorTypeID?: (5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | null) | undefined, ActorStatus?: ActiveInactiveEnum | undefined, ActorHierarchyLevel?: (number | null) | undefined, CurrencyID?: (number | null) | undefined, LastUpdated?: (string | null) | undefined, RouteManagerName?: (string | null) | undefined, RouteManagerMobile?: (string | null) | undefined, TimeZoneKey?: (number | null) | undefined, DayLightSavingsBit?: (boolean | null) | undefined, CountryID?: (number | null) | undefined, DailyCCTransLimitPerCard?: (number | null) | undefined, DailyPPTransLimitPerCard?: (number | null) | undefined, DailyExternalPPTransLimitPerCard?: (number | null) | undefined, DailyCCTransLimitPerCardPerOperator?: (number | null) | undefined, OperatorActorID?: (number | null) | undefined, DistributorActorID?: (number | null) | undefined, AreaActorID?: (number | null) | undefined, RouteActorID?: (number | null) | undefined, ActorHierarchy?: (string | null) | undefined, ActorHasChildrenBit?: (boolean | null) | undefined, ActorHasMachinesBit?: (boolean | null) | undefined, ActorImageURL?: (string | null) | undefined, ActorContractInfo?: (string | null) | undefined, ActorSQSID?: (number | null) | undefined, UseProductGroupVATBit?: (boolean | null) | undefined, EreceiptTransactionEndEnableBit?: (boolean | null) | undefined, MaximumRevalueAmountLimit?: (number | null) | undefined, ActorCreatedBy?: (number | null) | undefined, ActorCreationDate?: (string | null) | undefined, UpdateBy?: (number | null) | undefined, CultureID?: (number | null) | undefined, RevaluePayoutByDistributor?: (boolean | null) | undefined, FiscalizationBit?: (boolean | null) | undefined, GeoCountryID?: (number | null) | undefined, GeoState?: (string | null) | undefined, GeoCity?: (string | null) | undefined, GeoAddress?: (string | null) | undefined, GeoStreetNumber?: (string | null) | undefined, GeoLongitude?: (number | null) | undefined, GeoLatitude?: (number | null) | undefined, GeoZipCode?: (string | null) | undefined, GeoZoom?: (number | null) | undefined, ActorLanguageID?: LanguageIdEnum | undefined, ActorMerchantBit?: (string | null) | undefined, ActorMerchantNameForDescriptor?: (string | null) | undefined, OverrideGeoInherritcanceBit?: (boolean | null) | undefined, AirportID?: (number | null) | undefined, VerticalCustomJSON?: (string | null) | undefined, FiscalizationActorID?: (number | null) | undefined, SupportIncrementalAuth?: (boolean | null) | undefined, MaximumDefaultCredit?: (number | null) | undefined}; export type UpdateApiV1ActorsActorIDArgs = {ActorID: number, body: ActorsDbEntity}; export type UpdateApiV1ActorsActorIDOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; export const languageIdEnum = z.unknown(); export const actors = z.object({ParentActorID: z.number().int().nullable().optional(), ActorID: z.number().int().nullable().optional(), ActorDescription: z.string().nullable().optional(), ActorCode: z.number().int().nullable().optional(), ActorAddress: z.string().nullable().optional(), ActorContact: z.string().nullable().optional(), ActorTypeID: z.number().int().nullable().optional(), ActorStatus: z.number().int().nullable().optional(), ActorHierarchyLevel: z.number().int().nullable().optional(), CurrencyID: z.number().int().nullable().optional(), LastUpdated: z.string().nullable().optional(), RouteManagerName: z.string().nullable().optional(), RouteManagerMobile: z.string().nullable().optional(), TimeZoneKey: z.number().int().nullable().optional(), DayLightSavingsBit: z.boolean().nullable().optional(), CountryID: z.number().int().nullable().optional(), DailyCCTransLimitPerCard: z.number().int().nullable().optional(), DailyPPTransLimitPerCard: z.number().int().nullable().optional(), DailyExternalPPTransLimitPerCard: z.number().int().nullable().optional(), DailyCCTransLimitPerCardPerOperator: z.number().int().nullable().optional(), OperatorActorID: z.number().int().nullable().optional(), DistributorActorID: z.number().int().nullable().optional(), AreaActorID: z.number().int().nullable().optional(), RouteActorID: z.number().int().nullable().optional(), ActorHierarchy: z.string().nullable().optional(), ActorHasChildrenBit: z.boolean().nullable().optional(), ActorHasMachinesBit: z.boolean().nullable().optional(), ActorImageURL: z.string().nullable().optional(), ActorContractInfo: z.string().nullable().optional(), ActorSQSID: z.number().int().nullable().optional(), UseProductGroupVATBit: z.boolean().nullable().optional(), EreceiptTransactionEndEnableBit: z.boolean().nullable().optional(), MaximumRevalueAmountLimit: z.number().nullable().optional(), ActorCreatedBy: z.number().int().nullable().optional(), ActorCreationDate: z.string().nullable().optional(), UpdateBy: z.number().int().nullable().optional(), CultureID: z.number().int().nullable().optional(), RevaluePayoutByDistributor: z.boolean().nullable().optional(), FiscalizationBit: z.boolean().nullable().optional(), GeoCountryID: z.number().int().nullable().optional(), GeoState: z.string().nullable().optional(), GeoCity: z.string().nullable().optional(), GeoAddress: z.string().nullable().optional(), GeoStreetNumber: z.string().nullable().optional(), GeoLongitude: z.number().nullable().optional(), GeoLatitude: z.number().nullable().optional(), GeoZipCode: z.string().nullable().optional(), GeoZoom: z.number().int().nullable().optional(), ActorLanguageID: languageIdEnum.optional(), ActorMerchantBit: z.string().nullable().optional(), ActorMerchantNameForDescriptor: z.string().nullable().optional(), OverrideGeoInherritcanceBit: z.boolean().nullable().optional(), AirportID: z.number().int().nullable().optional(), VerticalCustomJSON: z.string().nullable().optional(), FiscalizationActorID: z.number().int().nullable().optional(), SupportIncrementalAuth: z.boolean().nullable().optional(), MaximumDefaultCredit: z.number().nullable().optional(), Refs: z.record(z.string(), z.string().nullable()).nullable().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 }; /** * Update Operator/Sub-Operator * * PUT /v1/actors/{ActorID} */ export const updateApiV1ActorsActorID = async (args: UpdateApiV1ActorsActorIDArgs, options?: UpdateApiV1ActorsActorIDOptions) => { const {baseUrl = "https://example.com:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/actors/${encodeURIComponent(String(args.ActorID))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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(actors, await res.json()) };