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

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

export type CreateWorkspaceUploadRequestAssignment = {
  /**
   * The ID of the assigned user
   */
  assigneeUserId?: string | null | undefined;
  /**
   * Enum representing the responsibility type for a workspace upload request assignment
   */
  uploadRequestResponsibilityTypeId: WorkspaceUploadRequestResponsibilityType;
  /**
   * The first name of the assignee
   */
  firstName?: string | null | undefined;
  /**
   * The last name of the assignee
   */
  lastName?: string | null | undefined;
  /**
   * The email of the assignee
   */
  email?: string | null | undefined;
};

/** @internal */
export type CreateWorkspaceUploadRequestAssignment$Outbound = {
  assignee_user_id?: string | null | undefined;
  upload_request_responsibility_type_id: string;
  first_name?: string | null | undefined;
  last_name?: string | null | undefined;
  email?: string | null | undefined;
};

/** @internal */
export const CreateWorkspaceUploadRequestAssignment$outboundSchema: z.ZodType<
  CreateWorkspaceUploadRequestAssignment$Outbound,
  z.ZodTypeDef,
  CreateWorkspaceUploadRequestAssignment
> = z.object({
  assigneeUserId: z.nullable(z.string()).optional(),
  uploadRequestResponsibilityTypeId:
    WorkspaceUploadRequestResponsibilityType$outboundSchema,
  firstName: z.nullable(z.string()).optional(),
  lastName: z.nullable(z.string()).optional(),
  email: z.nullable(z.string()).optional(),
}).transform((v) => {
  return remap$(v, {
    assigneeUserId: "assignee_user_id",
    uploadRequestResponsibilityTypeId: "upload_request_responsibility_type_id",
    firstName: "first_name",
    lastName: "last_name",
  });
});

export function createWorkspaceUploadRequestAssignmentToJSON(
  createWorkspaceUploadRequestAssignment:
    CreateWorkspaceUploadRequestAssignment,
): string {
  return JSON.stringify(
    CreateWorkspaceUploadRequestAssignment$outboundSchema.parse(
      createWorkspaceUploadRequestAssignment,
    ),
  );
}
