/*
 * 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 WorkspaceUserForUpdate = {
  /**
   * The ID of the role to update to
   */
  roleId?: string | undefined;
};

/** @internal */
export type WorkspaceUserForUpdate$Outbound = {
  role_id?: string | undefined;
};

/** @internal */
export const WorkspaceUserForUpdate$outboundSchema: z.ZodType<
  WorkspaceUserForUpdate$Outbound,
  z.ZodTypeDef,
  WorkspaceUserForUpdate
> = z.object({
  roleId: z.string().optional(),
}).transform((v) => {
  return remap$(v, {
    roleId: "role_id",
  });
});

export function workspaceUserForUpdateToJSON(
  workspaceUserForUpdate: WorkspaceUserForUpdate,
): string {
  return JSON.stringify(
    WorkspaceUserForUpdate$outboundSchema.parse(workspaceUserForUpdate),
  );
}
