/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: d8323e9df800
 */

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { ClosedEnum } from "../../types/enums.js";

export const Order = {
  Asc: "asc",
  Desc: "desc",
} as const;
export type Order = ClosedEnum<typeof Order>;

export type LogsRequest = {
  searchExpression?: string | null | undefined;
  order?: Order | undefined;
};

/** @internal */
export const Order$outboundSchema: z.ZodEnum<typeof Order> = z.enum(Order);

/** @internal */
export type LogsRequest$Outbound = {
  search_expression?: string | null | undefined;
  order: string;
};

/** @internal */
export const LogsRequest$outboundSchema: z.ZodType<
  LogsRequest$Outbound,
  LogsRequest
> = z.object({
  searchExpression: z.nullable(z.string()).optional(),
  order: Order$outboundSchema.default("desc"),
}).transform((v) => {
  return remap$(v, {
    searchExpression: "search_expression",
  });
});

export function logsRequestToJSON(logsRequest: LogsRequest): string {
  return JSON.stringify(LogsRequest$outboundSchema.parse(logsRequest));
}
