/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; import { ClosedEnum } from "../../types/enums.js"; export type Metadata = { /** * The SHA1 checksum of the upload binary blob. Optionally be provided and serves as an additional security check when later processing the file in complete-external-upload endpoint. */ sha1Checksum?: string | undefined; }; export const UploadType = { Avatar: "avatar", ProfileBackground: "profile_background", CardBackground: "card_background", CustomEmoji: "custom_emoji", Composer: "composer", } as const; export type UploadType = ClosedEnum; export type CreateMultipartUploadRequestBody = { fileName: string; /** * File size should be represented in bytes. */ fileSize: number; metadata?: Metadata | undefined; uploadType: UploadType; }; /** * external upload initialized */ export type CreateMultipartUploadResponseBody = { /** * The identifier of the multipart upload in the external storage provider. This is the multipart upload_id in AWS S3. */ externalUploadIdentifier: string; /** * The path of the temporary file on the external storage service. */ key: string; /** * A unique string that identifies the external upload. This must be stored and then sent in the /complete-multipart and /batch-presign-multipart-parts endpoints. */ uniqueIdentifier: string; }; /** @internal */ export const Metadata$inboundSchema: z.ZodType< Metadata, z.ZodTypeDef, unknown > = z.object({ "sha1-checksum": z.string().optional(), }).transform((v) => { return remap$(v, { "sha1-checksum": "sha1Checksum", }); }); /** @internal */ export type Metadata$Outbound = { "sha1-checksum"?: string | undefined; }; /** @internal */ export const Metadata$outboundSchema: z.ZodType< Metadata$Outbound, z.ZodTypeDef, Metadata > = z.object({ sha1Checksum: z.string().optional(), }).transform((v) => { return remap$(v, { sha1Checksum: "sha1-checksum", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Metadata$ { /** @deprecated use `Metadata$inboundSchema` instead. */ export const inboundSchema = Metadata$inboundSchema; /** @deprecated use `Metadata$outboundSchema` instead. */ export const outboundSchema = Metadata$outboundSchema; /** @deprecated use `Metadata$Outbound` instead. */ export type Outbound = Metadata$Outbound; } /** @internal */ export const UploadType$inboundSchema: z.ZodNativeEnum = z .nativeEnum(UploadType); /** @internal */ export const UploadType$outboundSchema: z.ZodNativeEnum = UploadType$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UploadType$ { /** @deprecated use `UploadType$inboundSchema` instead. */ export const inboundSchema = UploadType$inboundSchema; /** @deprecated use `UploadType$outboundSchema` instead. */ export const outboundSchema = UploadType$outboundSchema; } /** @internal */ export const CreateMultipartUploadRequestBody$inboundSchema: z.ZodType< CreateMultipartUploadRequestBody, z.ZodTypeDef, unknown > = z.object({ file_name: z.string(), file_size: z.number().int(), metadata: z.lazy(() => Metadata$inboundSchema).optional(), upload_type: UploadType$inboundSchema, }).transform((v) => { return remap$(v, { "file_name": "fileName", "file_size": "fileSize", "upload_type": "uploadType", }); }); /** @internal */ export type CreateMultipartUploadRequestBody$Outbound = { file_name: string; file_size: number; metadata?: Metadata$Outbound | undefined; upload_type: string; }; /** @internal */ export const CreateMultipartUploadRequestBody$outboundSchema: z.ZodType< CreateMultipartUploadRequestBody$Outbound, z.ZodTypeDef, CreateMultipartUploadRequestBody > = z.object({ fileName: z.string(), fileSize: z.number().int(), metadata: z.lazy(() => Metadata$outboundSchema).optional(), uploadType: UploadType$outboundSchema, }).transform((v) => { return remap$(v, { fileName: "file_name", fileSize: "file_size", uploadType: "upload_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateMultipartUploadRequestBody$ { /** @deprecated use `CreateMultipartUploadRequestBody$inboundSchema` instead. */ export const inboundSchema = CreateMultipartUploadRequestBody$inboundSchema; /** @deprecated use `CreateMultipartUploadRequestBody$outboundSchema` instead. */ export const outboundSchema = CreateMultipartUploadRequestBody$outboundSchema; /** @deprecated use `CreateMultipartUploadRequestBody$Outbound` instead. */ export type Outbound = CreateMultipartUploadRequestBody$Outbound; } /** @internal */ export const CreateMultipartUploadResponseBody$inboundSchema: z.ZodType< CreateMultipartUploadResponseBody, z.ZodTypeDef, unknown > = z.object({ external_upload_identifier: z.string(), key: z.string(), unique_identifier: z.string(), }).transform((v) => { return remap$(v, { "external_upload_identifier": "externalUploadIdentifier", "unique_identifier": "uniqueIdentifier", }); }); /** @internal */ export type CreateMultipartUploadResponseBody$Outbound = { external_upload_identifier: string; key: string; unique_identifier: string; }; /** @internal */ export const CreateMultipartUploadResponseBody$outboundSchema: z.ZodType< CreateMultipartUploadResponseBody$Outbound, z.ZodTypeDef, CreateMultipartUploadResponseBody > = z.object({ externalUploadIdentifier: z.string(), key: z.string(), uniqueIdentifier: z.string(), }).transform((v) => { return remap$(v, { externalUploadIdentifier: "external_upload_identifier", uniqueIdentifier: "unique_identifier", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateMultipartUploadResponseBody$ { /** @deprecated use `CreateMultipartUploadResponseBody$inboundSchema` instead. */ export const inboundSchema = CreateMultipartUploadResponseBody$inboundSchema; /** @deprecated use `CreateMultipartUploadResponseBody$outboundSchema` instead. */ export const outboundSchema = CreateMultipartUploadResponseBody$outboundSchema; /** @deprecated use `CreateMultipartUploadResponseBody$Outbound` instead. */ export type Outbound = CreateMultipartUploadResponseBody$Outbound; }