/* * 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 { ReportCreatorType, ReportCreatorType$inboundSchema, } from "./reportcreatortype.js"; export type ReportSummary = { /** * Always `report`. */ type: "report"; /** * The unique ID for the report. */ id: string; /** * The merchant account ID this report belongs to. */ merchantAccountId: string; /** * The name of the report. */ name: string; /** * The ID of the user who created the report. */ creatorId?: string | null | undefined; /** * The display name of the report creator. */ creatorDisplayName?: string | null | undefined; /** * The type of the report creator. */ creatorType?: ReportCreatorType | null | undefined; }; /** @internal */ export const ReportSummary$inboundSchema: z.ZodType< ReportSummary, z.ZodTypeDef, unknown > = z.object({ type: z.literal("report").default("report"), id: z.string(), merchant_account_id: z.string(), name: z.string(), creator_id: z.nullable(z.string()).optional(), creator_display_name: z.nullable(z.string()).optional(), creator_type: z.nullable(ReportCreatorType$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "merchant_account_id": "merchantAccountId", "creator_id": "creatorId", "creator_display_name": "creatorDisplayName", "creator_type": "creatorType", }); }); export function reportSummaryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReportSummary$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReportSummary' from JSON`, ); }