/* * 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 { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { UserStatus, UserStatus$inboundSchema } from "./userstatus.js"; export type AuditLogEntryUser = { /** * Always `user`. */ type: "user"; /** * The ID of the user. */ id?: string | null | undefined; /** * The name of the user. */ name: string; /** * The email address for this user. */ emailAddress?: string | null | undefined; /** * Whether this is a Gr4vy staff user. */ isStaff: boolean; status: UserStatus; }; /** @internal */ export const AuditLogEntryUser$inboundSchema: z.ZodType< AuditLogEntryUser, z.ZodTypeDef, unknown > = z.object({ type: z.literal("user").default("user"), id: z.nullable(z.string()).optional(), name: z.string(), email_address: z.nullable(z.string()).optional(), is_staff: z.boolean(), status: UserStatus$inboundSchema, }).transform((v) => { return remap$(v, { "email_address": "emailAddress", "is_staff": "isStaff", }); }); export function auditLogEntryUserFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditLogEntryUser$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditLogEntryUser' from JSON`, ); }