/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { S3FileCreateMultipart, S3FileCreateMultipart$Outbound, S3FileCreateMultipart$outboundSchema, } from "./s3filecreatemultipart.js"; /** * Schema to create a file to be used as a product media file. */ export type ProductMediaFileCreate = { organizationId?: string | null | undefined; name: string; /** * MIME type of the file. Only images are supported for this type of file. */ mimeType: string; /** * Size of the file. A maximum of 10 MB is allowed for this type of file. */ size: number; checksumSha256Base64?: string | null | undefined; upload: S3FileCreateMultipart; service: "product_media"; version?: string | null | undefined; }; /** @internal */ export type ProductMediaFileCreate$Outbound = { organization_id?: string | null | undefined; name: string; mime_type: string; size: number; checksum_sha256_base64?: string | null | undefined; upload: S3FileCreateMultipart$Outbound; service: "product_media"; version?: string | null | undefined; }; /** @internal */ export const ProductMediaFileCreate$outboundSchema: z.ZodMiniType< ProductMediaFileCreate$Outbound, ProductMediaFileCreate > = z.pipe( z.object({ organizationId: z.optional(z.nullable(z.string())), name: z.string(), mimeType: z.string(), size: z.int(), checksumSha256Base64: z.optional(z.nullable(z.string())), upload: S3FileCreateMultipart$outboundSchema, service: z.literal("product_media"), version: z.optional(z.nullable(z.string())), }), z.transform((v) => { return remap$(v, { organizationId: "organization_id", mimeType: "mime_type", checksumSha256Base64: "checksum_sha256_base64", }); }), ); export function productMediaFileCreateToJSON( productMediaFileCreate: ProductMediaFileCreate, ): string { return JSON.stringify( ProductMediaFileCreate$outboundSchema.parse(productMediaFileCreate), ); }