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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";

export type GetWorkspaceDocumentsRequest = {
  /**
   * The ID of the account
   */
  accountId: string;
  /**
   * The ID of the workspace
   */
  workspaceId: string;
  /**
   * Number of documents to return. Defaults to the maximum which is 100
   */
  count?: number | undefined;
  /**
   * Position of the first item in the total results. Defaults to 0
   */
  startPosition?: number | undefined;
  /**
   * Filter documents where Name contains the filter. Defaults to null, to not filter
   */
  nameFilter?: string | undefined;
};

/** @internal */
export type GetWorkspaceDocumentsRequest$Outbound = {
  accountId: string;
  workspaceId: string;
  count?: number | undefined;
  start_position?: number | undefined;
  name_filter?: string | undefined;
};

/** @internal */
export const GetWorkspaceDocumentsRequest$outboundSchema: z.ZodType<
  GetWorkspaceDocumentsRequest$Outbound,
  z.ZodTypeDef,
  GetWorkspaceDocumentsRequest
> = z.object({
  accountId: z.string(),
  workspaceId: z.string(),
  count: z.number().int().optional(),
  startPosition: z.number().int().optional(),
  nameFilter: z.string().optional(),
}).transform((v) => {
  return remap$(v, {
    startPosition: "start_position",
    nameFilter: "name_filter",
  });
});

export function getWorkspaceDocumentsRequestToJSON(
  getWorkspaceDocumentsRequest: GetWorkspaceDocumentsRequest,
): string {
  return JSON.stringify(
    GetWorkspaceDocumentsRequest$outboundSchema.parse(
      getWorkspaceDocumentsRequest,
    ),
  );
}
