/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { statsMediaGet } from "../funcs/statsMediaGet.js"; import { statsMediaGetByDate } from "../funcs/statsMediaGetByDate.js"; import { statsMediaGetEngagement } from "../funcs/statsMediaGetEngagement.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class StatsMedia extends ClientSDK { /** * Show Media Stats * * @remarks * Retrieve stats for a video. This endpoint provides statistics for a specific video identified by its media-id. * * * ## Requires api token with one of the following permissions * ``` * Read detailed stats * ``` * */ async get( request: operations.GetStatsMediasMediaIdRequest, options?: RequestOptions, ): Promise { return unwrapAsync(statsMediaGet( this, request, options, )); } /** * Show Media Stats by Date * * @remarks * Retrieve stats for a media organized by day, between a start and end date paramater (inclusive). If start and end date are not provided, defaults to yesterday and today. * * * ## Requires api token with one of the following permissions * ``` * Read detailed stats * ``` * */ async getByDate( request: operations.GetStatsMediasMediaIdByDateRequest, options?: RequestOptions, ): Promise> { return unwrapAsync(statsMediaGetByDate( this, request, options, )); } /** * Show Media Engagement * * @remarks * Retrieve engagement data for a video. This endpoint provides engagement data for a specific video identified by its media-id. * * * ## Requires api token with one of the following permissions * ``` * Read detailed stats * ``` * */ async getEngagement( request: operations.GetStatsMediasMediaIdEngagementRequest, options?: RequestOptions, ): Promise { return unwrapAsync(statsMediaGetEngagement( this, request, options, )); } }