/*
 * 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 GetWorkspaceAssignableRolesRequest = {
  /**
   * The ID of the account
   */
  accountId: string;
  /**
   * The ID of the workspace
   */
  workspaceId: string;
  /**
   * A search filter that returns assignable roles by the beginning of the role name
   */
  filter?: string | undefined;
  /**
   * The index position within the total result set from which to start returning values. The default value is 0
   */
  startPosition?: number | undefined;
  /**
   * The number of results to return. This value must be a number between 1 and 100 (default)
   */
  count?: number | undefined;
};

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

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

export function getWorkspaceAssignableRolesRequestToJSON(
  getWorkspaceAssignableRolesRequest: GetWorkspaceAssignableRolesRequest,
): string {
  return JSON.stringify(
    GetWorkspaceAssignableRolesRequest$outboundSchema.parse(
      getWorkspaceAssignableRolesRequest,
    ),
  );
}
