/* * 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 GetBackgroundJobStatusBackgroundJobStatusIdRequest = { /** * The numeric ID of the background job */ backgroundJobStatusId: number; }; /** * The status of the background job that's been queued for the request. */ export const GetBackgroundJobStatusBackgroundJobStatusIdStatus = { 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 GetBackgroundJobStatusBackgroundJobStatusIdStatus = ClosedEnum< typeof GetBackgroundJobStatusBackgroundJobStatusIdStatus >; /** * A background job keeps track of the progress of an asynchronous task, e.g * * @remarks * bulk archiving media, translating media, etc. */ export type GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus = { /** * 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: GetBackgroundJobStatusBackgroundJobStatusIdStatus; }; /** * OK */ export type GetBackgroundJobStatusBackgroundJobStatusIdResponse = { /** * A background job keeps track of the progress of an asynchronous task, e.g * * @remarks * bulk archiving media, translating media, etc. */ backgroundJobStatus: GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus; }; /** @internal */ export type GetBackgroundJobStatusBackgroundJobStatusIdRequest$Outbound = { backgroundJobStatusId: number; }; /** @internal */ export const GetBackgroundJobStatusBackgroundJobStatusIdRequest$outboundSchema: z.ZodType< GetBackgroundJobStatusBackgroundJobStatusIdRequest$Outbound, z.ZodTypeDef, GetBackgroundJobStatusBackgroundJobStatusIdRequest > = z.object({ backgroundJobStatusId: z.number().int(), }); export function getBackgroundJobStatusBackgroundJobStatusIdRequestToJSON( getBackgroundJobStatusBackgroundJobStatusIdRequest: GetBackgroundJobStatusBackgroundJobStatusIdRequest, ): string { return JSON.stringify( GetBackgroundJobStatusBackgroundJobStatusIdRequest$outboundSchema.parse( getBackgroundJobStatusBackgroundJobStatusIdRequest, ), ); } /** @internal */ export const GetBackgroundJobStatusBackgroundJobStatusIdStatus$inboundSchema: z.ZodNativeEnum = z .nativeEnum(GetBackgroundJobStatusBackgroundJobStatusIdStatus); /** @internal */ export const GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus$inboundSchema: z.ZodType< GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), status: GetBackgroundJobStatusBackgroundJobStatusIdStatus$inboundSchema, }); export function getBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatusFromJSON( jsonString: string, ): SafeParseResult< GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus, SDKValidationError > { return safeParse( jsonString, (x) => GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus' from JSON`, ); } /** @internal */ export const GetBackgroundJobStatusBackgroundJobStatusIdResponse$inboundSchema: z.ZodType< GetBackgroundJobStatusBackgroundJobStatusIdResponse, z.ZodTypeDef, unknown > = z.object({ background_job_status: z.lazy(() => GetBackgroundJobStatusBackgroundJobStatusIdBackgroundJobStatus$inboundSchema ), }).transform((v) => { return remap$(v, { "background_job_status": "backgroundJobStatus", }); }); export function getBackgroundJobStatusBackgroundJobStatusIdResponseFromJSON( jsonString: string, ): SafeParseResult< GetBackgroundJobStatusBackgroundJobStatusIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetBackgroundJobStatusBackgroundJobStatusIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetBackgroundJobStatusBackgroundJobStatusIdResponse' from JSON`, ); }