/* * 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 GetStatsProjectsProjectIdRequest = { /** * The Hashed ID or ID of the project for which you want to retrieve stats. */ projectId: string; }; /** * Success response with the stats of the project. */ export type GetStatsProjectsProjectIdResponse = { /** * The total number of times the videos in this project have been loaded. */ loadCount?: number | undefined; /** * The total number of times the videos in this project have been played. */ playCount?: number | undefined; /** * The total time spent viewing the videos in this project. */ hoursWatched?: number | undefined; /** * The total number of videos in this project. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ numberOfVideos?: number | undefined; }; /** @internal */ export type GetStatsProjectsProjectIdRequest$Outbound = { projectId: string; }; /** @internal */ export const GetStatsProjectsProjectIdRequest$outboundSchema: z.ZodType< GetStatsProjectsProjectIdRequest$Outbound, z.ZodTypeDef, GetStatsProjectsProjectIdRequest > = z.object({ projectId: z.string(), }); export function getStatsProjectsProjectIdRequestToJSON( getStatsProjectsProjectIdRequest: GetStatsProjectsProjectIdRequest, ): string { return JSON.stringify( GetStatsProjectsProjectIdRequest$outboundSchema.parse( getStatsProjectsProjectIdRequest, ), ); } /** @internal */ export const GetStatsProjectsProjectIdResponse$inboundSchema: z.ZodType< GetStatsProjectsProjectIdResponse, z.ZodTypeDef, unknown > = z.object({ load_count: z.number().int().optional(), play_count: z.number().int().optional(), hours_watched: z.number().optional(), number_of_videos: z.number().int().optional(), }).transform((v) => { return remap$(v, { "load_count": "loadCount", "play_count": "playCount", "hours_watched": "hoursWatched", "number_of_videos": "numberOfVideos", }); }); export function getStatsProjectsProjectIdResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetStatsProjectsProjectIdResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetStatsProjectsProjectIdResponse' from JSON`, ); }