import {z} from 'zod' export type ObjectIDFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Includes', value: Array}; export type DateFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'GreaterThan', value: string} | {_type: 'LessThan', value: string} | {_type: 'GreaterThanOrEqual', value: string} | {_type: 'LessThanOrEqual', value: string} | {_type: 'InBetween', startValue: string, endValue: string}; export type ShortTextFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type MarkdownFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type SlugFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Includes', value: Array}; export type EntityArrayFilter = Array | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'Includes', value: Array}; export type JSONFilter = {_type: 'IsNull'} | {_type: 'NotNull'} | {[key: string]: string | number | boolean | {_type: 'EqualTo', value: string | number | boolean} | {_type: 'NotEqual', value: string | number | boolean} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string | number | boolean} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array} | {_type: 'GreaterThan', value: string | number | boolean} | {_type: 'LessThan', value: string | number | boolean} | {_type: 'GreaterThanOrEqual', value: string | number | boolean} | {_type: 'LessThanOrEqual', value: string | number | boolean} | {_type: 'InBetween', startValue: string | number | boolean, endValue: string | number | boolean}}; export type VeryLongTextFilter = string | {_type: 'EqualTo', value: string} | {_type: 'NotEqual', value: string} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: string} | {_type: 'Search', value: string} | {_type: 'Includes', value: Array}; export type BooleanFilter = boolean | {_type: 'EqualTo', value: boolean} | {_type: 'NotEqual', value: boolean} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: boolean}; export type NumberFilter = number | {_type: 'EqualTo', value: number} | {_type: 'NotEqual', value: number} | {_type: 'IsNull'} | {_type: 'NotNull'} | {_type: 'EqualToOrNull', value: number} | {_type: 'GreaterThan', value: number} | {_type: 'LessThan', value: number} | {_type: 'GreaterThanOrEqual', value: number} | {_type: 'LessThanOrEqual', value: number} | {_type: 'InBetween', startValue: number, endValue: number}; export type ScheduledMaintenanceQuerySchema = {_id?: ObjectIDFilter | undefined, createdAt?: DateFilter | undefined, updatedAt?: DateFilter | undefined, deletedAt?: DateFilter | undefined, projectId?: ObjectIDFilter | undefined, title?: ShortTextFilter | undefined, description?: MarkdownFilter | undefined, slug?: SlugFilter | undefined, createdByUserId?: ObjectIDFilter | undefined, monitors?: EntityArrayFilter | undefined, hosts?: EntityArrayFilter | undefined, kubernetesClusters?: EntityArrayFilter | undefined, dockerHosts?: EntityArrayFilter | undefined, podmanHosts?: EntityArrayFilter | undefined, proxmoxClusters?: EntityArrayFilter | undefined, openStackClouds?: EntityArrayFilter | undefined, vmwareVCenters?: EntityArrayFilter | undefined, iotFleets?: EntityArrayFilter | undefined, networkSites?: EntityArrayFilter | undefined, dockerSwarmClusters?: EntityArrayFilter | undefined, cephClusters?: EntityArrayFilter | undefined, storageArrays?: EntityArrayFilter | undefined, databaseServers?: EntityArrayFilter | undefined, dataStoreIds?: JSONFilter | undefined, openStackParts?: JSONFilter | undefined, services?: EntityArrayFilter | undefined, statusPages?: EntityArrayFilter | undefined, labels?: EntityArrayFilter | undefined, currentScheduledMaintenanceStateId?: ObjectIDFilter | undefined, changeMonitorStatusToId?: ObjectIDFilter | undefined, startsAt?: DateFilter | undefined, endsAt?: DateFilter | undefined, subscriberNotificationStatusMessage?: VeryLongTextFilter | undefined, shouldStatusPageSubscribersBeNotifiedOnEventCreated?: BooleanFilter | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing?: BooleanFilter | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded?: BooleanFilter | undefined, customFields?: JSONFilter | undefined, sendSubscriberNotificationsOnBeforeTheEvent?: JSONFilter | undefined, nextSubscriberNotificationBeforeTheEventAt?: DateFilter | undefined, scheduledMaintenanceNumber?: NumberFilter | undefined, scheduledMaintenanceNumberWithPrefix?: ShortTextFilter | undefined, isVisibleOnStatusPage?: BooleanFilter | undefined, publishOnStatusPageAt?: DateFilter | undefined, enableReminders?: BooleanFilter | undefined, nextReminderNotificationAt?: DateFilter | undefined, reminderNotificationSentCount?: NumberFilter | undefined}; export type MonitorRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, monitorTemplateId?: boolean | undefined, autoProvisionedNetworkDeviceId?: boolean | undefined, networkAlertPolicyId?: boolean | undefined, monitorType?: boolean | undefined, currentMonitorStatusId?: boolean | undefined, monitorSteps?: boolean | undefined}; export type HostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined, hostId?: boolean | undefined, hostArch?: boolean | undefined, hostType?: boolean | undefined, hostIpAddresses?: boolean | undefined, cpuCores?: boolean | undefined, totalMemoryBytes?: boolean | undefined, processCount?: boolean | undefined, containerRuntime?: boolean | undefined, deploymentEnvironment?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, cloudProvider?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryPercent?: boolean | undefined, latestSwapPercent?: boolean | undefined, latestDiskPercent?: boolean | undefined, latestDiskMountpoint?: boolean | undefined, latestInodesPercent?: boolean | undefined, latestInodesMountpoint?: boolean | undefined, latestLoadAverage15m?: boolean | undefined, bootedAt?: boolean | undefined, failedSystemdUnitCount?: boolean | undefined, failedSystemdUnits?: boolean | undefined, readingsUpdatedAt?: boolean | undefined}; export type KubernetesClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, clusterIdentifier?: boolean | undefined, provider?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, aiAccessRunnerId?: boolean | undefined}; export type DockerHostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined}; export type PodmanHostRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostIdentifier?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, osType?: boolean | undefined, osVersion?: boolean | undefined}; export type ProxmoxClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, pveVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type OpenStackCloudRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, collectionMethod?: boolean | undefined}; export type VMwareVCenterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, collectionMethod?: boolean | undefined}; export type IoTFleetRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type NetworkSiteRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, siteType?: boolean | undefined, networkSiteTypeId?: boolean | undefined, probeId?: boolean | undefined, snmpCredentialProfileId?: boolean | undefined, parentSiteId?: boolean | undefined, materializedPath?: boolean | undefined, depth?: boolean | undefined, address?: boolean | undefined, latitude?: boolean | undefined, longitude?: boolean | undefined, currentMonitorStatusId?: boolean | undefined, lastRollupAt?: boolean | undefined, healthRollupPolicy?: boolean | undefined, offlineThresholdPercent?: boolean | undefined, alertSeverityId?: boolean | undefined, currentActiveAlertId?: boolean | undefined}; export type DockerSwarmClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, dockerVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, swarmId?: boolean | undefined}; export type CephClusterRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, fsid?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, cephVersion?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type StorageArrayRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, storageSystem?: boolean | undefined, reportedName?: boolean | undefined, systemId?: boolean | undefined, osName?: boolean | undefined, osVersion?: boolean | undefined, otelCollectorStatus?: boolean | undefined, agentVersion?: boolean | undefined, lastSeenAt?: boolean | undefined, capacityBytes?: boolean | undefined, usedBytes?: boolean | undefined}; export type DatabaseServerRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, databaseIdentifier?: boolean | undefined, dbSystem?: boolean | undefined, serverAddress?: boolean | undefined, serverPort?: boolean | undefined, discoverySource?: boolean | undefined, otelCollectorStatus?: boolean | undefined, lastSeenAt?: boolean | undefined}; export type ServiceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, serviceColor?: boolean | undefined, serviceLanguage?: boolean | undefined, techStack?: boolean | undefined, lastSeenAt?: boolean | undefined, serviceVersion?: boolean | undefined, deploymentEnvironment?: boolean | undefined, serviceNamespace?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, telemetrySdkLanguage?: boolean | undefined, cloudProvider?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined}; export type StatusPageRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, smtpConfigId?: boolean | undefined, callSmsConfigId?: boolean | undefined, defaultBarColor?: boolean | undefined, subscriberEmailNotificationFooterText?: boolean | undefined}; export type LabelRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, name?: boolean | undefined, projectId?: boolean | undefined, color?: boolean | undefined, isArchived?: boolean | undefined}; export type ScheduledMaintenanceSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, title?: boolean | undefined, description?: boolean | undefined, slug?: boolean | undefined, createdByUserId?: boolean | undefined, monitors?: MonitorRelationSelectSchema | undefined, hosts?: HostRelationSelectSchema | undefined, kubernetesClusters?: KubernetesClusterRelationSelectSchema | undefined, dockerHosts?: DockerHostRelationSelectSchema | undefined, podmanHosts?: PodmanHostRelationSelectSchema | undefined, proxmoxClusters?: ProxmoxClusterRelationSelectSchema | undefined, openStackClouds?: OpenStackCloudRelationSelectSchema | undefined, vmwareVCenters?: VMwareVCenterRelationSelectSchema | undefined, iotFleets?: IoTFleetRelationSelectSchema | undefined, networkSites?: NetworkSiteRelationSelectSchema | undefined, dockerSwarmClusters?: DockerSwarmClusterRelationSelectSchema | undefined, cephClusters?: CephClusterRelationSelectSchema | undefined, storageArrays?: StorageArrayRelationSelectSchema | undefined, databaseServers?: DatabaseServerRelationSelectSchema | undefined, dataStoreIds?: boolean | undefined, openStackParts?: boolean | undefined, services?: ServiceRelationSelectSchema | undefined, statusPages?: StatusPageRelationSelectSchema | undefined, labels?: LabelRelationSelectSchema | undefined, currentScheduledMaintenanceStateId?: boolean | undefined, changeMonitorStatusToId?: boolean | undefined, startsAt?: boolean | undefined, endsAt?: boolean | undefined, subscriberNotificationStatusMessage?: boolean | undefined, shouldStatusPageSubscribersBeNotifiedOnEventCreated?: boolean | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing?: boolean | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded?: boolean | undefined, customFields?: boolean | undefined, sendSubscriberNotificationsOnBeforeTheEvent?: boolean | undefined, nextSubscriberNotificationBeforeTheEventAt?: boolean | undefined, scheduledMaintenanceNumber?: boolean | undefined, scheduledMaintenanceNumberWithPrefix?: boolean | undefined, isVisibleOnStatusPage?: boolean | undefined, publishOnStatusPageAt?: boolean | undefined, enableReminders?: boolean | undefined, nextReminderNotificationAt?: boolean | undefined, reminderNotificationSentCount?: boolean | undefined}; export type SortOrder = 'ASC' | 'DESC'; export type ScheduledMaintenanceSortSchema = {_id?: SortOrder | undefined, createdAt?: SortOrder | undefined, updatedAt?: SortOrder | undefined, deletedAt?: SortOrder | undefined, projectId?: SortOrder | undefined, title?: SortOrder | undefined, slug?: SortOrder | undefined, createdByUserId?: SortOrder | undefined, currentScheduledMaintenanceStateId?: SortOrder | undefined, changeMonitorStatusToId?: SortOrder | undefined, startsAt?: SortOrder | undefined, endsAt?: SortOrder | undefined, subscriberNotificationStatusMessage?: SortOrder | undefined, shouldStatusPageSubscribersBeNotifiedOnEventCreated?: SortOrder | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing?: SortOrder | undefined, shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded?: SortOrder | undefined, nextSubscriberNotificationBeforeTheEventAt?: SortOrder | undefined, scheduledMaintenanceNumber?: SortOrder | undefined, scheduledMaintenanceNumberWithPrefix?: SortOrder | undefined, isVisibleOnStatusPage?: SortOrder | undefined, publishOnStatusPageAt?: SortOrder | undefined, enableReminders?: SortOrder | undefined, nextReminderNotificationAt?: SortOrder | undefined, reminderNotificationSentCount?: SortOrder | undefined}; export type CreateApiScheduledMaintenanceGetListArgs = {body: {query?: ScheduledMaintenanceQuerySchema | undefined, select?: ScheduledMaintenanceSelectSchema | undefined, sort?: ScheduledMaintenanceSortSchema | undefined, limit?: number | undefined, skip?: number | undefined}}; export type CreateApiScheduledMaintenanceGetListOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const scheduledMaintenance = z.object({_id: z.string().optional(), createdAt: z.object({}).optional(), updatedAt: z.object({}).optional(), deletedAt: z.object({}).optional(), version: z.number().optional(), projectId: z.string(), title: z.string(), description: z.string().optional(), slug: z.string(), createdByUserId: z.string().optional(), monitors: z.array(z.object({_id: z.string().optional()})).optional(), hosts: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesClusters: z.array(z.object({_id: z.string().optional()})).optional(), dockerHosts: z.array(z.object({_id: z.string().optional()})).optional(), podmanHosts: z.array(z.object({_id: z.string().optional()})).optional(), proxmoxClusters: z.array(z.object({_id: z.string().optional()})).optional(), openStackClouds: z.array(z.object({_id: z.string().optional()})).optional(), vmwareVCenters: z.array(z.object({_id: z.string().optional()})).optional(), iotFleets: z.array(z.object({_id: z.string().optional()})).optional(), networkSites: z.array(z.object({_id: z.string().optional()})).optional(), dockerSwarmClusters: z.array(z.object({_id: z.string().optional()})).optional(), cephClusters: z.array(z.object({_id: z.string().optional()})).optional(), storageArrays: z.array(z.object({_id: z.string().optional()})).optional(), databaseServers: z.array(z.object({_id: z.string().optional()})).optional(), dataStoreIds: z.object({}).optional(), openStackParts: z.object({}).optional(), services: z.array(z.object({_id: z.string().optional()})).optional(), statusPages: z.array(z.object({_id: z.string().optional()})).optional(), labels: z.array(z.object({_id: z.string().optional()})).optional(), currentScheduledMaintenanceStateId: z.string(), changeMonitorStatusToId: z.string().optional(), startsAt: z.object({}), endsAt: z.object({}), subscriberNotificationStatusOnEventScheduled: z.enum(["Skipped", "Pending", "InProgress", "Success", "Failed"]).optional(), subscriberNotificationStatusMessage: z.string().optional(), shouldStatusPageSubscribersBeNotifiedOnEventCreated: z.boolean().optional(), shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing: z.boolean().optional(), shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded: z.boolean().optional(), customFields: z.object({}).optional(), isOwnerNotifiedOfResourceCreation: z.boolean(), sendSubscriberNotificationsOnBeforeTheEvent: z.object({}).optional(), nextSubscriberNotificationBeforeTheEventAt: z.object({}).optional(), scheduledMaintenanceNumber: z.number().optional(), scheduledMaintenanceNumberWithPrefix: z.string().optional(), isVisibleOnStatusPage: z.boolean().optional(), publishOnStatusPageAt: z.object({}).optional(), enableReminders: z.boolean().optional(), nextReminderNotificationAt: z.object({}).optional(), reminderNotificationSentCount: z.number().optional()}); export const createApiScheduledMaintenanceGetListResponse = z.object({data: z.array(scheduledMaintenance).optional(), count: z.number().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 }; /** * List Scheduled Maintenance Event * * POST /scheduled-maintenance/get-list */ export const createApiScheduledMaintenanceGetList = async (args: CreateApiScheduledMaintenanceGetListArgs, options?: CreateApiScheduledMaintenanceGetListOptions) => { const {baseUrl = "https://oneuptime.com/api", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (ApiKey !== undefined) headers.set("APIKey", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/scheduled-maintenance/get-list${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(createApiScheduledMaintenanceGetListResponse, await res.json()) };