/* * 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"; export type PartitionStats = { /** * Number of pages processed in the current month in this partition. */ pagesProcessedMonthly: number; /** * Number of hosted pages added in the current month in this partition. */ pagesHostedMonthly: number; /** * Total number of pages processed in this partition. */ pagesProcessedTotal: number; /** * Total number of hosted pages in this partition. */ pagesHostedTotal: number; /** * Total number of documents, inclusive of all files types, in this partition. */ documentCount: number; /** * Total number of seconds of video processed in the current month in this partition. */ videoProcessedMonthly: number; /** * Total number of seconds of video processed in this partition. */ videoProcessedTotal: number; /** * Total number of seconds of audio processed in the current month in this partition. */ audioProcessedMonthly: number; /** * Total number of seconds of audio processed in this partition. */ audioProcessedTotal: number; /** * Total number of MBs streamed in the current month in this partition. */ mediaStreamedMonthly: number; /** * Total number of MBs streamed in this partition. */ mediaStreamedTotal: number; /** * Total number of MBs hosted in the current month in this partition. */ mediaHostedMonthly: number; /** * Total number of MBs hosted in this partition. */ mediaHostedTotal: number; }; /** @internal */ export const PartitionStats$inboundSchema: z.ZodType< PartitionStats, z.ZodTypeDef, unknown > = z.object({ pages_processed_monthly: z.number(), pages_hosted_monthly: z.number(), pages_processed_total: z.number(), pages_hosted_total: z.number(), document_count: z.number().int(), video_processed_monthly: z.number(), video_processed_total: z.number(), audio_processed_monthly: z.number(), audio_processed_total: z.number(), media_streamed_monthly: z.number(), media_streamed_total: z.number(), media_hosted_monthly: z.number(), media_hosted_total: z.number(), }).transform((v) => { return remap$(v, { "pages_processed_monthly": "pagesProcessedMonthly", "pages_hosted_monthly": "pagesHostedMonthly", "pages_processed_total": "pagesProcessedTotal", "pages_hosted_total": "pagesHostedTotal", "document_count": "documentCount", "video_processed_monthly": "videoProcessedMonthly", "video_processed_total": "videoProcessedTotal", "audio_processed_monthly": "audioProcessedMonthly", "audio_processed_total": "audioProcessedTotal", "media_streamed_monthly": "mediaStreamedMonthly", "media_streamed_total": "mediaStreamedTotal", "media_hosted_monthly": "mediaHostedMonthly", "media_hosted_total": "mediaHostedTotal", }); }); /** @internal */ export type PartitionStats$Outbound = { pages_processed_monthly: number; pages_hosted_monthly: number; pages_processed_total: number; pages_hosted_total: number; document_count: number; video_processed_monthly: number; video_processed_total: number; audio_processed_monthly: number; audio_processed_total: number; media_streamed_monthly: number; media_streamed_total: number; media_hosted_monthly: number; media_hosted_total: number; }; /** @internal */ export const PartitionStats$outboundSchema: z.ZodType< PartitionStats$Outbound, z.ZodTypeDef, PartitionStats > = z.object({ pagesProcessedMonthly: z.number(), pagesHostedMonthly: z.number(), pagesProcessedTotal: z.number(), pagesHostedTotal: z.number(), documentCount: z.number().int(), videoProcessedMonthly: z.number(), videoProcessedTotal: z.number(), audioProcessedMonthly: z.number(), audioProcessedTotal: z.number(), mediaStreamedMonthly: z.number(), mediaStreamedTotal: z.number(), mediaHostedMonthly: z.number(), mediaHostedTotal: z.number(), }).transform((v) => { return remap$(v, { pagesProcessedMonthly: "pages_processed_monthly", pagesHostedMonthly: "pages_hosted_monthly", pagesProcessedTotal: "pages_processed_total", pagesHostedTotal: "pages_hosted_total", documentCount: "document_count", videoProcessedMonthly: "video_processed_monthly", videoProcessedTotal: "video_processed_total", audioProcessedMonthly: "audio_processed_monthly", audioProcessedTotal: "audio_processed_total", mediaStreamedMonthly: "media_streamed_monthly", mediaStreamedTotal: "media_streamed_total", mediaHostedMonthly: "media_hosted_monthly", mediaHostedTotal: "media_hosted_total", }); }); export function partitionStatsToJSON(partitionStats: PartitionStats): string { return JSON.stringify(PartitionStats$outboundSchema.parse(partitionStats)); } export function partitionStatsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartitionStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartitionStats' from JSON`, ); }