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 LongTextFilter = 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 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 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 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 AlertQuerySchema = {_id?: ObjectIDFilter | undefined, createdAt?: DateFilter | undefined, updatedAt?: DateFilter | undefined, deletedAt?: DateFilter | undefined, projectId?: ObjectIDFilter | undefined, title?: LongTextFilter | undefined, description?: MarkdownFilter | undefined, impactStartedAt?: DateFilter | undefined, firstPagedAt?: DateFilter | undefined, createdByUserId?: ObjectIDFilter | undefined, monitorId?: ObjectIDFilter | undefined, onCallDutyPolicies?: EntityArrayFilter | undefined, hosts?: EntityArrayFilter | undefined, networkDevices?: EntityArrayFilter | undefined, kubernetesClusters?: EntityArrayFilter | undefined, kubernetesResources?: EntityArrayFilter | undefined, kubernetesContainers?: EntityArrayFilter | undefined, dockerHosts?: EntityArrayFilter | undefined, podmanHosts?: EntityArrayFilter | undefined, proxmoxClusters?: EntityArrayFilter | undefined, openStackClouds?: EntityArrayFilter | undefined, vmwareVCenters?: EntityArrayFilter | undefined, iotFleets?: EntityArrayFilter | undefined, dockerSwarmClusters?: EntityArrayFilter | undefined, cephClusters?: EntityArrayFilter | undefined, storageArrays?: EntityArrayFilter | undefined, cloudResources?: EntityArrayFilter | undefined, databaseServers?: EntityArrayFilter | undefined, dockerResources?: EntityArrayFilter | undefined, podmanResources?: EntityArrayFilter | undefined, services?: EntityArrayFilter | undefined, serviceLevelObjectives?: EntityArrayFilter | undefined, labels?: EntityArrayFilter | undefined, currentAlertStateId?: ObjectIDFilter | undefined, alertSeverityId?: ObjectIDFilter | undefined, monitorStatusWhenThisAlertWasCreatedId?: ObjectIDFilter | undefined, customFields?: JSONFilter | undefined, rootCause?: MarkdownFilter | undefined, createdStateLog?: JSONFilter | undefined, createdCriteriaId?: LongTextFilter | undefined, seriesFingerprint?: LongTextFilter | undefined, seriesLabels?: JSONFilter | undefined, monitorSummary?: JSONFilter | undefined, createdByProbeId?: ObjectIDFilter | undefined, isCreatedAutomatically?: BooleanFilter | undefined, remediationNotes?: MarkdownFilter | undefined, telemetryQuery?: JSONFilter | undefined, alertNumber?: NumberFilter | undefined, alertNumberWithPrefix?: ShortTextFilter | undefined, alertEpisodeId?: ObjectIDFilter | undefined, isPrivate?: BooleanFilter | undefined, enableReminders?: BooleanFilter | undefined, nextReminderNotificationAt?: DateFilter | undefined, reminderNotificationSentCount?: NumberFilter | undefined, nextIncidentRuleCheckAt?: DateFilter | undefined}; export type OnCallDutyPolicyRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, repeatPolicyIfNoOneAcknowledgesNoOfTimes?: 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 NetworkDeviceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, hostname?: boolean | undefined, dnsName?: boolean | undefined, otherAddresses?: boolean | undefined, discoveredName?: boolean | undefined, discoveredNameSource?: boolean | undefined, macAddress?: boolean | undefined, isMacAddressLearned?: boolean | undefined, probeId?: boolean | undefined, siteId?: boolean | undefined, oidTemplateId?: boolean | undefined, snmpCredentialProfileId?: boolean | undefined, currentMonitorStatusId?: boolean | undefined, monitoringMethod?: boolean | undefined, deviceRole?: boolean | undefined, networkDeviceRoleId?: boolean | undefined, monitorId?: boolean | undefined, snmpVersion?: boolean | undefined, sysDescr?: boolean | undefined, sysName?: boolean | undefined, sysObjectId?: boolean | undefined, sysLocation?: boolean | undefined, vendor?: boolean | undefined, deviceModel?: boolean | undefined, lastRebootedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, lastPolledAt?: boolean | undefined, isReachable?: boolean | undefined, isSnmpReachable?: boolean | undefined, lastSnmpSeenAt?: 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 KubernetesResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, kubernetesClusterId?: boolean | undefined, kind?: boolean | undefined, namespaceKey?: boolean | undefined, name?: boolean | undefined, uid?: boolean | undefined, phase?: boolean | undefined, isReady?: boolean | undefined, hasMemoryPressure?: boolean | undefined, hasDiskPressure?: boolean | undefined, hasPidPressure?: boolean | undefined, containerCount?: boolean | undefined, healthSeverity?: boolean | undefined, controllerDeploymentName?: boolean | undefined, controllerCronJobName?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, latestMemoryPercent?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: boolean | undefined}; export type KubernetesContainerRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, kubernetesClusterId?: boolean | undefined, podNamespaceKey?: boolean | undefined, podName?: boolean | undefined, name?: boolean | undefined, image?: boolean | undefined, state?: boolean | undefined, reason?: boolean | undefined, isReady?: boolean | undefined, restartCount?: boolean | undefined, memoryLimitBytes?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: 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 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 CloudResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, resourceIdentifier?: boolean | undefined, cloudPlatform?: boolean | undefined, cloudProvider?: boolean | undefined, cloudRegion?: boolean | undefined, cloudAccountId?: boolean | undefined, cloudResourceKind?: boolean | undefined, cloudResourceType?: boolean | undefined, cloudResourceGroup?: boolean | undefined, healthSeverity?: boolean | undefined, cloudConnectionId?: boolean | undefined, runtimeName?: boolean | undefined, runtimeVersion?: boolean | undefined, lastSeenAt?: 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 DockerResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, dockerHostId?: boolean | undefined, kind?: boolean | undefined, name?: boolean | undefined, containerId?: boolean | undefined, imageName?: boolean | undefined, state?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: boolean | undefined}; export type PodmanResourceRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, podmanHostId?: boolean | undefined, kind?: boolean | undefined, name?: boolean | undefined, containerId?: boolean | undefined, imageName?: boolean | undefined, state?: boolean | undefined, latestCpuPercent?: boolean | undefined, latestMemoryBytes?: boolean | undefined, metricsUpdatedAt?: boolean | undefined, lastSeenAt?: boolean | undefined, resourceCreationTimestamp?: 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 ServiceLevelObjectiveRelationSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, name?: boolean | undefined, description?: boolean | undefined, sliType?: boolean | undefined, targetPercentage?: 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 AlertSelectSchema = {_id?: boolean | undefined, createdAt?: boolean | undefined, updatedAt?: boolean | undefined, deletedAt?: boolean | undefined, projectId?: boolean | undefined, title?: boolean | undefined, description?: boolean | undefined, impactStartedAt?: boolean | undefined, firstPagedAt?: boolean | undefined, createdByUserId?: boolean | undefined, monitorId?: boolean | undefined, onCallDutyPolicies?: OnCallDutyPolicyRelationSelectSchema | undefined, hosts?: HostRelationSelectSchema | undefined, networkDevices?: NetworkDeviceRelationSelectSchema | undefined, kubernetesClusters?: KubernetesClusterRelationSelectSchema | undefined, kubernetesResources?: KubernetesResourceRelationSelectSchema | undefined, kubernetesContainers?: KubernetesContainerRelationSelectSchema | undefined, dockerHosts?: DockerHostRelationSelectSchema | undefined, podmanHosts?: PodmanHostRelationSelectSchema | undefined, proxmoxClusters?: ProxmoxClusterRelationSelectSchema | undefined, openStackClouds?: OpenStackCloudRelationSelectSchema | undefined, vmwareVCenters?: VMwareVCenterRelationSelectSchema | undefined, iotFleets?: IoTFleetRelationSelectSchema | undefined, dockerSwarmClusters?: DockerSwarmClusterRelationSelectSchema | undefined, cephClusters?: CephClusterRelationSelectSchema | undefined, storageArrays?: StorageArrayRelationSelectSchema | undefined, cloudResources?: CloudResourceRelationSelectSchema | undefined, databaseServers?: DatabaseServerRelationSelectSchema | undefined, dockerResources?: DockerResourceRelationSelectSchema | undefined, podmanResources?: PodmanResourceRelationSelectSchema | undefined, services?: ServiceRelationSelectSchema | undefined, serviceLevelObjectives?: ServiceLevelObjectiveRelationSelectSchema | undefined, labels?: LabelRelationSelectSchema | undefined, currentAlertStateId?: boolean | undefined, alertSeverityId?: boolean | undefined, monitorStatusWhenThisAlertWasCreatedId?: boolean | undefined, customFields?: boolean | undefined, rootCause?: boolean | undefined, createdStateLog?: boolean | undefined, createdCriteriaId?: boolean | undefined, seriesFingerprint?: boolean | undefined, seriesLabels?: boolean | undefined, monitorSummary?: boolean | undefined, createdByProbeId?: boolean | undefined, isCreatedAutomatically?: boolean | undefined, remediationNotes?: boolean | undefined, telemetryQuery?: boolean | undefined, alertNumber?: boolean | undefined, alertNumberWithPrefix?: boolean | undefined, alertEpisodeId?: boolean | undefined, isPrivate?: boolean | undefined, enableReminders?: boolean | undefined, nextReminderNotificationAt?: boolean | undefined, reminderNotificationSentCount?: boolean | undefined, nextIncidentRuleCheckAt?: boolean | undefined}; export type SortOrder = 'ASC' | 'DESC'; export type AlertSortSchema = {_id?: SortOrder | undefined, createdAt?: SortOrder | undefined, updatedAt?: SortOrder | undefined, deletedAt?: SortOrder | undefined, projectId?: SortOrder | undefined, title?: SortOrder | undefined, impactStartedAt?: SortOrder | undefined, firstPagedAt?: SortOrder | undefined, createdByUserId?: SortOrder | undefined, monitorId?: SortOrder | undefined, currentAlertStateId?: SortOrder | undefined, alertSeverityId?: SortOrder | undefined, monitorStatusWhenThisAlertWasCreatedId?: SortOrder | undefined, createdCriteriaId?: SortOrder | undefined, seriesFingerprint?: SortOrder | undefined, createdByProbeId?: SortOrder | undefined, isCreatedAutomatically?: SortOrder | undefined, alertNumber?: SortOrder | undefined, alertNumberWithPrefix?: SortOrder | undefined, alertEpisodeId?: SortOrder | undefined, isPrivate?: SortOrder | undefined, enableReminders?: SortOrder | undefined, nextReminderNotificationAt?: SortOrder | undefined, reminderNotificationSentCount?: SortOrder | undefined, nextIncidentRuleCheckAt?: SortOrder | undefined}; export type CreateApiAlertGetListArgs = {body: {query?: AlertQuerySchema | undefined, select?: AlertSelectSchema | undefined, sort?: AlertSortSchema | undefined, limit?: number | undefined, skip?: number | undefined}}; export type CreateApiAlertGetListOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; export const alert = 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(), impactStartedAt: z.object({}).optional(), firstPagedAt: z.object({}).optional(), createdByUserId: z.string().optional(), monitorId: z.string().optional(), onCallDutyPolicies: z.array(z.object({_id: z.string().optional()})).optional(), hosts: z.array(z.object({_id: z.string().optional()})).optional(), networkDevices: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesClusters: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesResources: z.array(z.object({_id: z.string().optional()})).optional(), kubernetesContainers: 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(), 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(), cloudResources: z.array(z.object({_id: z.string().optional()})).optional(), databaseServers: z.array(z.object({_id: z.string().optional()})).optional(), dockerResources: z.array(z.object({_id: z.string().optional()})).optional(), podmanResources: z.array(z.object({_id: z.string().optional()})).optional(), services: z.array(z.object({_id: z.string().optional()})).optional(), serviceLevelObjectives: z.array(z.object({_id: z.string().optional()})).optional(), labels: z.array(z.object({_id: z.string().optional()})).optional(), currentAlertStateId: z.string(), alertSeverityId: z.string(), monitorStatusWhenThisAlertWasCreatedId: z.string().optional(), customFields: z.object({}).optional(), isOwnerNotifiedOfAlertCreation: z.boolean(), rootCause: z.string().optional(), createdStateLog: z.object({}).optional(), createdCriteriaId: z.string().optional(), seriesFingerprint: z.string().optional(), seriesLabels: z.object({}).optional(), monitorSummary: z.object({}).optional(), createdByProbeId: z.string().optional(), isCreatedAutomatically: z.boolean().optional(), remediationNotes: z.string().optional(), telemetryQuery: z.object({}).optional(), alertNumber: z.number().optional(), alertNumberWithPrefix: z.string().optional(), alertEpisodeId: z.string().optional(), isPrivate: z.boolean().optional(), enableReminders: z.boolean().optional(), nextReminderNotificationAt: z.object({}).optional(), reminderNotificationSentCount: z.number().optional(), nextIncidentRuleCheckAt: z.object({}).optional()}); export const createApiAlertGetListResponse = z.object({data: z.array(alert).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 Alert * * POST /alert/get-list */ export const createApiAlertGetList = async (args: CreateApiAlertGetListArgs, options?: CreateApiAlertGetListOptions) => { 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(/\/+$/, '')}/alert/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(createApiAlertGetListResponse, await res.json()) };