/* * 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 { AlertState, AlertState$outboundSchema } from "./alert-state.js"; import { AlertType, AlertType$outboundSchema } from "./alert-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 AlertLogFilterOrder = { Asc: "asc", Desc: "desc", } as const; export type AlertLogFilterOrder = ClosedEnum; export type AlertLogFilter = { alertStatus?: AlertState | undefined; alertType?: AlertType | undefined; customerId?: string | undefined; endTime?: Date | undefined; entityId?: string | 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?: AlertLogFilterOrder | undefined; sort?: Array | undefined; startTime?: Date | undefined; status?: Status | undefined; }; /** @internal */ export const AlertLogFilterOrder$outboundSchema: z.ZodMiniEnum< typeof AlertLogFilterOrder > = z.enum(AlertLogFilterOrder); /** @internal */ export type AlertLogFilter$Outbound = { alert_status?: string | undefined; alert_type?: string | undefined; customer_id?: string | undefined; end_time?: string | undefined; entity_id?: string | undefined; entity_type?: string | undefined; expand?: string | undefined; filters?: Array | undefined; limit?: number | undefined; offset?: number | undefined; order?: string | undefined; sort?: Array | undefined; start_time?: string | undefined; status?: string | undefined; }; /** @internal */ export const AlertLogFilter$outboundSchema: z.ZodMiniType< AlertLogFilter$Outbound, AlertLogFilter > = z.pipe( z.object({ alertStatus: z.optional(AlertState$outboundSchema), alertType: z.optional(AlertType$outboundSchema), customerId: z.optional(z.string()), endTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))), entityId: z.optional(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(AlertLogFilterOrder$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, { alertStatus: "alert_status", alertType: "alert_type", customerId: "customer_id", endTime: "end_time", entityId: "entity_id", entityType: "entity_type", startTime: "start_time", }); }), ); export function alertLogFilterToJSON(alertLogFilter: AlertLogFilter): string { return JSON.stringify(AlertLogFilter$outboundSchema.parse(alertLogFilter)); }