/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: afb19c640ecc */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; import * as components from "../components/index.js"; /** * Field to sort by. When omitted, active and managed deployments are grouped first, then sorted by created_at. When set, results are sorted purely by the specified field with no grouping. */ export const ListDeploymentsV1WorkflowsDeploymentsGetOrderBy = { UpdatedAt: "updated_at", CreatedAt: "created_at", } as const; /** * Field to sort by. When omitted, active and managed deployments are grouped first, then sorted by created_at. When set, results are sorted purely by the specified field with no grouping. */ export type ListDeploymentsV1WorkflowsDeploymentsGetOrderBy = ClosedEnum< typeof ListDeploymentsV1WorkflowsDeploymentsGetOrderBy >; /** * Sort direction. Applied to order_by when set, or within each activity group when omitted. */ export const ListDeploymentsV1WorkflowsDeploymentsGetOrder = { Asc: "asc", Desc: "desc", } as const; /** * Sort direction. Applied to order_by when set, or within each activity group when omitted. */ export type ListDeploymentsV1WorkflowsDeploymentsGetOrder = ClosedEnum< typeof ListDeploymentsV1WorkflowsDeploymentsGetOrder >; export type ListDeploymentsV1WorkflowsDeploymentsGetRequest = { activeOnly?: boolean | undefined; /** * Filter deployments by hardened status */ isHardened?: boolean | null | undefined; workflowName?: string | null | undefined; /** * Filter deployments by creator's user id */ createdBy?: string | null | undefined; /** * Filter deployments with at least one worker on any of these location types (OR) */ locationTypes?: Array | null | undefined; /** * Filter deployments by name or ID prefix */ search?: string | null | undefined; /** * Field to sort by. When omitted, active and managed deployments are grouped first, then sorted by created_at. When set, results are sorted purely by the specified field with no grouping. */ orderBy?: ListDeploymentsV1WorkflowsDeploymentsGetOrderBy | null | undefined; /** * Sort direction. Applied to order_by when set, or within each activity group when omitted. */ order?: ListDeploymentsV1WorkflowsDeploymentsGetOrder | undefined; /** * Maximum number of deployments to return */ limit?: number | null | undefined; /** * Cursor from a previous response for pagination */ cursor?: string | null | undefined; /** * Workspace ID to scope the request to. Defaults to the caller's context. */ workspaceId?: string | null | undefined; }; /** @internal */ export const ListDeploymentsV1WorkflowsDeploymentsGetOrderBy$outboundSchema: z.ZodEnum = z.enum( ListDeploymentsV1WorkflowsDeploymentsGetOrderBy, ); /** @internal */ export const ListDeploymentsV1WorkflowsDeploymentsGetOrder$outboundSchema: z.ZodEnum = z.enum( ListDeploymentsV1WorkflowsDeploymentsGetOrder, ); /** @internal */ export type ListDeploymentsV1WorkflowsDeploymentsGetRequest$Outbound = { active_only: boolean; is_hardened?: boolean | null | undefined; workflow_name?: string | null | undefined; created_by?: string | null | undefined; location_types?: Array | null | undefined; search?: string | null | undefined; order_by?: string | null | undefined; order: string; limit?: number | null | undefined; cursor?: string | null | undefined; workspace_id?: string | null | undefined; }; /** @internal */ export const ListDeploymentsV1WorkflowsDeploymentsGetRequest$outboundSchema: z.ZodType< ListDeploymentsV1WorkflowsDeploymentsGetRequest$Outbound, ListDeploymentsV1WorkflowsDeploymentsGetRequest > = z.object({ activeOnly: z.boolean().default(true), isHardened: z.nullable(z.boolean()).optional(), workflowName: z.nullable(z.string()).optional(), createdBy: z.nullable(z.string()).optional(), locationTypes: z.nullable(z.array(components.LocationType$outboundSchema)) .optional(), search: z.nullable(z.string()).optional(), orderBy: z.nullable( ListDeploymentsV1WorkflowsDeploymentsGetOrderBy$outboundSchema, ).optional(), order: ListDeploymentsV1WorkflowsDeploymentsGetOrder$outboundSchema.default( "desc", ), limit: z.nullable(z.int()).optional(), cursor: z.nullable(z.string()).optional(), workspaceId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { activeOnly: "active_only", isHardened: "is_hardened", workflowName: "workflow_name", createdBy: "created_by", locationTypes: "location_types", orderBy: "order_by", workspaceId: "workspace_id", }); }); export function listDeploymentsV1WorkflowsDeploymentsGetRequestToJSON( listDeploymentsV1WorkflowsDeploymentsGetRequest: ListDeploymentsV1WorkflowsDeploymentsGetRequest, ): string { return JSON.stringify( ListDeploymentsV1WorkflowsDeploymentsGetRequest$outboundSchema.parse( listDeploymentsV1WorkflowsDeploymentsGetRequest, ), ); }