/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: aacf6aa7e767 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; /** * First-page sort order: 'asc' (oldest first) or 'desc'. Ignored when `cursor` is set. */ export const GetDeploymentLogsOrder = { Asc: "asc", Desc: "desc", } as const; /** * First-page sort order: 'asc' (oldest first) or 'desc'. Ignored when `cursor` is set. */ export type GetDeploymentLogsOrder = ClosedEnum; export type GetDeploymentLogsRequest = { name: string; /** * Filter logs by worker name */ workerName?: string | null | undefined; /** * Filter logs by workflow name */ workflowName?: string | null | undefined; /** * Only return logs at or after this timestamp */ after?: Date | null | undefined; /** * Only return logs before this timestamp */ before?: Date | null | undefined; /** * First-page sort order: 'asc' (oldest first) or 'desc'. Ignored when `cursor` is set. */ order?: GetDeploymentLogsOrder | undefined; /** * Pagination cursor from a previous response's `next_cursor`; carries the window and order */ cursor?: string | null | undefined; /** * Maximum number of logs to return */ limit?: number | undefined; }; /** @internal */ export const GetDeploymentLogsOrder$outboundSchema: z.ZodEnum< typeof GetDeploymentLogsOrder > = z.enum(GetDeploymentLogsOrder); /** @internal */ export type GetDeploymentLogsRequest$Outbound = { name: string; worker_name?: string | null | undefined; workflow_name?: string | null | undefined; after?: string | null | undefined; before?: string | null | undefined; order: string; cursor?: string | null | undefined; limit: number; }; /** @internal */ export const GetDeploymentLogsRequest$outboundSchema: z.ZodType< GetDeploymentLogsRequest$Outbound, GetDeploymentLogsRequest > = z.object({ name: z.string(), workerName: z.nullable(z.string()).optional(), workflowName: z.nullable(z.string()).optional(), after: z.nullable(z.date().transform(v => v.toISOString())).optional(), before: z.nullable(z.date().transform(v => v.toISOString())).optional(), order: GetDeploymentLogsOrder$outboundSchema.default("asc"), cursor: z.nullable(z.string()).optional(), limit: z.int().default(50), }).transform((v) => { return remap$(v, { workerName: "worker_name", workflowName: "workflow_name", }); }); export function getDeploymentLogsRequestToJSON( getDeploymentLogsRequest: GetDeploymentLogsRequest, ): string { return JSON.stringify( GetDeploymentLogsRequest$outboundSchema.parse(getDeploymentLogsRequest), ); }