/* * 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"; /** * Successful operation. Account stats retrieved. */ export type GetStatsAccountResponse = { /** * The total number of times all of the videos from this account have been loaded. */ loadCount: number; /** * The total number of times all of the videos from this account have been played. */ playCount: number; /** * The total amount of time spent watching all of the videos in this account. */ hoursWatched: number; }; /** @internal */ export const GetStatsAccountResponse$inboundSchema: z.ZodType< GetStatsAccountResponse, z.ZodTypeDef, unknown > = z.object({ load_count: z.number().int(), play_count: z.number().int(), hours_watched: z.number(), }).transform((v) => { return remap$(v, { "load_count": "loadCount", "play_count": "playCount", "hours_watched": "hoursWatched", }); }); export function getStatsAccountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetStatsAccountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetStatsAccountResponse' from JSON`, ); }