/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import { AlertEntityType, AlertEntityType$outboundSchema, } from "./alert-entity-type.js"; import { FilterCondition, FilterCondition$Outbound, FilterCondition$outboundSchema, } from "./filter-condition.js"; import { SortCondition, SortCondition$Outbound, SortCondition$outboundSchema, } from "./sort-condition.js"; import { Status, Status$outboundSchema } from "./status.js"; export const AlertSettingsFilterOrder = { Asc: "asc", Desc: "desc", } as const; export type AlertSettingsFilterOrder = ClosedEnum< typeof AlertSettingsFilterOrder >; export type AlertSettingsFilter = { enabled?: boolean | undefined; endTime?: Date | undefined; entityId?: string | undefined; entityIds?: Array | undefined; entityType?: AlertEntityType | undefined; expand?: string | undefined; /** * filters allows complex filtering based on multiple fields */ filters?: Array | undefined; limit?: number | undefined; offset?: number | undefined; order?: AlertSettingsFilterOrder | undefined; parentEntityId?: string | undefined; parentEntityIds?: Array | undefined; parentEntityType?: AlertEntityType | undefined; sort?: Array | undefined; startTime?: Date | undefined; status?: Status | undefined; }; /** @internal */ export const AlertSettingsFilterOrder$outboundSchema: z.ZodMiniEnum< typeof AlertSettingsFilterOrder > = z.enum(AlertSettingsFilterOrder); /** @internal */ export type AlertSettingsFilter$Outbound = { enabled?: boolean | undefined; end_time?: string | undefined; entity_id?: string | undefined; entity_ids?: Array | undefined; entity_type?: string | undefined; expand?: string | undefined; filters?: Array | undefined; limit?: number | undefined; offset?: number | undefined; order?: string | undefined; parent_entity_id?: string | undefined; parent_entity_ids?: Array | undefined; parent_entity_type?: string | undefined; sort?: Array | undefined; start_time?: string | undefined; status?: string | undefined; }; /** @internal */ export const AlertSettingsFilter$outboundSchema: z.ZodMiniType< AlertSettingsFilter$Outbound, AlertSettingsFilter > = z.pipe( z.object({ enabled: z.optional(z.boolean()), endTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), entityId: z.optional(z.string()), entityIds: z.optional(z.array(z.string())), entityType: z.optional(AlertEntityType$outboundSchema), expand: z.optional(z.string()), filters: z.optional(z.array(FilterCondition$outboundSchema)), limit: z.optional(z.int()), offset: z.optional(z.int()), order: z.optional(AlertSettingsFilterOrder$outboundSchema), parentEntityId: z.optional(z.string()), parentEntityIds: z.optional(z.array(z.string())), parentEntityType: z.optional(AlertEntityType$outboundSchema), sort: z.optional(z.array(SortCondition$outboundSchema)), startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), status: z.optional(Status$outboundSchema), }), z.transform((v) => { return remap$(v, { endTime: "end_time", entityId: "entity_id", entityIds: "entity_ids", entityType: "entity_type", parentEntityId: "parent_entity_id", parentEntityIds: "parent_entity_ids", parentEntityType: "parent_entity_type", startTime: "start_time", }); }), ); export function alertSettingsFilterToJSON( alertSettingsFilter: AlertSettingsFilter, ): string { return JSON.stringify( AlertSettingsFilter$outboundSchema.parse(alertSettingsFilter), ); }