/*
 * 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";

export type ListDeploymentsV1WorkflowsDeploymentsGetRequest = {
  activeOnly?: boolean | undefined;
  /**
   * Filter deployments by hardened status
   */
  isHardened?: boolean | null | undefined;
  workflowName?: string | null | undefined;
  /**
   * Filter deployments by name or ID prefix
   */
  search?: string | null | 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 type ListDeploymentsV1WorkflowsDeploymentsGetRequest$Outbound = {
  active_only: boolean;
  is_hardened?: boolean | null | undefined;
  workflow_name?: string | null | undefined;
  search?: string | null | undefined;
  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(),
    search: z.nullable(z.string()).optional(),
    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",
      workspaceId: "workspace_id",
    });
  });

export function listDeploymentsV1WorkflowsDeploymentsGetRequestToJSON(
  listDeploymentsV1WorkflowsDeploymentsGetRequest:
    ListDeploymentsV1WorkflowsDeploymentsGetRequest,
): string {
  return JSON.stringify(
    ListDeploymentsV1WorkflowsDeploymentsGetRequest$outboundSchema.parse(
      listDeploymentsV1WorkflowsDeploymentsGetRequest,
    ),
  );
}
