/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PostFoldersIdCopyRequestBody = { /** * The email address of the account Manager that will be the owner of the new folder. Defaults to the Account Owner if invalid or omitted. */ adminEmail?: string | undefined; }; export type PostFoldersIdCopyRequest = { /** * Folder Hashed ID */ id: string; requestBody?: PostFoldersIdCopyRequestBody | undefined; }; /** * The status of the background job that's been queued for the request. */ export const PostFoldersIdCopyStatus = { Queued: "queued", Started: "started", Finished: "finished", Failed: "failed", } as const; /** * The status of the background job that's been queued for the request. */ export type PostFoldersIdCopyStatus = ClosedEnum< typeof PostFoldersIdCopyStatus >; /** * A background job keeps track of the progress of an asynchronous task, e.g * * @remarks * bulk archiving media, translating media, etc. */ export type PostFoldersIdCopyBackgroundJobStatus = { /** * The ID of the background job that's been queued for the request. */ id: number; /** * The status of the background job that's been queued for the request. */ status: PostFoldersIdCopyStatus; }; /** * Folder queued to be copied */ export type PostFoldersIdCopyResponse = { /** * A background job keeps track of the progress of an asynchronous task, e.g * * @remarks * bulk archiving media, translating media, etc. */ backgroundJobStatus?: PostFoldersIdCopyBackgroundJobStatus | undefined; }; /** @internal */ export type PostFoldersIdCopyRequestBody$Outbound = { adminEmail?: string | undefined; }; /** @internal */ export const PostFoldersIdCopyRequestBody$outboundSchema: z.ZodType< PostFoldersIdCopyRequestBody$Outbound, z.ZodTypeDef, PostFoldersIdCopyRequestBody > = z.object({ adminEmail: z.string().optional(), }); export function postFoldersIdCopyRequestBodyToJSON( postFoldersIdCopyRequestBody: PostFoldersIdCopyRequestBody, ): string { return JSON.stringify( PostFoldersIdCopyRequestBody$outboundSchema.parse( postFoldersIdCopyRequestBody, ), ); } /** @internal */ export type PostFoldersIdCopyRequest$Outbound = { id: string; RequestBody?: PostFoldersIdCopyRequestBody$Outbound | undefined; }; /** @internal */ export const PostFoldersIdCopyRequest$outboundSchema: z.ZodType< PostFoldersIdCopyRequest$Outbound, z.ZodTypeDef, PostFoldersIdCopyRequest > = z.object({ id: z.string(), requestBody: z.lazy(() => PostFoldersIdCopyRequestBody$outboundSchema) .optional(), }).transform((v) => { return remap$(v, { requestBody: "RequestBody", }); }); export function postFoldersIdCopyRequestToJSON( postFoldersIdCopyRequest: PostFoldersIdCopyRequest, ): string { return JSON.stringify( PostFoldersIdCopyRequest$outboundSchema.parse(postFoldersIdCopyRequest), ); } /** @internal */ export const PostFoldersIdCopyStatus$inboundSchema: z.ZodNativeEnum< typeof PostFoldersIdCopyStatus > = z.nativeEnum(PostFoldersIdCopyStatus); /** @internal */ export const PostFoldersIdCopyBackgroundJobStatus$inboundSchema: z.ZodType< PostFoldersIdCopyBackgroundJobStatus, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), status: PostFoldersIdCopyStatus$inboundSchema, }); export function postFoldersIdCopyBackgroundJobStatusFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostFoldersIdCopyBackgroundJobStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostFoldersIdCopyBackgroundJobStatus' from JSON`, ); } /** @internal */ export const PostFoldersIdCopyResponse$inboundSchema: z.ZodType< PostFoldersIdCopyResponse, z.ZodTypeDef, unknown > = z.object({ background_job_status: z.lazy(() => PostFoldersIdCopyBackgroundJobStatus$inboundSchema ).optional(), }).transform((v) => { return remap$(v, { "background_job_status": "backgroundJobStatus", }); }); export function postFoldersIdCopyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PostFoldersIdCopyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PostFoldersIdCopyResponse' from JSON`, ); }