/*
 * 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 GetWorkspacesRequest = {
  /**
   * The ID of the account
   */
  accountId: string;
  /**
   * Number of workspaces 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;
};

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

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

export function getWorkspacesRequestToJSON(
  getWorkspacesRequest: GetWorkspacesRequest,
): string {
  return JSON.stringify(
    GetWorkspacesRequest$outboundSchema.parse(getWorkspacesRequest),
  );
}
